codesaaz-core 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codesaaz.es.js +729 -723
- package/dist/codesaaz.umd.js +13 -13
- package/package.json +1 -1
package/dist/codesaaz.umd.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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
|
|
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(jd)}}function jd(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 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"]]);/**
|
|
5
|
+
*/let lr;const js=n=>lr=n,zd=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 Wd=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 Hd=Symbol();function Ud(n){return!zs(n)||!n.hasOwnProperty(Hd)}const{assign:$t}=Object;function qd(n){return!!(r.isRef(n)&&n.effect)}function Yd(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||Wd)(()=>i._e.run(()=>(a=r.effectScope()).run(()=>e({action:E}))));for(const _ in S){const D=S[_];if(r.isRef(D)&&!qd(D)||r.isReactive(D))o||(p&&Ud(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(zd,null):null),l&&js(l),l=lr,l._s.has(i)||(o?fr(i,e,s,l):Yd(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 Kd(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},Xd={key:0,class:"field flex flex-col mb-3"},Gd=["for"],Qd={key:0},Jd={key:0,class:"font-bold"},Zd={key:1,class:"font-bold text-color-hint"},eu={key:1,class:"flex items-center"},tu={class:"ml-2"},nu={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",Xd,[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",Qd,"*")):r.createCommentVNode("",!0)],8,Gd),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",Zd,r.toDisplayString(y.split(":")[1]),1)):(r.openBlock(),r.createElementBlock("small",Jd,r.toDisplayString(y),1))]))),128))])):r.createCommentVNode("",!0),n.column.inputComponent.toLowerCase()=="input_boolean"?(r.openBlock(),r.createElementBlock("div",eu,[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",tu,[r.createTextVNode(r.toDisplayString(n.column.displayName||n.column.name)+" ",1),n.column.required?(r.openBlock(),r.createElementBlock("span",nu,"*")):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 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}".
|
|
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 iu(n){return typeof n=="object"&&n!==null}function su(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}function gr(n){if(!iu(n)||su(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 ou={};function ru(n){return ou[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 au=Symbol("vee-validate-form"),lu=Symbol("vee-validate-form-context"),cu=typeof window<"u";function du(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 uu(n){return n==="checkbox"||n==="radio"}function fu(n){return Sn(n)||Array.isArray(n)}function hu(n){return Array.isArray(n)?n.length===0:Sn(n)&&Object.keys(n).length===0}function Wi(n){return/^\[.+\]$/i.test(n)}function mu(n){return xr(n)&&n.multiple}function xr(n){return n.tagName==="SELECT"}function pu(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 cu?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)=>fu(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(hu(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 gu(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 yu(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 bu(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(uu(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(mu(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 bu(e)}function xu(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=_u(n[i]);return n[i]!==!1&&(t[i]=Or(s)),t},e):typeof n!="string"?e:n.split("|").reduce((t,i)=>{const s=ku(i);return s.name&&(t[s.name]=Or(s.params)),t},e):e}function _u(n){return n===!0?[]:Array.isArray(n)||Sn(n)?n:[n]}function Or(n){const e=t=>typeof t=="string"&&t[0]==="@"?Su(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 ku=n=>{let e=[];const t=n.split(":")[0];return n.includes(":")&&(e=n.split(":").slice(1).join(":").split(",")),{name:t,params:e}};function Su(n){const e=t=>{var i;return(i=wt(t,n))!==null&&i!==void 0?i:t[n]};return e.__locatorRef=n,e}let wu=Object.assign({},{generateMessage:({field:n})=>`${n} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const zn=()=>wu;async function Eu(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 Cu(s,n);return Object.assign(Object.assign({},o),{valid:!o.errors.length})}async function Cu(n,e){const t=n.rules;if(It(t)||br(t))return Du(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:xu(t)}),s=[],o=Object.keys(i.rules),a=o.length;for(let l=0;l<a;l++){const c=o[l],d=await Ou(i,e,{name:c,params:i.rules[c]});if(d.error&&(s.push(d.error),n.bails))return{errors:s}}return{errors:s}}function vu(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(!vu(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 Du(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 Ou(n,e,t){const i=ru(t.name);if(!i)throw new Error(`No such validator '${t.name}' exists.`);const s=Nu(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 Nu(n,e){const t=i=>du(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 Tu(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 Pu(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 Eu(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 Bu=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=Bu++,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=yu(()=>{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:_}=Vu(u,d),D=Mu(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=gu(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=Au({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 Tu(O,d):await Pu(O,d,{names:x.value,bailsMap:E.value});return a.value=!1,N}const tn=Q((O,{evt:N})=>{pu(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(au,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(lu,Ne),Ne}function Mu(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 Vu(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 Au(n,e){return e?{valid:n.valid&&e.valid,errors:[...n.errors,...e.errors]}:n}function Fu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Xs,Mr;function $u(){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=$u(),Gs,Vr;function Iu(){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=Iu(),qi={exports:{}},Ar;function Lu(){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 Ru=Lu();const ju=Fu(Ru),zu=Object.prototype.toString,Wu=Error.prototype.toString,Hu=RegExp.prototype.toString,Uu=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",qu=/^Symbol\((.*)\)(.*)$/;function Yu(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 Yu(n);if(t==="string")return e?`"${n}"`:n;if(t==="function")return"[Function "+(n.name||"anonymous")+"]";if(t==="symbol")return Uu.call(n).replace(qu,"Symbol($1)");const i=zu.call(n).slice(8,-1);return i==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):i==="Error"||n instanceof Error?"["+Wu.call(n)+"]":i==="RegExp"?Hu.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,Ku=/\$\{\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(Ku,(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"},Xu={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}"},Gu={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:Xu,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:Gu,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 Qu(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
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(()=>Pb),"/src/directives/textFormatUpperCase.js":()=>Promise.resolve().then(()=>Bb)});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:"my-2"},$f={class:"flex flex-col md:flex-row md:justify-between md:items-center"},If={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",r.mergeProps(Q.$attrs,{class:"card"}),[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",Ff,[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",$f,[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",If,[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")],16),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 Lf(){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 Rf=Object.defineProperty,jf=Object.defineProperties,zf=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertySymbols,ia=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,oa=(n,e,t)=>e in n?Rf(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)=>jf(n,zf(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},Wf=Lf(),jt=Wf;function ra(n,e){oo(n)?n.push(...e||[]):Cn(n)&&Object.assign(n,e)}function Hf(n){return Cn(n)&&n.hasOwnProperty("value")&&n.hasOwnProperty("type")?n.value:n}function Uf(n){return n.replaceAll(/ /g,"").replace(/[^\w]/g,"-")}function lo(n="",e=""){return Uf(`${gt(n,!1)&>(e,!1)?`${n}-`:n}${e}`)}function aa(n="",e=""){return`--${lo(n,e)}`}function qf(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(qf(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 Yf(n,e,t){gt(e,!1)&&n.push(`${e}:${t};`)}function Dn(n,e){return n?`${n}{${e}}`:""}var Hn=(...n)=>Kf(Me.getTheme(),...n),Kf=(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 Xf(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=Hf(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("-",".")),Yf(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 Xf(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 Gf(n,e){return co(n)?n.matches(e)?n:n.querySelector(e):null}function Qf(n){if(n){let e=n.parentNode;return e&&e instanceof ShadowRoot&&e.host&&(e=e.host),e}return null}function Jf(n){return!!(n!==null&&typeof n<"u"&&n.nodeName&&Qf(n))}function ca(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Zf(n,e="",t){co(n)&&t!==null&&t!==void 0&&n.setAttribute(e,t)}var es={};function eh(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){th(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 th(n,e,t){return(e=nh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nh(n){var e=ih(n,"string");return qn(e)=="symbol"?e:e+""}function ih(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 sh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;r.getCurrentInstance()?r.onMounted(n):e?n():r.nextTick(n)}var oh=0;function rh(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(++oh):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),Zf(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(),Jf(s.value)&&l.head.removeChild(s.value),t.value=!1)};return d&&!f&&sh(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 dh(n)||ch(n,e)||lh(n,e)||ah()}function ah(){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
|
|
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}=Qu(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 Ju=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Zu(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=Ju.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 ef=/^[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])?)*$/,tf=/^((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,nf=/^(?:[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,sf="^\\d{4}-\\d{2}-\\d{2}",of="\\d{2}:\\d{2}:\\d{2}",rf="(([+-]\\d{2}(:?\\d{2})?)|Z)",af=new RegExp(`${sf}T${of}(\\.\\d+)?${rf}$`),lf=n=>an(n)||n===n.trim(),cf={}.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===cf?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(ef,{name:"email",message:e,excludeEmptyString:!0})}url(e=He.url){return this.matches(tf,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=He.uuid){return this.matches(nf,{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(af,{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:lf})}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 df=new Date(""),uf=n=>Object.prototype.toString.call(n)==="[object Date]";class Qi extends pt{constructor(){super({type:"date",check(e){return uf(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t,i)=>!i.spec.coerce||i.isType(e)||e===null?e:(e=Zu(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=df,Qi.prototype;function ff(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 ju.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 hf=(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 mf=(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 pf=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=pf,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=ff(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 mf(o,e)&&(a=Object.assign({},o),i||delete a[e],a[t]=s(o)),a})}json(){return this.transform(hf)}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 gf={key:0,class:"surface-card"},yf={class:"info"},bf={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",gf,[s[1]||(s[1]=r.createElementVNode("h4",{class:"flex-1 font-bold text-red-500"},"Errors",-1)),r.createElementVNode("div",yf,[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",bf,[(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)}}},xf={class:"field flex flex-col"},_f=["for"],kf={key:0,class:"flex items-center"},Sf={key:1},wf={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",xf,[r.createElementVNode("label",{for:n.columnName},r.toDisplayString(n.columnName),9,_f),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",kf,[r.createElementVNode("div",null,r.toDisplayString(m.value[n.relatedEntityColumn]),1)])):(r.openBlock(),r.createElementBlock("span",Sf,r.toDisplayString(m.placeholder),1))]),option:r.withCtx(m=>[r.createElementVNode("div",wf,[r.createElementVNode("div",null,r.toDisplayString(m.option[n.relatedEntityColumn]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"])])}}},Ef={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Cf={key:1,style:{"font-weight":"700","font-size":"1.25rem"}},vf={__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",Ef,"Edit "+r.toDisplayString(n.entityName)+" record details",1)):r.createCommentVNode("",!0),n.recordId?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Cf,"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)}}},Df={__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 Of(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"},Nf={AND:"and",OR:"or"};const Tf={key:0},Pf={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",Tf,[r.createElementVNode("span",{ref_key:"el",ref:e},r.toDisplayString(n.value),513)])):(r.openBlock(),r.createElementBlock("span",Pf,r.toDisplayString(n.value),1))}};class Bf{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 Bf}),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:{}}),Mf={class:"field flex flex-col w-full"},Vf={key:0,class:"flex items-center"},Af={key:1},Ff={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",Mf,[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",Vf,[r.createElementVNode("div",null,r.toDisplayString(f.value.name),1)])):(r.openBlock(),r.createElementBlock("span",Af,r.toDisplayString(f.placeholder),1))]),option:r.withCtx(f=>[r.createElementVNode("div",Ff,[r.createElementVNode("div",null,r.toDisplayString(f.option.name),1)])]),_:1},8,["modelValue","options"])])}}},$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}=Kd(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:Nf.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",r.mergeProps(Q.$attrs,{class:"card"}),[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")],16),l.value?(r.openBlock(),r.createBlock(vf,{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(Df,{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)&>(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(Of(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 {
|
|
@@ -131,7 +131,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
131
131
|
background: transparent;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`)},
|
|
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);
|
|
@@ -152,26 +152,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
152
152
|
overflow: hidden;
|
|
153
153
|
padding-right: `.concat(t("scrollbar.width"),`;
|
|
154
154
|
}
|
|
155
|
-
`)},
|
|
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 _h(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=kh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function kh(n){var e=Sh(n,"string");return Kn(e)=="symbol"?e:e+""}function Sh(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 wh={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=eh("pc")},created:function(){this._hook("onCreated")},beforeMount:function(){this.rootEl=Gf(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=bh(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},{})}}},Eh={root:{position:"relative"}},Ch={root:"p-chart"},vh=Ot.extend({name:"chart",classes:Ch,inlineStyles:Eh}),Dh={name:"BaseChart",extends:wh,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:vh,provide:function(){return{$pcChart:this,$parentInstance:this}}},ka={name:"Chart",extends:Dh,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(()=>kS).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){Oh(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 Oh(n,e,t){return(e=Nh(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Nh(n){var e=Th(n,"string");return Qn(e)=="symbol"?e:e+""}function Th(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 Ph=["width","height"];function Bh(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,Ph)],16)}ka.render=Bh;function Mh(){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 Vh={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}=Mh(),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}}},Ah={class:"chart-container"},Fh={key:0},$h={key:1};function Ih(n,e,t,i,s,o){const a=r.resolveComponent("Chart",!0);return r.openBlock(),r.createElementBlock("div",Ah,[t.chartData?(r.openBlock(),r.createElementBlock("div",Fh,[r.createVNode(a,{type:t.type,data:i.computedChartData,options:i.computedChartOptions},null,8,["type","data","options"])])):(r.openBlock(),r.createElementBlock("div",$h,e[0]||(e[0]=[r.createElementVNode("p",null,"No data available for the chart.",-1)])))])}const Jn=Be(Vh,[["render",Ih],["__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 Lh={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}}},Rh={key:0,class:"chart-container"},jh={key:1},zh={key:0},Wh={key:1},Hh={key:2};function Uh(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",Rh,[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",jh,[i.loading?(r.openBlock(),r.createElementBlock("p",zh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Wh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Hh,"No data available for the chart."))]))])}const Ea=Be(Lh,[["render",Uh],["__scopeId","data-v-67577a46"]]),qh={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}}},Yh={key:0,class:"chart-container"},Kh={key:1},Xh={key:0},Gh={key:1},Qh={key:2};function Jh(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",Yh,[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",Kh,[i.loading?(r.openBlock(),r.createElementBlock("p",Xh,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",Gh,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",Qh,"No data available for the chart."))]))])}const Ca=Be(qh,[["render",Jh],["__scopeId","data-v-2cfe3d4d"]]),Zh={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}}},em={key:0,class:"chart-container"},tm={key:1},nm={key:0},im={key:1},sm={key:2};function om(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",em,[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",tm,[i.loading?(r.openBlock(),r.createElementBlock("p",nm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",im,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",sm,"No data available for the chart."))]))])}const va=Be(Zh,[["render",om],["__scopeId","data-v-27f5ea01"]]),rm={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}}},am={key:0,class:"chart-container"},lm={key:1},cm={key:0},dm={key:1},um={key:2};function fm(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",am,[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",lm,[i.loading?(r.openBlock(),r.createElementBlock("p",cm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",dm,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",um,"No data available for the chart."))]))])}const Da=Be(rm,[["render",fm],["__scopeId","data-v-941f0d0a"]]),hm={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}}},mm={key:0,class:"chart-container"},pm={key:1},gm={key:0},ym={key:1},bm={key:2};function xm(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",mm,[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",pm,[i.loading?(r.openBlock(),r.createElementBlock("p",gm,"Loading chart data...")):i.error?(r.openBlock(),r.createElementBlock("p",ym,r.toDisplayString(i.error),1)):(r.openBlock(),r.createElementBlock("p",bm,"No data available for the chart."))]))])}const Oa=Be(hm,[["render",xm],["__scopeId","data-v-80750171"]]),_m={class:"flex flex-col p-3"},km={class:"flex justify-center flex-row mb-2 cursor-pointer"},Sm={style:{"word-break":"break-all"}},wm={__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",_m,[r.createElementVNode("div",km,[r.createElementVNode("div",Sm,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)}}},Em={class:"flex flex-col mt-3"},Cm={class:"flex flex-row items-center"},vm={class:"flex items-center justify-center mt-5"},Dm={key:0,class:"pi pi-caret-right"},Om={key:1,class:"pi pi-caret-down"},Nm={key:0},Tm={class:"flex flex-col mt-5"},Pm={class:"col-12"},Bm={class:"flex flex-col mt-5"},Mm={class:"col-12 font-bold"},Vm={key:0},Am={class:"flex flex-col mt-5"},Fm={class:"col-12"},$m={class:"flex flex-col mt-5"},Im={class:"col-12"},Lm={class:"flex flex-col mt-5"},Rm={class:"col-12"},jm={class:"flex flex-row justify-between items-center mt-5"},zm={key:1,class:"mt-2"},Wm={class:"flex flex-row justify-between items-center"},Hm={key:1,class:"text-red-500"},Um={class:"flex flex-col mt-5"},qm={class:"flex flex-row justify-between items-center mt-2"},Ym={class:"flex flex-row items-center mt-5 mb-5"},Km={class:"font-bold"},Xm={class:"font-bold ml-2 flex-1"},Gm={class:"flex flex-row justify-center items-center mb-2"},Qm={class:"ml-2 flex-1"},Jm={key:0,class:"pi pi-exclamation-circle"},Zm={class:"flex flex-col justify-center"},ep={class:"flex flex-row justify-between items-center"},tp={class:"justify-start"},np={class:"justify-start"},ip=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",Em,[r.createElementVNode("div",Cm,[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",vm,[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",Dm)),x.value?(r.openBlock(),r.createElementBlock("div",Om)):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",Nm,[r.createElementVNode("div",Tm,[A[10]||(A[10]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",Pm,[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",Bm,[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",Mm,[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",Vm,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",Am,[A[12]||(A[12]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",Fm,[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",$m,[A[13]||(A[13]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",Im,[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",Lm,[A[14]||(A[14]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",Rm,[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",jm,[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",zm,[r.createVNode(De),r.createElementVNode("div",Wm,[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",Hm,"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",Um,[r.createVNode(De),r.createElementVNode("div",qm,[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",Ym,[r.createElementVNode("div",Km,r.toDisplayString((nn=s.value)==null?void 0:nn.totalRecords),1),r.createElementVNode("div",Xm,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",Gm,[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",Qm,[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",Jm,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",Zm,[r.createVNode(De,{class:"mt-5"}),r.createElementVNode("div",ep,[r.createElementVNode("div",tp,[r.createVNode(Ae,{label:"Cancel",icon:"",severity:"secondary",onClick:A[8]||(A[8]=Z=>t.value=!1)})]),r.createElementVNode("div",np,[r.createVNode(Ae,{label:"Save",severity:"success",onClick:B})])])])],64)}}},[["__scopeId","data-v-7fd52649"]]),sp={class:"field flex flex-col"},op={key:0,class:"flex items-center"},rp={key:1},ap={class:"flex items-center"},lp={class:"flex flex-col justify-center"},cp={class:"flex flex-row justify-between items-center"},dp={class:"justify-start"},up={class:"justify-start"},fp={__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",sp,[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",op,[r.createElementVNode("div",null,r.toDisplayString(C.value[l.value.name]),1)])):(r.openBlock(),r.createElementBlock("span",rp,r.toDisplayString(C.placeholder),1))]),option:r.withCtx(C=>[r.createElementVNode("div",ap,[r.createElementVNode("div",null,r.toDisplayString(C.option[l.value.name]),1)])]),_:1},8,["modelValue","item-value","options","optionLabel","placeholder"]),r.createElementVNode("div",lp,[r.createVNode(x),r.createElementVNode("div",cp,[r.createElementVNode("div",dp,[r.createVNode(E,{label:"Cancel",icon:"",severity:"secondary",onClick:y[1]||(y[1]=C=>t.value=!1)})]),r.createElementVNode("div",up,[r.createVNode(E,{label:"Save",severity:"success",onClick:p})])])])])}}},hp={style:{"font-weight":"700","font-size":"1.25rem"}},mp={class:"flex flex-col"},pp={class:"flex flex-row justify-between items-center"},gp={class:"justify-start"},yp={class:"justify-start"},bp="",xp={__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,bp,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",hp,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",mp,[r.createVNode(v),r.createElementVNode("div",pp,[r.createElementVNode("div",gp,[r.createVNode(S,{label:"Cancel",icon:"",severity:"secondary",onClick:E[0]||(E[0]=T=>t.value=!1)})]),r.createElementVNode("div",yp,[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(ip,{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(fp,{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"])}}},_p={class:"flex flex-col border-bottom-section pb-3 pt-3"},kp={class:"flex items-center pl-3 pr-3 justify-between"},Sp={key:0,class:"pi pi-caret-right"},wp={key:1,class:"pi pi-caret-down"},Ep={class:"ml-3 font-bold"},Cp={class:"ml-1"},vp={class:"text-right"},Dp={key:0},Op=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",_p,[r.createElementVNode("div",kp,[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",Sp)),t.value?(r.openBlock(),r.createElementBlock("div",wp)):r.createCommentVNode("",!0),r.createElementVNode("div",Ep,r.toDisplayString(n.linkedEntity.entityName),1),r.createElementVNode("div",Cp," ("+r.toDisplayString(l.value)+") ",1)]),r.createElementVNode("div",vp,[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",Dp,[(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(wm,{key:0,linkEntityListItem:f},null,8,["linkEntityListItem"]))]))),128))])):r.createCommentVNode("",!0)]),i.value?(r.openBlock(),r.createBlock(xp,{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"]]),Np={class:"flex"},Tp={class:"p-3 mt-3 flex-col items-center"},Pp={key:0,class:"pi pi-caret-right"},Bp={key:1,class:"pi pi-caret-down"},Mp={class:"font-bold ml-2"},Vp={key:0,class:"flex flex-col mt-4"},Ap={class:"flex flex-col mt-2"},Fp={class:"flex flex-row flex-wrap justify-between pl-5"},$p={class:"flex flex-col"},Ip={class:"font-bold"},Lp={class:"mt-2"},Rp={key:0,class:"flex flex-col",style:{position:"relative","max-width":"400px","background-color":"var(--surface-card)"}},jp={key:2,style:{width:"350px"},class:"flex flex-col justify-center"},zp={key:0,class:"custom-sidebar"},Wp={class:"custom-sidebar-content"},Hp={class:"custom-sidebar-button"},Up={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",Np,[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",Tp,[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",Pp)),o.value?(r.openBlock(),r.createElementBlock("i",Bp)):r.createCommentVNode("",!0),r.createElementVNode("span",Mp," About this "+r.toDisplayString(r.unref(l)),1)]),o.value?(r.openBlock(),r.createElementBlock("div",Vp,[(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",Ap,[w[5]||(w[5]=r.createElementVNode("h3",{class:"mt-2 text-xl font-semibold"},"Data highlights",-1)),r.createElementVNode("div",Fp,[(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",$p,[r.createElementVNode("div",Ip,r.toDisplayString(H.name),1),r.createElementVNode("div",Lp,[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",Rp,[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",jp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(g),(H,te)=>(r.openBlock(),r.createElementBlock("div",{key:te},[r.createVNode(Op,{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",zp,[r.createElementVNode("div",Wp,[r.createElementVNode("div",Hp,[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",Up," 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"])}}},qp={key:0,style:{"font-weight":"700","font-size":"1.25rem"}},Yp={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",qp,"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",Yp,"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)}}},Kp={class:"flex justify-between items-start"},Xp={class:"flex-grow-1"},Gp={class:"tile-grid"},Qp={class:"font-bold text-lg text-700"},Jp={class:"flex flex-col gap-2"},Zp=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",Kp,[r.createElementVNode("div",Xp,[r.createElementVNode("div",Gp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,(m,p)=>(r.openBlock(),r.createElementBlock("div",{key:p},[r.createElementVNode("span",Qp,r.toDisplayString(m.name)+" : ",1),r.createVNode(ro,{column:m,value:n.item[m.name]},null,8,["column","value"])]))),128))])]),r.createElementVNode("div",Jp,[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"]]),eg=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:Zp),r.mergeProps({ref_for:!0},{item:o}),null,16))]))),128))}},[["__scopeId","data-v-b13f837f"]]),tg={};function ng(n,e){return null}const ig=Be(tg,[["render",ng]]),sg={class:"my-2"},og={class:"m-0"},rg={__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",sg,[r.createElementVNode("h2",og,"EntityName: "+r.toDisplayString(r.unref(t)),1)])]),end:r.withCtx(()=>s[0]||(s[0]=[])),_:1})}}},ag={class:"flex flex-col mb-5"},lg={class:"col-12"},cg={class:"flex flex-col mb-5"},dg={class:"col-12"},ug={key:0},fg={class:"flex flex-col mb-5"},hg={class:"col-12"},mg={class:"flex flex-col mb-5"},pg={class:"col-12"},gg={class:"flex flex-col mb-5"},yg={class:"col-12"},bg={class:"flex flex-row justify-between items-center"},xg={key:1},_g={class:"flex flex-row justify-between items-center"},kg={key:1,class:"text-red-500"},Sg={class:"flex flex-col"},wg={class:"flex flex-row justify-between items-center"},Eg={__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",ag,[_[5]||(_[5]=r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Column",-1)),r.createElementVNode("div",lg,[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",cg,[_[6]||(_[6]=r.createElementVNode("div",{class:"col-12 font-bold"},[r.createElementVNode("div",{class:"col-12 font-bold"},"Sort Direction")],-1)),r.createElementVNode("div",dg,[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",ug,[r.createVNode(B),r.createElementVNode("div",fg,[_[7]||(_[7]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Column",-1)),r.createElementVNode("div",hg,[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",mg,[_[8]||(_[8]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter Operator",-1)),r.createElementVNode("div",pg,[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",gg,[_[9]||(_[9]=r.createElementVNode("div",{class:"col-12 font-bold"},"Filter value",-1)),r.createElementVNode("div",yg,[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",bg,[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",xg,[r.createVNode(B),r.createElementVNode("div",_g,[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",kg,"Filter is empty"))]),r.createVNode(X,{label:"Edit",icon:"",severity:"info",onClick:F=>C($)},null,8,["onClick"])])]))]))),128)),r.createElementVNode("div",Sg,[r.createVNode(B),r.createElementVNode("div",wg,[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"])}}},Cg={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",Cg,[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(Eg,{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"])}}},vg={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",vg,[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||rg))),(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||eg),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||ig)))],64))}}},Dg={key:0},Og=["href"],Ng={key:1},Tg={class:"action-buttons"},Pg=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",Dg,[r.createElementVNode("a",{href:`${n.baseUrl}/${n.item[n.hrefKey]}`,target:"_blank",class:"hover:underline"},r.toDisplayString(o.value),9,Og)])):(r.openBlock(),r.createElementBlock("li",Ng,[r.createElementVNode("span",null,"No matching field found for '"+r.toDisplayString(o.value)+"'.",1)])),r.createElementVNode("li",Tg,[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"]]),Bg={key:0,class:"error-message"},Mg={class:"text-red-500 font-bold"},Vg={key:0},Ag={key:1},Fg={key:2},$g={key:3},Ig={key:1},Pa=Be({__name:"EntityListing",props:{entityName:String,listClass:String,listItemClass: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 r.openBlock(),r.createElementBlock("div",r.mergeProps(c.$attrs,{class:"flex flex-col"}),[r.renderSlot(c.$slots,"header",{},void 0,!0),c.$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.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(n.listClass)},[(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,class:r.normalizeClass(n.listItemClass)},void 0,!0)),256))],2)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[!n.displayField||!n.baseUrl||!n.hrefKey||!n.entityName?(r.openBlock(),r.createElementBlock("div",Bg,[r.createElementVNode("p",Mg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Vg,"Entity Name")),n.displayField?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ag,"Display Field")),n.baseUrl?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Fg,"Base Url")),n.hrefKey?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",$g,"Href Key"))])])):(r.openBlock(),r.createElementBlock("div",Ig,[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(c.listItemDisplay!=null&&c.listItemDisplay!=""?c.listItemDisplay:Pg),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)),r.renderSlot(c.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-15e8b30a"]]),Lg={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col"},Rg={class:"flex justify-between items-start gap-4"},jg={class:"flex-grow"},zg={class:"flex flex-col gap-2"},Wg={class:"font-bold text-gray-700"},Hg={class:"text-gray-600"},Ug={class:"flex flex-col gap-2"},qg=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",Lg,[r.createElementVNode("div",Rg,[r.createElementVNode("div",jg,[r.createElementVNode("div",zg,[(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",Wg,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",Hg,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",Ug,[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"]]),Yg={class:"flex flex-wrap gap-4 p-2"},Kg={key:0,class:"error-message"},Xg={class:"text-red-500 font-bold"},Gg={key:0},Qg={key:1},Jg={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 r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[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",Yg,[(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",Qg,[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",Jg,[(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:qg),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",Kg,[r.createElementVNode("p",Xg,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Gg,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16)}}},[["__scopeId","data-v-e46715c5"]]),Zg={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},ey={class:"flex justify-between items-start gap-4"},ty={class:"flex-grow"},ny={class:"flex flex-col gap-2"},iy={class:"font-bold text-gray-700"},sy={class:"text-gray-600"},oy={class:"flex flex-col gap-2"},ry=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",Zg,[r.createElementVNode("div",ey,[r.createElementVNode("div",ty,[r.createElementVNode("div",ny,[(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",iy,r.toDisplayString(g.displayName||g.name)+":",1),r.createElementVNode("span",sy,r.toDisplayString(n.item[g.name]),1)]))),128))])]),r.createElementVNode("div",oy,[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-7e37c710"]]);/**
|
|
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,listClass:String,listItemClass: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 r.openBlock(),r.createElementBlock("div",r.mergeProps(c.$attrs,{class:"flex flex-col"}),[r.renderSlot(c.$slots,"header",{},void 0,!0),c.$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.showFilters?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.listFilter||zt),{key:1})):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(n.listClass)},[(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,class:r.normalizeClass(n.listItemClass)},void 0,!0)),256))],2)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[!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(c.listItemDisplay!=null&&c.listItemDisplay!=""?c.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)),r.renderSlot(c.$slots,"footer",{},void 0,!0)],16)}}},[["__scopeId","data-v-15e8b30a"]]),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 r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[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))],16)}}},[["__scopeId","data-v-e46715c5"]]),ey={class:"p-6 bg-white shadow-md rounded-lg border border-gray-300 flex flex-col responsive-box"},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-7e37c710"]]);/**
|
|
157
157
|
* Vue 3 Carousel 0.13.0
|
|
158
158
|
* (c) 2025
|
|
159
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"],ay={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:ay,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"),ly=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 cy(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 dy='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(dy);for(const t of e)t instanceof HTMLElement&&!t.hasAttribute("disabled")&&t.getAttribute("aria-hidden")!=="true"&&t.setAttribute("tabindex","-1")}function uy(n,e){return Object.keys(n).filter(t=>!e.includes(t)).reduce((t,i)=>(t[i]=n[i],t),{})}function fy(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 hy(n){const{transform:e}=window.getComputedStyle(n);return e.split(/[(,)]/).slice(1,-1).map(t=>parseFloat(t))}function my(n){let e=1,t=1;return n.forEach(i=>{const s=hy(i);s.length===6&&(e/=s[0],t/=s[3])}),{widthMultiplier:e,heightMultiplier:t}}function py(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 gy(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?py(t,i):n!==void 0&&e!==void 0?gy(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 yy=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})):()=>""}}),by={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:by,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=ly(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),uy(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=my(X);if(F(M),$(M),B.value)u.value=cy(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=fy({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(yy)])}}});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)}`,xy={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 _y(n){return n in po}const Wa=n=>n&&_y(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=xy[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)}}}),ky={class:"p-4 mb-4 flex flex-wrap gap-2 border border-gray-300 shadow-md rounded-lg"},Sy={key:0,class:"error-message"},wy={class:"text-red-500 font-bold"},Ey={key:0},Cy={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)=>(r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[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",ky,[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",Cy,[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:ry),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",Sy,[r.createElementVNode("p",wy,[d[0]||(d[0]=r.createTextVNode(" Error: Missing required props - ")),n.entityName?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",Ey,"Entity Name"))])])),r.renderSlot(c.$slots,"footer",{},void 0,!0)],64))],16))}},[["__scopeId","data-v-84369e22"]]),vy={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,Dy=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 Oy={};function os(){return Oy}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 Ny(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 Ty(n,e,t){const[i,s]=Ny(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)/Dy)}function Py(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 By(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function My(n){return!(!By(n)&&typeof n!="number"||isNaN(+ct(n)))}function Vy(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 Ay={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"}},Fy=(n,e,t)=>{let i;const s=Ay[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 $y={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Iy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ly={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ry={date:go({formats:$y,defaultWidth:"full"}),time:go({formats:Iy,defaultWidth:"full"}),dateTime:go({formats:Ly,defaultWidth:"full"})},jy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zy=(n,e,t,i)=>jy[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 Wy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Hy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Uy={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"]},qy={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"]},Yy={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"}},Ky={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"}},Xy={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:Wy,defaultWidth:"wide"}),quarter:ii({values:Hy,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ii({values:Uy,defaultWidth:"wide"}),day:ii({values:qy,defaultWidth:"wide"}),dayPeriod:ii({values:Yy,defaultWidth:"wide",formattingValues:Ky,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)?Qy(l,f=>f.test(a)):Gy(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 Gy(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function Qy(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function Jy(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 Zy=/^(\d+)(th|st|nd|rd)?/i,eb=/\d+/i,tb={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},nb={any:[/^b/i,/^(a|c)/i]},ib={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sb={any:[/1/i,/2/i,/3/i,/4/i]},ob={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},rb={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]},ab={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},lb={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]},cb={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},db={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}},ub={ordinalNumber:Jy({matchPattern:Zy,parsePattern:eb,valueCallback:n=>parseInt(n,10)}),era:si({matchPatterns:tb,defaultMatchWidth:"wide",parsePatterns:nb,defaultParseWidth:"any"}),quarter:si({matchPatterns:ib,defaultMatchWidth:"wide",parsePatterns:sb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:si({matchPatterns:ob,defaultMatchWidth:"wide",parsePatterns:rb,defaultParseWidth:"any"}),day:si({matchPatterns:ab,defaultMatchWidth:"wide",parsePatterns:lb,defaultParseWidth:"any"}),dayPeriod:si({matchPatterns:cb,defaultMatchWidth:"any",parsePatterns:db,defaultParseWidth:"any"})},fb={code:"en-US",formatDistance:Fy,formatLong:Ry,formatRelative:zy,localize:Xy,match:ub,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hb(n,e){const t=ct(n,e==null?void 0:e.in);return Ty(t,Vy(t))+1}function mb(n,e){const t=ct(n,e==null?void 0:e.in),i=+rs(t)-+Py(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 pb(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 gb(n,e){const t=ct(n,e==null?void 0:e.in),i=+ni(t,e)-+pb(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=gb(n,i);return e==="wo"?t.ordinalNumber(s,{unit:"week"}):pe(s,e.length)},I:function(n,e,t){const i=mb(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=hb(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"})}},yb={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))}},bb=/^D+$/,xb=/^Y+$/,_b=["D","DD","YY","YYYY"];function kb(n){return bb.test(n)}function Sb(n){return xb.test(n)}function wb(n,e,t){const i=Eb(n,e,t);if(console.warn(i),_b.includes(n))throw new RangeError(i)}function Eb(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 Cb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Db=/^'([^]*?)'?$/,Ob=/''/g,Nb=/[a-zA-Z]/;function ol(n,e,t){var u,f,h,m;const i=os(),s=i.locale??fb,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(!My(l))throw new RangeError("Invalid time value");let c=e.match(vb).map(p=>{const g=p[0];if(g==="p"||g==="P"){const y=yb[g];return y(p,s.formatLong)}return p}).join("").match(Cb).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:Tb(p)};if(el[g])return{isToken:!0,value:p};if(g.match(Nb))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;(Sb(g)||kb(g))&&wb(g,e,String(n));const y=el[g[0]];return y(l,g,s.localize,d)}).join("")}function Tb(n){const e=n.match(Db);return e?e[1].replace(Ob,"'"):n}const Pb=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"})),Bb=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"}));/*!
|
|
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)=>(r.openBlock(),r.createElementBlock("div",r.normalizeProps(r.guardReactiveProps(c.$attrs)),[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))],16))}},[["__scopeId","data-v-84369e22"]]),Ka={__name:"FieldExpression",props:["value"],setup(n){return(e,t)=>(r.openBlock(),r.createElementBlock("span",null,r.toDisplayString(n.value),1))}},Dy={install(n,e){n.component("CSEntityGrid",na),n.component("csentitygrid",na),n.component("CSEntityList",Ta),n.component("csentitylist",Ta),n.component("CSFieldExpression",Ka),n.component("csfieldexpression",Ka),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)}},Xa=6048e5,Oy=864e5,Ga=Symbol.for("constructDateFrom");function Ht(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&Ga in n?n[Ga](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 Qa(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 Ja(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 Za(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=Za(i),a=Za(s),l=+o-Ja(o),c=+a-Ja(a);return Math.round((l-c)/Oy)}function By(n,e){const t=Qa(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/Xa)+1}function el(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=el(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/Xa)+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"},tl={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=el(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=Qa(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 il(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 il(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"+nl(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"+nl(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 nl(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 il(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 sl=(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"})}},ol=(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:ol,P:(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],i=t[1],s=t[2];if(!s)return sl(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}}",sl(i,e)).replace("{{time}}",ol(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 rl(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(tl[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=tl[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=rl(new Date(t),i||"yyyy-MM-dd");n.textContent=s}},updated(n,e){const{value:t,arg:i}=e;if(n&&t){const s=rl(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"}));/*!
|
|
161
161
|
* @kurkle/color v0.3.4
|
|
162
162
|
* https://github.com/kurkle/color#readme
|
|
163
163
|
* (c) 2024 Jukka Kurkela
|
|
164
164
|
* Released under the MIT License
|
|
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
|
|
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 al(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 ll(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=ll(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(ll,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 cl(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=cl(+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]=cl(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=al(e[1]),s=al(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${Tt(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const dl={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"},ul={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(ul),t=Object.keys(dl);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,dl[o]);o=parseInt(ul[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 fl(n,e){return n&&Object.assign(e||{},n)}function hl(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=fl(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=hl(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=fl(this._rgb);return e&&(e.a=Tt(e.a)),e}set rgb(e){this._rgb=hl(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}}/*!
|
|
166
166
|
* Chart.js v4.4.7
|
|
167
167
|
* https://www.chartjs.org
|
|
168
168
|
* (c) 2024 Chart.js Contributors
|
|
169
169
|
* Released under the MIT License
|
|
170
|
-
*/function Pt(){}const t0=(()=>{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 n0=(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 i0(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||i0;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:s0})}function s0(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 o0(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 r0(n){const e=o0(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]=r0(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 a0(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const _e=Math.PI,ke=2*_e,l0=ke+_e,fs=Number.POSITIVE_INFINITY,c0=_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 d0(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 u0(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 f0(n,e){return(n-e+l0)%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 h0(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),m0=(n,e,t)=>Co(n,t,i=>n[i][e]>=t);function p0(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 g0(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 y0(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,b0=(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 x0=["x","y","borderWidth","radius","tension"],_0=["color","borderColor","backgroundColor"];function k0(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:_0},numbers:{type:"number",properties:x0}}),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 S0(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Bl=new Map;function w0(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 w0(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=E0(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 E0(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 C0(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 v0{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 v0({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[k0,S0,C0]);function D0(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 O0(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)*c0;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 N0(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 T0(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 P0(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 B0(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 M0(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,P0(n,o),c=0;c<a.length;++c)d=a[c],o.backdrop&&M0(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),B0(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 V0=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,A0=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function F0(n,e){const t=(""+n).match(V0);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 $0=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]=$0(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(A0)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:oe(n.family,e.family),lineHeight:F0(oe(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:oe(n.weight,e.weight),string:""};return s.string=D0(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 I0(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,()=>q0(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,()=>R0(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 L0=(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 R0(n,e,t){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let l=i[e];return Xt(l)&&a.isScriptable(e)&&(l=j0(e,l,n,t)),Ee(l)&&l.length&&(l=z0(e,l,n,a.isIndexable)),Vo(e,l)&&(l=Pn(l,s,o&&o[e],a)),l}function j0(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 z0(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 W0=(n,e)=>n===!0?e:typeof n=="string"?Kt(e,n):void 0;function H0(n,e,t,i,s){for(const o of e){const a=W0(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,()=>U0(e,t,i))}function Rl(n,e,t,i,s){for(;t;)t=H0(n,e,t,i,s);return t}function U0(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Ee(s)&&le(t)?t:s||{}}function q0(n,e,t,i){let s;for(const o of e)if(s=jl(L0(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=Y0(n._scopes)),e}function Y0(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 K0=Number.EPSILON||1e-14,Bn=(n,e)=>e<n.length&&!n[e].skip&&n[e],Hl=n=>n==="x"?"y":"x";function X0(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 G0(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,K0)){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 Q0(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 J0(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]}G0(n,s,o),Q0(n,o,e)}function ys(n,e,t){return Math.max(Math.min(n,t),e)}function Z0(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 ex(n,e,t,i,s){let o,a,l,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")J0(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=X0(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&&Z0(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 tx(n,e){return xs(n).getPropertyValue(e)}const nx=["top","right","bottom","left"];function pn(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const o=nx[s];i[o]=parseFloat(n[e+"-"+o+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const ix=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function sx(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,l,c;if(ix(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}=sx(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 ox(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 rx(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=ox(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 ax=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=tx(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 lx(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 cx(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 dx=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}}},ux=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?dx(e,t):ux()}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:f0,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 fx(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}=fx(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 hx(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 mx(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 px(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const o=!!n._loop,{start:a,end:l}=hx(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,mx(t,a,c,d),t,e)}function Zl(n,e,t,i){return!i||!i.setContext||!t?e:gx(n,e,t,i)}function gx(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}))),yx(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 yx(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)}/*!
|
|
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,ml=(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 pl(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function s0(n,e,t,i){if(!pl(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(!pl(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 gl={"":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(gl[e]||(gl[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",yl=(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,bl=_e*2/3,Gt=Math.log10,yt=Math.sign;function ui(n,e,t){return Math.abs(n-e)<t}function xl(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 _l(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 kl(n){if(!Oe(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Sl(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 wl=["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]}}),wl.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 El(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)&&(wl.forEach(o=>{delete n[o]}),delete n._chartjs)}function Cl(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const vl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Dl(n,e){let t=[],i=!1;return function(...s){t=s,i||(i=!0,vl.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 Ol(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 Nl(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,Tl=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ke/t)),Pl=(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:Tl(n,.075,.3),easeOutElastic:n=>hs(n)?n:Pl(n,.075,.3),easeInOutElastic(n){return hs(n)?n:n<.5?.5*Tl(n*2,.1125,.45):.5+.5*Pl(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 Bl(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 Ml=new Map;function E0(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Ml.get(t);return i||(i=new Intl.NumberFormat(n,e),Ml.set(t,i)),i}function mi(n,e,t){return E0(e,t).format(n)}const Vl={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?Vl.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:Vl};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 Al(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){Fl(n,e,t,i,null)}function Fl(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+=bl,n.lineTo(t+Math.sin(y)*u,i-Math.cos(y)*g),y+=bl,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 $l(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=$l(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=ml(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=zl("_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 Ll(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 Wl(l).includes(c)},ownKeys(l){return Wl(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:Il(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 Ll(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 Il(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 Ll(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 Rl(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=Rl(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=Rl(e._fallback,t,i),a=[...n,...s],l=new Set;l.add(i);let c=jl(l,a,t,o||t,i);return c===null||typeof o<"u"&&o!==t&&(c=jl(l,a,o,c,i),c===null)?!1:Mo(Array.from(l),[""],s,o,()=>q0(e,t,i))}function jl(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=zl(R0(o,n),t),typeof s<"u")return Vo(n,s)?Ao(t,i,n,s):s}function zl(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Wl(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 Hl(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],Ul=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=Ul(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=Ul(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 ql(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 Yl(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 Kl(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 Xl(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Gl(n){return n==="angle"?{between:fi,compare:h0,normalize:Ge}:{between:Bt,compare:(e,t)=>e-t,normalize:e=>e}}function Ql({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}=Gl(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 Jl(n,e,t){if(!t)return[n];const{property:i,start:s,end:o}=t,a=e.length,{compare:l,between:c,normalize:d}=Gl(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(Ql({start:y,end:_,loop:h,count:a,style:m})),y=null),D=_,E=b));return y!==null&&p.push(Ql({start:y,end:f,loop:h,count:a,style:m})),p}function Zl(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const o=Jl(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 ec(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 ec(n,px(t,a,c,d),t,e)}function ec(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=tc(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=tc(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 tc(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)}/*!
|
|
171
171
|
* Chart.js v4.4.7
|
|
172
172
|
* https://www.chartjs.org
|
|
173
173
|
* (c) 2024 Chart.js Contributors
|
|
174
174
|
* Released under the MIT License
|
|
175
|
-
*/class bx{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 bx;const tc="transparent",xx={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||xx[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=kx(e,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&_x(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 _x(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 kx(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 Sx(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 wx(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 Ex(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 Cx(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function vx(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 Dx(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=Cx(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]=Dx(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 Ox(n,e){return Qt(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Nx(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),Tx=(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=Ex(t,s)}else if(i!==t){if(i){wl(i,this);const s=this._cachedMeta;xi(s),s._parsed=[]}t&&Object.isExtensible(t)&&g0(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=Tx(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=vx(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=wx(oe(this.options.clip,Sx(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=Nx(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=Ox(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 Px(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 Bx(n){const e=n.iScale,t=Px(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 Mx(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 Vx(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 Ax(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)?Ax(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 Fx(n,e,t){return n!==0?yt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function $x(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 Ix(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}=$x(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=Lx(n,e,t),n=fc(n,t,e)):n=fc(n,e,t),n}function Lx(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 Rx(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;Ix(x,E,b,a),Rx(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||Bx(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=Fx(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"?Vx(e,t,s,d):Mx(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 jx(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(n0(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:p,offsetY:g}=jx(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 zx(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?m0: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}=zx(o[l],e,a,s);for(let m=f;m<=h;++m){const p=u[m];p.skip||i(p,d,m)}}}function Wx(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 Hx(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 Ux(n,e,t,i,s,o){let a=[];const l=Wx(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?Hx(n,e,t,s):Ux(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 qx(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 Yx(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 Kx(n,e){const t=Yx(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 Xx(n){const e=qx(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 Gx(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 Qx(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 Jx(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,Jx(l.horizontal,e));const{same:f,other:h}=Gx(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=Xx(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=Kx(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),Qx(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",Zx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},wc=n=>n===null||n==="";function e_(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=ax?{passive:!0}:!1;function t_(n,e,t){n&&n.addEventListener(e,t,Ec)}function n_(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Ec)}function i_(n,e){const t=Zx[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 s_(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 o_(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 r_(n,e){Ni.size||window.addEventListener("resize",vc),Ni.set(n,e)}function a_(n){Ni.delete(n),Ni.size||window.removeEventListener("resize",vc)}function l_(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),r_(n,o),a}function Yo(n,e,t){t&&t.disconnect(),e==="resize"&&a_(n)}function c_(n,e,t){const i=n.canvas,s=vl(o=>{n.ctx!==null&&t(i_(o,n))},n);return t_(i,e,s),s}class Dc extends qo{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(e_(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:s_,detach:o_,resize:l_}[t]||c_;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]||n_)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return rx(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 d_(n,e){const t=n.options.ticks,i=u_(n),s=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?h_(e):[],a=o.length,l=o[0],c=o[a-1],d=[];if(a>s)return m_(e,d,o,a/s),d;const u=f_(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 u_(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 f_(n,e,t){const i=p_(n),s=e.length/t;if(!i)return Math.max(s,1);const o=d0(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 h_(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function m_(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 p_(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 g_=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 y_(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 b_(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 x_(n,e){return Qt(n,{scale:e,type:"scale"})}function __(n,e,t){return Qt(n,{tick:t,index:e,type:"tick"})}function k_(n,e,t){let i=vo(n);return(t&&e!=="right"||!t&&e==="right")&&(i=g_(i)),i}function S_(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=I0(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=d_(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)}b_(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 h0(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=__(this.getContext(),e,i))}return this.$context||(this.$context=x_(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=y_(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}=S_(this,c,t,l);hn(e,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:h,textAlign:k_(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;C_(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,w_(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 w_(n,e,t){const i=li(Object.create(null),[t?Se.get(t):{},Se.get(e),n.defaults]);Se.set(e,i),n.defaultRoutes&&E_(e,n.defaultRoutes),n.descriptors&&Se.describe(e,n.descriptors)}function E_(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 C_(n){return"id"in n&&"defaults"in n}class v_{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 v_;class D_{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=O_(i);return s===!1&&!t?[]:T_(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 O_(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 N_(n,e){return!e&&n===!1?null:n===!0?{}:n}function T_(n,{plugins:e,localIds:t},i,s){const o=[],a=n.getContext();for(const l of e){const c=l.id,d=N_(i[c],s);d!==null&&o.push({plugin:l,options:P_(n.config,{plugin:l,local:t[c]},d,a)})}return o}function P_(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 B_(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function M_(n,e){return n===e?"_index_":"_value_"}function Mc(n){if(n==="x"||n==="y"||n==="r")return n}function V_(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||V_(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 A_(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 F_(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,A_(a,n),Se.scales[l.type]),d=M_(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=B_(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=F_(n,e)}function Fc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function $_(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 I_{constructor(e){this._config=$_(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(R_(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 L_=n=>le(n)&&Object.getOwnPropertyNames(n).some(e=>Xt(n[e]));function R_(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)||L_(l))||a&&Ee(l))return!0}return!1}var j_="4.4.7";const z_=["top","bottom","left","right","chartArea"];function Rc(n,e){return n==="top"||n==="bottom"||z_.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 W_(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 H_(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 U_(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 q_(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 I_(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=t0(),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 D_,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=y0(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",W_),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;H_(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=q_(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=a0(e),d=U_(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",j_),j(_t,"getChart",Hc);function Uc(){return ge(_t.instances,n=>n._plugins.invalidate())}function Y_(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 K_(n){return Bo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function X_(n,e,t,i){const s=K_(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}=X_(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 G_(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 Q_(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&&Y_(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,G_(t,this,u,a,l),Q_(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 J_(n,e,t){n.lineTo(t.x,t.y)}function Z_(n){return n.stepped?N0:n.tension||n.cubicInterpolationMode==="monotone"?T0:J_}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 ek(n,e,t,i){const{points:s,options:o}=e,{count:a,start:l,loop:c,ilen:d}=Yc(s,t,i),u=Z_(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 tk(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?tk:ek}function nk(n){return n.stepped?lx:n.tension||n.cubicInterpolationMode==="monotone"?cx:yn}function ik(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 sk(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 ok=typeof Path2D=="function";function rk(n,e,t,i){ok&&!e.options.segment?ik(n,e,t,i):sk(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;ex(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=px(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=nk(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(),rk(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 ak(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 lk(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 ck(n){const e=Xc(n),t=e.right-e.left,i=e.bottom-e.top,s=ak(n,t/2,i/2),o=lk(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 dk(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function uk(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}=ck(this),l=dk(a.radius)?yi:uk;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 fk(n,e){return n.borderColor=Jc(e),n.backgroundColor=Zc(e),++e}function hk(n,e){return n.backgroundColor=n.data.map(()=>Jc(e++)),e}function mk(n,e){return n.backgroundColor=n.data.map(()=>Zc(e++)),e}function pk(n){let e=0;return(t,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Jt?e=hk(t,e):s instanceof Vn?e=mk(t,e):s&&(e=fk(t,e))}}function ed(n){let e;for(e in n)if(n[e].borderColor||n[e].backgroundColor)return!0;return!1}function gk(n){return n&&(n.borderColor||n.backgroundColor)}function yk(){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)||gk(s)||o&&ed(o)||yk();if(!t.forceOverride&&a)return;const l=pk(n);i.forEach(l)}};function bk(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 xk(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 _k(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}=_k(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=bk(d,f,h,i,t);break;case"min-max":p=xk(d,f,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}s._decimated=p})},destroy(n){id(n)}};function kk(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 Sk(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=Sk(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 wk(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 Ek(n,e,t){const i=Ok(n);if(le(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Oe(s)&&Math.floor(s)===s?Ck(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Ck(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function vk(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 Dk(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 Ok(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 Nk(n){const{scale:e,index:t,line:i}=n,s=[],o=i.segments,a=i.points,l=Tk(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++)Pk(s,a[u],l)}return new At({points:s,options:{}})}function Tk(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 Pk(n,e,t){const i=[];for(let s=0;s<t.length;s++){const o=t[s],{first:a,last:l,point:c}=Bk(o,e,"x");if(!(!c||a&&l)){if(a)i.unshift(c);else if(n.push(c),!l)break}}n.push(...i)}function Bk(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 Mk(n){const{chart:e,fill:t,line:i}=n;if(Oe(t))return Vk(e,t);if(t==="stack")return Nk(n);if(t==="shape")return!0;const s=Ak(n);return s instanceof ld?s:rd(s,i)}function Vk(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Ak(n){return(n.scale||{}).getPointPositionForValue?$k(n):Fk(n)}function Fk(n){const{scale:e={},fill:t}=n,i=vk(t,e);if(Oe(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function $k(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,o=i.reverse?e.max:e.min,a=Dk(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=Mk(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),Ik(n,{line:s,target:i,above:u,below:f,area:t,scale:o,axis:a}),gs(n))}function Ik(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=kk(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,Lk(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 Lk(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:Ek(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=wk(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)}},Rk=(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}=jk(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=b0(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(!Hk(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const s=this._hoveredItem,o=Rk(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 jk(n,e,t,i,s){const o=zk(i,n,e,t),a=Wk(s,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}function zk(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 Wk(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 Hk(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 Uk(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){Uk(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(`
|
|
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=vl.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 nc="transparent",_x={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Bl(n||nc),s=i.valid&&Bl(e||nc);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class ic{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 ic(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 sc(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=sc(n,t),s=sc(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 oc(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 rc(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 ac(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 lc(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=ac(h,a,!0,i.type),h._bottom=ac(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",cc=(n,e)=>e?n:Object.assign({},n),Px=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:oc(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&&El(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){El(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)&&(lc(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&&lc(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:oc(s,!0),values:t._stacks[e.axis]._visualValues};return rc(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=rc(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 cc(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(cc(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=Cl(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 dc(n,e,t,i){return Ee(n)?Fx(n,e,t,i):e[t.axis]=t.parse(n,i),e}function uc(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(dc(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[fc(u,a,l,c)]=!0,s=d)),o[fc(s,a,l,c)]=!0,n.borderSkipped=o}function fc(n,e,t,i){return i?(n=Rx(n,e,t),n=hc(n,t,e)):n=hc(n,e,t),n}function Rx(n,e,t){return n===e?t:n===t?e:n}function hc(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 uc(e,t,i,s)}parseArrayData(e,t,i,s){return uc(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(dc(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=ml(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}=Ol(t,s,a);this._drawStart=l,this._drawCount=c,Nl(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 Hl.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 Hl.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}=Ol(t,i,s);if(this._drawStart=o,this._drawCount=a,Nl(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 mc=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 pc={_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}=Sl(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 gc(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 yc={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 gc(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=gn(e,n);return gc(n,s,"y",t.intersect,i)}}};const bc=["left","top","right","bottom"];function vi(n,e){return n.filter(t=>t.pos===e)}function xc(n,e){return n.filter(t=>bc.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||!bc.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=xc(e,"x"),c=xc(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 _c(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function kc(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&&kc(a,o.getPadding());const l=Math.max(0,e.outerWidth-_c(a,n,"left","right")),c=Math.max(0,e.outerHeight-_c(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 Sc(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);kc(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),Sc(l.leftAndTop,m,f,p),m.x+=m.w,m.y+=m.h,Sc(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 wc 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"},Ec=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",Ec(s)){const o=Yl(n,"width");o!==void 0&&(n.width=o)}if(Ec(i))if(n.style.height==="")n.height=n.width/(e||2);else{const o=Yl(n,"height");o!==void 0&&(n.height=o)}return n}const Cc=lx?{passive:!0}:!1;function n_(n,e,t){n&&n.addEventListener(e,t,Cc)}function i_(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Cc)}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 vc=0;function Dc(){const n=window.devicePixelRatio;n!==vc&&(vc=n,Ni.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function a_(n,e){Ni.size||window.addEventListener("resize",Dc),Ni.set(n,e)}function l_(n){Ni.delete(n),Ni.size||window.removeEventListener("resize",Dc)}function c_(n,e,t){const i=n.canvas,s=i&&$o(i);if(!s)return;const o=Dl((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=Dl(o=>{n.ctx!==null&&t(s_(o,n))},n);return n_(i,e,s),s}class Oc 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 Nc(n){return!Fo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?wc:Oc}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,Tc=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Pc=(n,e)=>Math.min(e||n,n);function Bc(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 Mc(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=Tc(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=Tc(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?Bc(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=Pc(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-Mc(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=Mc(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=Bc(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/Pc(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 Vc(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(Vc(n))return n;for(const t of e){const i=t.axis||A_(t.position)||n.length>1&&Vc(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,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 Ac(n,"x",t[0])||Ac(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 Fc(n){const e=n.options||(n.options={});e.plugins=oe(e.plugins,{}),e.scales=$_(n,e)}function $c(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function I_(n){return n=n||{},n.data=$c(n.data),Fc(n),n}const Ic=new Map,Lc=new Set;function Ds(n,e){let t=Ic.get(n);return t||(t=e(),Ic.set(n,t),Lc.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=$c(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(),Fc(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)),Lc.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}=Rc(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}=Rc(this._resolverCache,e,i);return le(t)?Pn(o,t,void 0,s):o}}function Rc(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}=Il(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 jc(n,e){return n==="top"||n==="bottom"||W_.indexOf(n)===-1&&e==="x"}function zc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Wc(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 Hc(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={},Uc=n=>{const e=Hc(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),qc()}static unregister(...e){ut.remove(...e),qc()}constructor(e,t){const i=this.config=new L_(t),s=Hc(e),o=Uc(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||Nc(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",Wc),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():ql(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Al(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,ql(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||jc(l.position,d)!==jc(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(zc("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(zc("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);(!yl(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(!yl(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(),Wc({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=yc.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(),Al(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",Uc);function qc(){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}=Sl(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 Yc(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 Kc(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}=Kc(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}=Kc(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()),Yc(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)Yc(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=Zl(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 Xc(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 Xc(this,t,"x",i)}inYRange(t,i){return Xc(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 Gc(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=$l(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=Gc(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)&&Gc(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 Qc=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)"],Jc=Zo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Zc(n){return Zo[n%Zo.length]}function ed(n){return Jc[n%Jc.length]}function hk(n,e){return n.borderColor=Zc(e),n.backgroundColor=ed(e),++e}function mk(n,e){return n.backgroundColor=n.data.map(()=>Zc(e++)),e}function pk(n,e){return n.backgroundColor=n.data.map(()=>ed(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 td(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 nd={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=td(i)||yk(s)||o&&td(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 id(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 sd(n){n.data.datasets.forEach(e=>{id(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 od={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,e,t)=>{if(!t.enabled){sd(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){id(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){sd(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=Zl(e,u);for(const h of f){const m=er(t,o[h.start],o[h.end],h.loop),p=Jl(l,s,m);for(const g of p)a.push({source:g,target:h,start:{[t]:rd(u,m,"start",Math.max)},end:{[t]:rd(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 rd(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function ad(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 ld(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(ad({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 cd{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 cd?s:ad(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 cd({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&&(dd(n,i,a.top),ud(n,{line:t,target:i,color:s,scale:l,property:c}),n.restore(),n.save(),dd(n,i,a.bottom)),ud(n,{line:t,target:i,color:o,scale:l,property:c}),n.restore()}function dd(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 ud(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():fd(n,i,f,s);const y=!!i.pathSegment(n,d,{move:p,reverse:!0});g=p&&y,g||fd(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 fd(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var hd={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;ld(o)&&nr(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!ld(i)||t.drawTime!=="beforeDatasetDraw"||nr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const md=(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 pd 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}=md(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}=md(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;Fl(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},Kl(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+=gd(v,X)+u}else m.y+=k}),Xl(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=gd(e,t)),i}function gd(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 yd={id:"legend",_element:pd,start(n,e,t){const i=n.legend=new pd({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 bd={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 xd={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(`
|
|
176
176
|
`)>-1?n.split(`
|
|
177
|
-
`):n}function qk(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 Yk(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Kk(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 Xk(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"),Kk(d,n,e,t)&&(d="center"),d}function _d(n,e,t){const i=t.yAlign||e.yAlign||Yk(n,t);return{xAlign:t.xAlign||e.xAlign||Xk(n,e,t,i),yAlign:i}}function Gk(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Qk(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=Gk(e,l);const g=Qk(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 Jk(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=Jk(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(qk(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 Zk=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function eS(n,e,t,i){const s=n.indexOf(e);if(s===-1)return Zk(n,e,t,i);const o=n.lastIndexOf(e);return s!==o?t:s}const tS=(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:eS(i,e,oe(t,e),this._addedLabels),tS(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 nS(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&&u0((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=nS(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 iS(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 sS(n,{min:e,max:t}){e=Xe(n.min,e);const i=[],s=Ai(e);let o=iS(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=sS(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 oS(n,e,t){return t=Ee(t)?t:[t],{w:O0(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 rS(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=oS(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);aS(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=dS(n,i,s)}function aS(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 lS(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=hS(c.y,l.h,d),f=uS(d),h=fS(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 cS(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 dS(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=lS(n,u,c);i.push(f),l==="auto"&&(f.visible=cS(f,d),f.visible&&(d=f))}return i}function uS(n){return n===0||n===180?"center":n<180?"left":"right"}function fS(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function hS(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function mS(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 pS(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));mS(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 gS(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 yS(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?rS(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 yS(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&&pS(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);gS(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 bS(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 xS(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 _S(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:_S(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=p0(s,o,a);return this._unit=t.unit||(i.autoSkip?Ad(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):bS(this,l.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:xS(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 kS=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=vy,$e.useEntitiesStore=ea,$e.useGlobalConfigsStore=Ze,Object.defineProperties($e,{__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 _d(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 kd(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 Sd(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 wd(n){return kt([],Ft(n))}function Zk(n,e,t){return Qt(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Ed(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Cd={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"?Cd[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 wd(Ue(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,s=[];return ge(e,o=>{const a={before:[],lines:[],after:[]},l=Ed(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 wd(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=Ed(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=_d(this,i),d=Object.assign({},l,c),u=kd(this.chart,i,d),f=Sd(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=_d(this,e),c=Object.assign({},a,this._size),d=kd(t,e,c),u=Sd(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),Kl(e,t.textDirection),o.y+=a.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),Xl(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 vd={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:Cd},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"]},Dd=Object.freeze({__proto__:null,Colors:nd,Decimation:od,Filler:hd,Legend:yd,SubTitle:xd,Title:bd,Tooltip:vd});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 Od(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 Od.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:Od}});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=xl((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=xl(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(kl(k),kl(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,Nd(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,Nd(l,C,n))?t[t.length-1].value=l:t.push({value:l}):(!x||_===l)&&t.push({value:_}),t}function Nd(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"&&_l(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 Td(n){return n/Math.pow(10,Ai(n))===1}function Pd(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(;Pd(n,e,i)>10;)i++;for(;Pd(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:Td(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:Td(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"&&_l(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 Bd(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=Bd(p,u.x,h.w,0,180),y=Bd(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 Md(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(),Md(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(),Md(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 Vd(n,e){return n-e}function Ad(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 Fd(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 $d(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 Id(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 pc._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:Ad(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?Fd(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(),Id(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||Fd(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++)$d(u,h,p);return(h===i||s.bounds==="ticks"||m===1)&&$d(u,h,p),Object.keys(u).sort(Vd).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,Id(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(Ad(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Cl(e.sort(Vd))}}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 Ld=Object.freeze({__proto__:null,CategoryScale:Ms,LinearScale:As,LogarithmicScale:Fs,RadialLinearScale:$n,TimeScale:In,TimeSeriesScale:Ls});const Rd=[mc,Qc,Dd,Ld];_t.register(...Rd);const SS=Object.freeze(Object.defineProperty({__proto__:null,Animation:ic,Animations:Io,ArcElement:Fn,BarController:_i,BarElement:Mi,BasePlatform:qo,BasicPlatform:wc,BubbleController:ki,CategoryScale:Ms,Chart:_t,Colors:nd,DatasetController:nt,Decimation:od,DomPlatform:Oc,DoughnutController:Jt,Element:xt,Filler:hd,Interaction:yc,Legend:yd,LineController:Si,LineElement:At,LinearScale:As,LogarithmicScale:Fs,PieController:ks,PointElement:Bi,PolarAreaController:Vn,RadarController:wi,RadialLinearScale:$n,Scale:Zt,ScatterController:Ei,SubTitle:xd,Ticks:pi,TimeScale:In,TimeSeriesScale:Ls,Title:bd,Tooltip:vd,_adapters:pc,_detectPlatform:Nc,animator:bt,controllers:mc,default:_t,defaults:Se,elements:Qc,layouts:Ie,plugins:Dd,registerables:Rd,registry:ut,scales:Ld},Symbol.toStringTag,{value:"Module"}));$e.default=Dy,$e.useEntitiesStore=ea,$e.useGlobalConfigsStore=Ze,Object.defineProperties($e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|