evui 3.5.5 → 3.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- (function(se,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(se=typeof globalThis<"u"?globalThis:se||self,i(se.evui={},se.Vue))})(this,function(se,i){"use strict";function Zr(e,t){const n=Object.create(null),o=e.split(",");for(let s=0;s<o.length;s++)n[o[s]]=!0;return s=>!!n[s]}const xi=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const Ws=()=>{},qr=/^on[^a-z]/,Kr=e=>qr.test(e),Qe=Object.assign,Jr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Qr=Object.prototype.hasOwnProperty,go=(e,t)=>Qr.call(e,t),pe=Array.isArray,Jt=e=>yo(e)==="[object Map]",ec=e=>yo(e)==="[object Set]",Oe=e=>typeof e=="function",dt=e=>typeof e=="string",po=e=>typeof e=="symbol",_e=e=>e!==null&&typeof e=="object",tc=e=>(_e(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),nc=Object.prototype.toString,yo=e=>nc.call(e),$s=e=>yo(e).slice(8,-1),oc=e=>yo(e)==="[object Object]",bi=e=>dt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ic=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qt=(e,t)=>!Object.is(e,t),sc=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let Xs;const Ci=()=>Xs||(Xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Si(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=dt(o)?cc(o):Si(o);if(s)for(const l in s)t[l]=s[l]}return t}if(dt(e)||_e(e))return e}const lc=/;(?![^(]*\))/g,ac=/:([^]+)/,rc=/\/\*[^]*?\*\//g;function cc(e){const t={};return e.replace(rc,"").split(lc).forEach(n=>{if(n){const o=n.split(ac);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function wi(e){let t="";if(dt(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const o=wi(e[n]);o&&(t+=o+" ")}else if(_e(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Us(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Ys;const ki=e=>{const t=new Set(e);return t.w=0,t.n=0,t},js=e=>(e.w&It)>0,Gs=e=>(e.n&It)>0,Mi=new WeakMap;let pn=0,It=1;const Ei=30;let Ae;const Pt=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ii=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class dc{constructor(t,n=null,o){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=Ys){l&&l.active&&l.effects.push(s)}(this,o)}run(){if(!this.active)return this.fn();let t=Ae,n=_t;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Ae,Ae=this,_t=!0,It=1<<++pn,pn<=Ei?(({deps:o})=>{if(o.length)for(let s=0;s<o.length;s++)o[s].w|=It})(this):Zs(this),this.fn()}finally{pn<=Ei&&(o=>{const{deps:s}=o;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];js(r)&&!Gs(r)?r.delete(o):s[l++]=r,r.w&=~It,r.n&=~It}s.length=l}})(this),It=1<<--pn,Ae=this.parent,_t=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ae===this?this.deferStop=!0:this.active&&(Zs(this),this.onStop&&this.onStop(),this.active=!1)}}function Zs(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let _t=!0;const qs=[];function Ks(){qs.push(_t),_t=!1}function Js(){const e=qs.pop();_t=e===void 0||e}function Ue(e,t,n){if(_t&&Ae){let o=Mi.get(e);o||Mi.set(e,o=new Map);let s=o.get(n);s||o.set(n,s=ki()),function(l,a){let r=!1;pn<=Ei?Gs(l)||(l.n|=It,r=!js(l)):r=!l.has(Ae),r&&(l.add(Ae),Ae.deps.push(l),process.env.NODE_ENV!=="production"&&Ae.onTrack&&Ae.onTrack(Qe({effect:Ae},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Ae,target:e,type:t,key:n}:void 0)}}function vt(e,t,n,o,s,l){const a=Mi.get(e);if(!a)return;let r=[];if(t==="clear")r=[...a.values()];else if(n==="length"&&pe(e)){const d=Number(o);a.forEach((h,u)=>{(u==="length"||!po(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":pe(e)?bi(n)&&r.push(a.get("length")):(r.push(a.get(Pt)),Jt(e)&&r.push(a.get(Ii)));break;case"delete":pe(e)||(r.push(a.get(Pt)),Jt(e)&&r.push(a.get(Ii)));break;case"set":Jt(e)&&r.push(a.get(Pt))}const c=process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:o,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?xo(r[0],c):xo(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?xo(ki(d),c):xo(ki(d))}}function xo(e,t){const n=pe(e)?e:[...e];for(const o of n)o.computed&&Qs(o,t);for(const o of n)o.computed||Qs(o,t)}function Qs(e,t){(e!==Ae||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(Qe({effect:e},t)),e.scheduler?e.scheduler():e.run())}const hc=Zr("__proto__,__v_isRef,__isVue"),el=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(po)),tl=uc();function uc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=fe(this);for(let l=0,a=this.length;l<a;l++)Ue(o,"get",l+"");const s=o[t](...n);return s===-1||s===!1?o[t](...n.map(fe)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Ks();const o=fe(this)[t].apply(this,n);return Js(),o}}),e}function fc(e){const t=fe(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class nl{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,o){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&o===(s?l?hl:dl:l?Ic:cl).get(t))return t;const a=pe(t);if(!s){if(a&&go(tl,n))return Reflect.get(tl,n,o);if(n==="hasOwnProperty")return fc}const r=Reflect.get(t,n,o);return(po(n)?el.has(n):hc(n))?r:(s||Ue(t,"get",n),l?r:ze(r)?a&&bi(n)?r:r.value:_e(r)?s?fl(r):ul(r):r)}}class mc extends nl{constructor(t=!1){super(!1,t)}set(t,n,o,s){let l=t[n];if(zt(l)&&ze(l)&&!ze(o))return!1;if(!this._shallow&&(Di(o)||zt(o)||(l=fe(l),o=fe(o)),!pe(t)&&ze(l)&&!ze(o)))return l.value=o,!0;const a=pe(t)&&bi(n)?Number(n)<t.length:go(t,n),r=Reflect.set(t,n,o,s);return t===fe(s)&&(a?Qt(o,l)&&vt(t,"set",n,o,l):vt(t,"add",n,o)),r}deleteProperty(t,n){const o=go(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&o&&vt(t,"delete",n,void 0,s),l}has(t,n){const o=Reflect.has(t,n);return po(n)&&el.has(n)||Ue(t,"has",n),o}ownKeys(t){return Ue(t,"iterate",pe(t)?"length":Pt),Reflect.ownKeys(t)}}class ol extends nl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Us(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Us(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const gc=new mc,pc=new ol,yc=new ol(!0),vi=e=>e,bo=e=>Reflect.getPrototypeOf(e);function Co(e,t,n=!1,o=!1){const s=fe(e=e.__v_raw),l=fe(t);n||(Qt(t,l)&&Ue(s,"get",t),Ue(s,"get",l));const{has:a}=bo(s),r=o?vi:n?Li:Ri;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function So(e,t=!1){const n=this.__v_raw,o=fe(n),s=fe(e);return t||(Qt(e,s)&&Ue(o,"has",e),Ue(o,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function wo(e,t=!1){return e=e.__v_raw,!t&&Ue(fe(e),"iterate",Pt),Reflect.get(e,"size",e)}function il(e){e=fe(e);const t=fe(this);return bo(t).has.call(t,e)||(t.add(e),vt(t,"add",e,e)),this}function sl(e,t){t=fe(t);const n=fe(this),{has:o,get:s}=bo(n);let l=o.call(n,e);l?process.env.NODE_ENV!=="production"&&rl(n,o,e):(e=fe(e),l=o.call(n,e));const a=s.call(n,e);return n.set(e,t),l?Qt(t,a)&&vt(n,"set",e,t,a):vt(n,"add",e,t),this}function ll(e){const t=fe(this),{has:n,get:o}=bo(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&rl(t,n,e):(e=fe(e),s=n.call(t,e));const l=o?o.call(t,e):void 0,a=t.delete(e);return s&&vt(t,"delete",e,void 0,l),a}function al(){const e=fe(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?Jt(e)?new Map(e):new Set(e):void 0,o=e.clear();return t&&vt(e,"clear",void 0,void 0,n),o}function ko(e,t){return function(n,o){const s=this,l=s.__v_raw,a=fe(l),r=t?vi:e?Li:Ri;return!e&&Ue(a,"iterate",Pt),l.forEach((c,d)=>n.call(o,r(c),r(d),s))}}function Mo(e,t,n){return function(...o){const s=this.__v_raw,l=fe(s),a=Jt(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...o),h=n?vi:t?Li:Ri;return!t&&Ue(l,"iterate",c?Ii:Pt),{next(){const{value:u,done:f}=d.next();return f?{value:u,done:f}:{value:r?[h(u[0]),h(u[1])]:h(u),done:f}},[Symbol.iterator](){return this}}}}function Tt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${ic(e)} operation ${n}failed: target is readonly.`,fe(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function xc(){const e={get(s){return Co(this,s)},get size(){return wo(this)},has:So,add:il,set:sl,delete:ll,clear:al,forEach:ko(!1,!1)},t={get(s){return Co(this,s,!1,!0)},get size(){return wo(this)},has:So,add:il,set:sl,delete:ll,clear:al,forEach:ko(!1,!0)},n={get(s){return Co(this,s,!0)},get size(){return wo(this,!0)},has(s){return So.call(this,s,!0)},add:Tt("add"),set:Tt("set"),delete:Tt("delete"),clear:Tt("clear"),forEach:ko(!0,!1)},o={get(s){return Co(this,s,!0,!0)},get size(){return wo(this,!0)},has(s){return So.call(this,s,!0)},add:Tt("add"),set:Tt("set"),delete:Tt("delete"),clear:Tt("clear"),forEach:ko(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Mo(s,!1,!1),n[s]=Mo(s,!0,!1),t[s]=Mo(s,!1,!0),o[s]=Mo(s,!0,!0)}),[e,n,t,o]}const[bc,Cc,Sc,wc]=xc();function Ti(e,t){const n=t?e?wc:Sc:e?Cc:bc;return(o,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(go(n,s)&&s in o?n:o,s,l)}const kc={get:Ti(!1,!1)},Mc={get:Ti(!0,!1)},Ec={get:Ti(!0,!0)};function rl(e,t,n){const o=fe(n);if(o!==n&&t.call(e,o)){const s=$s(e);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const cl=new WeakMap,Ic=new WeakMap,dl=new WeakMap,hl=new WeakMap;function ul(e){return zt(e)?e:Bi(e,!1,gc,kc,cl)}function fl(e){return Bi(e,!0,pc,Mc,dl)}function Eo(e){return Bi(e,!0,yc,Ec,hl)}function Bi(e,t,n,o,s){if(!_e(e))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=s.get(e);if(l)return l;const a=(r=e).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}($s(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?o:n);return s.set(e,c),c}function At(e){return zt(e)?At(e.__v_raw):!(!e||!e.__v_isReactive)}function zt(e){return!(!e||!e.__v_isReadonly)}function Di(e){return!(!e||!e.__v_isShallow)}function Oi(e){return At(e)||zt(e)}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}const Ri=e=>_e(e)?ul(e):e,Li=e=>_e(e)?fl(e):e;function ze(e){return!(!e||e.__v_isRef!==!0)}const vc={get:(e,t,n)=>{return ze(o=Reflect.get(e,t,n))?o.value:o;var o},set:(e,t,n,o)=>{const s=e[t];return ze(s)&&!ze(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}},Ft=[];function ht(e,...t){if(process.env.NODE_ENV==="production")return;Ks();const n=Ft.length?Ft[Ft.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=function(){let l=Ft[Ft.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(o)Ht(o,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${_l(n,l.type)}>`).join(`
1
+ (function(se,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(se=typeof globalThis<"u"?globalThis:se||self,i(se.evui={},se.Vue))})(this,function(se,i){"use strict";function Gr(e,t){const n=Object.create(null),o=e.split(",");for(let s=0;s<o.length;s++)n[o[s]]=!0;return s=>!!n[s]}const xi=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const Ws=()=>{},Zr=/^on[^a-z]/,qr=e=>Zr.test(e),Qe=Object.assign,Kr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Jr=Object.prototype.hasOwnProperty,go=(e,t)=>Jr.call(e,t),pe=Array.isArray,Jt=e=>yo(e)==="[object Map]",Qr=e=>yo(e)==="[object Set]",Oe=e=>typeof e=="function",dt=e=>typeof e=="string",po=e=>typeof e=="symbol",_e=e=>e!==null&&typeof e=="object",ec=e=>(_e(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),tc=Object.prototype.toString,yo=e=>tc.call(e),$s=e=>yo(e).slice(8,-1),nc=e=>yo(e)==="[object Object]",bi=e=>dt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,oc=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),Qt=(e,t)=>!Object.is(e,t),ic=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let Xs;const Ci=()=>Xs||(Xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Si(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=dt(o)?rc(o):Si(o);if(s)for(const l in s)t[l]=s[l]}return t}if(dt(e)||_e(e))return e}const sc=/;(?![^(]*\))/g,lc=/:([^]+)/,ac=/\/\*[^]*?\*\//g;function rc(e){const t={};return e.replace(ac,"").split(sc).forEach(n=>{if(n){const o=n.split(lc);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function wi(e){let t="";if(dt(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const o=wi(e[n]);o&&(t+=o+" ")}else if(_e(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Us(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Ys;const ki=e=>{const t=new Set(e);return t.w=0,t.n=0,t},js=e=>(e.w&Et)>0,Gs=e=>(e.n&Et)>0,Mi=new WeakMap;let pn=0,Et=1;const Ii=30;let Ae;const Pt=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ei=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class cc{constructor(t,n=null,o){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=Ys){l&&l.active&&l.effects.push(s)}(this,o)}run(){if(!this.active)return this.fn();let t=Ae,n=_t;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Ae,Ae=this,_t=!0,Et=1<<++pn,pn<=Ii?(({deps:o})=>{if(o.length)for(let s=0;s<o.length;s++)o[s].w|=Et})(this):Zs(this),this.fn()}finally{pn<=Ii&&(o=>{const{deps:s}=o;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];js(r)&&!Gs(r)?r.delete(o):s[l++]=r,r.w&=~Et,r.n&=~Et}s.length=l}})(this),Et=1<<--pn,Ae=this.parent,_t=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ae===this?this.deferStop=!0:this.active&&(Zs(this),this.onStop&&this.onStop(),this.active=!1)}}function Zs(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let _t=!0;const qs=[];function Ks(){qs.push(_t),_t=!1}function Js(){const e=qs.pop();_t=e===void 0||e}function Ue(e,t,n){if(_t&&Ae){let o=Mi.get(e);o||Mi.set(e,o=new Map);let s=o.get(n);s||o.set(n,s=ki()),function(l,a){let r=!1;pn<=Ii?Gs(l)||(l.n|=Et,r=!js(l)):r=!l.has(Ae),r&&(l.add(Ae),Ae.deps.push(l),process.env.NODE_ENV!=="production"&&Ae.onTrack&&Ae.onTrack(Qe({effect:Ae},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Ae,target:e,type:t,key:n}:void 0)}}function vt(e,t,n,o,s,l){const a=Mi.get(e);if(!a)return;let r=[];if(t==="clear")r=[...a.values()];else if(n==="length"&&pe(e)){const d=Number(o);a.forEach((h,f)=>{(f==="length"||!po(f)&&f>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":pe(e)?bi(n)&&r.push(a.get("length")):(r.push(a.get(Pt)),Jt(e)&&r.push(a.get(Ei)));break;case"delete":pe(e)||(r.push(a.get(Pt)),Jt(e)&&r.push(a.get(Ei)));break;case"set":Jt(e)&&r.push(a.get(Pt))}const c=process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:o,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?xo(r[0],c):xo(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?xo(ki(d),c):xo(ki(d))}}function xo(e,t){const n=pe(e)?e:[...e];for(const o of n)o.computed&&Qs(o,t);for(const o of n)o.computed||Qs(o,t)}function Qs(e,t){(e!==Ae||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(Qe({effect:e},t)),e.scheduler?e.scheduler():e.run())}const dc=Gr("__proto__,__v_isRef,__isVue"),el=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(po)),tl=hc();function hc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=ue(this);for(let l=0,a=this.length;l<a;l++)Ue(o,"get",l+"");const s=o[t](...n);return s===-1||s===!1?o[t](...n.map(ue)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){Ks();const o=ue(this)[t].apply(this,n);return Js(),o}}),e}function fc(e){const t=ue(this);return Ue(t,"has",e),t.hasOwnProperty(e)}class nl{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,o){const s=this._isReadonly,l=this._shallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return l;if(n==="__v_raw"&&o===(s?l?hl:dl:l?Ic:cl).get(t))return t;const a=pe(t);if(!s){if(a&&go(tl,n))return Reflect.get(tl,n,o);if(n==="hasOwnProperty")return fc}const r=Reflect.get(t,n,o);return(po(n)?el.has(n):dc(n))?r:(s||Ue(t,"get",n),l?r:ze(r)?a&&bi(n)?r:r.value:_e(r)?s?ul(r):fl(r):r)}}class uc extends nl{constructor(t=!1){super(!1,t)}set(t,n,o,s){let l=t[n];if(zt(l)&&ze(l)&&!ze(o))return!1;if(!this._shallow&&(Di(o)||zt(o)||(l=ue(l),o=ue(o)),!pe(t)&&ze(l)&&!ze(o)))return l.value=o,!0;const a=pe(t)&&bi(n)?Number(n)<t.length:go(t,n),r=Reflect.set(t,n,o,s);return t===ue(s)&&(a?Qt(o,l)&&vt(t,"set",n,o,l):vt(t,"add",n,o)),r}deleteProperty(t,n){const o=go(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&o&&vt(t,"delete",n,void 0,s),l}has(t,n){const o=Reflect.has(t,n);return po(n)&&el.has(n)||Ue(t,"has",n),o}ownKeys(t){return Ue(t,"iterate",pe(t)?"length":Pt),Reflect.ownKeys(t)}}class ol extends nl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Us(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Us(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const mc=new uc,gc=new ol,pc=new ol(!0),vi=e=>e,bo=e=>Reflect.getPrototypeOf(e);function Co(e,t,n=!1,o=!1){const s=ue(e=e.__v_raw),l=ue(t);n||(Qt(t,l)&&Ue(s,"get",t),Ue(s,"get",l));const{has:a}=bo(s),r=o?vi:n?Ri:Li;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function So(e,t=!1){const n=this.__v_raw,o=ue(n),s=ue(e);return t||(Qt(e,s)&&Ue(o,"has",e),Ue(o,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function wo(e,t=!1){return e=e.__v_raw,!t&&Ue(ue(e),"iterate",Pt),Reflect.get(e,"size",e)}function il(e){e=ue(e);const t=ue(this);return bo(t).has.call(t,e)||(t.add(e),vt(t,"add",e,e)),this}function sl(e,t){t=ue(t);const n=ue(this),{has:o,get:s}=bo(n);let l=o.call(n,e);l?process.env.NODE_ENV!=="production"&&rl(n,o,e):(e=ue(e),l=o.call(n,e));const a=s.call(n,e);return n.set(e,t),l?Qt(t,a)&&vt(n,"set",e,t,a):vt(n,"add",e,t),this}function ll(e){const t=ue(this),{has:n,get:o}=bo(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&rl(t,n,e):(e=ue(e),s=n.call(t,e));const l=o?o.call(t,e):void 0,a=t.delete(e);return s&&vt(t,"delete",e,void 0,l),a}function al(){const e=ue(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?Jt(e)?new Map(e):new Set(e):void 0,o=e.clear();return t&&vt(e,"clear",void 0,void 0,n),o}function ko(e,t){return function(n,o){const s=this,l=s.__v_raw,a=ue(l),r=t?vi:e?Ri:Li;return!e&&Ue(a,"iterate",Pt),l.forEach((c,d)=>n.call(o,r(c),r(d),s))}}function Mo(e,t,n){return function(...o){const s=this.__v_raw,l=ue(s),a=Jt(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...o),h=n?vi:t?Ri:Li;return!t&&Ue(l,"iterate",c?Ei:Pt),{next(){const{value:f,done:u}=d.next();return u?{value:f,done:u}:{value:r?[h(f[0]),h(f[1])]:h(f),done:u}},[Symbol.iterator](){return this}}}}function Tt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${oc(e)} operation ${n}failed: target is readonly.`,ue(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function yc(){const e={get(s){return Co(this,s)},get size(){return wo(this)},has:So,add:il,set:sl,delete:ll,clear:al,forEach:ko(!1,!1)},t={get(s){return Co(this,s,!1,!0)},get size(){return wo(this)},has:So,add:il,set:sl,delete:ll,clear:al,forEach:ko(!1,!0)},n={get(s){return Co(this,s,!0)},get size(){return wo(this,!0)},has(s){return So.call(this,s,!0)},add:Tt("add"),set:Tt("set"),delete:Tt("delete"),clear:Tt("clear"),forEach:ko(!0,!1)},o={get(s){return Co(this,s,!0,!0)},get size(){return wo(this,!0)},has(s){return So.call(this,s,!0)},add:Tt("add"),set:Tt("set"),delete:Tt("delete"),clear:Tt("clear"),forEach:ko(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Mo(s,!1,!1),n[s]=Mo(s,!0,!1),t[s]=Mo(s,!1,!0),o[s]=Mo(s,!0,!0)}),[e,n,t,o]}const[xc,bc,Cc,Sc]=yc();function Ti(e,t){const n=t?e?Sc:Cc:e?bc:xc;return(o,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(go(n,s)&&s in o?n:o,s,l)}const wc={get:Ti(!1,!1)},kc={get:Ti(!0,!1)},Mc={get:Ti(!0,!0)};function rl(e,t,n){const o=ue(n);if(o!==n&&t.call(e,o)){const s=$s(e);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const cl=new WeakMap,Ic=new WeakMap,dl=new WeakMap,hl=new WeakMap;function fl(e){return zt(e)?e:Bi(e,!1,mc,wc,cl)}function ul(e){return Bi(e,!0,gc,kc,dl)}function Io(e){return Bi(e,!0,pc,Mc,hl)}function Bi(e,t,n,o,s){if(!_e(e))return process.env.NODE_ENV!=="production"&&console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const l=s.get(e);if(l)return l;const a=(r=e).__v_skip||!Object.isExtensible(r)?0:function(d){switch(d){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}($s(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?o:n);return s.set(e,c),c}function At(e){return zt(e)?At(e.__v_raw):!(!e||!e.__v_isReactive)}function zt(e){return!(!e||!e.__v_isReadonly)}function Di(e){return!(!e||!e.__v_isShallow)}function Oi(e){return At(e)||zt(e)}function ue(e){const t=e&&e.__v_raw;return t?ue(t):e}const Li=e=>_e(e)?fl(e):e,Ri=e=>_e(e)?ul(e):e;function ze(e){return!(!e||e.__v_isRef!==!0)}const Ec={get:(e,t,n)=>{return ze(o=Reflect.get(e,t,n))?o.value:o;var o},set:(e,t,n,o)=>{const s=e[t];return ze(s)&&!ze(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}},Ft=[];function ht(e,...t){if(process.env.NODE_ENV==="production")return;Ks();const n=Ft.length?Ft[Ft.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=function(){let l=Ft[Ft.length-1];if(!l)return[];const a=[];for(;l;){const r=a[0];r&&r.vnode===l?r.recurseCount++:a.push({vnode:l,recurseCount:0});const c=l.component&&l.component.parent;l=c&&c.vnode}return a}();if(o)Ht(o,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${_l(n,l.type)}>`).join(`
2
2
  `),s]);else{const l=[`[Vue warn]: ${e}`,...t];s.length&&l.push(`
3
3
  `,...function(a){const r=[];return a.forEach((c,d)=>{r.push(...d===0?[]:[`
4
- `],...function({vnode:h,recurseCount:u}){const f=u>0?`... (${u} recursive calls)`:"",g=!!h.component&&h.component.parent==null,p=` at <${_l(h.component,h.type,g)}`,m=">"+f;return h.props?[p,...Tc(h.props),m]:[p+m]}(c))}),r}(s)),console.warn(...l)}Js()}function Tc(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...ml(o,e[o]))}),n.length>3&&t.push(" ..."),t}function ml(e,t,n){return dt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ze(t)?(t=ml(e,fe(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Oe(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=fe(t),n?t:[`${e}=`,t])}const gl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function Ht(e,t,n,o){let s;try{s=o?e(...o):e()}catch(l){pl(l,t,n)}return s}function Ni(e,t,n,o){if(Oe(e)){const l=Ht(e,t,n,o);return l&&tc(l)&&l.catch(a=>{pl(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(Ni(e[l],t,n,o));return s}function pl(e,t,n,o=!0){const s=t?t.vnode:null;if(t){let l=t.parent;const a=t.proxy,r=process.env.NODE_ENV!=="production"?gl[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](e,a,r)===!1)return}l=l.parent}const c=t.appContext.config.errorHandler;if(c)return void Ht(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=gl[a];if(r&&(d=r,Ft.push(d)),ht("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ft.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,o)}let Io=!1,Vi=!1;const et=[];let Bt=0;const en=[];let ut=null,Dt=0;const yl=Promise.resolve();let Pi=null;const Bc=100;function xl(e){const t=Pi||yl;return e?t.then(this?e.bind(this):e):t}function _i(e){et.length&&et.includes(e,Io&&e.allowRecurse?Bt+1:Bt)||(e.id==null?et.push(e):et.splice(function(t){let n=Bt+1,o=et.length;for(;n<o;){const s=n+o>>>1,l=et[s],a=yn(l);a<t||a===t&&l.pre?n=s+1:o=s}return n}(e.id),0,e),bl())}function bl(){Io||Vi||(Vi=!0,Pi=yl.then(Sl))}function Cl(e){pe(e)?en.push(...e):ut&&ut.includes(e,e.allowRecurse?Dt+1:Dt)||en.push(e),bl()}const yn=e=>e.id==null?1/0:e.id,Dc=(e,t)=>{const n=yn(e)-yn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Sl(e){Vi=!1,Io=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),et.sort(Dc);const t=process.env.NODE_ENV!=="production"?n=>wl(e,n):Ws;try{for(Bt=0;Bt<et.length;Bt++){const n=et[Bt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;Ht(n,null,14)}}}finally{Bt=0,et.length=0,function(n){if(en.length){const o=[...new Set(en)];if(en.length=0,ut)return void ut.push(...o);for(ut=o,process.env.NODE_ENV!=="production"&&(n=n||new Map),ut.sort((s,l)=>yn(s)-yn(l)),Dt=0;Dt<ut.length;Dt++)process.env.NODE_ENV!=="production"&&wl(n,ut[Dt])||ut[Dt]();ut=null,Dt=0}}(e),Io=!1,Pi=null,(et.length||en.length)&&Sl(e)}}function wl(e,t){if(e.has(t)){const n=e.get(t);if(n>Bc){const o=t.ownerInstance,s=o&&Pl(o.type);return ht(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}e.set(t,n+1)}else e.set(t,1)}const xn=new Set;process.env.NODE_ENV!=="production"&&(Ci().__VUE_HMR_RUNTIME__={createRecord:Ai(function(e,t){return vo.has(e)?!1:(vo.set(e,{initialDef:bn(t),instances:new Set}),!0)}),rerender:Ai(function(e,t){const n=vo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,bn(o.type).render=t),o.renderCache=[],o.update()}))}),reload:Ai(function(e,t){const n=vo.get(e);if(!n)return;t=bn(t),kl(n.initialDef,t);const o=[...n.instances];for(const s of o){const l=bn(s.type);xn.has(l)||(l!==n.initialDef&&kl(l,t),xn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(xn.add(l),s.ceReload(t.styles),xn.delete(l)):s.parent?_i(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Cl(()=>{for(const s of o)xn.delete(bn(s.type))})})});const vo=new Map;function bn(e){return Al(e)?e.__vccOpts:e}function kl(e,t){Qe(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function Ai(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Cn=null,Oc=null;const Rc=Symbol.for("v-ndc"),To={};function Lc(e,t,{immediate:n,deep:o,flush:s,onTrack:l,onTrigger:a}=xi){var r;process.env.NODE_ENV==="production"||t||(n!==void 0&&ht('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&ht('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=M=>{ht("Invalid watch source: ",M,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=Ys===((r=on)==null?void 0:r.scope)?on:null;let h,u,f=!1,g=!1;if(ze(e)?(h=()=>e.value,f=Di(e)):At(e)?(h=()=>e,o=!0):pe(e)?(g=!0,f=e.some(M=>At(M)||Di(M)),h=()=>e.map(M=>ze(M)?M.value:At(M)?tn(M):Oe(M)?Ht(M,d,2):void(process.env.NODE_ENV!=="production"&&c(M)))):Oe(e)?h=t?()=>Ht(e,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),Ni(e,d,3,[p])}:(h=Ws,process.env.NODE_ENV!=="production"&&c(e)),t&&o){const M=h;h=()=>tn(M())}let p=M=>{u=y.onStop=()=>{Ht(M,d,4),u=y.onStop=void 0}},m=g?new Array(e.length).fill(To):To;const x=()=>{if(y.active)if(t){const M=y.run();(o||f||(g?M.some((I,E)=>Qt(I,m[E])):Qt(M,m)))&&(u&&u(),Ni(t,d,3,[M,m===To?void 0:g&&m[0]===To?[]:m,p]),m=M)}else y.run()};let b;x.allowRecurse=!!t,s==="sync"?b=x:s==="post"?b=()=>Tl(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),b=()=>_i(x));const y=new dc(h,b);return process.env.NODE_ENV!=="production"&&(y.onTrack=l,y.onTrigger=a),t?n?x():m=y.run():s==="post"?Tl(y.run.bind(y),d&&d.suspense):y.run(),()=>{y.stop(),d&&d.scope&&Jr(d.scope.effects,y)}}function Nc(e,t,n){const o=this.proxy,s=dt(e)?e.includes(".")?function(c,d){const h=d.split(".");return()=>{let u=c;for(let f=0;f<h.length&&u;f++)u=u[h[f]];return u}}(o,e):()=>o[e]:e.bind(o,o);let l;Oe(t)?l=t:(l=t.handler,n=t);const a=on;Vl(this);const r=Lc(s,l.bind(o),n);return a?Vl(a):Fc(),r}function tn(e,t){if(!_e(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),ze(e))tn(e.value,t);else if(pe(e))for(let n=0;n<e.length;n++)tn(e[n],t);else if(ec(e)||Jt(e))e.forEach(n=>{tn(n,t)});else if(oc(e))for(const n in e)tn(e[n],t);return e}const zi=e=>e?4&e.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((o=t.exposed,sc(o,"__v_skip",!0),At(n=o)?n:new Proxy(n,vc)),{get:(s,l)=>l in s?s[l]:l in Fi?Fi[l](t):void 0,has:(s,l)=>l in s||l in Fi}));var n,o}(e)||e.proxy:zi(e.parent):null,Fi=Qe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Eo(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Eo(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Eo(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Eo(e.refs):e.refs,$parent:e=>zi(e.parent),$root:e=>zi(e.root),$emit:e=>e.emit,$options:e=>function(t){const n=t.type,{mixins:o,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=t.appContext,c=a.get(n);let d;return c?d=c:l.length||o||s?(d={},l.length&&l.forEach(h=>Bo(d,h,r,!0)),Bo(d,n,r)):d=n,_e(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>_i(e.update)),$nextTick:e=>e.n||(e.n=xl.bind(e.proxy)),$watch:e=>Nc.bind(e)});function Ml(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function Bo(e,t,n,o=!1){const{mixins:s,extends:l}=t;l&&Bo(e,l,n,!0),s&&s.forEach(a=>Bo(e,a,n,!0));for(const a in t)if(o&&a==="expose")process.env.NODE_ENV!=="production"&&ht('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=Vc[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Vc={data:El,props:vl,emits:vl,methods:Sn,computed:Sn,beforeCreate:Le,created:Le,beforeMount:Le,mounted:Le,beforeUpdate:Le,updated:Le,beforeDestroy:Le,beforeUnmount:Le,destroyed:Le,unmounted:Le,activated:Le,deactivated:Le,errorCaptured:Le,serverPrefetch:Le,components:Sn,directives:Sn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=Qe(Object.create(null),e);for(const o in t)n[o]=Le(e[o],t[o]);return n},provide:El,inject:function(e,t){return Sn(Il(e),Il(t))}};function El(e,t){return t?e?function(){return Qe(Oe(e)?e.call(this,this):e,Oe(t)?t.call(this,this):t)}:t:e}function Il(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Le(e,t){return e?[...new Set([].concat(e,t))]:t}function Sn(e,t){return e?Qe(Object.create(null),e,t):t}function vl(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:Qe(Object.create(null),Ml(e),Ml(t??{})):t}const Tl=function(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):Cl(e)},Bl=Symbol.for("v-fgt"),Pc=Symbol.for("v-txt"),_c=Symbol.for("v-cmt"),Dl="__vInternal",Ol=({key:e})=>e??null,Do=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?dt(e)||ze(e)||Oe(e)?{i:Cn,r:e,k:t,f:!!n}:e:null),Ac=process.env.NODE_ENV!=="production"?(...e)=>Rl(...e):Rl;function Rl(e,t=null,n=null,o=0,s=null,l=!1){if(e&&e!==Rc||(process.env.NODE_ENV==="production"||e||ht(`Invalid vnode type when creating vnode: ${e}.`),e=_c),(a=e)&&a.__v_isVNode===!0){const c=Oo(e,t,!0);return n&&Hi(c,n),c.patchFlag|=-2,c}var a;if(Al(e)&&(e=e.__vccOpts),t){t=function(h){return h?Oi(h)||Dl in h?Qe({},h):h:null}(t);let{class:c,style:d}=t;c&&!dt(c)&&(t.class=wi(c)),_e(d)&&(Oi(d)&&!pe(d)&&(d=Qe({},d)),t.style=Si(d))}const r=dt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:_e(e)?4:Oe(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Oi(e)&&ht("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
- Component that was made reactive: `,e=fe(e)),function(c,d=null,h=null,u=0,f=null,g=c===Bl?0:1,p=!1,m=!1){const x={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Ol(d),ref:d&&Do(d),scopeId:Oc,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:g,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Cn};return m?(Hi(x,h),128&g&&c.normalize(x)):h&&(x.shapeFlag|=dt(h)?8:16),process.env.NODE_ENV!=="production"&&x.key!=x.key&&ht("VNode created with invalid key (NaN). VNode type:",x.type),x}(e,t,n,o,s,r,l,!0)}function Oo(e,t,n=!1){const{props:o,ref:s,patchFlag:l,children:a}=e,r=t?function(...c){const d={};for(let h=0;h<c.length;h++){const u=c[h];for(const f in u)if(f==="class")d.class!==u.class&&(d.class=wi([d.class,u.class]));else if(f==="style")d.style=Si([d.style,u.style]);else if(Kr(f)){const g=d[f],p=u[f];!p||g===p||pe(g)&&g.includes(p)||(d[f]=g?[].concat(g,p):p)}else f!==""&&(d[f]=u[f])}return d}(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:r,key:r&&Ol(r),ref:t&&t.ref?n&&s?pe(s)?s.concat(Do(t)):[s,Do(t)]:Do(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&pe(a)?a.map(Ll):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Bl?l===-1?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oo(e.ssContent),ssFallback:e.ssFallback&&Oo(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Ll(e){const t=Oo(e);return pe(e.children)&&(t.children=e.children.map(Ll)),t}function zc(e=" ",t=0){return Ac(Pc,null,e,t)}function Hi(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(pe(t))n=16;else if(typeof t=="object"){if(65&o){const s=t.default;return void(s&&(s._c&&(s._d=!1),Hi(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||Dl in t||(t._ctx=Cn)}}else Oe(t)?(t={default:t,_ctx:Cn},n=32):(t=String(t),64&o?(n=16,t=[zc(t)]):n=8);e.children=t,e.shapeFlag|=n}let Wi,nn,on=null,Nl="__VUE_INSTANCE_SETTERS__";(nn=Ci()[Nl])||(nn=Ci()[Nl]=[]),nn.push(e=>on=e),Wi=e=>{nn.length>1?nn.forEach(t=>t(e)):nn[0](e)};const Vl=e=>{Wi(e),e.scope.on()},Fc=()=>{on&&on.scope.off(),Wi(null)},Hc=/(?:^|[-_])(\w)/g,Wc=e=>e.replace(Hc,t=>t.toUpperCase()).replace(/[-_]/g,"");function Pl(e,t=!0){return Oe(e)?e.displayName||e.name:e.name||t&&e.__name}function _l(e,t,n=!1){let o=Pl(t);if(!o&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(o=s[1])}if(!o&&e&&e.parent){const s=l=>{for(const a in l)if(l[a]===t)return a};o=s(e.components||e.parent.type.components)||s(e.appContext.components)}return o?Wc(o):n?"App":"Anonymous"}function Al(e){return Oe(e)&&"__vccOpts"in e}function $i(e){return!(!e||!e.__v_isShallow)}function zl(e,t,n){if(arguments.length===2)for(var o,s=0,l=t.length;s<l;s++)!o&&s in t||(o||(o=Array.prototype.slice.call(t,0,s)),o[s]=t[s]);return e.concat(o||Array.prototype.slice.call(t))}function Fl(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!Fl(e[n],t[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#0b1bc9"},n={style:"color:#b62e24"},o={style:"color:#9d288c"},s={header:u=>_e(u)?u.__isVue?["div",e,"VueInstance"]:ze(u)?["div",{},["span",e,h(u)],"<",r(u.value),">"]:At(u)?["div",{},["span",e,$i(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(zt(u)?" (readonly)":"")]:zt(u)?["div",{},["span",e,$i(u)?"ShallowReadonly":"Readonly"],"<",r(u),">"]:null:null,hasBody:u=>u&&u.__isVue,body(u){if(u&&u.__isVue)return["div",{},...l(u.$)]}};function l(u){const f=[];u.type.props&&u.props&&f.push(a("props",fe(u.props))),u.setupState!==xi&&f.push(a("setup",u.setupState)),u.data!==xi&&f.push(a("data",fe(u.data)));const g=c(u,"computed");g&&f.push(a("computed",g));const p=c(u,"inject");return p&&f.push(a("injected",p)),f.push(["div",{},["span",{style:o.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function a(u,f){return f=Qe({},f),Object.keys(f).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},u],["div",{style:"padding-left:1.25em"},...Object.keys(f).map(g=>["div",{},["span",o,g+": "],r(f[g],!1)])]]:["span",{}]}function r(u,f=!0){return typeof u=="number"?["span",t,u]:typeof u=="string"?["span",n,JSON.stringify(u)]:typeof u=="boolean"?["span",o,u]:_e(u)?["object",{object:f?fe(u):u}]:["span",n,String(u)]}function c(u,f){const g=u.type;if(Oe(g))return;const p={};for(const m in u.ctx)d(g,m,f)&&(p[m]=u.ctx[m]);return p}function d(u,f,g){const p=u[g];return!!(pe(p)&&p.includes(f)||_e(p)&&f in p)||!(!u.extends||!d(u.extends,f,g))||!(!u.mixins||!u.mixins.some(m=>d(m,f,g)))||void 0}function h(u){return $i(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var $c=function(){function e(t,n){this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(e.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),e.prototype.createObserver=function(t){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var o;if(this.options=typeof(o=t)=="function"?{callback:o}:o,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var u=function(f){for(var g=[],p=1;p<arguments.length;p++)g[p-1]=arguments[p];if(h=g,!c||f!==d){var m=r.leading;typeof m=="function"&&(m=m(f,d)),c&&f===d||!m||l.apply(void 0,zl([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,zl([f],h,!1)),c=0},a)}};return u._clear=function(){clearTimeout(c),c=null},u}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),xl(function(){n.observer&&n.observer.observe(n.el)})}},e.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},e}(),Xi={beforeMount:function(e,t){var n=t.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):e._vue_visibilityState=new $c(e,n))},updated:function(e,t){var n=t.value;if(!Fl(n,t.oldValue)){var o=e._vue_visibilityState;n&&o&&o.createObserver(n)}},unmounted:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};const wn={mounted(e,t){if(typeof ResizeObserver>"u")return;const n=t.value;if(typeof n!="function")return;getComputedStyle(e).position==="static"&&e.style.setProperty("position","relative","important");const o=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});o.observe(e),e.__resizeObserver__=o},unmounted(e){const t=e.__resizeObserver__;t&&(t.disconnect(),e.__resizeObserver__=null)}},le=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},Xc={name:"EvTabs",directives:{observeVisibility:Xi,resize:wn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:e=>{const t=e.map(o=>o.value),n=[...new Set(t)];return e.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):e.every(o=>Object.hasOwnProperty.call(o,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(e,{emit:t}){const n=i.ref(!1),o=i.ref([]),s=i.computed({get:()=>e.modelValue,set:C=>{t("update:modelValue",C),t("change",C)}});i.provide("evTabs",s);const l=i.computed({get:()=>e.panels,set:C=>t("update:panels",C)}),a=i.computed(()=>!e.draggable||!n.value?l.value:o.value),r=l.value.map(C=>C.value),c=i.ref(null),d=i.ref(null),h=i.ref(!1),u=i.reactive({x:0}),f=i.computed(()=>({transform:`translateX(${u.x}px)`})),g=()=>{const C=c.value.offsetWidth,S=d.value.offsetWidth;if(h.value=C<S,h.value){const w=C-S;w>u.x&&(u.x=w)}else u.x=0};i.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let C,S;r.length>l.value.length?(C=r,S=l.value.map(k=>k.value)):(C=l.value.map(k=>k.value),S=r);const w=C.filter(k=>!S.includes(k))[0];if(s.value===w){const k=r.findIndex(B=>B===w);k===0?s.value=l.value[0].value:s.value=l.value[k-1].value}}});const p=C=>{s.value=C},m=C=>{if(l.value.length<2)return;const S=l.value.findIndex(w=>w.value===C);if(S<0){s.value=l.value[0].value;return}C===s.value&&(S===0?s.value=l.value[1].value:s.value=l.value[S-1].value),l.value.splice(S,1),i.nextTick(()=>{r.splice(S,1)}),i.triggerRef(l)},x=(C,S=100)=>{const w=c.value.offsetWidth,k=d.value.offsetWidth,B=w-k;C==="next"&&u.x!==B?B>=u.x-S?u.x=B:u.x-=S:C==="prev"&&u.x!==0&&(S*-1<=u.x?u.x=0:u.x+=S)},b=i.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:m,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:x,dragstartTab:(C,S)=>{e.draggable&&(o.value=[...l.value],b.item=C,b.idx=S,n.value=!0)},dragoverTab:C=>{var k;if(!e.draggable||((k=b.item)==null?void 0:k.value)===C)return;const S=o.value.findIndex(B=>{var D;return B.value===((D=b.item)==null?void 0:D.value)}),w=o.value.findIndex(B=>B.value===C);o.value.splice(S,1),o.value.splice(w,0,b.item)},dragendTab:()=>{e.draggable&&(l.value=[...o.value],b.item={},b.idx=null,n.value=!1,o.value.splice(0))},dragSelectCls:C=>{var S;return e.draggable&&((S=b.item)==null?void 0:S.value)===C},selectIdxCls:C=>e.draggable&&b.idx===C,onResize:()=>{g()}}}},Uc={class:"ev-tabs-header"},Yc={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},jc=["onClick","onDragstart","onDragover"],Gc=["title"],Zc=["onClick"],qc={class:"ev-tabs-body"};function Kc(e,t,n,o,s,l){const a=i.resolveDirective("resize"),r=i.resolveDirective("observe-visibility");return i.withDirectives((i.openBlock(),i.createElementBlock("section",{class:i.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[i.createElementVNode("div",Uc,[i.createElementVNode("div",{class:i.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":o.hasScroll}])},[o.hasScroll?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:t[0]||(t[0]=c=>o.scrollTab("prev"))},[...t[3]||(t[3]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),i.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:t[1]||(t[1]=c=>o.scrollTab("next"))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):i.createCommentVNode("",!0),i.createElementVNode("div",Yc,[i.createElementVNode("ul",{ref:"listRef",class:"ev-tabs-list",style:i.normalizeStyle(o.listRefStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.computedTabList,(c,d)=>(i.openBlock(),i.createElementBlock("li",i.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===o.mv,"has-icon":c.iconClass,"drag-select":o.dragSelectCls(c.value),"select-idx":o.selectIdxCls(d)},onClick:h=>o.clickTab(c.value),onDragstart:i.withModifiers(h=>o.dragstartTab(c,d),["stop"]),onDragover:i.withModifiers(h=>o.dragoverTab(c.value),["prevent"]),onDragend:t[2]||(t[2]=i.withModifiers((...h)=>o.dragendTab&&o.dragendTab(...h),["prevent"]))}),[c.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"text",title:c.text},i.toDisplayString(c.text),9,Gc),n.closable?(i.openBlock(),i.createElementBlock("span",{key:1,class:"close-icon",onClick:i.withModifiers(h=>o.removeTab(c.value),["stop"])},[...t[5]||(t[5]=[i.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,Zc)):i.createCommentVNode("",!0)],16,jc))),128))],4)],512)],2)]),i.createElementVNode("div",qc,[i.renderSlot(e.$slots,"default")])],2)),[[a,o.onResize],[r,{callback:o.onResize,once:!0}]])}const kn=le(Xc,[["render",Kc]]);kn.install=e=>{e.component(kn.name,kn)};const Jc={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1}},emits:{},setup(e){const t=i.inject("evTabs",null);return{isSelected:i.computed(()=>e.value===t.value)}}},Qc={class:"ev-tab-panel"};function ed(e,t,n,o,s,l){return i.withDirectives((i.openBlock(),i.createElementBlock("article",Qc,[i.renderSlot(e.$slots,"default")],512)),[[i.vShow,o.isSelected]])}const Mn=le(Jc,[["render",ed]]);Mn.install=e=>{e.component(Mn.name,Mn)};const td={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:e=>["button","submit","reset"].includes(e)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(e){const t=i.ref(null);return i.onMounted(()=>{e.autoFocus&&t.value.focus()}),{buttonRef:t}}},nd=["type","disabled","autofocus"];function od(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("button",{ref:"buttonRef",class:i.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:t[0]||(t[0]=a=>e.$emit("click",a))},[i.renderSlot(e.$slots,"default")],10,nd)}const sn=le(td,[["render",od]]);sn.install=e=>{e.component(sn.name,sn)};const id={name:"EvButtonGroup"},sd={class:"ev-button-group"};function ld(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",sd,[i.renderSlot(e.$slots,"default")])}const En=le(id,[["render",ld]]);En.install=e=>{e.component(En.name,En)};const ad={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(e,{emit:t}){const n=i.ref();i.onMounted(()=>{n.value&&e.tooltipTitle&&(n.value.title=e.tooltipTitle)});const o=i.ref(null),s=i.inject("EvCheckboxGroupMv",i.computed({get:()=>e.modelValue,set:c=>{c&&!o.value.indeterminate&&t("update:indeterminate",!1),t("update:modelValue",c)}})),l=i.computed(()=>e.label),a=i.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=i.inject("EvCheckboxGroupChange",async c=>{await i.nextTick(),t("change",s.value,c)});return i.watch(()=>e.indeterminate,c=>{i.nextTick(()=>{o.value&&(o.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:o,checked:a,changeMv:r}}},rd=["disabled","value","readonly"],cd={ref:"checkboxLabel",class:"ev-checkbox-label"};function dd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:o.checked}]])},[i.withDirectives(i.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:t[1]||(t[1]=(...a)=>o.changeMv&&o.changeMv(...a))},null,40,rd),[[i.vModelCheckbox,o.mv]]),i.createElementVNode("span",cd,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.label),1)],64))],512)],2)}const ln=le(ad,[["render",dd]]);ln.install=e=>{e.component(ln.name,ln)};const hd={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});i.provide("EvCheckboxGroupMv",n);const o=async s=>{await i.nextTick(),t("change",n.value,s)};i.provide("EvCheckboxGroupChange",o)}};function ud(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[i.renderSlot(e.$slots,"default")],2)}const an=le(hd,[["render",ud]]);an.install=e=>{e.component(an.name,an)};const fd={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.inject("EvRadioGroupMv",i.computed({get:()=>e.modelValue,set:l=>t("update:modelValue",l)})),o=i.inject("EvRadioGroupChange",async l=>{await i.nextTick(),t("change",n.value,l)}),s=i.computed(()=>n.value===e.label);return{mv:n,checked:s,changeMv:o}}},md=["value","disabled"],gd={class:"ev-radio-label"};function pd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:o.checked},n.size]])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:t[1]||(t[1]=i.withModifiers((...a)=>o.changeMv&&o.changeMv(...a),["stop"]))},null,40,md),[[i.vModelRadio,o.mv]]),i.createElementVNode("span",gd,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.label),1)],64))])],2)}const In=le(fd,[["render",pd]]);In.install=e=>{e.component(In.name,In)};const yd={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});i.provide("EvRadioGroupMv",n);const o=async s=>{await i.nextTick(),t("change",n.value,s)};i.provide("EvRadioGroupChange",o)}};function xd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[i.renderSlot(e.$slots,"default")],2)}const vn=le(yd,[["render",xd]]);vn.install=e=>{e.component(vn.name,vn)};const Ro={mounted(e,t){const n=e,o=t.modifiers.bubbles,s=l=>{(o||n!==l.target&&!n.contains(l.target))&&t.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},bd={mounted(e,t){const n=e;let o=null;const s=t.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(o=l[h],o!==d.target&&!o.contains(d.target)){t.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},Cd={mounted(e,t){const n=e,o=t.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(o||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&t.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}};var Ot=function(){return Ot=Object.assign||function(t){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Ot.apply(this,arguments)};function rn(e,t,n){if(n||arguments.length===2)for(var o=0,s=t.length,l;o<s;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Lo=44032,Tn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ne=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ie=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Rt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},Ui={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},Hl=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],Wl=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function $l(e){var t="",n="",o="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Tn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-Lo;a=r%Ie.length,l=(r-a)/Ie.length%Ne.length,s=((r-a)/Ie.length-l)/Ne.length,t=Tn[s],n=Ne[l],o=Ie[a]}return{initial:t,medial:n,finale:o,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(e,t){var n=t[0],o=t[1];return rn(rn([],e,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(o,"\\)(\\s+)"),"g"),n,o],[RegExp(`([가-힣]['" ]{0,1})`.concat(o,"\\(").concat(n,"\\)(\\s+)"),"g"),n,o]],!1)},[]);function Sd(e,t){var n=t===void 0?{}:t,o=n.grouped,s=o===void 0?!1:o,l=[];return e.split("").forEach(function(a){var r=$l(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,f=r.medialOffset,g=r.finaleOffset;l.push((u!==-1||f!==-1||g!==-1?[c,Rt[d]&&Hl.indexOf(d)===-1?Rt[d]:d,Rt[h]&&Hl.indexOf(h)===-1?Rt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var Wt=Object.entries(Rt).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[s.join("")]=o,n))},{}),Xl=function(e){return typeof e<"u"};function wd(e){var t=e.findIndex(function(d){return Ne.indexOf(d)!==-1}),n=t!==-1&&Ne.indexOf(e[t+1])!==-1?t+1:t,o=e.slice(0,t).join(""),s=e.slice(t,n+1).join(""),l=e.slice(n+1).join(""),a=Tn.indexOf(Wt[o]||o),r=Ne.indexOf(Wt[s]||s),c=Ie.indexOf(Wt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Lo+a*(Ne.length*Ie.length)+r*Ie.length+c):e.join("")}function kd(e){var t=[];(typeof e=="string"?e.split(""):e).forEach(function(l,a,r){typeof l=="string"&&t.length>0&&Ne.indexOf(r[a-1])!==-1&&Ne.indexOf(l)!==-1&&Wt["".concat(r[a-1]).concat(l)]?t[t.length-1]=Wt["".concat(r[a-1]).concat(l)]:t.push(l)});var n={medial:null,finales:[]},o=[n];t.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},o.push({grouped:l,finales:[]}),o.push(n)):Ne.indexOf(l)!==-1?(n={medial:l,finales:[]},o.push(n)):n.finales.push(l)}),o.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],u=d.slice(1);l.initials=u,c.finales=h?[h]:[]}if(l.finales.length>2||a===o.length-1&&l.finales.length>1){var f=l.finales,g=f[0],p=f[1],m=f.slice(2);Wt["".concat(g).concat(p)]&&(l.finales=rn([Wt["".concat(g).concat(p)]],m,!0))}}});var s=[];return o.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var u=r.slice(),f=u.pop(),g=d[0],p=d.slice(1);Ie.indexOf(g)===-1&&(p=rn([g],p,!0),g=""),u.filter(Xl).forEach(function(m){return s.push([m])}),s.push([f,c,g].filter(Boolean)),p.filter(Xl).forEach(function(m){return s.push([m])})}}),s.map(wd).join("")}var Md=Object.values(Wl).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[s]=o,n))},{});function Ul(e){return kd(e.split("").map(function(t){return Md[t]||t}).join(""))}var Yl=/[\\^$.*+?()[\]{}|]/g,Ed=RegExp(Yl.source);function Yi(e){return e&&Ed.test(e)?e.replace(Yl,"\\$&"):e||""}var No=function(e,t){t===void 0&&(t=!1);var n=Tn.indexOf(e);if(n!==-1){var o=n*Ne.length*Ie.length+Lo;return"[".concat(t?e:"").concat(String.fromCharCode(o),"-").concat(String.fromCharCode(o+Ne.length*Ie.length-1),"]")}return e},jl="__".concat(parseInt("fuzzy",36),"__"),Gl="__".concat(parseInt("ignorespace",36),"__"),ji=function(){var e,t;return function(n,o){var s=o===void 0?{}:o,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,u=s.ignoreSpace,f=u===void 0?!1:u,g=s.ignoreCase,p=g===void 0?!0:g,m=s.global,x=m===void 0?!1:m,b=s.fuzzy,y=b===void 0?!1:b,M=s.nonCaptureGroup,I=M===void 0?!1:M,E=s.engToKor,T=E===void 0?!1:E;if(e===n)return t;var V=n,C=[];if(T&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var S=Ul(n.trim());S.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=S,C.push(Yi(n.trim())))}var w=V.split(""),k=w.slice(-1)[0],B="",D=$l(k||"");if(D.initialOffset!==-1){w=w.slice(0,-1);var O=D.initial,R=D.medial,v=D.finale,N=D.initialOffset,L=D.medialOffset,P=N*Ne.length*Ie.length+Lo,_=[];switch(!0){case v!=="":{_.push(k),Tn.includes(v)&&_.push("".concat(String.fromCharCode(P+L*Ie.length)).concat(No(v))),Rt[v]&&_.push("".concat(String.fromCharCode(P+L*Ie.length+Ie.join("").search(Rt[v][0])+1)).concat(No(Rt[v][1])));break}case R!=="":{var A=void 0,z=void 0;Ui[R]?(A=P+Ne.join("").search(Ui[R][0])*Ie.length,z=P+Ne.join("").search(Ui[R][1])*Ie.length+Ie.length-1):(A=P+L*Ie.length,z=A+Ie.length-1),_.push("[".concat(String.fromCharCode(A),"-").concat(String.fromCharCode(z),"]"));break}case O!=="":{_.push(No(O,!0));break}}B=_.length>1?I?"(?:".concat(_.join("|"),")"):"(".concat(_.join("|"),")"):_[0]}var $=y?jl:f?Gl:"",U=a?w.map(function(K){return K.search(/[ㄱ-ㅎ]/)!==-1?No(K,!0):Yi(K)}).join($):Yi(w.join($)),H=U.trim()!==""&&B.trim()!=="",X=H?"".concat(U).concat($).concat(B):"".concat(U).concat(B),j=(c?"^":"")+X+(h?"$":"");return $&&(j=j.replace(RegExp(jl,"g"),".*").replace(RegExp(Gl,"g"),"\\s*")),C.length>0&&(j=rn(rn([],C,!0),[j],!1).map(function(K){return"(".concat(K,")")}).join("|")),t=RegExp(j,(x?"g":"")+(p?"i":"")),t}}(),Id=Object.values(Wl).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[o]=s,n))},{});function vd(e){return e.split("").map(function(t){return Sd(t,{grouped:!1}).map(function(n){return Id[n]||n})}).flat().join("")}const Td=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n={get:()=>e.items.some(m=>m.value===e.modelValue)?e.modelValue:null,set:m=>t("update:modelValue",m)},o={get:()=>Array.isArray(e.modelValue)?e.modelValue:[],set:m=>t("update:modelValue",m)},s=i.computed(e.multiple?o:n),l=()=>{var m;return(m=e.items.find(x=>x.value===s.value))==null?void 0:m.name},a=()=>e.items.filter(m=>e.modelValue.includes(m.value)),r=i.computed(e.multiple?a:l),c=i.computed(()=>e.multiple&&s.value.length?null:e.placeholder),d=()=>s.value,h=()=>s.value.length,u=i.computed(e.multiple?h:d),f=()=>{e.disabled||(e.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},g=async()=>{await i.nextTick(),t("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:f,removeMv:async m=>{if(!e.disabled){const x=s.value.indexOf(m);s.value.splice(x,1),s.value=[...s.value],await g()}},changeMv:g}},Bd=e=>{const{props:t}=i.getCurrentInstance(),{mv:n,changeMv:o}=e,s=i.ref(!1),l=i.ref(t.filterText),a=i.ref(null),r=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref("100%"),u=i.ref(null),f=i.reactive({top:0}),g=i.computed(()=>{var v;if(!l.value||!t.filterable)return t.items;const D=(v=l.value)==null?void 0:v.trim(),O=Ul(D),R=vd(D);return t.items.filter(({name:N})=>N.search(ji(D))>-1||N.search(ji(O))>-1||N.search(ji(R))>-1)}),p=D=>{var O;l.value=(O=D==null?void 0:D.target)==null?void 0:O.value},m=async()=>{var N,L,P;await i.nextTick();const D=(N=r.value)==null?void 0:N.getBoundingClientRect().height,O=(L=r.value)==null?void 0:L.getBoundingClientRect().y,R=(P=c.value)==null?void 0:P.getBoundingClientRect().height;document.documentElement.clientHeight<O+D+R?f.top=`-${R}px`:f.top=`${D}px`},x=()=>{var N,L,P;if(!((P=(L=(N=d.value)==null?void 0:N.children[0])==null?void 0:L.children)!=null&&P.length))return;const D="selected",O=d.value.children[0].children,R=d.value.offsetTop;let v=null;for(let _=0;_<O.length;_++)if(v=O[_],v.classList.contains(D)){if(!v.offsetTop)return;d.value.scrollTop=v.offsetTop-R;break}},b=async()=>{if(d.value&&c.value){await i.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth);const D=d.value.querySelectorAll(".ev-select-dropbox-item");let O=0;D.forEach(U=>{const H=U.scrollWidth;H>O&&(O=H)});const{borderLeftWidth:R,borderRightWidth:v}=window.getComputedStyle(c.value),N=parseInt(R)+parseInt(v),L=d.value.offsetWidth-d.value.clientWidth;O+=L+N;const P=window.innerWidth,A=c.value.getBoundingClientRect().left,z=P-A-20,$=Math.max(Math.min(O,z),u.value);h.value=`${$}px`}else h.value="100%"};i.watch(()=>s.value,async D=>{D&&(await x(),await b())}),i.watch(()=>g.value,async()=>{await m()}),t.filterable&&i.watch(()=>g.value,()=>m());const y=async()=>{t.items.length&&!t.disabled&&(s.value=!s.value,s.value&&await m())},M=()=>{t.filterable&&(l.value=""),s.value=!1},I=i.ref(!1),E=D=>{D||(I.value=!I.value),I.value?n.value=g.value.filter(O=>!O.disabled).map(O=>O.value):n.value=[]},T=D=>{t.filterable&&(l.value=""),s.value=!1,n.value!==D&&(n.value=D,o())},V=D=>{if(t.filterable&&(l.value=""),!n.value.includes(D))n.value.push(D);else{const O=n.value.indexOf(D);n.value.splice(O,1)}I.value=n.value.length===g.value.filter(O=>!O.disabled).length,n.value=[...n.value],o()},C=t.multiple?V:T,S=D=>D===n.value,w=D=>n.value.includes(D),k=t.multiple?w:S;i.watch(()=>n.value,D=>{t.multiple&&t.checkable&&(D.length===0?I.value=!1:I.value=D.length===g.value.filter(O=>!O.disabled).length,m())});const B=()=>{s.value&&(b(),m())};return i.onMounted(()=>{window.addEventListener("resize",B)}),i.onUnmounted(()=>{window.removeEventListener("resize",B)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:g,clickSelectInput:y,clickOutsideDropbox:M,changeFilterText:p,changeDropboxPosition:m,clickItem:C,selectedItemClass:k,allCheck:I,changeAllCheck:E,dropboxWidth:h}},Dd={name:"EvSelect",components:{EvCheckbox:ln,EvCheckboxGroup:an},directives:{clickoutside:bd},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"}},emits:{"update:modelValue":null,change:null},setup(){const{mv:e,selectedModel:t,computedPlaceholder:n,isClearableIcon:o,changeMv:s,removeMv:l,removeAllMv:a}=Td(),{select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:g,filteredItems:p,clickSelectInput:m,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:M,selectedItemClass:I,allCheck:E,changeAllCheck:T,dropboxWidth:V}=Bd({mv:e,changeMv:s});return{mv:e,selectedModel:t,computedPlaceholder:n,isClearableIcon:o,changeMv:s,removeMv:l,removeAllMv:a,select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:g,filteredItems:p,clickSelectInput:m,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:M,selectedItemClass:I,allCheck:E,changeAllCheck:T,dropboxWidth:V}}},Od={ref:"selectWrapper",class:"ev-select__wrapper"},Rd=["placeholder","disabled"],Ld={key:1,class:"ev-select-tag-wrapper"},Nd=["placeholder","disabled"],Vd={class:"ev-tag-name"},Pd=["onClick"],_d={key:0,class:"ev-select-tag"},Ad={class:"ev-tag-name"},zd={key:1,class:"ev-select-tag num"},Fd={class:"ev-tag-name"},Hd={class:"ev-select-dropbox-wrapper"},Wd=["placeholder","value"],$d={ref:"itemWrapper",class:"ev-select-dropbox-list"},Xd={key:0,class:"ev-select-dropbox-ul"},Ud=["title","onClick"],Yd={key:1},jd={class:"ev-select-dropbox-item disabled"},Gd={key:0,class:"ev-select-dropbox-ul"},Zd=["title","onClick"],qd={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},Kd={key:0,class:"ev-select-dropbox-ul"},Jd=["title","onClick"],Qd={key:1},eh={class:"ev-select-dropbox-item disabled"};function th(e,t,n,o,s,l){const a=i.resolveComponent("ev-checkbox"),r=i.resolveComponent("ev-checkbox-group"),c=i.resolveDirective("clickoutside");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"select",class:i.normalizeClass(["ev-select",{selected:o.isDropbox,disabled:n.disabled}])},[i.createElementVNode("div",Od,[n.multiple?(i.openBlock(),i.createElementBlock("div",Ld,[!n.clearable||!o.isClearableIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[3]||(t[3]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},[i.createElementVNode("i",{class:i.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:o.isDropbox}])},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",placeholder:o.computedPlaceholder,disabled:n.disabled,onClick:t[4]||(t[4]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},null,8,Nd),n.collapseTags?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o.selectedModel.length?(i.openBlock(),i.createElementBlock("div",_d,[i.createElementVNode("span",Ad,i.toDisplayString(o.selectedModel[0].name),1),i.createElementVNode("span",{class:"ev-tag-suffix",onClick:t[5]||(t[5]=i.withModifiers(d=>[o.removeMv(o.selectedModel[0].value),o.changeDropboxPosition()],["stop"]))},[...t[13]||(t[13]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):i.createCommentVNode("",!0),o.selectedModel.length>1?(i.openBlock(),i.createElementBlock("div",zd,[i.createElementVNode("span",Fd," + "+i.toDisplayString(o.selectedModel.length-1),1)])):i.createCommentVNode("",!0)],64)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(o.selectedModel,d=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"ev-select-tag"},[i.createElementVNode("span",Vd,i.toDisplayString(d.name),1),i.createElementVNode("span",{class:"ev-tag-suffix",onClick:i.withModifiers(h=>[o.removeMv(d.value),o.changeDropboxPosition()],["stop"])},[...t[12]||(t[12]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Pd)]))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[!n.clearable||!o.isClearableIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[0]||(t[0]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},[i.createElementVNode("i",{class:i.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:o.isDropbox}])},null,2)])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>o.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:o.computedPlaceholder,disabled:n.disabled,onClick:t[2]||(t[2]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},null,8,Rd),[[i.vModelText,o.selectedModel]])],64)),n.clearable?i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:t[6]||(t[6]=i.withModifiers(d=>[o.removeAllMv(),o.clickOutsideDropbox()],["stop"]))},[...t[14]||(t[14]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[i.vShow,o.isClearableIcon]]):i.createCommentVNode("",!0),i.createElementVNode("div",Hd,[o.isDropbox?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"dropbox",class:"ev-select-dropbox",style:i.normalizeStyle([o.dropboxPosition,{width:o.dropboxWidth}])},[n.filterable?i.renderSlot(e.$slots,"search-filter",{key:0,item:{value:o.filterTextRef,onInput:o.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[i.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:o.filterTextRef,onInput:t[7]||(t[7]=(...d)=>o.changeFilterText&&o.changeFilterText(...d))},null,40,Wd)]):i.createCommentVNode("",!0),n.checkable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.multiple?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-select-dropbox-item all-check",{selected:o.allCheck}]),onClick:t[10]||(t[10]=i.withModifiers(d=>[o.changeAllCheck(!1),o.changeDropboxPosition()],["self","prevent"]))},[i.createVNode(a,{modelValue:o.allCheck,"onUpdate:modelValue":t[8]||(t[8]=d=>o.allCheck=d),label:n.allCheckLabel,onChange:t[9]||(t[9]=d=>[o.changeAllCheck(!0),o.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):i.createCommentVNode("",!0),i.createElementVNode("div",$d,[n.multiple?(i.openBlock(),i.createBlock(r,{key:0,modelValue:o.mv,"onUpdate:modelValue":t[11]||(t[11]=d=>o.mv=d)},{default:i.withCtx(()=>[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",Xd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(u=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["self","prevent"])},[i.createVNode(a,{label:d.value,disabled:d.disabled},{default:i.withCtx(()=>[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)]),_:2},1032,["label","disabled"])],10,Ud))),128))])):(i.openBlock(),i.createElementBlock("ul",Yd,[i.createElementVNode("li",jd,i.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",Gd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(u=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["stop","prevent"])},[i.createVNode(a,{"model-value":o.mv===d.value,disabled:d.disabled},{default:i.withCtx(()=>[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)]),_:2},1032,["model-value","disabled"])],10,Zd))),128))])):i.createCommentVNode("",!0)],64))],512)],64)):(i.openBlock(),i.createElementBlock("div",qd,[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",Kd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(u=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)],10,Jd))),128))])):(i.openBlock(),i.createElementBlock("ul",Qd,[i.createElementVNode("li",eh,i.toDisplayString(n.noMatchingText),1)]))],512))],4)):i.createCommentVNode("",!0)])],512)],2)),[[c,o.clickOutsideDropbox]])}const Bn=le(Dd,[["render",th]]);Bn.install=e=>{e.component(Bn.name,Bn)};const nh={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,clickMv:()=>{!e.disabled&&!e.readonly&&(n.value=!n.value)}}}};function oh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:i.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:t[0]||(t[0]=(...a)=>o.clickMv&&o.clickMv(...a))},null,6)}const Dn=le(nh,[["render",oh]]);Dn.install=e=>{e.component(Dn.name,Dn)};const ih={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"}},emits:["update:modelValue","focus","blur","input","change","search"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:m=>t("update:modelValue",m)}),o=i.ref(!1),s=()=>{e.type==="password"&&(o.value=!o.value)},l=i.computed(()=>e.type==="password"?o.value?"text":"password":e.type==="search"?"text":e.type);i.watch(()=>e.type,m=>{m!=="password"&&(o.value=!1)});const a=()=>{n.value=""},r=()=>{t("search",n.value)},c=m=>{e.type==="search"&&(m.key==="Enter"||m.keyCode===13)&&r()},d=m=>{t("focus",m)},h=m=>{t("blur",m)},u=m=>new TextEncoder().encode(m).length,f=i.computed(()=>e.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:o,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:m=>{let x=m.target.value;if(e.maxLength&&e.maxUnit==="byte"){for(;u(x)>e.maxLength;)x=x.slice(0,-1);m.target.value=x}n.value=x,t("input",x,m)},changeMv:m=>t("change",n.value,m),currentLength:f}}},sh={class:"ev-text-field-wrapper"},lh=["placeholder","disabled","readonly","autocomplete","maxlength"],ah=["type","placeholder","disabled","readonly","autocomplete","maxlength"],rh={key:3,class:"ev-text-field-icon icon-suffix"},ch={key:4,class:"ev-text-field-icon icon-prefix"},dh={key:0,class:"ev-text-field-error"},hh={class:"curr-length"};function uh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":e.$slots["icon-prefix"],"ev-text-field-suffix":e.$slots["icon-suffix"],"ev-text-field-prefix-suffix":e.$slots["icon-prefix"]&&e.$slots["icon-suffix"]}])},[i.createElementVNode("div",sh,[n.type==="textarea"?i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[1]||(t[1]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>o.blurInput&&o.blurInput(...a)),onInput:t[3]||(t[3]=(...a)=>o.inputMv&&o.inputMv(...a)),onChange:t[4]||(t[4]=(...a)=>o.changeMv&&o.changeMv(...a))},null,40,lh)),[[i.vModelText,o.mv]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>o.mv=a),class:"ev-input",type:o.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[6]||(t[6]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[7]||(t[7]=(...a)=>o.blurInput&&o.blurInput(...a)),onInput:t[8]||(t[8]=(...a)=>o.inputMv&&o.inputMv(...a)),onChange:t[9]||(t[9]=(...a)=>o.changeMv&&o.changeMv(...a)),onKeyup:t[10]||(t[10]=(...a)=>o.keyupInput&&o.keyupInput(...a))},null,40,ah),[[i.vModelDynamic,o.mv]]),n.type==="text"&&n.clearable?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:t[11]||(t[11]=(...a)=>o.clearValue&&o.clearValue(...a))},[...t[14]||(t[14]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):i.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["ev-text-field-icon icon-password",{on:o.isPasswordVisible}]),onClick:t[12]||(t[12]=(...a)=>o.changePasswordVisible&&o.changePasswordVisible(...a))},[i.createElementVNode("i",{class:i.normalizeClass(o.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):i.createCommentVNode("",!0),n.type==="search"?(i.openBlock(),i.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:t[13]||(t[13]=(...a)=>o.searchValue&&o.searchValue(...a))},[...t[15]||(t[15]=[i.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):i.createCommentVNode("",!0),e.$slots["icon-suffix"]?(i.openBlock(),i.createElementBlock("span",rh,[i.renderSlot(e.$slots,"icon-suffix")])):i.createCommentVNode("",!0),e.$slots["icon-prefix"]?(i.openBlock(),i.createElementBlock("span",ch,[i.renderSlot(e.$slots,"icon-prefix")])):i.createCommentVNode("",!0)],64))]),n.errorMsg?(i.openBlock(),i.createElementBlock("div",dh,i.toDisplayString(n.errorMsg),1)):i.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["ev-text-field-maxlength",{max:o.currentLength>n.maxLength}])},[i.createElementVNode("span",hh,i.toDisplayString(o.currentLength),1),i.createTextVNode(" / "+i.toDisplayString(n.maxLength)+i.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):i.createCommentVNode("",!0)],2)}const On=le(ih,[["render",uh]]);On.install=e=>{e.component(On.name,On)};function Zl(e){let t=null;if(typeof e=="string"||typeof e=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(e);t=n?{value:+n[2],unit:n[3]||void 0}:null}return t}function ve(e){return typeof e=="number"&&!Number.isNaN(e)}function ft(...e){return e.every(ve)}function We(e,t){const n=e/t*100;return!ft(e,t,n)||e===0||t===0?0:n.toFixed(2)}function fh(e){return ft(e)?1e6*e:0}function mh(e){return ft(e)?1e9*e:0}function gh(e){return ft(e)?1e12*e:0}function ph(e){return ft(e)?1e15*e:0}function $t(e){const t=/\B(?=(\d{3})+(?!\d))/g;if(ft(e)){if(Number.isInteger(e))return e.toString().replace(t,",");const n=e.toString().split(".");return n[0].replace(t,",")+(n[1]?`.${n[1]}`:"")}return!1}function Rn(e){const t=(e==null?void 0:e.toString().split(".")[1])||0;return t?t.length:0}function Gi(e){return e==null}function yh(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function Ln(e,{min:t,max:n,step:o}){const s=Math.floor((e-t)/o),l=(e-t)%o,a=Math.floor((n-t)/o),r=Math.max(Rn(o),Rn(t));let c=!1,d;if(r){let h=+parseFloat(o*s).toFixed(r);d=+(h+t).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==o,l>o/2&&!c&&(d=+(d+o).toFixed(r)),d>n?(h=+parseFloat(o*a).toFixed(r),d=+(h+t).toFixed(r)):d<t&&(d=t)}else d=o*s+t,c=s===a&&n-d!==o,l>o/2&&!c&&(d+=o),d>n?d=o*a+t:d<t&&(d=t);return d}function xh(){const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(e.modelValue),o=i.ref(e.modelValue),s=d=>e.precision&&(d||d===0)?Number(d).toFixed(e.precision):d,l=d=>{let h=d;!d&&d!==0?h=e.stepStrictly?o.value:null:isNaN(d)?h=o.value:e.stepStrictly?(e.min===-1/0&&(e.min=0),h=Ln(d,{min:e.min,max:e.max,step:e.step})):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max?h=e.max:h=+h,n.value=s(h),o.value=s(h),t("update:modelValue",h),t("change",h)},a=d=>{t("focus",d)},r=d=>{t("blur",d)},c=d=>{l(d.target.value)};return i.watch(()=>e.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function bh(e){const{props:t}=i.getCurrentInstance(),{currentValue:n,validateValue:o}=e;return{stepValue:l=>{if(t.readonly||t.disabled)return;let a;if(!n.value&&n.value!==0)a=t.min===-1/0?0:t.min;else{const r=+n.value,c=l==="up"?t.step:t.step*-1,h=10**Math.max(Rn(r),Rn(t.step));a=(Math.round(r*h)+Math.round(c*h))/h}a>=t.min&&a<=t.max&&o(a)}}}function Ch(e){const{props:t}=i.getCurrentInstance(),{currentValue:n,validateValue:o}=e,s=t.max||t.max===0,l=t.min||t.min===0,a=()=>{s&&l&&t.max<=t.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),t.step&&(t.precision||t.precision===0)&&Rn(t.step)>t.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>t.max?c=t.max:l&&c<t.min&&(c=t.min)),o(c)};i.onBeforeMount(()=>{a(),r()})}const Sh={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:e=>e>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:e=>e>=0&&e<=100&&e===parseInt(e,10)}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:e,validateValue:t,focusInput:n,blurInput:o,changeMv:s}=xh(),{stepValue:l}=bh({currentValue:e,validateValue:t});return Ch({currentValue:e,validateValue:t}),{currentValue:e,validateValue:t,focusInput:n,blurInput:o,changeMv:s,stepValue:l}}},wh={class:"ev-input-number__wrapper"},kh=["onClick"],Mh=["placeholder","disabled","readonly"];function Eh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[i.createElementVNode("div",wh,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["up","down"],a=>i.createElementVNode("span",{key:`step-arrow-${a}`,class:i.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>o.stepValue(a)},[i.createElementVNode("i",{class:i.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,kh)),64)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>o.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:t[1]||(t[1]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>o.blurInput&&o.blurInput(...a)),onChange:t[3]||(t[3]=(...a)=>o.changeMv&&o.changeMv(...a)),onKeydown:[t[4]||(t[4]=i.withKeys(i.withModifiers(a=>o.stepValue("up"),["prevent"]),["up"])),t[5]||(t[5]=i.withKeys(i.withModifiers(a=>o.stepValue("down"),["prevent"]),["down"])),t[6]||(t[6]=i.withKeys(i.withModifiers(a=>o.validateValue(o.currentValue),["prevent"]),["enter"]))]},null,40,Mh),[[i.vModelText,o.currentValue,void 0,{trim:!0}]])])],2)}const Nn=le(Sh,[["render",Eh]]);Nn.install=e=>{e.component(Nn.name,Nn)};var ql=typeof global=="object"&&global&&global.Object===Object&&global,Ih=typeof self=="object"&&self&&self.Object===Object&&self,tt=ql||Ih||Function("return this")(),mt=tt.Symbol,Kl=Object.prototype,vh=Kl.hasOwnProperty,Th=Kl.toString,Vn=mt?mt.toStringTag:void 0;function Bh(e){var t=vh.call(e,Vn),n=e[Vn];try{e[Vn]=void 0;var o=!0}catch{}var s=Th.call(e);return o&&(t?e[Vn]=n:delete e[Vn]),s}var Dh=Object.prototype,Oh=Dh.toString;function Rh(e){return Oh.call(e)}var Lh="[object Null]",Nh="[object Undefined]",Jl=mt?mt.toStringTag:void 0;function Lt(e){return e==null?e===void 0?Nh:Lh:Jl&&Jl in Object(e)?Bh(e):Rh(e)}function nt(e){return e!=null&&typeof e=="object"}var Vh="[object Symbol]";function Vo(e){return typeof e=="symbol"||nt(e)&&Lt(e)==Vh}function Ph(e,t){for(var n=-1,o=e==null?0:e.length,s=Array(o);++n<o;)s[n]=t(e[n],n,e);return s}var Ye=Array.isArray,Ql=mt?mt.prototype:void 0,ea=Ql?Ql.toString:void 0;function ta(e){if(typeof e=="string")return e;if(Ye(e))return Ph(e,ta)+"";if(Vo(e))return ea?ea.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _h=/\s/;function Ah(e){for(var t=e.length;t--&&_h.test(e.charAt(t)););return t}var zh=/^\s+/;function Fh(e){return e&&e.slice(0,Ah(e)+1).replace(zh,"")}function Ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var na=NaN,Hh=/^[-+]0x[0-9a-f]+$/i,Wh=/^0b[01]+$/i,$h=/^0o[0-7]+$/i,Xh=parseInt;function Po(e){if(typeof e=="number")return e;if(Vo(e))return na;if(Ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Fh(e);var n=Wh.test(e);return n||$h.test(e)?Xh(e.slice(2),n?2:8):Hh.test(e)?na:+e}var oa=1/0,Uh=17976931348623157e292;function ia(e){if(!e)return e===0?e:0;if(e=Po(e),e===oa||e===-oa){var t=e<0?-1:1;return t*Uh}return e===e?e:0}function Zi(e){return e}var Yh="[object AsyncFunction]",jh="[object Function]",Gh="[object GeneratorFunction]",Zh="[object Proxy]";function qi(e){if(!Ve(e))return!1;var t=Lt(e);return t==jh||t==Gh||t==Yh||t==Zh}var Ki=tt["__core-js_shared__"],sa=function(){var e=/[^.]+$/.exec(Ki&&Ki.keys&&Ki.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function qh(e){return!!sa&&sa in e}var Kh=Function.prototype,Jh=Kh.toString;function Xt(e){if(e!=null){try{return Jh.call(e)}catch{}try{return e+""}catch{}}return""}var Qh=/[\\^$.*+?()[\]{}|]/g,eu=/^\[object .+?Constructor\]$/,tu=Function.prototype,nu=Object.prototype,ou=tu.toString,iu=nu.hasOwnProperty,su=RegExp("^"+ou.call(iu).replace(Qh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lu(e){if(!Ve(e)||qh(e))return!1;var t=qi(e)?su:eu;return t.test(Xt(e))}function au(e,t){return e==null?void 0:e[t]}function Ut(e,t){var n=au(e,t);return lu(n)?n:void 0}var Ji=Ut(tt,"WeakMap"),la=Object.create,ru=function(){function e(){}return function(t){if(!Ve(t))return{};if(la)return la(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function aa(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cu(){}function du(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}var hu=800,uu=16,fu=Date.now;function mu(e){var t=0,n=0;return function(){var o=fu(),s=uu-(o-n);if(n=o,s>0){if(++t>=hu)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function gu(e){return function(){return e}}var _o=function(){try{var e=Ut(Object,"defineProperty");return e({},"",{}),e}catch{}}(),pu=_o?function(e,t){return _o(e,"toString",{configurable:!0,enumerable:!1,value:gu(t),writable:!0})}:Zi,yu=mu(pu);function xu(e,t){for(var n=-1,o=e==null?0:e.length;++n<o&&t(e[n],n,e)!==!1;);return e}function bu(e,t,n,o){for(var s=e.length,l=n+-1;++l<s;)if(t(e[l],l,e))return l;return-1}function Cu(e){return e!==e}function Su(e,t,n){for(var o=n-1,s=e.length;++o<s;)if(e[o]===t)return o;return-1}function wu(e,t,n){return t===t?Su(e,t,n):bu(e,Cu,n)}function ku(e,t){var n=e==null?0:e.length;return!!n&&wu(e,t,0)>-1}var Mu=9007199254740991,Eu=/^(?:0|[1-9]\d*)$/;function Qi(e,t){var n=typeof e;return t=t??Mu,!!t&&(n=="number"||n!="symbol"&&Eu.test(e))&&e>-1&&e%1==0&&e<t}function es(e,t,n){t=="__proto__"&&_o?_o(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Pn(e,t){return e===t||e!==e&&t!==t}var Iu=Object.prototype,vu=Iu.hasOwnProperty;function ra(e,t,n){var o=e[t];(!(vu.call(e,t)&&Pn(o,n))||n===void 0&&!(t in e))&&es(e,t,n)}function Tu(e,t,n,o){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var r=t[l],c=void 0;c===void 0&&(c=e[r]),s?es(n,r,c):ra(n,r,c)}return n}var ca=Math.max;function Bu(e,t,n){return t=ca(t===void 0?e.length-1:t,0),function(){for(var o=arguments,s=-1,l=ca(o.length-t,0),a=Array(l);++s<l;)a[s]=o[t+s];s=-1;for(var r=Array(t+1);++s<t;)r[s]=o[s];return r[t]=n(a),aa(e,this,r)}}function da(e,t){return yu(Bu(e,t,Zi),e+"")}var Du=9007199254740991;function ts(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Du}function Ao(e){return e!=null&&ts(e.length)&&!qi(e)}function Ou(e,t,n){if(!Ve(n))return!1;var o=typeof t;return(o=="number"?Ao(n)&&Qi(t,n.length):o=="string"&&t in n)?Pn(n[t],e):!1}function ha(e){return da(function(t,n){var o=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=e.length>3&&typeof l=="function"?(s--,l):void 0,a&&Ou(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),t=Object(t);++o<s;){var r=n[o];r&&e(t,r,o,l)}return t})}var Ru=Object.prototype;function ns(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ru;return e===n}function Lu(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}var Nu="[object Arguments]";function ua(e){return nt(e)&&Lt(e)==Nu}var fa=Object.prototype,Vu=fa.hasOwnProperty,Pu=fa.propertyIsEnumerable,zo=ua(function(){return arguments}())?ua:function(e){return nt(e)&&Vu.call(e,"callee")&&!Pu.call(e,"callee")};function _u(){return!1}var ma=typeof se=="object"&&se&&!se.nodeType&&se,ga=ma&&typeof module=="object"&&module&&!module.nodeType&&module,Au=ga&&ga.exports===ma,pa=Au?tt.Buffer:void 0,zu=pa?pa.isBuffer:void 0,_n=zu||_u,Fu="[object Arguments]",Hu="[object Array]",Wu="[object Boolean]",$u="[object Date]",Xu="[object Error]",Uu="[object Function]",Yu="[object Map]",ju="[object Number]",Gu="[object Object]",Zu="[object RegExp]",qu="[object Set]",Ku="[object String]",Ju="[object WeakMap]",Qu="[object ArrayBuffer]",ef="[object DataView]",tf="[object Float32Array]",nf="[object Float64Array]",of="[object Int8Array]",sf="[object Int16Array]",lf="[object Int32Array]",af="[object Uint8Array]",rf="[object Uint8ClampedArray]",cf="[object Uint16Array]",df="[object Uint32Array]",ye={};ye[tf]=ye[nf]=ye[of]=ye[sf]=ye[lf]=ye[af]=ye[rf]=ye[cf]=ye[df]=!0,ye[Fu]=ye[Hu]=ye[Qu]=ye[Wu]=ye[ef]=ye[$u]=ye[Xu]=ye[Uu]=ye[Yu]=ye[ju]=ye[Gu]=ye[Zu]=ye[qu]=ye[Ku]=ye[Ju]=!1;function hf(e){return nt(e)&&ts(e.length)&&!!ye[Lt(e)]}function os(e){return function(t){return e(t)}}var ya=typeof se=="object"&&se&&!se.nodeType&&se,An=ya&&typeof module=="object"&&module&&!module.nodeType&&module,uf=An&&An.exports===ya,is=uf&&ql.process,cn=function(){try{var e=An&&An.require&&An.require("util").types;return e||is&&is.binding&&is.binding("util")}catch{}}(),xa=cn&&cn.isTypedArray,ss=xa?os(xa):hf,ff=Object.prototype,mf=ff.hasOwnProperty;function ba(e,t){var n=Ye(e),o=!n&&zo(e),s=!n&&!o&&_n(e),l=!n&&!o&&!s&&ss(e),a=n||o||s||l,r=a?Lu(e.length,String):[],c=r.length;for(var d in e)(t||mf.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Qi(d,c)))&&r.push(d);return r}function Ca(e,t){return function(n){return e(t(n))}}var gf=Ca(Object.keys,Object),pf=Object.prototype,yf=pf.hasOwnProperty;function xf(e){if(!ns(e))return gf(e);var t=[];for(var n in Object(e))yf.call(e,n)&&n!="constructor"&&t.push(n);return t}function Sa(e){return Ao(e)?ba(e):xf(e)}function bf(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Cf=Object.prototype,Sf=Cf.hasOwnProperty;function wf(e){if(!Ve(e))return bf(e);var t=ns(e),n=[];for(var o in e)o=="constructor"&&(t||!Sf.call(e,o))||n.push(o);return n}function wa(e){return Ao(e)?ba(e,!0):wf(e)}var kf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mf=/^\w*$/;function ls(e,t){if(Ye(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Vo(e)?!0:Mf.test(e)||!kf.test(e)||t!=null&&e in Object(t)}var zn=Ut(Object,"create");function Ef(){this.__data__=zn?zn(null):{},this.size=0}function If(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vf="__lodash_hash_undefined__",Tf=Object.prototype,Bf=Tf.hasOwnProperty;function Df(e){var t=this.__data__;if(zn){var n=t[e];return n===vf?void 0:n}return Bf.call(t,e)?t[e]:void 0}var Of=Object.prototype,Rf=Of.hasOwnProperty;function Lf(e){var t=this.__data__;return zn?t[e]!==void 0:Rf.call(t,e)}var Nf="__lodash_hash_undefined__";function Vf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zn&&t===void 0?Nf:t,this}function Yt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Yt.prototype.clear=Ef,Yt.prototype.delete=If,Yt.prototype.get=Df,Yt.prototype.has=Lf,Yt.prototype.set=Vf;function Pf(){this.__data__=[],this.size=0}function Fo(e,t){for(var n=e.length;n--;)if(Pn(e[n][0],t))return n;return-1}var _f=Array.prototype,Af=_f.splice;function zf(e){var t=this.__data__,n=Fo(t,e);if(n<0)return!1;var o=t.length-1;return n==o?t.pop():Af.call(t,n,1),--this.size,!0}function Ff(e){var t=this.__data__,n=Fo(t,e);return n<0?void 0:t[n][1]}function Hf(e){return Fo(this.__data__,e)>-1}function Wf(e,t){var n=this.__data__,o=Fo(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}function bt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}bt.prototype.clear=Pf,bt.prototype.delete=zf,bt.prototype.get=Ff,bt.prototype.has=Hf,bt.prototype.set=Wf;var Fn=Ut(tt,"Map");function $f(){this.size=0,this.__data__={hash:new Yt,map:new(Fn||bt),string:new Yt}}function Xf(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ho(e,t){var n=e.__data__;return Xf(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Uf(e){var t=Ho(this,e).delete(e);return this.size-=t?1:0,t}function Yf(e){return Ho(this,e).get(e)}function jf(e){return Ho(this,e).has(e)}function Gf(e,t){var n=Ho(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}function Ct(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Ct.prototype.clear=$f,Ct.prototype.delete=Uf,Ct.prototype.get=Yf,Ct.prototype.has=jf,Ct.prototype.set=Gf;var Zf="Expected a function";function as(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Zf);var n=function(){var o=arguments,s=t?t.apply(this,o):o[0],l=n.cache;if(l.has(s))return l.get(s);var a=e.apply(this,o);return n.cache=l.set(s,a)||l,a};return n.cache=new(as.Cache||Ct),n}as.Cache=Ct;var qf=500;function Kf(e){var t=as(e,function(o){return n.size===qf&&n.clear(),o}),n=t.cache;return t}var Jf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qf=/\\(\\)?/g,em=Kf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Jf,function(n,o,s,l){t.push(s?l.replace(Qf,"$1"):o||n)}),t});function tm(e){return e==null?"":ta(e)}function ka(e,t){return Ye(e)?e:ls(e,t)?[e]:em(tm(e))}function Wo(e){if(typeof e=="string"||Vo(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ma(e,t){t=ka(t,e);for(var n=0,o=t.length;e!=null&&n<o;)e=e[Wo(t[n++])];return n&&n==o?e:void 0}function nm(e,t,n){var o=e==null?void 0:Ma(e,t);return o===void 0?n:o}function om(e,t){for(var n=-1,o=t.length,s=e.length;++n<o;)e[s+n]=t[n];return e}var Ea=Ca(Object.getPrototypeOf,Object),im="[object Object]",sm=Function.prototype,lm=Object.prototype,Ia=sm.toString,am=lm.hasOwnProperty,rm=Ia.call(Object);function cm(e){if(!nt(e)||Lt(e)!=im)return!1;var t=Ea(e);if(t===null)return!0;var n=am.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ia.call(n)==rm}function dm(){this.__data__=new bt,this.size=0}function hm(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function um(e){return this.__data__.get(e)}function fm(e){return this.__data__.has(e)}var mm=200;function gm(e,t){var n=this.__data__;if(n instanceof bt){var o=n.__data__;if(!Fn||o.length<mm-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ct(o)}return n.set(e,t),this.size=n.size,this}function ot(e){var t=this.__data__=new bt(e);this.size=t.size}ot.prototype.clear=dm,ot.prototype.delete=hm,ot.prototype.get=um,ot.prototype.has=fm,ot.prototype.set=gm;var va=typeof se=="object"&&se&&!se.nodeType&&se,Ta=va&&typeof module=="object"&&module&&!module.nodeType&&module,pm=Ta&&Ta.exports===va,Ba=pm?tt.Buffer:void 0,Da=Ba?Ba.allocUnsafe:void 0;function Oa(e,t){if(t)return e.slice();var n=e.length,o=Da?Da(n):new e.constructor(n);return e.copy(o),o}function ym(e,t){for(var n=-1,o=e==null?0:e.length,s=0,l=[];++n<o;){var a=e[n];t(a,n,e)&&(l[s++]=a)}return l}function xm(){return[]}var bm=Object.prototype,Cm=bm.propertyIsEnumerable,Ra=Object.getOwnPropertySymbols,Sm=Ra?function(e){return e==null?[]:(e=Object(e),ym(Ra(e),function(t){return Cm.call(e,t)}))}:xm;function wm(e,t,n){var o=t(e);return Ye(e)?o:om(o,n(e))}function rs(e){return wm(e,Sa,Sm)}var cs=Ut(tt,"DataView"),ds=Ut(tt,"Promise"),dn=Ut(tt,"Set"),La="[object Map]",km="[object Object]",Na="[object Promise]",Va="[object Set]",Pa="[object WeakMap]",_a="[object DataView]",Mm=Xt(cs),Em=Xt(Fn),Im=Xt(ds),vm=Xt(dn),Tm=Xt(Ji),it=Lt;(cs&&it(new cs(new ArrayBuffer(1)))!=_a||Fn&&it(new Fn)!=La||ds&&it(ds.resolve())!=Na||dn&&it(new dn)!=Va||Ji&&it(new Ji)!=Pa)&&(it=function(e){var t=Lt(e),n=t==km?e.constructor:void 0,o=n?Xt(n):"";if(o)switch(o){case Mm:return _a;case Em:return La;case Im:return Na;case vm:return Va;case Tm:return Pa}return t});var Bm=Object.prototype,Dm=Bm.hasOwnProperty;function Om(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Dm.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var $o=tt.Uint8Array;function hs(e){var t=new e.constructor(e.byteLength);return new $o(t).set(new $o(e)),t}function Rm(e,t){var n=hs(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Lm=/\w*$/;function Nm(e){var t=new e.constructor(e.source,Lm.exec(e));return t.lastIndex=e.lastIndex,t}var Aa=mt?mt.prototype:void 0,za=Aa?Aa.valueOf:void 0;function Vm(e){return za?Object(za.call(e)):{}}function Fa(e,t){var n=t?hs(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Pm="[object Boolean]",_m="[object Date]",Am="[object Map]",zm="[object Number]",Fm="[object RegExp]",Hm="[object Set]",Wm="[object String]",$m="[object Symbol]",Xm="[object ArrayBuffer]",Um="[object DataView]",Ym="[object Float32Array]",jm="[object Float64Array]",Gm="[object Int8Array]",Zm="[object Int16Array]",qm="[object Int32Array]",Km="[object Uint8Array]",Jm="[object Uint8ClampedArray]",Qm="[object Uint16Array]",eg="[object Uint32Array]";function tg(e,t,n){var o=e.constructor;switch(t){case Xm:return hs(e);case Pm:case _m:return new o(+e);case Um:return Rm(e);case Ym:case jm:case Gm:case Zm:case qm:case Km:case Jm:case Qm:case eg:return Fa(e,n);case Am:return new o;case zm:case Wm:return new o(e);case Fm:return Nm(e);case Hm:return new o;case $m:return Vm(e)}}function Ha(e){return typeof e.constructor=="function"&&!ns(e)?ru(Ea(e)):{}}var ng="[object Map]";function og(e){return nt(e)&&it(e)==ng}var Wa=cn&&cn.isMap,ig=Wa?os(Wa):og,sg="[object Set]";function lg(e){return nt(e)&&it(e)==sg}var $a=cn&&cn.isSet,ag=$a?os($a):lg,rg=1,Xa="[object Arguments]",cg="[object Array]",dg="[object Boolean]",hg="[object Date]",ug="[object Error]",Ua="[object Function]",fg="[object GeneratorFunction]",mg="[object Map]",gg="[object Number]",Ya="[object Object]",pg="[object RegExp]",yg="[object Set]",xg="[object String]",bg="[object Symbol]",Cg="[object WeakMap]",Sg="[object ArrayBuffer]",wg="[object DataView]",kg="[object Float32Array]",Mg="[object Float64Array]",Eg="[object Int8Array]",Ig="[object Int16Array]",vg="[object Int32Array]",Tg="[object Uint8Array]",Bg="[object Uint8ClampedArray]",Dg="[object Uint16Array]",Og="[object Uint32Array]",ge={};ge[Xa]=ge[cg]=ge[Sg]=ge[wg]=ge[dg]=ge[hg]=ge[kg]=ge[Mg]=ge[Eg]=ge[Ig]=ge[vg]=ge[mg]=ge[gg]=ge[Ya]=ge[pg]=ge[yg]=ge[xg]=ge[bg]=ge[Tg]=ge[Bg]=ge[Dg]=ge[Og]=!0,ge[ug]=ge[Ua]=ge[Cg]=!1;function Xo(e,t,n,o,s,l){var a,r=t&rg;if(a!==void 0)return a;if(!Ve(e))return e;var c=Ye(e);if(c)a=Om(e);else{var d=it(e),h=d==Ua||d==fg;if(_n(e))return Oa(e,r);if(d==Ya||d==Xa||h&&!s)a=h?{}:Ha(e);else{if(!ge[d])return s?e:{};a=tg(e,d,r)}}l||(l=new ot);var u=l.get(e);if(u)return u;l.set(e,a),ag(e)?e.forEach(function(p){a.add(Xo(p,t,n,p,e,l))}):ig(e)&&e.forEach(function(p,m){a.set(m,Xo(p,t,n,m,e,l))});var f=rs,g=c?void 0:f(e);return xu(g||e,function(p,m){g&&(m=p,p=e[m]),ra(a,m,Xo(p,t,n,m,e,l))}),a}var Rg=1,Lg=4;function Se(e){return Xo(e,Rg|Lg)}var Ng="__lodash_hash_undefined__";function Vg(e){return this.__data__.set(e,Ng),this}function Pg(e){return this.__data__.has(e)}function Hn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ct;++t<n;)this.add(e[t])}Hn.prototype.add=Hn.prototype.push=Vg,Hn.prototype.has=Pg;function _g(e,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}function ja(e,t){return e.has(t)}var Ag=1,zg=2;function Ga(e,t,n,o,s,l){var a=n&Ag,r=e.length,c=t.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(e),h=l.get(t);if(d&&h)return d==t&&h==e;var u=-1,f=!0,g=n&zg?new Hn:void 0;for(l.set(e,t),l.set(t,e);++u<r;){var p=e[u],m=t[u];if(o)var x=a?o(m,p,u,t,e,l):o(p,m,u,e,t,l);if(x!==void 0){if(x)continue;f=!1;break}if(g){if(!_g(t,function(b,y){if(!ja(g,y)&&(p===b||s(p,b,n,o,l)))return g.push(y)})){f=!1;break}}else if(!(p===m||s(p,m,n,o,l))){f=!1;break}}return l.delete(e),l.delete(t),f}function Fg(e){var t=-1,n=Array(e.size);return e.forEach(function(o,s){n[++t]=[s,o]}),n}function us(e){var t=-1,n=Array(e.size);return e.forEach(function(o){n[++t]=o}),n}var Hg=1,Wg=2,$g="[object Boolean]",Xg="[object Date]",Ug="[object Error]",Yg="[object Map]",jg="[object Number]",Gg="[object RegExp]",Zg="[object Set]",qg="[object String]",Kg="[object Symbol]",Jg="[object ArrayBuffer]",Qg="[object DataView]",Za=mt?mt.prototype:void 0,fs=Za?Za.valueOf:void 0;function ep(e,t,n,o,s,l,a){switch(n){case Qg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Jg:return!(e.byteLength!=t.byteLength||!l(new $o(e),new $o(t)));case $g:case Xg:case jg:return Pn(+e,+t);case Ug:return e.name==t.name&&e.message==t.message;case Gg:case qg:return e==t+"";case Yg:var r=Fg;case Zg:var c=o&Hg;if(r||(r=us),e.size!=t.size&&!c)return!1;var d=a.get(e);if(d)return d==t;o|=Wg,a.set(e,t);var h=Ga(r(e),r(t),o,s,l,a);return a.delete(e),h;case Kg:if(fs)return fs.call(e)==fs.call(t)}return!1}var tp=1,np=Object.prototype,op=np.hasOwnProperty;function ip(e,t,n,o,s,l){var a=n&tp,r=rs(e),c=r.length,d=rs(t),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in t:op.call(t,f)))return!1}var g=l.get(e),p=l.get(t);if(g&&p)return g==t&&p==e;var m=!0;l.set(e,t),l.set(t,e);for(var x=a;++u<c;){f=r[u];var b=e[f],y=t[f];if(o)var M=a?o(y,b,f,t,e,l):o(b,y,f,e,t,l);if(!(M===void 0?b===y||s(b,y,n,o,l):M)){m=!1;break}x||(x=f=="constructor")}if(m&&!x){var I=e.constructor,E=t.constructor;I!=E&&"constructor"in e&&"constructor"in t&&!(typeof I=="function"&&I instanceof I&&typeof E=="function"&&E instanceof E)&&(m=!1)}return l.delete(e),l.delete(t),m}var sp=1,qa="[object Arguments]",Ka="[object Array]",Uo="[object Object]",lp=Object.prototype,Ja=lp.hasOwnProperty;function ap(e,t,n,o,s,l){var a=Ye(e),r=Ye(t),c=a?Ka:it(e),d=r?Ka:it(t);c=c==qa?Uo:c,d=d==qa?Uo:d;var h=c==Uo,u=d==Uo,f=c==d;if(f&&_n(e)){if(!_n(t))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new ot),a||ss(e)?Ga(e,t,n,o,s,l):ep(e,t,c,n,o,s,l);if(!(n&sp)){var g=h&&Ja.call(e,"__wrapped__"),p=u&&Ja.call(t,"__wrapped__");if(g||p){var m=g?e.value():e,x=p?t.value():t;return l||(l=new ot),s(m,x,n,o,l)}}return f?(l||(l=new ot),ip(e,t,n,o,s,l)):!1}function Yo(e,t,n,o,s){return e===t?!0:e==null||t==null||!nt(e)&&!nt(t)?e!==e&&t!==t:ap(e,t,n,o,Yo,s)}var rp=1,cp=2;function dp(e,t,n,o){var s=n.length,l=s;if(e==null)return!l;for(e=Object(e);s--;){var a=n[s];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<l;){a=n[s];var r=a[0],c=e[r],d=a[1];if(a[2]){if(c===void 0&&!(r in e))return!1}else{var h=new ot,u;if(!(u===void 0?Yo(d,c,rp|cp,o,h):u))return!1}}return!0}function Qa(e){return e===e&&!Ve(e)}function hp(e){for(var t=Sa(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,Qa(s)]}return t}function er(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function up(e){var t=hp(e);return t.length==1&&t[0][2]?er(t[0][0],t[0][1]):function(n){return n===e||dp(n,e,t)}}function fp(e,t){return e!=null&&t in Object(e)}function mp(e,t,n){t=ka(t,e);for(var o=-1,s=t.length,l=!1;++o<s;){var a=Wo(t[o]);if(!(l=e!=null&&n(e,a)))break;e=e[a]}return l||++o!=s?l:(s=e==null?0:e.length,!!s&&ts(s)&&Qi(a,s)&&(Ye(e)||zo(e)))}function gp(e,t){return e!=null&&mp(e,t,fp)}var pp=1,yp=2;function xp(e,t){return ls(e)&&Qa(t)?er(Wo(e),t):function(n){var o=nm(n,e);return o===void 0&&o===t?gp(n,e):Yo(t,o,pp|yp)}}function bp(e){return function(t){return t==null?void 0:t[e]}}function Cp(e){return function(t){return Ma(t,e)}}function Sp(e){return ls(e)?bp(Wo(e)):Cp(e)}function wp(e){return typeof e=="function"?e:e==null?Zi:typeof e=="object"?Ye(e)?xp(e[0],e[1]):up(e):Sp(e)}function kp(e){return function(t,n,o){for(var s=-1,l=Object(t),a=o(t),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return t}}var Mp=kp(),ms=function(){return tt.Date.now()},Ep="Expected a function",Ip=Math.max,vp=Math.min;function jo(e,t,n){var o,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(Ep);t=Po(t)||0,Ve(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Ip(Po(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f);function g(T){var V=o,C=s;return o=s=void 0,d=T,a=e.apply(C,V),a}function p(T){return d=T,r=setTimeout(b,t),h?g(T):a}function m(T){var V=T-c,C=T-d,S=t-V;return u?vp(S,l-C):S}function x(T){var V=T-c,C=T-d;return c===void 0||V>=t||V<0||u&&C>=l}function b(){var T=ms();if(x(T))return y(T);r=setTimeout(b,m(T))}function y(T){return r=void 0,f&&o?g(T):(o=s=void 0,a)}function M(){r!==void 0&&clearTimeout(r),d=0,o=c=s=r=void 0}function I(){return r===void 0?a:y(ms())}function E(){var T=ms(),V=x(T);if(o=arguments,s=this,c=T,V){if(r===void 0)return p(c);if(u)return clearTimeout(r),r=setTimeout(b,t),g(c)}return r===void 0&&(r=setTimeout(b,t)),a}return E.cancel=M,E.flush=I,E}function gs(e,t,n){(n!==void 0&&!Pn(e[t],n)||n===void 0&&!(t in e))&&es(e,t,n)}function Tp(e){return nt(e)&&Ao(e)}function ps(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Bp(e){return Tu(e,wa(e))}function Dp(e,t,n,o,s,l,a){var r=ps(e,n),c=ps(t,n),d=a.get(c);if(d){gs(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,u=h===void 0;if(u){var f=Ye(c),g=!f&&_n(c),p=!f&&!g&&ss(c);h=c,f||g||p?Ye(r)?h=r:Tp(r)?h=du(r):g?(u=!1,h=Oa(c,!0)):p?(u=!1,h=Fa(c,!0)):h=[]:cm(c)||zo(c)?(h=r,zo(r)?h=Bp(r):(!Ve(r)||qi(r))&&(h=Ha(c))):u=!1}u&&(a.set(c,h),s(h,c,o,l,a),a.delete(c)),gs(e,n,h)}function Go(e,t,n,o,s){e!==t&&Mp(t,function(l,a){if(s||(s=new ot),Ve(l))Dp(e,t,a,n,Go,o,s);else{var r=o?o(ps(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),gs(e,a,r)}},wa)}function tr(e,t,n,o,s,l){return Ve(e)&&Ve(t)&&(l.set(t,e),Go(e,t,void 0,tr,l),l.delete(t)),e}var Op=ha(function(e,t,n,o){Go(e,t,n,o)}),Fe=da(function(e){return e.push(void 0,tr),aa(Op,void 0,e)}),Rp=Math.max,Lp=Math.min;function Np(e,t,n){return e>=Lp(t,n)&&e<Rp(t,n)}function gt(e,t,n){return t=ia(t),n===void 0?(n=t,t=0):n=ia(n),e=Po(e),Np(e,t,n)}function je(e,t){return Yo(e,t)}var Vp="[object Number]";function Pp(e){return typeof e=="number"||nt(e)&&Lt(e)==Vp}function pt(e){return e==null}function _p(e){return e===void 0}var ys=ha(function(e,t,n){Go(e,t,n)}),Ap=Array.prototype,zp=Ap.reverse;function Fp(e){return e==null?e:zp.call(e)}var Hp="Expected a function";function xs(e,t,n){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Hp);return Ve(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),jo(e,t,{leading:o,maxWait:t,trailing:s})}var Wp=1/0,$p=dn&&1/us(new dn([,-0]))[1]==Wp?function(e){return new dn(e)}:cu,Xp=200;function Up(e,t,n){var o=-1,s=ku,l=e.length,a=!0,r=[],c=r;if(l>=Xp){var d=t?null:$p(e);if(d)return us(d);a=!1,s=ja,c=new Hn}else c=t?[]:r;e:for(;++o<l;){var h=e[o],u=t?t(h):h;if(h=h!==0?h:0,a&&u===u){for(var f=c.length;f--;)if(c[f]===u)continue e;t&&c.push(u),r.push(h)}else s(c,u,n)||(c!==r&&c.push(u),r.push(h))}return r}function Yp(e,t){return e&&e.length?Up(e,wp(t)):[]}const jp=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(e.modelValue),o=()=>{if(!e.showStep)return[];const f=e.max-e.min,g=f/e.step,p=We(e.step,f),m=[];for(let x=1;x<g;x++)m.push(x*p);return m},s=()=>{if(!e.mark||!Object.keys(e.mark).length)return[];const f=(p,m="value")=>{if(!p)return[];const x=e.mark.style&&typeof e.mark.style=="object"?e.mark.style:{},b=Object.keys(p),y=[];let M;for(let I=0;I<b.length;I++)M=+b[I],isNaN(M)||y.push({posX:m==="value"?We(M,e.max-e.min):M,label:p[M],style:x});return y};return e.mark.value||e.mark.percent?[...f(e.mark.value),...f(e.mark.percent,"percent")]:[...f(e.mark)]},l=i.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=i.reactive({valueRange:0,stepList:i.computed(o),markList:i.computed(s),offset:{left:0,width:0}}),r=i.ref(),c=i.computed(()=>{const f=e.tooltipFormat,g=f instanceof Function;return{left:g?f(l.leftValue):l.leftValue,right:g?f(l.rightValue):l.rightValue}}),d=f=>{const g={min:e.min,max:e.max,step:e.step};let p,m;e.range&&Array.isArray(f)?(p=typeof f[0]=="number"&&!isNaN(f[0])?f[0]:e.min,m=typeof f[1]=="number"&&!isNaN(f[1])?f[1]:e.min,l.leftValue=Ln(p,g),l.rightValue=Ln(m,g)):(p=e.min,m=typeof f=="number"&&!isNaN(f)?f:e.min,l.leftValue=Ln(p,g),l.rightValue=Ln(m,g))},h=f=>{if(a.valueRange<=0)return;d(f);let g;if(e.range&&Array.isArray(f)){const p=Math.min(l.leftValue,l.rightValue),m=Math.max(l.leftValue,l.rightValue);g=[p,m]}else g=l.rightValue;n.value=g,t("update:modelValue",g),t("change",g)},u=()=>{const f=r.value.getBoundingClientRect();a.offset.left=f.left,a.offset.width=f.width,a.valueRange=e.max-e.min};return i.watch(()=>e.modelValue,(f,g)=>{Pp(f)&&f>=0&&!je(f,g)&&!l.dragging&&(d(f),n.value=f)}),i.watch(()=>e.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},Gp=e=>{const{props:t}=i.getCurrentInstance(),{state:n,slider:o}=e,s="transparent",l=i.computed(()=>({left:o.valueRange>0?`${We(n.leftValue-t.min,o.valueRange)}%`:0})),a=i.computed(()=>({left:o.valueRange>0?`${We(n.rightValue-t.min,o.valueRange)}%`:0})),r=i.computed(()=>!t.color||Array.isArray(t.color)&&t.color.length!==1?{}:{borderColor:(typeof t.color=="string"?t.color:t.color[0])||s}),c=i.computed(()=>t.color&&Array.isArray(t.color)),d=i.computed(()=>{const f=Math.min(n.leftValue,n.rightValue),p=+(Math.max(n.leftValue,n.rightValue)-f).toFixed(2),m=o.valueRange>0&&t.range?We(+(f-t.min).toFixed(2),o.valueRange):0,x=p>0?We(p,o.valueRange):0,b={};return t.color&&(typeof t.color=="string"||Array.isArray(t.color)&&t.color.length===1?b.backgroundColor=(typeof t.color=="string"?t.color:t.color[0])||s:Array.isArray(t.color)&&t.color.length>1&&(b.backgroundColor=(t.range?t.color[1]:t.color[0])||s)),{left:`${m}%`,width:`${x}%`,...b}}),h=i.computed(()=>{if(!c.value||t.color.length<2||!t.range)return{};const f=Math.min(n.leftValue,n.rightValue);return{width:`${We(Math.abs(f-t.min),o.valueRange)}%`,backgroundColor:t.color[0]||s}}),u=i.computed(()=>{if(!c.value||t.color.length<2)return{};const f=Math.max(n.leftValue,n.rightValue),g=We(+(f-t.min).toFixed(2),o.valueRange),p=We(+(t.max-f).toFixed(2),o.valueRange),m=t.range?2:t.color.length-1;return{left:`${g}%`,width:`${p}%`,backgroundColor:t.color[m]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},Zp=e=>{const{props:t}=i.getCurrentInstance(),{currentValue:n,state:o,slider:s,updateSliderInfo:l,setSliderValue:a}=e,r=g=>{o.dragging||l();const p=g.type.indexOf("touch")!==-1?g.touches[0].clientX:g.clientX,{valueRange:m,offset:x}=s;let b=t.min+(p-x.left)*m/x.width;return b<t.min?b=t.min:b>t.max&&(b=t.max),b},c=g=>{if(t.readonly||t.disabled||o.dragging)return;const p=r(g);let m;if(t.range){const b=Math.min(o.leftValue,o.rightValue)+Math.abs((o.rightValue-o.leftValue)/2),y=o.leftValue>o.rightValue;p<b?o.handleType=y?"right":"left":o.handleType=y?"left":"right",m=o.handleType==="left"?[p,o.rightValue]:[o.leftValue,p]}else o.handleType="right",m=p;a(m)},d=g=>{const p=r(g);o.dragging=!0;let m;t.range?m=o.handleType==="left"?[p,o.rightValue]:[o.leftValue,p]:m=p,a(m)},h=()=>{o.handleType=null,o.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:g=>{t.readonly||t.disabled||(o.handleType=g,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(g,p)=>{if(t.showInput&&!o.dragging&&o.isInit)if(t.range&&Array.isArray(n.value)){const m=p==="left"?[g,n.value[1]]:[n.value[0],g];a(m)}else t.range||a(g)}}},qp=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{currentValue:o,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=e,c=()=>{const h=t.max||t.max===0,u=t.min||t.min===0;h&&u&&t.max<=t.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(o.value=t.range?[t.min,t.min]:t.min,n("update:modelValue",o.value)),r(o.value),s.isInit=!0};i.onMounted(()=>{c(),d()})},Kp={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:e=>e>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:e,state:t,slider:n,formatValue:o,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=jp(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:g}=Gp({state:t,slider:n}),{startDrag:p,clickSlider:m,changeInput:x}=Zp({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a});return qp({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:e,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:g,sliderLine:s,...i.toRefs(t),...i.toRefs(n),formatValue:o,startDrag:p,clickSlider:m,changeInput:x}}},Jp={class:"ev-slider-wrapper"},Qp={ref:"sliderLine",class:"ev-slider-line"},ey={key:0,class:"ev-slider-step-wrapper"},ty={key:2,class:"ev-slider-mark-wrapper"},ny={class:"ev-slider-mark-label"},oy=["innerHTML"],iy=["innerHTML"];function sy(e,t,n,o,s,l){const a=i.resolveComponent("ev-input-number");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":o.isColorArray,"show-mark":e.markList.length}])},[i.createElementVNode("div",Jp,[i.createElementVNode("div",Qp,[n.showStep&&n.step?(i.openBlock(),i.createElementBlock("div",ey,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.stepList,(r,c)=>(i.openBlock(),i.createElementBlock("span",{key:`slider-step-${c}`,style:i.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):i.createCommentVNode("",!0),o.isColorArray&&n.color.length>1?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.range?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(o.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",{style:i.normalizeStyle(o.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ev-slider-thumb",style:i.normalizeStyle(o.rangeThumbStyle)},null,4),e.markList.length>0?(i.openBlock(),i.createElementBlock("div",ty,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.markList,(r,c)=>(i.openBlock(),i.createElementBlock("div",{key:`slider-step-${c}`,style:i.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[i.createElementVNode("span",ny,i.toDisplayString(r.label),1)],4))),128))])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ev-slider-line-layer",onClick:t[0]||(t[0]=(...r)=>o.clickSlider&&o.clickSlider(...r))})],512),n.range?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="left"}]),style:i.normalizeStyle(o.leftHandleStyle),onMousedown:t[1]||(t[1]=i.withModifiers(r=>o.startDrag("left"),["stop","prevent"]))},[i.createElementVNode("span",{style:i.normalizeStyle(o.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),i.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:o.formatValue.left},null,8,oy)],38)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="right"}]),style:i.normalizeStyle(o.rightHandleStyle),onMousedown:t[2]||(t[2]=i.withModifiers(r=>o.startDrag("right"),["stop","prevent"]))},[i.createElementVNode("span",{style:i.normalizeStyle(o.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),i.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:o.formatValue.right},null,8,iy)],38)]),n.showInput&&!n.range?(i.openBlock(),i.createBlock(a,{key:0,modelValue:o.currentValue,"onUpdate:modelValue":t[3]||(t[3]=r=>o.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:o.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createVNode(a,{modelValue:o.currentValue[0],"onUpdate:modelValue":t[4]||(t[4]=r=>o.currentValue[0]=r),step:n.step,min:n.min,max:o.currentValue[1],"step-strictly":"",onChange:t[5]||(t[5]=r=>o.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),i.createVNode(a,{modelValue:o.currentValue[1],"onUpdate:modelValue":t[6]||(t[6]=r=>o.currentValue[1]=r),step:n.step,min:o.currentValue[0],max:n.max,"step-strictly":"",onChange:t[7]||(t[7]=r=>o.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):i.createCommentVNode("",!0)],2)}const Wn=le(Kp,[["render",sy]]);Wn.install=e=>{e.component(Wn.name,Wn)};const ly={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(e,{emit:t}){return{onClick:l=>{t("click",l)},onDblClick:l=>{t("dbl-click",l)},onContextMenu:l=>{t("context-menu",l)}}}};function ay(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("i",{class:i.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:i.normalizeStyle({color:n.color}),onClick:t[0]||(t[0]=(...a)=>o.onClick&&o.onClick(...a)),"on:dblClick":t[1]||(t[1]=(...a)=>o.onDblClick&&o.onDblClick(...a)),onContextmenu:t[2]||(t[2]=(...a)=>o.onContextMenu&&o.onContextMenu(...a))},null,38)}const hn=le(ly,[["render",ay]]);hn.install=e=>{e.component(hn.name,hn)};const bs=6,Cs=7,Ss=4,ws=3,ks=5,Ms=4,$e=12,ry=24,cy=60,dy=60,st=12,nr=4,Es=20,Is={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},hy={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},Ge={DATE:"date",MONTH:"month",YEAR:"year"},Zo=864e5,qo=+new Date("1970-01-01 00:00:00"),or=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),ir=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),uy=(e,t)=>e.length?e.reduce((n,o)=>new Date(n).getTime()>new Date(o).getTime()?n:o):"",Te=e=>e===null?"00":+e<10?`0${e}`:e,un=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),fy=(e,t)=>new Date(`${e}-${t}-1`).getDay(),vs=(e,t)=>{let n;switch(t){case 4:case 6:case 9:case 11:n=30;break;case 2:e%4===0&&e%100!==0||e%400===0?n=29:n=28;break;default:n=31;break}return n},$n=({year:e,month:t,date:n,hour:o,min:s,sec:l})=>o!==void 0&&s!==void 0&&l!==void 0?`${e}-${Te(t)}-${Te(n)} ${Te(o)}:${Te(s)}:${Te(l)}`:`${e}-${Te(t)}-${Te(n)}`,Be=(e,t)=>{var s,l,a,r,c,d;let n=i.unref(e);Array.isArray(n)&&(n=uy(e));const o={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return t==="year"?o.year:t==="month"?o.month:t==="date"?o.date:t==="hour"?o.hour:t==="min"?o.min:t==="sec"?o.sec:o},sr=(e,t,n)=>e==="next"?{year:n===12?t+1:t,month:(n+1)%12||12}:{year:n===1?t-1:t,month:(n-1)%12||12},Xn=(e,t,n)=>{const o=Be(t,n);if(e){const s=e==null?void 0:e.split(":")[0],l=e==null?void 0:e.split(":")[1],a=e==null?void 0:e.split(":")[2];if(n==="hour")return s==="HH"?o:+s;if(n==="min")return l==="mm"?o:+l;if(n==="sec")return a==="ss"?o:+a}return o},we=(e,t)=>{if(!t)return"";const n=Te(Xn(e,t,"hour")),o=Te(Xn(e,t,"min")),s=Te(Xn(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${o}:${s}`},Ko=(e,t,n,o)=>{if(!o.length)return!1;let s=t==="main"?n:o[0],l=t==="expanded"?n:o[1],a=s,r=l;if(!n.split(" ")[1])if(e==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=o[0].split(" ")[1],d=o[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},fn=e=>new Date(`${e}`).getTime(),lr=e=>{const t=10**(e.toString().length-1),n=Math.floor(e/t),o=Math.floor(e%(t*n)),s=n*t+Math.floor(o/Es)*Es,l=s+Es-1;return{start:s,end:l}},my=()=>{var m,x,b;const{props:e}=i.getCurrentInstance(),t=(m=e.options)==null?void 0:m.timeFormat,n=i.computed(()=>["dateRange","dateTimeRange"].includes(e.mode)?["main","expanded"]:["main"]);let o;if(e.mode!=="dateMulti"&&e.mode!=="dateRange"&&e.mode!=="dateTimeRange")if(e.modelValue&&(e.modelValue.length===10&&or.exec((x=e.modelValue)==null?void 0:x.toString())||e.modelValue.length===19&&ir.exec((b=e.modelValue)==null?void 0:b.toString())))if(e.mode==="dateTime"&&t){const y=we(t,e.modelValue);o=i.ref(y)}else o=i.ref(e.modelValue);else o=i.ref("");else if(Array.isArray(e.modelValue)&&e.modelValue.every(y=>!y||y.length===10&&or.exec(y)||y.length===19&&ir.exec(y)))if(e.mode==="dateTimeRange"&&e.modelValue.length===2&&t){const y=[];y.push(we(t[0],e.modelValue[0])),y.push(we(t[1],e.modelValue[1])),o=i.ref([...y])}else o=i.ref([...e.modelValue]);else o=i.ref([]);const s=()=>{e.mode==="date"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):e.mode==="dateTime"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):e.mode==="dateMulti"&&e.modelValue&&!Array.isArray(e.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):e.mode==="dateRange"&&e.modelValue?Array.isArray(e.modelValue)?fn(`${e.modelValue[0]} 00:00:00`)>fn(`${e.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):e.mode==="dateTimeRange"&&e.modelValue&&(Array.isArray(e.modelValue)?fn(e.modelValue[0])>fn(e.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(e.mode)?o.value[0]:o.value;a!=null&&a.length?l={year:Be(a,"year"),month:Be(a,"month"),hour:Math.floor(Be(a,"hour")/st)+1||1,min:Math.floor(Be(a,"min")/st)+1||1,sec:Math.floor(Be(a,"sec")/st)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(e.mode)&&Array.isArray(o.value)&&o.value[1]){const y=o.value[1];r={year:Be(y,"year"),month:Be(y,"month")},e.mode==="dateTimeRange"&&(r.hour=Math.floor(Be(y,"hour")/st)+1||1,r.min=Math.floor(Be(y,"min")/st)+1||1,r.sec=Math.floor(Be(y,"sec")/st)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=i.reactive({main:l,expanded:r}),d=i.reactive({main:i.computed(()=>lr(c.main.year)),expanded:i.computed(()=>lr(c.expanded.year))}),h=i.computed(()=>Is[e.monthNotation][c.main.month-1]),u=i.computed(()=>Is[e.monthNotation][c.expanded.month-1]),f=i.reactive({main:h,expanded:u}),g=i.computed(()=>hy[e.dayOfTheWeekNotation]),p=i.reactive({main:Ge.DATE,expanded:Ge.DATE});return i.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:o,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:g,selectedListType:p}},gy=e=>{const{props:t}=i.getCurrentInstance(),{selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:s}=e,l=i.reactive({main:un(ks,Ms),expanded:un(ks,Ms)}),a=i.reactive({main:un(Ss,ws),expanded:un(Ss,ws)}),r=i.reactive({main:un(bs,Cs),expanded:un(bs,Cs)}),c=i.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:p=>{const m=o[p];let x=t.options.disabledDate;x&&Array.isArray(x)&&(x=p==="main"?x[0]:x[1]);const b=["dateRange","dateTimeRange"].includes(t.mode),y=$n({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),M=($e+m.month-1)%$e||$e,I=(m.month+1)%$e||$e,E=m.month===1?m.year-1:m.year,T=m.month===12?m.year+1:m.year,V=fy(m.year,m.month),C=vs(m.month===1?m.year-1:m.year,($e+m.month-1)%$e||$e),S=vs(m.year,m.month);let w="";t.mode.includes("Time")&&(t.mode==="dateTime"?w=n.value:w=p==="main"?n.value[0]:n.value[1]);let k=0,B=0,D=0,O=0,R="";const v=(N,L,P)=>{var X,j,K;R=$n({year:B,month:D,date:O});const _=(w==null?void 0:w.split(" ")[1])??"",A=b&&!x&&Ko(t.mode,p,R,n.value)||+new Date(`${R} ${_}`)<qo,z=x&&x(new Date(`${R} ${_}`))||A,$=+(p!=="main"),U=b&&n.value.length>$&&((j=(X=n.value)==null?void 0:X[$])==null?void 0:j.includes(R)),H=!z&&(b?U:(K=n.value)==null?void 0:K.includes(R));r[p][L][P]={monthType:`${N}${z?" disabled":""}`,isToday:y===R,isSelected:H,year:B,month:D,date:O}};for(let N=0;N<bs;N++)for(let L=0;L<Cs;L++)N===0?V!==0?L<V?(B=E,D=M,O=C-V+1+L,v("prev",N,L)):(k++,B=m.year,D=m.month,O=k,v("",N,L)):(B=E,D=M,O=C-6+L,v("prev",N,L)):S<=k?(k++,B=T,D=I,O=k-S,v("next",N,L)):(k++,B=m.year,D=m.month,O=k,v("",N,L))},setCalendarMonth:p=>{let m=0;const x=new Date().getFullYear(),b=new Date().getMonth()+1,{year:y,month:M}=o[p];for(let I=0;I<Ss;I++)for(let E=0;E<ws;E++)a[p][I][E]={label:Is.abbrName[m++],value:m,today:y===x&&m===b,isSelected:m===M}},setCalendarYear:p=>{let m=s[p].start;const x=new Date().getFullYear(),b=new Date(qo).getFullYear();for(let y=0;y<ks;y++)for(let M=0;M<Ms;M++)l[p][y][M]={label:m,value:m,today:m===x,isSelected:m===o[p].year,disabled:m<b},m++},setHmsTime:()=>{var V,C;const p=(V=t.options)==null?void 0:V.timeFormat,m=(C=t.options)==null?void 0:C.disabledDate,x=Array.isArray(p)?p[0]:p,b=Array.isArray(p)?p[1]:"",y=t.mode==="dateTimeRange"?n.value[0]:n.value,M=t.mode==="dateTimeRange"?n.value[1]:"",I=Array.isArray(m)?m[0]:m,E=Array.isArray(m)?m[1]:m,T=(S,w,k)=>{const B=S==="main"?y:M,D=S==="main"?I:E;if(!B)return!1;const O=B.split(" ")[0];let R=Be(B,"hour"),v=Be(B,"min"),N=Be(B,"sec");w==="hour"?R=k:w==="min"?v=k:w==="sec"&&(N=k);const L=`${O} ${Te(R)}:${Te(v)}:${Te(N)}`;return D&&D(new Date(L))?!0:!D&&Ko(t.mode,S,L,n.value)};["hour","min","sec"].forEach(S=>{let w=dy;S==="hour"?w=ry:S==="min"&&(w=cy);const k=y&&y.length>0?Xn(x,y,S):-1,B=M&&M.length>0?Xn(b,M,S):-1;for(let D=0;D<w;D++){let O=t.mode==="dateTimeRange"&&T("main",S,D);c.main[S][D]={timeType:S,num:D,isSelected:!O&&k===D,isDisabled:O},t.mode==="dateTimeRange"&&(O=T("expanded",S,D),c.expanded[S][D]={timeType:S,num:D,isSelected:!O&&B===D,isDisabled:O})}})},getTimeInfo:(p,m,x,b)=>{const y=o[b],M=c[b],I=y[p]-1,E=m-1,T=x-1,V=I*st+E*nr+T;return M[p][V]}}},py=e=>{var R;const{props:t,emit:n}=i.getCurrentInstance(),o=(R=t.options)==null?void 0:R.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=e,f=i.ref(""),g=i.ref(null),p=Array.isArray(o)?o[0]:o,m=Array.isArray(o)?o[1]:"",x={main:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"},expanded:{hour:m&&m.split(":")[0]!=="HH",min:m&&m.split(":")[1]!=="mm",sec:m&&m.split(":")[2]!=="ss"}},b=(v,N)=>{const L=l[v],{year:P,month:_,hour:A,min:z,sec:$}=N;P&&(L.year=P),_&&(L.month=_),A&&(L.hour=A),z&&(L.min=z),$&&(L.sec=$)},y=v=>{v==null||v.forEach((N,L)=>{const P=L===0?"main":"expanded";b(P,{year:Be(N,"year"),month:Be(N,"month"),hour:Math.floor(Be(N,"hour")/st)+1,min:Math.floor(Be(N,"min")/st)+1,sec:Math.floor(Be(N,"sec")/st)+1}),r(P)})},M=(v,N)=>{const L=u[v]===Ge.MONTH?1:20,P=N==="prev"?-L:L,_=new Date(qo).getFullYear(),A=l[v].year+P;l[v].year=A<_?_:A},I=(v,N)=>{const L=l[v];if(N==="prev"){const P=new Date(qo).getFullYear();if(L.year===P&&L.month===1)return;L.month===1?(L.year-=1,L.month=12):L.month-=1}else L.month===12?(L.year+=1,L.month=1):L.month+=1},E=(v,N)=>{switch(u[v]){case Ge.DATE:{I(v,N),r(v);break}case Ge.MONTH:M(v,N),c(v);break;case Ge.YEAR:M(v,N),d(v);break}},T=(v,N)=>{N===Ge.DATE?r(v):N===Ge.MONTH?c(v):N===Ge.YEAR&&d(v),u[v]=N},V=(v,N)=>{const{value:L}=N;N.disabled||(u[v]===Ge.YEAR?(l[v].year=L,u[v]=Ge.MONTH,c(v)):(l[v].month=L,u[v]=Ge.DATE,r(v)))},C=(v,N)=>{var J,te,G,oe;const{year:L,month:P,date:_,monthType:A}=N,z=$n({year:L,month:P,date:_}),$=t.modelValue?(Array.isArray(t.modelValue)?((J=t.modelValue)==null?void 0:J.map(Z=>Z==null?void 0:Z.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(z):!1;let U=t.options.disabledDate;if(U&&Array.isArray(U)&&(U=v==="main"?U[0]:U[1]),U&&U(new Date(z))&&!$)return;if(!U&&["dateRange","dateTimeRange"].includes(t.mode)&&Ko(t.mode,v,z,s.value))return;const H=l[v],X=($e+H.month-1)%$e||$e,j=H.month===1?H.year-1:H.year,K=(H.month+1)%$e||$e,q=H.month===12?H.year+1:H.year,Q=()=>{A.includes("prev")?(H.year=j,H.month=X):A.includes("next")&&(H.year=q,H.month=K)};switch(t.mode){case"date":n("update:modelValue",z);break;case"dateTime":{const ae=!!((te=s.value)!=null&&te.split(" ")[1])?(G=s.value)==null?void 0:G.split(" ")[1]:"00:00:00",me=we(o,`${z} ${ae}`);n("update:modelValue",me);break}case"dateMulti":{const Z=t.options.multiType,ae=t.options.multiDayLimit;if(Z==="date"){const me=s.value.indexOf(z);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<ae&&(s.value.push(z),Q(),n("update:modelValue",[...s.value]))}else if(Z==="week"||Z==="weekday"){const me=Z==="week"?7:5,re=Z==="week"?6:5,ue=new Date(`${z} 00:00:00`),ke=ue.getDay(),rt=re-ke,ct=ue.getTime()+Zo*rt;for(let yt=0;yt<me;yt++){const ho=new Date(ct-yt*Zo).getFullYear(),uo=new Date(ct-yt*Zo).getMonth()+1,fo=new Date(ct-yt*Zo).getDate(),Zt=`${ho}-${Te(uo)}-${Te(fo)}`;if(yt===0)if(s.value.includes(Zt)){s.value.splice(0);break}else s.value.splice(0),Q();(!U||!U(new Date(Zt)))&&s.value.unshift(Zt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let Z=[...s.value];if(!s.value.length)Z=[z,z];else{const ae=+(v==="expanded");Z[ae]=z}n("update:modelValue",Z);break}case"dateTimeRange":{let Z=[...s.value];if(Z.length){const ae=+(v==="expanded"),me=((oe=Z[ae])==null?void 0:oe.split(" ")[1])||"00:00:00";let re=`${z} ${me}`;o&&o.length&&(re=we(o[ae],re)),Z[ae]=re}else{let ae=`${z} 00:00:00`,me=`${z} 00:00:00`;o&&o.length&&(ae=we(o[0],ae),me=we(o[1],me)),Z=[ae,me]}n("update:modelValue",Z);break}}},S=(v,N,L)=>{if(x[v][N])return;const P=l[v],_=1;N==="hour"?L==="down"&&P.hour<2?P.hour++:L==="up"&&P.hour>_&&P.hour--:N==="min"?L==="down"&&P.min<5?P.min++:L==="up"&&P.min>_&&P.min--:N==="sec"&&(L==="down"&&P.sec<5?P.sec++:L==="up"&&P.sec>_&&P.sec--)},w=(v,N,L,P)=>{var te;if(x[v][N])return;const _=l[v],A=a[v],z=_[N]-1,$=L-1,U=P-1,H=z*st+$*nr+U;if((te=A[N][H])!=null&&te.isDisabled)return;const X=new Date,j={year:X.getFullYear(),month:X.getMonth()+1,date:X.getDate()};let K=!0,q=[];const Q=()=>{let G;return N==="hour"?G=`${Te(H)}:00:00'`:N==="min"?G=`00:${Te(H)}:00`:N==="sec"&&(G=`00:00:${Te(H)}`),`${$n(j)} ${G}`},J=G=>{let re=11;return N==="min"?re=14:N==="sec"&&(re=17),`${G==null?void 0:G.substr(0,re)}${Te(H)}${G==null?void 0:G.substr(re+2)}`};if(t.mode==="dateTime"){let G;t.modelValue?G=we(o,J(t.modelValue)):(K=!1,G=we(o,Q())),n("update:modelValue",G),q.push(G)}else{const G=v!=="main"|0;let oe=[...s.value];if(t.modelValue.length){let Z=J(t.modelValue[G]);o&&o.length&&(Z=we(o[G],Z)),oe[G]=Z}else{const Z=Q();oe=[Z,Z],o&&o.length&&(oe=[...oe.map((ae,me)=>we(o[me],ae))]),K=!1,q=oe}n("update:modelValue",oe)}h(),K||y(q)},k=(v,N)=>{E(v,N.deltaY>0?"next":"prev")},B=(v,N,L)=>{x[v][N]||S(v,N,L.deltaY>0?"down":"up")},D=xs((v,N)=>{const L=N.target.tagName==="TD"?N.target:N.target.parentElement,P=L.classList.contains("disabled"),_=L.classList.contains("prev"),A=L.classList.contains("next");if(L.classList.length>0&&!P){const z=l[v];let $={year:+z.year,month:+z.month,date:N.target.innerText};_?$={...$,...sr("prev",$.year,$.month)}:A&&($={...$,...sr("next",$.year,$.month)});const U=f.value,H=$n({year:$.year,month:$.month,date:$.date});fn(H)<fn(U)?(s.value[0]=H,s.value[1]=U):(s.value[0]=U,s.value[1]=H),r("main"),r("expanded")}},10),O=v=>{const N=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),L=t.options.disabledDate;if(N){const[P,_]=s.value;let[A,z]=[L,L];if(L&&Array.isArray(L)&&([A,z]=L),v[0]&&v[0]!==P&&A&&A(new Date(v[0])))return!0;if(v[1]&&v[1]!==_&&z&&z(new Date(v[1])))return!0;if(!L&&Ko(t.mode,"main",v[0],v))return!0}else{if(t.mode==="dateMulti")return v.some(P=>L&&L(new Date(P)));if(L&&L(new Date(v)))return!0}return!1};return i.watch(()=>t.modelValue,v=>{if(O(v)){n("update:modelValue",s.value);return}const N=["dateRange","dateMulti","dateTimeRange"].includes(t.mode);if(s.value=N?[...v]:v,t.mode==="dateRange")y(v);else if(t.mode.includes("Time")){let L=[];t.mode==="dateTime"?L=[v]:t.mode==="dateTimeRange"&&(L=v),y(L),h()}else t.mode==="date"&&y([v])}),{clickYearMonthBtn:T,clickPrevNextBtn:E,clickDate:C,clickYearMonth:V,clickHmsBtn:S,clickTime:w,wheelMonth:k,wheelTime:B,calendarEventName:g,onMousemoveDate:D,preventTimeEventType:x}},yy={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(o=>!!(!o||o.length===10&&t.exec(o))||o.length===19&&n.exec(o)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,timeFormat:o})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(o)?o.every(l=>!!(!l||s.exec(l))):!!(!o||s.exec(o))}}},emits:{"update:modelValue":[Array,String]},setup(e){const{calendarList:t,selectedValue:n,calendarPageInfo:o,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=my(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:g,setCalendarYear:p,setHmsTime:m,getTimeInfo:x}=gy({selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:a}),{clickPrevNextBtn:b,clickYearMonthBtn:y,clickDate:M,clickYearMonth:I,clickHmsBtn:E,clickTime:T,wheelMonth:V,wheelTime:C,calendarEventName:S,onMousemoveDate:w,preventTimeEventType:k}=py({selectedValue:n,calendarPageInfo:o,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:f,setCalendarMonth:g,setCalendarYear:p,setHmsTime:m});return f("main"),["dateRange","dateTimeRange"].includes(e.mode)&&f("expanded"),["dateTime","dateTimeRange"].includes(e.mode)&&m(),{calendarList:t,selectedValue:n,calendarPageInfo:o,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:x,clickPrevNextBtn:b,clickYearMonthBtn:y,clickDate:M,clickYearMonth:I,clickHmsBtn:E,clickTime:T,wheelMonth:V,wheelTime:C,calendarEventName:S,onMousemoveDate:w,preventTimeEventType:k}}},xy={class:"ev-calendar-wrapper"},by={class:"ev-calendar-date-area"},Cy={class:"ev-calendar-header"},Sy=["onClick"],wy={class:"ev-calendar-year-month-wrapper"},ky={key:0,class:"ev-calendar-year-range"},My=["onClick"],Ey=["onClick"],Iy=["onClick"],vy={class:"ev-calendar-body"},Ty=["onWheel"],By=["onClick"],Dy=["onWheel"],Oy=["onClick"],Ry={key:2,class:"ev-calendar-selector-btn-wrapper"},Ly={key:0,class:"ev-calendar-time-area"},Ny={key:0,class:"ev-calendar-time-area-disabled"},Vy={class:"ev-calendar-time-side"},Py={class:"ev-calendar-time-center"},_y=["onWheel"],Ay=["onClick"],zy={class:"ev-calendar-time-side"},Fy=["onClick"];function Hy(e,t,n,o,s,l){const a=i.resolveComponent("ev-button");return i.openBlock(),i.createElementBlock("div",xy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.calendarList,r=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[i.createElementVNode("div",by,[i.createElementVNode("div",Cy,[i.createElementVNode("div",{class:"move-month-arrow",onClick:c=>o.clickPrevNextBtn(r,"prev")},[...t[0]||(t[0]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Sy),i.createElementVNode("div",wy,[o.selectedListType[r]==="year"?(i.openBlock(),i.createElementBlock("span",ky,i.toDisplayString(o.calendarYearRangeInfo[r].start+" - "+o.calendarYearRangeInfo[r].end),1)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>o.clickYearMonthBtn(r,"year")},i.toDisplayString(o.calendarPageInfo[r].year),9,My),o.selectedListType[r]==="date"?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>o.clickYearMonthBtn(r,"month")},i.toDisplayString(o.calendarMonth[r]),9,Ey)):i.createCommentVNode("",!0)],64))]),i.createElementVNode("div",{class:"move-month-arrow",onClick:c=>o.clickPrevNextBtn(r,"next")},[...t[1]||(t[1]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Iy)]),i.createElementVNode("div",vy,[o.selectedListType[r]==="date"?(i.openBlock(),i.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.dayOfTheWeekList,c=>(i.openBlock(),i.createElementBlock("th",{key:c},i.toDisplayString(c),1))),128))])]),i.createElementVNode("tbody",{onWheel:i.withModifiers(c=>o.wheelMonth(r,c),["prevent"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.calendarTableInfo[r],c=>(i.openBlock(),i.createElementBlock("tr",{key:c},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c,d=>(i.openBlock(),i.createElementBlock("td",i.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>o.clickDate(r,d)},{[i.toHandlerKey(`${o.calendarEventName}`)]:h=>o.onMousemoveDate(r,h)}),[i.createElementVNode("div",null,[i.createElementVNode("span",null,i.toDisplayString(d.date),1)])],16,By))),128))]))),128))],40,Ty)])):(i.openBlock(),i.createElementBlock("table",{key:1,class:i.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${o.selectedListType[r]}`])},[i.createElementVNode("tbody",{onWheel:i.withModifiers(c=>o.wheelMonth(r,c),["prevent"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.selectedListType[r]==="month"?o.calendarMonthTableInfo[r]:o.calendarYearTableInfo[r],c=>(i.openBlock(),i.createElementBlock("tr",{key:c},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c,d=>(i.openBlock(),i.createElementBlock("td",{key:d.value,onClick:h=>o.clickYearMonth(r,d)},[i.createElementVNode("div",{class:i.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},i.toDisplayString(d.label),3)],8,Oy))),128))]))),128))],40,Dy)],2)),o.selectedListType[r]!=="date"?(i.openBlock(),i.createElementBlock("div",Ry,[i.createVNode(a,{onClick:c=>o.clickYearMonthBtn(r,"date")},{default:i.withCtx(()=>[...t[2]||(t[2]=[i.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):i.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(i.openBlock(),i.createElementBlock("div",Ly,[o.selectedListType[r]!=="date"?(i.openBlock(),i.createElementBlock("div",Ny)):i.createCommentVNode("",!0),i.createElementVNode("div",Vy,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["HOUR","MIN","SEC"],c=>i.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},i.toDisplayString(c),1)),64))]),i.createElementVNode("div",Py,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["hour","min","sec"],c=>i.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[i.createElementVNode("tbody",{onWheel:i.withModifiers(d=>o.wheelTime(r,c,d),["prevent"])},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(3,d=>i.createElementVNode("tr",{key:`${c}_${d}_tr`},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(4,h=>i.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:i.normalizeClass(["ev-calendar-time-td",{selected:o.getTimeInfo(c,d,h,r).isSelected},{disabled:o.preventTimeEventType[r][c]||o.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>o.clickTime(r,c,d,h)},[i.createElementVNode("div",null,i.toDisplayString(o.getTimeInfo(c,d,h,r).num),1)],10,Ay)),64))])),64))],40,_y)])),64))]),i.createElementVNode("div",zy,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["hour","min","sec"],c=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`${c}_btn_area`},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["up","down"],d=>i.createElementVNode("div",{key:`${c}_${d}_btn`,class:i.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:o.preventTimeEventType[r][c]}]),onClick:h=>o.clickHmsBtn(r,c,d)},[i.createElementVNode("i",{class:i.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,Fy)),64))],64))),64))])])):i.createCommentVNode("",!0)],64))),128))])}const Un=le(yy,[["render",Hy]]);Un.install=e=>{e.component(Un.name,Un)};const Wy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),$y=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),Xy=()=>{var f;const{props:e,emit:t}=i.getCurrentInstance(),n=(f=e.options)==null?void 0:f.timeFormat,o=["dateTimeRange","dateRange","dateMulti"].includes(e.mode),s=g=>{let p;if(e.mode==="dateTime")p=we(n,g);else if(e.modelValue.length){const[m,x]=n;p=[we(m,g[0]),we(x,g[1])]}return p},l=i.computed({get:()=>e.modelValue?["dateTime","dateTimeRange"].includes(e.mode)&&n?s(e.modelValue):o?[...e.modelValue]:e.modelValue:e.mode==="date"||e.mode==="dateTime"?"":[],set:g=>{if(["dateTime","dateTimeRange"].includes(e.mode)&&n){t("update:modelValue",s(g));return}t("update:modelValue",g)}});let a;if(["dateTimeRange","dateTime"].includes(e.mode)&&n)if(e.mode==="dateTimeRange"&&Array.isArray(e.modelValue)&&e.modelValue.length===2){const[g,p]=e.modelValue,[m,x]=n;e.modelValue=[we(m,g),we(x,p)],a=i.ref([...e.modelValue])}else e.mode==="dateTime"&&e.modelValue?a=i.ref(we(n,e.modelValue)):a=i.ref(e.modelValue);else a=i.ref(o?[...e.modelValue]:e.modelValue);const r=g=>{const p=y=>!!(y.length===10&&Wy.exec(y)),m=y=>!!(y.length===19&&$y.exec(y)),x=y=>{const M=y.split(" ")[0],I=+M.split("-")[0],E=+M.split("-")[1],T=+M.split("-")[2],V=vs(I,E);return+T<=V&&I>=new Date(0).getFullYear()};let b=!0;e.mode==="date"?b=p(g)&&x(g):e.mode==="dateTime"?b=m(g)&&x(g):e.mode==="dateRange"?b=g.every(y=>p(y)&&x(y)):e.mode==="dateTimeRange"&&(b=g.every(y=>m(y)&&x(y))),b&&(l.value=o?[...g]:g),a.value=o?[...l.value]:l.value},c=i.computed(()=>e.mode==="date"||e.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{e.mode==="date"||e.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async g=>{await i.nextTick(),t("change",l.value,g)},removeMv:g=>{if(!e.disabled){const p=l.value.indexOf(g);l.value.splice(p,1),l.value=[...l.value]}}}},Uy=()=>{const{props:e}=i.getCurrentInstance(),t=i.ref(!1),n=i.ref(null),o=i.ref(null),s=i.ref(null),l=i.ref(null),a=i.reactive({top:null,right:null,left:null}),r=async()=>{var M,I;await i.nextTick();const h=(M=o.value)==null?void 0:M.getBoundingClientRect(),u=(I=s.value)==null?void 0:I.getBoundingClientRect(),f=h.height,g=h.y,p=h.x,m=u.height,x=u.width,b=document.documentElement.clientHeight,y=document.documentElement.clientWidth;b<g+f+m?(a.top=`-${m}px`,y<p+x?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${f}px`,y<p+x?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:t,datePicker:n,datePickerWrapper:o,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{e.disabled||(t.value=e.enableTextInput?!0:!t.value,t.value&&await r())},clickOutsideDropbox:()=>{t.value=!1},changeDropboxPosition:r}},Yy=e=>{var g;const{props:t}=i.getCurrentInstance(),{mv:n,currentValue:o,clickOutsideDropbox:s}=e,l=i.reactive([]);(g=t.shortcuts)==null||g.forEach(({value:p,label:m,shortcutDate:x})=>{l.push({key:p,label:m,shortcutDate:x,isActive:!1})});const a=()=>{const p=l.find(m=>m.isActive);p&&(p.isActive=!1)},r=p=>{const m=l.find(x=>x.key===p);m&&(m.isActive=!0)},c=p=>p===null?"00":+p<10?`0${p}`:p,d=p=>{const m=p?new Date(p):new Date,x=m.getFullYear(),b=m.getMonth()+1,y=m.getDate();return`${x}-${c(b)}-${c(y)}`},h=p=>{const m=p?new Date(p):new Date,x=m.getHours(),b=m.getMinutes(),y=m.getSeconds();return`${d(m)} ${c(x)}:${c(b)}:${c(y)}`},u=()=>{var x,b;a();const p=["dateRange","dateTimeRange"].includes(t.mode);if(!l.length||t.mode==="dateMulti"&&((x=t.options)==null?void 0:x.multiType)!=="date"||p&&!n.value.length||!p&&!n.value)return;let m;if(p){const y=(b=t.options)==null?void 0:b.timeFormat,[M,I]=n.value;let E;t.mode==="dateTimeRange"&&(y!=null&&y.length)?E=l.find(({shortcutDate:T})=>{const[V,C]=T(),[S,w]=y,k=we(S,h(V)),B=we(w,h(C)),D=k===h(M),O=B===h(I);return D&&O}):E=l.find(({shortcutDate:T})=>{const[V,C]=T(),S=t.mode==="dateTimeRange"?h:d,w=S(V)===S(M),k=S(C)===S(I);return w&&k}),m=E==null?void 0:E.key}else{const y=t.mode==="dateTime"?h:d,M=y(n.value),I=l.find(({shortcutDate:E})=>y(E())===M);m=I==null?void 0:I.key}m&&r(m)},f=p=>{var M;const m=["dateRange","dateTimeRange"].includes(t.mode),x=l.find(({key:I})=>I===p);if(!x)return;const b=x.shortcutDate,y=(M=t.options)==null?void 0:M.timeFormat;if(m){const[I,E]=b();if(t.mode==="dateTimeRange")if(y!=null&&y.length){const[T,V]=y;n.value=[we(T,h(I)),we(V,h(E))]}else n.value=[h(I),h(E)];else n.value=[d(I),d(E)]}else{const I=b();n.value=t.mode==="dateTime"?we(y,h(I)):d(I)}a(),r(p)};return i.watch(()=>t.modelValue,p=>{var m,x;if(u(),!(t.mode==="dateMulti"&&((m=t==null?void 0:t.options)==null?void 0:m.multiType)==="date"&&((x=t==null?void 0:t.options)==null?void 0:x.multiDayLimit)>p.length)){if(t.mode==="dateRange"||t.mode==="dateTimeRange"){o.value=[...p];return}else if(t.mode==="dateTime"){o.value=p;return}o.value=p,s()}}),{usedShortcuts:l,clickShortcut:f,setActiveShortcut:u}},jy={name:"EvDatePicker",directives:{clickoutside:Cd},props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(o=>!!(!o||o.length===10&&t.exec(o))||o.length===19&&n.exec(o)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,tagShorten:o,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(o===void 0||typeof o=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:e=>e.length?e.every(({shortcutDate:t})=>{if(typeof t!="function")return!1;const n=t();return Array.isArray(n)&&n.every(o=>o instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:e,currentValue:t,isClearableIcon:n,validateValue:o,removeAllMv:s,changeMv:l,removeMv:a}=Xy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:g,clickOutsideDropbox:p,changeDropboxPosition:m}=Uy(),{usedShortcuts:x,clickShortcut:b,setActiveShortcut:y}=Yy({mv:e,currentValue:t,clickOutsideDropbox:p});return y(),{mv:e,currentValue:t,isClearableIcon:n,validateValue:o,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:g,clickOutsideDropbox:p,changeDropboxPosition:m,usedShortcuts:x,clickShortcut:b}}},Gy={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},Zy=["placeholder","readonly","disabled"],qy=["placeholder","disabled"],Ky={class:"ev-tag-name"},Jy=["onClick"],Qy={key:0,class:"ev-select-tag num"},ex={class:"ev-tag-name"},tx={class:"ev-select-tag num"},nx={class:"ev-tag-name"},ox={class:"ev-date-picker-dropbox-wrapper"},ix={key:0,class:"ev-date-picker-dropbox__button-layout"},sx={key:1,class:"ev-date-picker-dropbox__divider"};function lx(e,t,n,o,s,l){const a=i.resolveComponent("ev-button"),r=i.resolveComponent("ev-button-group"),c=i.resolveComponent("ev-calendar"),d=i.resolveDirective("clickoutside");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"datePicker",class:i.normalizeClass(["ev-date-picker",{disabled:e.$props.disabled}])},[i.createElementVNode("div",Gy,[e.$props.mode==="date"||e.$props.mode==="dateTime"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[t[15]||(t[15]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>o.currentValue=h),type:"text",class:i.normalizeClass(["ev-input",{readonly:!e.$props.enableTextInput}]),placeholder:e.$props.placeholder,readonly:!e.$props.enableTextInput,disabled:e.$props.disabled,onClick:t[1]||(t[1]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h)),onKeydown:t[2]||(t[2]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[3]||(t[3]=h=>o.validateValue(o.currentValue))},null,42,Zy),[[i.vModelText,o.currentValue,void 0,{trim:!0}]])],64)):e.$props.mode==="dateMulti"||!e.$props.enableTextInput?(i.openBlock(),i.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:t[4]||(t[4]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h))},[t[18]||(t[18]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:e.$props.placeholder,disabled:e.$props.disabled},null,8,qy),e.$props.mode==="dateMulti"&&(e.$props.options.multiType==="date"||!e.$props.options.tagShorten)?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(o.mv,(h,u)=>(i.openBlock(),i.createElementBlock("div",{key:`${h}_${u}`,class:i.normalizeClass(["ev-select-tag",{num:e.$props.options.multiType!=="date"}])},[i.createElementVNode("span",Ky,i.toDisplayString(h),1),e.$props.options.multiType==="date"?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:i.withModifiers(f=>[o.removeMv(h),o.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Jy)):i.createCommentVNode("",!0)],2))),128)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o.mv[0]?(i.openBlock(),i.createElementBlock("div",Qy,[i.createElementVNode("span",ex,i.toDisplayString(o.mv[0]),1)])):i.createCommentVNode("",!0),o.mv[o.mv.length-1]?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[t[17]||(t[17]=i.createElementVNode("div",{class:"ev-select-tag num"},[i.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),i.createElementVNode("div",tx,[i.createElementVNode("span",nx,i.toDisplayString(o.mv[o.mv.length-1]),1)])],64)):i.createCommentVNode("",!0)],64))])):(i.openBlock(),i.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:t[11]||(t[11]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h))},[t[20]||(t[20]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=h=>o.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[6]||(t[6]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[7]||(t[7]=h=>o.validateValue(o.currentValue))},null,544),[[i.vModelText,o.currentValue[0],void 0,{trim:!0}]]),o.currentValue[o.currentValue.length-1]?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[t[19]||(t[19]=i.createElementVNode("div",{class:"ev-date-picker-range-separator"},[i.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=h=>o.currentValue[o.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[9]||(t[9]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[10]||(t[10]=h=>o.validateValue(o.currentValue))},null,544),[[i.vModelText,o.currentValue[o.currentValue.length-1],void 0,{trim:!0}]])],64)):i.createCommentVNode("",!0)])),e.$props.clearable?i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:t[12]||(t[12]=i.withModifiers(h=>[o.removeAllMv(),o.clickOutsideDropbox()],["stop"]))},[...t[21]||(t[21]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[i.vShow,o.isClearableIcon]]):i.createCommentVNode("",!0),i.createElementVNode("div",ox,[o.isDropbox?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"dropbox",class:i.normalizeClass(["ev-date-picker-dropdown",e.$props.mode]),style:i.normalizeStyle(o.dropboxPosition)},[o.usedShortcuts.length?(i.openBlock(),i.createElementBlock("div",ix,[o.usedShortcuts.length===1?(i.openBlock(),i.createBlock(a,{key:0,type:o.usedShortcuts[0].isActive?"primary":"default",onClick:t[13]||(t[13]=h=>o.clickShortcut(o.usedShortcuts[0].key))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.usedShortcuts[0].label),1)]),_:1},8,["type"])):(i.openBlock(),i.createBlock(r,{key:1},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.usedShortcuts,h=>(i.openBlock(),i.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>o.clickShortcut(h.key)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):i.createCommentVNode("",!0),o.usedShortcuts.length?(i.openBlock(),i.createElementBlock("div",sx)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"ev-date-picker-dropbox__calendar":o.usedShortcuts.length})},[i.createVNode(c,{key:"fromCalendar",modelValue:o.mv,"onUpdate:modelValue":t[14]||(t[14]=h=>o.mv=h),mode:e.$props.mode,"month-notation":e.$props.monthNotation,"day-of-the-week-notation":e.$props.dayOfTheWeekNotation,options:e.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):i.createCommentVNode("",!0)])],512)],2)),[[d,o.clickOutsideDropbox]])}const Yn=le(jy,[["render",lx]]);Yn.install=e=>{e.component(Yn.name,Yn)};const ax={name:"EvMessage",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e,t){const n=i.reactive({timer:null,isShow:!0}),o=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,e.onClose&&e.onClose(),o(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},e.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return i.onMounted(()=>{l(),document.addEventListener("keydown",a)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),o()}),t.expose({hide:r}),{startTimer:l,clearTimer:o,closeMsg:s,...i.toRefs(n),hide:r}}},rx={key:0,class:"ev-message-icon"},cx=["innerHTML"],dx={key:2,class:"ev-message-content"};function hx(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Teleport,{to:"#ev-message-modal"},[i.createVNode(i.Transition,{name:"ev-message-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{ref:"msgRef",class:i.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:t[1]||(t[1]=(...a)=>o.clearTimer&&o.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>o.startTimer&&o.startTimer(...a))},[n.iconClass?(i.openBlock(),i.createElementBlock("span",rx,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,cx)):(i.openBlock(),i.createElementBlock("div",dx,i.toDisplayString(n.message),1)),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:3,class:"ev-message-close",onClick:t[0]||(t[0]=(...a)=>o.closeMsg&&o.closeMsg(...a))},[...t[3]||(t[3]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],34),[[i.vShow,e.isShow]])]),_:1})])}const ux=le(ax,[["render",hx]]),fx=i.defineComponent(ux),ar="ev-message-modal",rr=document.createElement("div");rr.id=ar;const Jo=(e={})=>{document.getElementById(ar)||document.body.appendChild(rr);const n=document.createElement("div"),o=()=>i.render(null,n),s=typeof e=="string"?{message:e,unmount:o}:{...e,unmount:o},l=i.h(fx,s);return i.render(l,n),l.component.exposed};Jo.install=e=>{const t=e.config.globalProperties;t.$message=Jo};const mx={name:"EvNotification",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:e=>["top-left","top-right","bottom-left","bottom-right"].includes(e)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e){const t=i.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(t.timer),t.timer=null},o=r=>{r.target.className!=="ev-notification-close"&&e.onClick&&e.onClick()},s=()=>{t.isShow=!1,e.onClose&&e.onClose(),n(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(t.timer=setTimeout(()=>{t.isShow&&s()},e.duration))},a=r=>{r.keyCode===27&&t.isShow&&s()};return i.onMounted(()=>{l(),document.addEventListener("keydown",a)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:o,closeMsg:s,...i.toRefs(t)}}},gx={key:0,class:"ev-notification-icon"},px={class:"ev-notification-content"},yx={key:0,class:"title"},xx=["innerHTML"],bx={key:2,class:"message"};function Cx(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Transition,{name:"ev-notification-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:t[1]||(t[1]=(...a)=>o.clearTimer&&o.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>o.startTimer&&o.startTimer(...a)),onClick:t[3]||(t[3]=(...a)=>o.clickMsg&&o.clickMsg(...a))},[n.iconClass?(i.openBlock(),i.createElementBlock("span",gx,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("div",px,[n.title?(i.openBlock(),i.createElementBlock("p",yx,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,xx)):(i.openBlock(),i.createElementBlock("p",bx,i.toDisplayString(n.message),1))]),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:t[0]||(t[0]=(...a)=>o.closeMsg&&o.closeMsg(...a))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],34),[[i.vShow,e.isShow]])]),_:1})}const Sx=le(mx,[["render",Cx]]),wx=i.defineComponent(Sx),cr="ev-notification-modal",Qo=document.createElement("div");Qo.id=cr;const kx=["top-left","top-right","bottom-left","bottom-right"],ei=(e={})=>{const t=e.position||"top-right";if(!kx.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(cr)||document.body.appendChild(Qo);let o=Qo.getElementsByClassName(`modal-${t}`);o.length?o=o[0]:(o=document.createElement("div"),o.classList.add(`modal-${t}`),Qo.appendChild(o));const l=document.createElement("div"),a=()=>i.render(null,l),r=typeof e=="string"?{message:e,unmount:a}:{...e,unmount:a},c=i.h(wx,r);i.render(c,l),o.appendChild(c.el)};ei.install=e=>{const t=e.config.globalProperties;t.$notify=ei};const Mx={name:"EvMessageBox",components:{EvButton:sn},props:{type:{type:String,default:"",validator:e=>["","info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(e){const t=i.ref(null),n=i.reactive({isShow:!0,iconClass:""}),o=c=>{if(!e.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,e.onClose&&e.onClose(d),e.unmount&&setTimeout(e.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&o()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{e.iconClass?n.iconClass=e.iconClass:e.type&&(n.iconClass=l(e.type))},r=c=>{if(!e.focusable)return!1;switch(c){case"confirmBtn":return e.showConfirmBtn;case"cancelBtn":return!e.showConfirmBtn&&e.showCancelBtn;case"messagebox":return!e.showConfirmBtn&&!e.showCancelBtn;default:return!1}};return i.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&t.value.focus()}),i.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:o,...i.toRefs(n),msgRef:t,hasFocus:r}}},Ex={key:0,class:"ev-message-box-icon"},Ix={class:"ev-message-box-content"},vx={key:0,class:"ev-message-box-title"},Tx=["innerHTML"],Bx={key:2,class:"ev-message-box-message"},Dx={class:"ev-message-box-btn"};function Ox(e,t,n,o,s,l){const a=i.resolveComponent("ev-button");return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ev-message-box-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{id:"ev-message-box-modal",onClick:t[3]||(t[3]=i.withModifiers(r=>o.closeMsg("modal"),["self"])),onWheel:i.withModifiers(()=>{},["stop","prevent"])},[i.createElementVNode("div",{ref:"msgRef",class:i.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(i.openBlock(),i.createElementBlock("span",Ex,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("div",Ix,[n.title?(i.openBlock(),i.createElementBlock("p",vx,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,Tx)):(i.openBlock(),i.createElementBlock("p",Bx,i.toDisplayString(n.message),1))]),i.createElementVNode("div",Dx,[n.showCancelBtn?(i.openBlock(),i.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":o.hasFocus("cancelBtn"),onClick:t[0]||(t[0]=r=>o.closeMsg("cancel"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):i.createCommentVNode("",!0),n.showConfirmBtn?(i.openBlock(),i.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":o.hasFocus("confirmBtn"),onClick:t[1]||(t[1]=r=>o.closeMsg("ok"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):i.createCommentVNode("",!0)]),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:t[2]||(t[2]=r=>o.closeMsg("cancel"))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],2)],544),[[i.vShow,e.isShow]])]),_:1})])}const Rx=le(Mx,[["render",Ox]]),Lx=i.defineComponent(Rx),ti=(e={})=>{const t=document.createElement("div"),n=()=>i.render(null,t),o=typeof e=="string"?{message:e,unmount:n}:{...e,unmount:n},s=i.h(Lx,o);i.render(s,t)};ti.install=e=>{const t=e.config.globalProperties;t.$messagebox=ti};const dr=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Nx=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.computed({get:()=>e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length?dr(e.rowLabels.length,e.colLabels.length):e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,validateValue:()=>{(e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length)&&(n.value=[...dr(e.rowLabels.length,e.colLabels.length)])}}},Vx=e=>{const{mv:t}=e,n=i.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),o=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const f=n.startRow<n.dragRow?n.startRow:n.dragRow,g=n.startRow>n.dragRow?n.startRow:n.dragRow,p=n.startCol<n.dragCol?n.startCol:n.dragCol,m=n.startCol>n.dragCol?n.startCol:n.dragCol;if(f>h||g<h||p>u||m<u)return{};const x="2px solid #5292F7";let b={};return h===f&&(b={...b,"border-top":x}),h===g&&(b={...b,"border-bottom":x}),u===p&&(b={...b,"border-left":x}),u===m&&(b={...b,"border-right":x}),b},s=(h,u)=>{n.startRow=h,n.startCol=u,n.dragRow=h,n.dragCol=u,n.dragEventName="mousemove"},l=(h,u)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=u,n.dragEventName=null;const f=[...t.value],g=n.startRow<n.endRow?n.startRow:n.endRow,p=n.startRow>n.endRow?n.startRow:n.endRow,m=n.startCol<n.endCol?n.startCol:n.endCol,x=n.startCol>n.endCol?n.startCol:n.endCol;for(let b=g;b<=p;b++)for(let y=m;y<=x;y++)f[b][y]=!f[b][y];t.value=[...f],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,u)=>{n.dragRow=h,n.dragCol=u},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const u=[...t.value],f=u[0][h];for(let g=0;g<u.length;g++)u[g][h]=!f;t.value=[...u]},selectRow:h=>{const u=[...t.value],f=u[h][0];for(let g=0;g<u[0].length;g++)u[h][g]=!f;t.value=[...u]}}},Px={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:e,validateValue:t}=Nx();t();const{mousePos:n,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=Vx({mv:e});return{mv:e,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...i.toRefs(n)}}},_x={class:"ev-scheduler-header"},Ax=["onClick","innerHTML"],zx=["onClick","innerHTML"],Fx=["onMousedown","onMouseup"];function Hx(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("table",{class:i.normalizeClass(["ev-scheduler",{draggable:!!e.dragEventName}])},[i.createElementVNode("thead",null,[i.createElementVNode("tr",_x,[t[1]||(t[1]=i.createElementVNode("td",null,null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.colLabels.length,(a,r)=>(i.openBlock(),i.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>o.selectColumn(r),innerHTML:n.colLabels[r]},null,8,Ax))),128))])]),i.createElementVNode("tbody",{onMouseleave:t[0]||(t[0]=(...a)=>o.mouseleaveBoxArea&&o.mouseleaveBoxArea(...a))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.rowLabels.length,(a,r)=>(i.openBlock(),i.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(i.openBlock(),i.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>o.selectRow(r),innerHTML:n.rowLabels[r]},null,8,zx)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.colLabels.length,(c,d)=>(i.openBlock(),i.createElementBlock("td",i.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:o.mv[r][d]}],style:o.selectionStyle(r,d),onMousedown:i.withModifiers(h=>o.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:i.withModifiers(h=>o.mouseupBox(r,d),["stop","prevent"])},{[i.toHandlerKey(`${e.dragEventName}`)]:h=>o.mousemoveBox(r,d)}),null,16,Fx))),128))]))),128))],32)],2)}const jn=le(Px,[["render",Hx]]);jn.install=e=>{e.component(jn.name,jn)};const Wx=()=>{const e=i.defineComponent(hr),t=i.ref([]);return{comp:e,childrenItems:t,initWrapperDiv:()=>{const o=document.createElement("div");o.id="ev-context-menu-modal",o.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(o)}}},$x=()=>{const{props:e}=i.getCurrentInstance(),t=i.computed(()=>e.isShowMenuOnClick),n=i.ref(!1),o=i.ref(null),s=i.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:o,menuStyle:s,show:async r=>{var d,h;n.value=!0,await i.nextTick();const c=(h=(d=o.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,f=c.width,g=document.documentElement.clientHeight,p=document.documentElement.clientWidth,m=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,g<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,p<r.clientX+f+m?s.left=`${r.pageX-f}px`:s.left=`${r.pageX}px`}},hide:async()=>{await i.nextTick(),!t.value&&(n.value=!1)}}},Xx=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.computed({get:()=>e.isShow,set:f=>t("update:isShow",f)}),o=i.computed(()=>!!e.items.some(f=>f.children)),s=i.ref([]),l=i.ref(!1),a=i.ref(null),r=i.reactive({top:null,left:null,right:null}),c=f=>{f||(n.value=!1)},d=f=>{var k,B,D;const g=document.documentElement.clientWidth,p=document.documentElement.clientHeight,m=20,x=(k=f.target.parentElement)==null?void 0:k.getBoundingClientRect(),{x:b,y,width:M,height:I}=x,E=(D=(B=a.value)==null?void 0:B.$el)==null?void 0:D.children[0].getBoundingClientRect(),{width:T,height:V}=E,C=f.target.offsetTop,S=p<y+C+V,w=g<b+M+T+m;S?r.top=`${I-V}px`:r.top=`${C}px`,w?r.left=`${0-T}px`:r.left=`${M}px`};return{computedIsShow:n,isExistChild:o,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:f=>{f.click&&!f.disabled&&f.click(f),f.isShowMenu||c(f.children)},handleMouseEnter:async(f,g)=>{!g.children||!Array.isArray(g.children)||g.disabled?l.value=!1:(l.value=!0,s.value=g.children,await i.nextTick(),d(f))},hideAll:c}},Ux={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:o,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=Xx();return{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:o,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Yx={class:"ev-menu-list"},jx={class:"ev-menu-ul"},Gx=["onClick","onMouseenter"],Zx={class:"ev-menu-li-text"},qx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function Kx(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",Yx,[i.createElementVNode("ul",jx,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(a,r)=>i.withDirectives((i.openBlock(),i.createElementBlock("li",{key:`${a.value}_${r}`,class:i.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>o.handleItemClick(a),onMouseenter:c=>o.handleMouseEnter(c,a)},[a.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",Zx,[a.slotKey?i.renderSlot(e.$slots,a.slotKey,{key:0,item:a},()=>[i.createTextVNode(i.toDisplayString(a.text),1)]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(i.openBlock(),i.createElementBlock("i",qx)):i.createCommentVNode("",!0)],42,Gx)),[[i.vShow,!a.hidden]])),128))]),o.isExistChild?i.withDirectives((i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:o.computedIsShow,"onUpdate:isShow":t[0]||(t[0]=a=>o.computedIsShow=a),comp:n.comp,items:o.childrenItems,style:i.normalizeStyle(o.menuStyle)},i.createSlots({_:2},[i.renderList(e.$slots,(a,r)=>({name:r,fn:i.withCtx(c=>[i.renderSlot(e.$slots,r,i.normalizeProps(i.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[i.vShow,o.childrenItems.length&&o.isShowChild]]):i.createCommentVNode("",!0)])}const hr=le(Ux,[["render",Kx]]),Jx={name:"EvContextMenu",directives:{clickoutside:Ro},components:{MenuList:hr},props:{items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:e,initWrapperDiv:t}=Wx(),{isShow:n,rootMenuList:o,menuStyle:s,show:l,hide:a}=$x();return i.onBeforeMount(()=>t()),{isShow:n,rootMenuList:o,menuStyle:s,comp:e,show:l,hide:a}}};function Qx(e,t,n,o,s,l){const a=i.resolveComponent("menu-list"),r=i.resolveDirective("clickoutside");return o.isShow&&n.items.length?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-context-menu-modal"},[i.withDirectives((i.openBlock(),i.createBlock(a,{ref:"rootMenuList",isShow:o.isShow,"onUpdate:isShow":t[0]||(t[0]=c=>o.isShow=c),class:i.normalizeClass(n.customClass),items:n.items,style:i.normalizeStyle(o.menuStyle),comp:o.comp},i.createSlots({_:2},[i.renderList(e.$slots,(c,d)=>({name:d,fn:i.withCtx(h=>[i.renderSlot(e.$slots,d,i.normalizeProps(i.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,o.hide]])])):i.createCommentVNode("",!0)}const Gn=le(Jx,[["render",Qx]]);Gn.install=e=>{e.component(Gn.name,Gn)};const eb=()=>window.innerWidth-document.documentElement.clientWidth,tb=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(),o=i.ref(),s=i.ref(!1),l=i.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const m=document.createElement("div");m.id="ev-window-modal",document.body.appendChild(m),a=document.getElementById("ev-window-modal")}})();const c=m=>{let x,b;if(typeof m=="string"||typeof m=="number"){const y=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(m);x=y?{value:+y[2],unit:y[3]||void 0}:void 0}else x=void 0;return x==null?b=void 0:x.unit?b=`${x.value}${x.unit}`:b=`${x.value}px`,b},d=(m,x="horizontal")=>{if(typeof m=="number")return m;if(!m)return 0;let b=0;const y=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(m);if(x&&["%","vw","vh"].includes(y[3])&&y[2]){const M=x==="horizontal"?window.innerWidth:window.innerHeight;b=Math.floor(M*+y[2]/100)}else y[2]&&(b=+y[2]);return b},h=i.reactive({}),u=i.computed(()=>({...e.style,...h})),f=()=>{if(h.position="fixed",e.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const m=d(e.width,"horizontal"),x=d(e.minWidth,"horizontal");m<x?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(e.minWidth)):h.width=c(e.width);const b=d(e.height,"vertical"),y=d(e.minHeight,"vertical");b<y?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(e.minHeight)):h.height=c(e.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(e.width,"horizontal")>window.innerWidth&&(h.left=0),d(e.height,"vertical")>window.innerHeight&&(h.top=0)},g=m=>{m==="layer"&&!e.closeOnClickModal||t("update:visible",!1)},p=m=>{var y;const x=(y=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:y.length,b=document.body;if(m){if(e.hideScroll){if(!x){const M=eb();b.style.paddingRight=`${M}px`}b.classList.add("ev-window-scroll-lock")}}else e.hideScroll&&x===1&&(b.style.removeProperty("padding-right"),b.classList.remove("ev-window-scroll-lock"))};return f(),i.watch(()=>e.visible,async m=>{p(m),m&&await i.nextTick(()=>{f()})}),{windowRef:n,headerRef:o,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:g,numberToUnit:c,removeUnit:d}},nb=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{windowRef:o,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=e,c=50,d=5,h=i.reactive({}),u=i.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),f=i.reactive({top:0,left:0}),g=i.reactive({top:!1,right:!1,left:!1,bottom:!1}),p=i.reactive({width:null,height:null,top:null,left:null}),m=(k,B)=>{if(k==null||B==null)return!1;const D=o.value.getBoundingClientRect(),O=+k-D.left,R=+B-D.top,v=s.value.style,N={top:r(v.paddingTop,"vertical"),left:r(v.paddingLeft,"horizontal"),right:r(v.paddingRight,"horizontal")},L=N.left,P=D.width-N.right,_=N.top,A=_+s.value.offsetHeight;return O>L&&O<P&&R>_&&R<A},x=k=>{if(k===null||typeof k!="object")return;let B,D,O,R,v,N;const L=o.value,P=Object.prototype.hasOwnProperty;P.call(k,"top")?B=k.top:B=u.top,P.call(k,"left")?D=k.left:D=u.left,P.call(k,"width")?O=k.width:O=L.offsetWidth,P.call(k,"height")?R=k.height:R=L.offsetHeight,P.call(k,"minWidth")?v=k.minWidth:v=t.minWidth,P.call(k,"minHeight")?N=k.minHeight:N=t.minHeight,O=r(O,"horizontal")>r(v,"horizontal")?O:v,R=r(R,"vertical")>r(N,"vertical")?R:N,h.top=a(B),h.left=a(D),h.width=a(O),h.height=a(R),h.minWidth=a(v),h.minHeight=a(N)},b=k=>{if(!(!o.value||u.pressedSpot))if(t.resizable){const B=o.value.getBoundingClientRect(),D=k.clientX-B.left,O=k.clientY-B.top,R=O<d,v=D<d,N=D>=B.width-d,L=O>=B.height-d;R&&v||L&&N?o.value.style.cursor="nwse-resize":R&&N||L&&v?o.value.style.cursor="nesw-resize":N||v?o.value.style.cursor="ew-resize":L||R?o.value.style.cursor="ns-resize":t.draggable&&m(k.clientX,k.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"}else t.draggable&&m(k.clientX,k.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"},y=k=>{const B=window.innerWidth,D=window.innerHeight,O=g.top,R=g.left,v=g.right,N=g.bottom,L=r(t.minWidth,"horizontal"),P=r(t.minHeight,"vertical"),_=k.clientX>=B?B:k.clientX;let A=k.clientY>=D?D:k.clientY;A=k.clientY>0?A:0;const z=_-u.clientX,$=A-u.clientY;let U=u.top,H=u.left,X=u.width,j=u.height;const K=U+u.height-P,q=H+u.width-L;O&&(U=u.top+$,j=u.height-$,U>K&&(U=K)),R&&(H=u.left+z,X=u.width-z,H>q&&(H=q)),v&&(X=u.width+z),N&&(j=u.height+$),X=Math.min(Math.max(X,L),B),j=Math.min(Math.max(j,P),D);const Q={top:U,left:H,width:X,height:j};x(Q),n("resize",k,{...Q})},M=(k,B)=>{let D=B;return D<0?D=0:D>k-c&&(D=Math.floor(k-c)),D},I=(k,B)=>{let D=B;return D<-(u.width-c)?D=-Math.floor(u.width-c):D>k-c&&(D=Math.floor(k-c)),D},E=k=>{if(k.preventDefault(),u.state="mousedown-mousemove",t.draggable&&u.pressedSpot==="header"){const B=document.documentElement.clientWidth,D=document.documentElement.clientHeight,O=k.clientY-u.clientY,R=k.clientX-u.clientX;let v=u.top+O,N=u.left+R;v=M(D,v),N=I(B,N),x({top:`${v}px`,left:`${N}px`,width:h.width??t.width,height:h.height??t.height})}else t.resizable&&u.pressedSpot==="border"&&y(k);n("mousedown-mousemove",k)},T=k=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",k),window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",T)},V=k=>{if(!o.value||!t.resizable&&!t.draggable)return;let B="";if(t.resizable){const D=o.value.getBoundingClientRect(),O=k.clientX-D.left,R=k.clientY-D.top,v=R<d,N=O<d,L=O>=D.width-d,P=R>=D.height-d;g.top=v,g.left=N,g.right=L,g.bottom=P,(v||N||L||P)&&(B="border")}if(B!=="border"&&m(k.clientX,k.clientY)&&(B="header"),!B||!t.draggable&&B==="header"||!t.resizable&&B==="border"){u.state="mousedown",u.pressedSpot="",u.top=o.value.offsetTop,u.left=o.value.offsetLeft,u.width=o.value.offsetWidth,u.height=o.value.offsetHeight,u.clientX=k.clientX,u.clientY=k.clientY,n("mousedown",{...u,ref:o.value});return}u.state="mousedown",u.pressedSpot=B,u.top=o.value.offsetTop,u.left=o.value.offsetLeft,u.width=o.value.offsetWidth,u.height=o.value.offsetHeight,u.clientX=k.clientX,u.clientY=k.clientY,n("mousedown",{...u,ref:o.value}),window.addEventListener("mousemove",E),window.addEventListener("mouseup",T)},C=k=>{!t.draggable&&!t.resizable||b(k)},S=()=>{l.value=!l.value,i.nextTick(()=>{l.value?(p.top=o.value.offsetTop,p.left=o.value.offsetLeft,p.width=o.value.offsetWidth,p.height=o.value.offsetHeight,x({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):x({top:p.top,left:p.left,width:p.width,height:p.height}),n("expand",{top:p.top,left:p.left,width:p.width,height:p.height})})},w=()=>{l.value=!1,u.state="",u.pressedSpot="",u.top=0,u.left=0,u.width=0,u.height=0,u.clientX=0,u.clientY=0,f.top=0,f.left=0,g.top=!1,g.left=!1,g.right=!1,g.bottom=!1,p.top=null,p.left=null,p.width=null,p.height=null,Object.keys(h).forEach(k=>{delete h[k]})};return i.watch(()=>t.visible,k=>{k||w()}),{dragStyle:h,startDrag:V,moveMouse:C,clickExpandBtn:S}},St=(()=>{let e=[],t=0;return{add(n){if(n!=null)return n.sequence=t++,e.push(n),n.sequence},remove(n){n!=null&&(e=e.filter(o=>o.sequence!==n.sequence))},get windows(){return e.slice()},getWindowBySequence(n){return e.find(o=>o.sequence===n)},isEmpty(){return e.length<=0},isFirstWindowOpen(){return t===1}}})(),wt=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),ob=e=>{const t=window.getComputedStyle(e).getPropertyValue("z-index").trim();return!t||isNaN(t)?700:parseInt(t)},Ts=()=>{const e=(n,o)=>n.zIndex>o.zIndex?1:n.zIndex<o.zIndex?-1:n.sequence>o.sequence?1:-1;return Array.prototype.map.call(St.windows,n=>({...n,zIndex:ob(n.elem)})).sort(e)},ib=({closeWin:e,windowRef:t})=>{const{props:n}=i.getCurrentInstance();let o=null,s=null;const l=()=>St.add({sequence:o,closeWin:e,elem:t.value,escClose:n.escClose}),a=x=>{St.remove(x)},r=x=>{if(St.isEmpty())return;const{code:b}=x;if(b!=="Escape")return;const y=Ts(),M=y[y.length-1];M.escClose&&M.closeWin()},c=()=>{o=l(),t.value.dataset.sequence=o,St.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const x=St.getWindowBySequence(o);a(x)},h=({elem:x,zIndex:b})=>{if(n.isModal){const y=x.parentElement.getElementsByClassName("ev-window-dim-layer")[0];y.style.zIndex=b}x.style.zIndex=b},u=()=>{St.windows.length===1&&wt.resetToLower();const x=wt.getNext();h({elem:t.value,zIndex:x})},f=x=>String(x.sequence)===t.value.dataset.sequence,g=()=>{const x=Ts();if(St.windows.length>wt.getAllocableCount()){const y=x.reverse();let M=0;y.forEach(E=>{if(f(E))return;const T=wt.getPrevFrom(M++);h({elem:E.elem,zIndex:T})});const I=wt.getNextOverLimit();h({elem:t.value,zIndex:I})}else{wt.resetToLower(),x.forEach(M=>{if(f(M))return;const I=wt.getNext();h({elem:M.elem,zIndex:I})});const y=wt.getNext();h({elem:t.value,zIndex:y})}},p=()=>{wt.isUpperLimitClose()?g():u()},m=()=>{if(!t.value||!n.focusable)return;const x=Ts(),b=x[x.length-1];f(b)||p()};return i.onMounted(()=>{n.visible&&(c(),s=setTimeout(p,0))}),i.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),i.watch(()=>n.visible,x=>{i.nextTick(()=>{x?(c(),s=setTimeout(p,0)):(d(),clearTimeout(s))})}),i.watch(()=>n.escClose,x=>{if(!n.visible)return;const b=St.getWindowBySequence(o);b&&(b.escClose=x)}),{setFocus:m}},sb={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:e,headerRef:t,isFullExpandWindow:n,maximizableIcon:o,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=tb(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=nb({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=ib({closeWin:l,windowRef:e});return{windowRef:e,headerRef:t,baseStyle:s,dragStyle:c,maximizableIcon:o,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:f}}},lb={key:0,ref:"headerRef",class:"ev-window-header"},ab={key:0,class:"ev-window-icon"},rb={key:1,class:"ev-window-title"},cb={class:"ev-window-content"},db={key:1,class:"ev-window-footer"},hb={class:"ev-window-top-right-icon"};function ub(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Teleport,{to:"#ev-window-modal"},[i.createVNode(i.Transition,{name:"ev-window-fade",appear:""},{default:i.withCtx(()=>[n.visible?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:t[0]||(t[0]=a=>o.closeWin("layer")),onWheel:i.withModifiers(()=>{},["stop","prevent"])},null,32)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref:"windowRef",class:i.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:i.normalizeStyle({...o.baseStyle,...o.dragStyle}),onMousedown:t[3]||(t[3]=(...a)=>o.startDrag&&o.startDrag(...a)),onMousemove:t[4]||(t[4]=(...a)=>o.moveMouse&&o.moveMouse(...a)),onClick:t[5]||(t[5]=(...a)=>o.setFocus&&o.setFocus(...a))},[e.$slots.header||n.iconClass||n.title?(i.openBlock(),i.createElementBlock("div",lb,[e.$slots.header?i.renderSlot(e.$slots,"header",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.iconClass?(i.openBlock(),i.createElementBlock("span",ab,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),n.title?(i.openBlock(),i.createElementBlock("p",rb,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0)],64))],512)):i.createCommentVNode("",!0),i.createElementVNode("div",cb,[i.renderSlot(e.$slots,"default")]),e.$slots.footer?(i.openBlock(),i.createElementBlock("div",db,[i.renderSlot(e.$slots,"footer")])):i.createCommentVNode("",!0),i.createElementVNode("div",hb,[n.maximizable&&!n.fullscreen?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:t[1]||(t[1]=(...a)=>o.clickExpandBtn&&o.clickExpandBtn(...a))},[i.createElementVNode("i",{class:i.normalizeClass(o.maximizableIcon)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ev-window-close",onClick:t[2]||(t[2]=(...a)=>o.closeWin&&o.closeWin(...a))},[...t[6]||(t[6]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):i.createCommentVNode("",!0)]),_:3})])}const Zn=le(sb,[["render",ub]]);Zn.install=e=>{e.component(Zn.name,Zn)};const fb={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(e,{emit:t}){return{clickEventName:i.computed(()=>e.clickOutside?"click":null),closeLoading:()=>t("update:modelValue",!1)}}},mb={class:"ev-loading-spinner"},gb={class:"ev-loading-spinner"};function pb(e,t,n,o,s,l){return n.fullscreen?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"body"},[n.modelValue?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:"ev-loading full-screen"},{[i.toHandlerKey(`${o.clickEventName}`)]:t[0]||(t[0]=(...a)=>o.closeLoading&&o.closeLoading(...a))}),[i.createElementVNode("div",mb,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock("i",{key:1,class:i.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:i.normalizeStyle(n.iconStyle)},null,6))])],16)):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.modelValue?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:"ev-loading"},{[i.toHandlerKey(`${o.clickEventName}`)]:t[1]||(t[1]=(...a)=>o.closeLoading&&o.closeLoading(...a))}),[i.createElementVNode("div",gb,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock("i",{key:1,class:i.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:i.normalizeStyle(n.iconStyle)},null,6))])],16)):i.createCommentVNode("",!0)],64))}const qn=le(fb,[["render",pb]]);qn.install=e=>{e.component(qn.name,qn)};const yb={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:e=>e>=0&&e<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(e){const t=i.computed(()=>({height:`${e.strokeWidth}px`})),n=i.computed(()=>{if(Array.isArray(e.color)){const o=[...e.color].sort((l,a)=>l.value-a.value);let s=o[0].color;if(!e.modelValue)return{width:`${e.modelValue}%`,"background-color":s};for(let l=0;l<o.length;l++){const a=l===0?0:o[l-1].value,r=o[l].value;if(e.modelValue>a&&e.modelValue<=r){s=o[l].color;break}}return{width:`${e.modelValue}%`,"background-color":s}}return{width:`${e.modelValue}%`,"background-color":e.color}});return{wrapperStyle:t,innerStyle:n}}},xb={class:"ev-progress"},bb={key:0,class:"ev-progress-inner-text"},Cb={key:0,class:"ev-progress-label"};function Sb(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",xb,[i.createElementVNode("div",{class:"ev-progress-wrapper",style:i.normalizeStyle(o.wrapperStyle)},[i.createElementVNode("div",{class:"ev-progress-inner",style:i.normalizeStyle(o.innerStyle)},[n.innerText?(i.openBlock(),i.createElementBlock("div",bb,i.toDisplayString(n.innerText),1)):i.createCommentVNode("",!0)],4)],4),e.$slots.default?(i.openBlock(),i.createElementBlock("div",Cb,[i.renderSlot(e.$slots,"default")])):i.createCommentVNode("",!0)])}const Kn=le(yb,[["render",Sb]]);Kn.install=e=>{e.component(Kn.name,Kn)};const wb={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:e=>{if(e.value){if(e.children!==void 0&&!Array.isArray(e.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(e.expand!==void 0&&typeof e.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(e.hidden!==void 0&&typeof e.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(e.disabled!==void 0&&typeof e.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(e.slotKey!==void 0&&typeof e.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e.expandable&&e.item.expand!==void 0&&typeof e.item.expand=="boolean"?e.item.expand:!0,o=i.ref(n),s=i.computed(()=>!!e.item.children&&!!e.item.children.length);return{isExpand:o,hasChild:s,clickMenu:a=>{s.value&&a.depth===e.depth?e.expandable&&(o.value=!o.value):t("click",a)}}}},kb={class:"text"};function Mb(e,t,n,o,s,l){return n.item.hidden?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[i.createElementVNode("div",{class:i.normalizeClass(["ev-menu-title",{expandable:o.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:t[0]||(t[0]=a=>o.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["front-icon",n.item.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",kb,[n.item.slotKey?i.renderSlot(e.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[i.createTextVNode(i.toDisplayString(n.item.text||n.item.value),1)]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&o.hasChild?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["list-expend-icon",{expend:n.expandable&&o.isExpand}])},[...t[1]||(t[1]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):i.createCommentVNode("",!0)],2),o.hasChild?i.withDirectives((i.openBlock(),i.createElementBlock("ol",{key:0,class:i.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.item.children,(a,r)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:o.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[i.vShow,o.isExpand]]):i.createCommentVNode("",!0)],2))}const ur=le(wb,[["render",Mb]]),Eb={name:"EvMenu",components:{MenuItem:ur},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.ref(e.items.filter(l=>e.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;t("update:modelValue",a.value),t("change",a,n.value),n.value=a}},component:ur}}},Ib={class:"ev-menu"};function vb(e,t,n,o,s,l){const a=i.resolveComponent("menu-item");return i.openBlock(),i.createElementBlock("ul",Ib,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(r,c)=>(i.openBlock(),i.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:o.component,onClick:o.clickMenu},i.createSlots({_:2},[i.renderList(e.$slots,(d,h)=>({name:h,fn:i.withCtx(u=>[i.renderSlot(e.$slots,h,i.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const Jn=le(Eb,[["render",vb]]);Jn.install=e=>{e.component(Jn.name,Jn)};const Tb={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(e,{emit:t}){const n=i.reactive(e.data),o=i.computed(()=>e.data.children&&e.data.children.length),s=i.computed(()=>{const m=e.expandIcon?e.expandIcon:"ev-icon-s-play",x=e.expandIcon?e.collapseIcon:"ev-icon-s-play";return e.data.expand?x:m}),l=i.computed(()=>e.data.children);function a(m,x){t("update-checked-info",{nodeKey:x,isChecked:m})}function r({nodeKey:m,isChecked:x}){t("update-checked-info",{nodeKey:m,isChecked:x})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,t("click-node",n.nodeKey))}function h(m){t("click-node",m)}function u(){n.disabled||t("dblclick-node",n.nodeKey)}function f(m){t("dblclick-node",m)}function g(m){t("show-context-menu",!0,m)}return{expandIconClasses:s,showExpandIcon:o,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:f,handleContextmenu:g,emitContextMenuFlag:(m,x)=>{t("show-context-menu",m,x)}}}},Bb={class:"ev-tree-children"},Db={class:"ev-tree-node"};function Ob(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-checkbox");return i.withDirectives((i.openBlock(),i.createElementBlock("ul",Bb,[i.createElementVNode("li",null,[i.createElementVNode("span",{class:i.normalizeClass([{expand:o.treeData.expand},"ev-tree-toggle"])},[o.showExpandIcon?(i.openBlock(),i.createBlock(a,{key:0,icon:o.expandIconClasses,onClick:o.handleExpand},null,8,["icon","onClick"])):i.createCommentVNode("",!0)],2),i.createElementVNode("div",Db,[n.useCheckbox?(i.openBlock(),i.createBlock(r,{key:0,modelValue:o.treeData.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>o.treeData.checked=c),indeterminate:o.treeData.indeterminate,disabled:o.treeData.disabled,onChange:t[1]||(t[1]=c=>o.handleCheck(o.treeData.checked,o.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):i.createCommentVNode("",!0),o.treeData.iconClass?(i.openBlock(),i.createBlock(a,{key:1,icon:o.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass([{"ev-tree-title-selected":o.treeData.selected,"ev-tree-title-disabled":o.treeData.disabled},"ev-tree-title"]),onContextmenu:t[2]||(t[2]=(...c)=>o.handleContextmenu&&o.handleContextmenu(...c)),onClick:t[3]||(t[3]=(...c)=>o.clickTreeContent&&o.clickTreeContent(...c)),onDblclick:t[4]||(t[4]=(...c)=>o.dblClickTreeContent&&o.dblClickTreeContent(...c))},i.toDisplayString(o.treeData.title),35)]),i.createVNode(i.TransitionGroup,{name:"fade"},{default:i.withCtx(()=>[o.treeData.expand?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(o.childrenInfo,(c,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:o.emitCheckedInfo,onClickNode:o.emitClickedContent,onDblclickNode:o.emitDblClickedContent,onShowContextMenu:o.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):i.createCommentVNode("",!0)]),_:1})])],512)),[[i.vShow,o.treeData.visible]])}const fr=le(Tb,[["render",Ob]]),Rb={name:"EvTree",components:{TreeNode:fr},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(e,{emit:t}){const n=i.ref(e.data);let o=[];const s=i.ref(null);let l=!1;const a=fr;function r(C){const S=o[C].parent;if(typeof S>"u")return;const w=o[C].node,k=o[S].node;if(!(w.checked===k.checked&&w.indeterminate===k.indeterminate)){if(w.checked)k.checked=k.children.every(B=>B.checked),k.indeterminate=!k.checked;else{const B=D=>D.checked||w.indeterminate;k.checked=!1,k.indeterminate=k.children.some(B)}r(S)}}function c(C,S={}){const w=Object.keys(S);for(let k=0;k<w.length;k++)C[w[k]]=S[w[k]];C.children&&C.children.forEach(k=>{c(k,S)})}function d(){let C=0;const S=[],w=[];function k(B,D){const O=B;O.nodeKey=C++,Object.hasOwnProperty.call(O,"selected")||(O.selected=!1),Object.hasOwnProperty.call(O,"visible")||(O.visible=!0),"value"in O&&w.includes(O.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),O.value+=O.nodeKey):"value"in O||(O.value=O.title+O.nodeKey),w.push(O.value),S[O.nodeKey]={node:O,nodeKey:O.nodeKey},typeof D<"u"&&(S[O.nodeKey].parent=D.nodeKey,S[D.nodeKey].children.push(O.nodeKey)),O.children&&(S[O.nodeKey].children=[],O.children.forEach(R=>k(R,O)))}return n.value.length&&k(n.value[0]),S}o=d();function h(){return o.filter(C=>C.node.checked).map(C=>C.node)}function u(){h().forEach(S=>{c(S,{checked:!0});const w=o[S.nodeKey].parent;if(!w&&w!==0)return;const k=o[w].node;typeof S.checked<"u"&&S.checked&&k.checked!==S.checked&&r(S.nodeKey)})}function f({nodeKey:C,isChecked:S}){const w=o[C].node;w.checked=S,w.indeterminate=!1,r(C),c(w,{checked:S,indeterminate:!1});const k=h();t("check",k),u()}function g(C){const S=o[C].node;for(let w=0;w<o.length;w++)o[w].node.nodeKey!==C&&(o[w].node.selected=!1);t("click-node",{title:S.title,value:S.value})}function p(C){const S=o[C].node;t("dblclick-node",{title:S.title,value:S.value})}const m=C=>{e.contextMenuItems.length&&l&&(s.value.show(C),l=!1)},x=(C,S)=>{l=C,m(S)},b=(C,S)=>C.toLowerCase().includes(S.toLowerCase()),y=C=>{var S;if(C.children){const w=!!((S=C.children.filter(k=>b(k.title,e.searchWord)))!=null&&S.length);C.children.forEach(k=>{y(k),k.visible=w&&b(k.title,e.searchWord)||!w})}};function M(C){C.children&&C.children.forEach(S=>{S.visible=!1,M(S)})}function I(C){if(!C&&C!==0)return;const S=o[C];S.node.visible=!0,S.parent!==void 0&&I(S.parent)}function E(C){o.forEach(w=>{const k=w.node;k.visible=!1}),o.filter(w=>b(w.node.title,C)).forEach(w=>{const k=w.node;k.visible=!0,e.searchIncludeChildren?y(k):M(k);const B=o[k.nodeKey].parent;I(B)})}const T=i.computed(()=>!n.value.length||n.value.every(C=>!C.visible));i.watch(()=>e.data,C=>{n.value=C,o=d()},{deep:!0});let V;return i.watch(()=>e.searchWord,C=>{V&&clearTimeout(V),V=setTimeout(()=>{C?E(C):o.forEach(S=>{const w=S.node;w.visible=!0})},200)}),i.onMounted(()=>{u();const C=h();C.length&&t("check",C)}),i.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:T,updateCheckedInfo:f,clickContent:g,dblClickContent:p,showContextMenu:m,getContextMenuFlag:x}}},Lb={class:"ev-tree-view"},Nb={key:0};function Vb(e,t,n,o,s,l){const a=i.resolveComponent("tree-node"),r=i.resolveComponent("ev-context-menu");return i.openBlock(),i.createElementBlock("div",Lb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.treeNodeData,(c,d)=>(i.openBlock(),i.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:o.component,onUpdateCheckedInfo:o.updateCheckedInfo,onClickNode:o.clickContent,onDblclickNode:o.dblClickContent,onShowContextMenu:o.getContextMenuFlag,onContextmenu:i.withModifiers(o.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),o.isShowEmptyText?(i.openBlock(),i.createElementBlock("div",Nb,i.toDisplayString(n.emptyText),1)):i.createCommentVNode("",!0),n.contextMenuItems.length?(i.openBlock(),i.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):i.createCommentVNode("",!0)])}const Qn=le(Rb,[["render",Vb]]);Qn.install=e=>{e.component(Qn.name,Qn)};const Pb={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:e=>{const t=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(e)&&(!t.test(e[0])||!t.test(e[1]))||!Array.isArray(e)&&!t.test(e)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:E=>{if(e.type==="range"){if(Array.isArray(E)){const T=E[0]>E[1]?"00:00":E[0],V=T.value>E[1]?"23:59":E[1];t("update:modelValue",[T,V])}}else t("update:modelValue",E)}}),o=i.computed(()=>{const E=["start time","end time"];return Array.isArray(e.placeholder)?[typeof e.placeholder[0]=="string"?e.placeholder[0]:E[0],typeof e.placeholder[1]=="string"?e.placeholder[1]:E[1]]:typeof e.placeholder=="string"?[e.placeholder,e.placeholder]:E}),s=i.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=i.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=E=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(E),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:E=>{t("focus",E)},blurInputTime:E=>{t("blur",E)},changeTime:E=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),t("change",E,n.value)},focusInputStartTime:E=>{t("focus",E)},blurInputStartTime:E=>{t("blur",E)},changeStartTime:E=>{r(),l.rangeStart=!1,t("change",E,n.value)},focusInputEndTime:E=>{t("focus",E)},blurInputEndTime:E=>{t("blur",E)},changeEndTime:E=>{c(),l.rangeEnd=!1,t("change",E,n.value)},placeholders:o}}},_b={class:"ev-time-picker"},Ab={key:0,class:"ev-time-picker-range"},zb=["disabled","readonly","placeholder"],Fb=["disabled","readonly","placeholder"],Hb={key:1,class:"ev-time-picker-single"},Wb=["disabled","readonly","placeholder"];function $b(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon");return i.openBlock(),i.createElementBlock("div",_b,[n.type==="range"?(i.openBlock(),i.createElementBlock("div",Ab,[i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>o.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:o.placeholders[0],onFocus:t[1]||(t[1]=(...r)=>o.focusInputStartTime&&o.focusInputStartTime(...r)),onBlur:t[2]||(t[2]=(...r)=>o.blurInputStartTime&&o.blurInputStartTime(...r)),onChange:t[3]||(t[3]=(...r)=>o.changeStartTime&&o.changeStartTime(...r))},null,40,zb),[[i.vModelText,o.time[0]]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearStartTime},null,8,["onClick"])):i.createCommentVNode("",!0)],2),t[12]||(t[12]=i.createElementVNode("p",{class:"tilde"},"~",-1)),i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>o.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:o.placeholders[1],onFocus:t[5]||(t[5]=(...r)=>o.focusInputEndTime&&o.focusInputEndTime(...r)),onBlur:t[6]||(t[6]=(...r)=>o.blurInputEndTime&&o.blurInputEndTime(...r)),onChange:t[7]||(t[7]=(...r)=>o.changeEndTime&&o.changeEndTime(...r))},null,40,Fb),[[i.vModelText,o.time[1]]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearEndTime},null,8,["onClick"])):i.createCommentVNode("",!0)],2)])):(i.openBlock(),i.createElementBlock("div",Hb,[i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>o.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:t[9]||(t[9]=(...r)=>o.focusInputTime&&o.focusInputTime(...r)),onBlur:t[10]||(t[10]=(...r)=>o.blurInputTime&&o.blurInputTime(...r)),onChange:t[11]||(t[11]=(...r)=>o.changeTime&&o.changeTime(...r))},null,40,Wb),[[i.vModelText,o.time]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearContents},null,8,["onClick"])):i.createCommentVNode("",!0)],2)]))])}const eo=le(Pb,[["render",$b]]);eo.install=e=>{e.component(eo.name,eo)};const Xb={name:"EvGridToolbar"},Ub={class:"gridToolbar"};function Yb(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",Ub,[i.renderSlot(e.$slots,"toolbarWrapper")])}const jb=le(Xb,[["render",Yb]]),Gb={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)}},emits:{"update:modelValue":null},setup(e,{emit:t}){const n=i.ref(e.modelValue),o=s=>{n.value=s>0?s:1,t("update:modelValue",n.value)};return i.watch(()=>e.modelValue,s=>{n.value=s}),{currentValue:n,changePage:o}}},Zb={class:"grid-pagination"};function qb(e,t,n,o,s,l){const a=i.resolveComponent("ev-pagination");return i.openBlock(),i.createElementBlock("div",Zb,[i.createVNode(a,{modelValue:o.currentValue,"onUpdate:modelValue":t[0]||(t[0]=r=>o.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:o.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const mr=le(Gb,[["render",qb],["__scopeId","data-v-2e265290"]]);var Kb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bs=Math.ceil,Ze=Math.floor,He="[BigNumber Error] ",gr=He+"Number primitive has more than 15 significant digits: ",lt=1e14,ce=14,Ds=9007199254740991,Os=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Nt=1e7,De=1e9;function pr(e){var t,n,o,s=y.prototype={constructor:y,toString:null,valueOf:null},l=new y(1),a=20,r=4,c=-7,d=21,h=-1e7,u=1e7,f=!1,g=1,p=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function y(C,S){var w,k,B,D,O,R,v,N,L=this;if(!(L instanceof y))return new y(C,S);if(S==null){if(C&&C._isBigNumber===!0){L.s=C.s,!C.c||C.e>u?L.c=L.e=null:C.e<h?L.c=[L.e=0]:(L.e=C.e,L.c=C.c.slice());return}if((R=typeof C=="number")&&C*0==0){if(L.s=1/C<0?(C=-C,-1):1,C===~~C){for(D=0,O=C;O>=10;O/=10,D++);D>u?L.c=L.e=null:(L.e=D,L.c=[C]);return}N=String(C)}else{if(!Kb.test(N=String(C)))return o(L,N,R);L.s=N.charCodeAt(0)==45?(N=N.slice(1),-1):1}(D=N.indexOf("."))>-1&&(N=N.replace(".","")),(O=N.search(/e/i))>0?(D<0&&(D=O),D+=+N.slice(O+1),N=N.substring(0,O)):D<0&&(D=N.length)}else{if(be(S,2,x.length,"Base"),S==10&&b)return L=new y(C),T(L,a+L.e+1,r);if(N=String(C),R=typeof C=="number"){if(C*0!=0)return o(L,N,R,S);if(L.s=1/C<0?(N=N.slice(1),-1):1,y.DEBUG&&N.replace(/^0\.0*|\./,"").length>15)throw Error(gr+C)}else L.s=N.charCodeAt(0)===45?(N=N.slice(1),-1):1;for(w=x.slice(0,S),D=O=0,v=N.length;O<v;O++)if(w.indexOf(k=N.charAt(O))<0){if(k=="."){if(O>D){D=v;continue}}else if(!B&&(N==N.toUpperCase()&&(N=N.toLowerCase())||N==N.toLowerCase()&&(N=N.toUpperCase()))){B=!0,O=-1,D=0;continue}return o(L,String(C),R,S)}R=!1,N=n(N,S,10,L.s),(D=N.indexOf("."))>-1?N=N.replace(".",""):D=N.length}for(O=0;N.charCodeAt(O)===48;O++);for(v=N.length;N.charCodeAt(--v)===48;);if(N=N.slice(O,++v)){if(v-=O,R&&y.DEBUG&&v>15&&(C>Ds||C!==Ze(C)))throw Error(gr+L.s*C);if((D=D-O-1)>u)L.c=L.e=null;else if(D<h)L.c=[L.e=0];else{if(L.e=D,L.c=[],O=(D+1)%ce,D<0&&(O+=ce),O<v){for(O&&L.c.push(+N.slice(0,O)),v-=ce;O<v;)L.c.push(+N.slice(O,O+=ce));O=ce-(N=N.slice(O)).length}else O-=v;for(;O--;N+="0");L.c.push(+N)}}else L.c=[L.e=0]}y.clone=pr,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(C){var S,w;if(C!=null)if(typeof C=="object"){if(C.hasOwnProperty(S="DECIMAL_PLACES")&&(w=C[S],be(w,0,De,S),a=w),C.hasOwnProperty(S="ROUNDING_MODE")&&(w=C[S],be(w,0,8,S),r=w),C.hasOwnProperty(S="EXPONENTIAL_AT")&&(w=C[S],w&&w.pop?(be(w[0],-De,0,S),be(w[1],0,De,S),c=w[0],d=w[1]):(be(w,-De,De,S),c=-(d=w<0?-w:w))),C.hasOwnProperty(S="RANGE"))if(w=C[S],w&&w.pop)be(w[0],-De,-1,S),be(w[1],1,De,S),h=w[0],u=w[1];else if(be(w,-De,De,S),w)h=-(u=w<0?-w:w);else throw Error(He+S+" cannot be zero: "+w);if(C.hasOwnProperty(S="CRYPTO"))if(w=C[S],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=w;else throw f=!w,Error(He+"crypto unavailable");else f=w;else throw Error(He+S+" not true or false: "+w);if(C.hasOwnProperty(S="MODULO_MODE")&&(w=C[S],be(w,0,9,S),g=w),C.hasOwnProperty(S="POW_PRECISION")&&(w=C[S],be(w,0,De,S),p=w),C.hasOwnProperty(S="FORMAT"))if(w=C[S],typeof w=="object")m=w;else throw Error(He+S+" not an object: "+w);if(C.hasOwnProperty(S="ALPHABET"))if(w=C[S],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))b=w.slice(0,10)=="0123456789",x=w;else throw Error(He+S+" invalid: "+w)}else throw Error(He+"Object expected: "+C);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:f,MODULO_MODE:g,POW_PRECISION:p,FORMAT:m,ALPHABET:x}},y.isBigNumber=function(C){if(!C||C._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var S,w,k=C.c,B=C.e,D=C.s;e:if({}.toString.call(k)=="[object Array]"){if((D===1||D===-1)&&B>=-De&&B<=De&&B===Ze(B)){if(k[0]===0){if(B===0&&k.length===1)return!0;break e}if(S=(B+1)%ce,S<1&&(S+=ce),String(k[0]).length==S){for(S=0;S<k.length;S++)if(w=k[S],w<0||w>=lt||w!==Ze(w))break e;if(w!==0)return!0}}}else if(k===null&&B===null&&(D===null||D===1||D===-1))return!0;throw Error(He+"Invalid BigNumber: "+C)},y.maximum=y.max=function(){return I(arguments,-1)},y.minimum=y.min=function(){return I(arguments,1)},y.random=function(){var C=9007199254740992,S=Math.random()*C&2097151?function(){return Ze(Math.random()*C)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var k,B,D,O,R,v=0,N=[],L=new y(l);if(w==null?w=a:be(w,0,De),O=Bs(w/ce),f)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(O*=2));v<O;)R=k[v]*131072+(k[v+1]>>>11),R>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),k[v]=B[0],k[v+1]=B[1]):(N.push(R%1e14),v+=2);v=O/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(O*=7);v<O;)R=(k[v]&31)*281474976710656+k[v+1]*1099511627776+k[v+2]*4294967296+k[v+3]*16777216+(k[v+4]<<16)+(k[v+5]<<8)+k[v+6],R>=9e15?crypto.randomBytes(7).copy(k,v):(N.push(R%1e14),v+=7);v=O/7}else throw f=!1,Error(He+"crypto unavailable");if(!f)for(;v<O;)R=S(),R<9e15&&(N[v++]=R%1e14);for(O=N[--v],w%=ce,O&&w&&(R=Os[ce-w],N[v]=Ze(O/R)*R);N[v]===0;N.pop(),v--);if(v<0)N=[D=0];else{for(D=-1;N[0]===0;N.splice(0,1),D-=ce);for(v=1,R=N[0];R>=10;R/=10,v++);v<ce&&(D-=ce-v)}return L.e=D,L.c=N,L}}(),y.sum=function(){for(var C=1,S=arguments,w=new y(S[0]);C<S.length;)w=w.plus(S[C++]);return w},n=function(){var C="0123456789";function S(w,k,B,D){for(var O,R=[0],v,N=0,L=w.length;N<L;){for(v=R.length;v--;R[v]*=k);for(R[0]+=D.indexOf(w.charAt(N++)),O=0;O<R.length;O++)R[O]>B-1&&(R[O+1]==null&&(R[O+1]=0),R[O+1]+=R[O]/B|0,R[O]%=B)}return R.reverse()}return function(w,k,B,D,O){var R,v,N,L,P,_,A,z,$=w.indexOf("."),U=a,H=r;for($>=0&&(L=p,p=0,w=w.replace(".",""),z=new y(k),_=z.pow(w.length-$),p=L,z.c=S(kt(Ke(_.c),_.e,"0"),10,B,C),z.e=z.c.length),A=S(w,k,B,O?(R=x,C):(R=C,x)),N=L=A.length;A[--L]==0;A.pop());if(!A[0])return R.charAt(0);if($<0?--N:(_.c=A,_.e=N,_.s=D,_=t(_,z,U,H,B),A=_.c,P=_.r,N=_.e),v=N+U+1,$=A[v],L=B/2,P=P||v<0||A[v+1]!=null,P=H<4?($!=null||P)&&(H==0||H==(_.s<0?3:2)):$>L||$==L&&(H==4||P||H==6&&A[v-1]&1||H==(_.s<0?8:7)),v<1||!A[0])w=P?kt(R.charAt(1),-U,R.charAt(0)):R.charAt(0);else{if(A.length=v,P)for(--B;++A[--v]>B;)A[v]=0,v||(++N,A=[1].concat(A));for(L=A.length;!A[--L];);for($=0,w="";$<=L;w+=R.charAt(A[$++]));w=kt(w,N,R.charAt(0))}return w}}(),t=function(){function C(k,B,D){var O,R,v,N,L=0,P=k.length,_=B%Nt,A=B/Nt|0;for(k=k.slice();P--;)v=k[P]%Nt,N=k[P]/Nt|0,O=A*v+N*_,R=_*v+O%Nt*Nt+L,L=(R/D|0)+(O/Nt|0)+A*N,k[P]=R%D;return L&&(k=[L].concat(k)),k}function S(k,B,D,O){var R,v;if(D!=O)v=D>O?1:-1;else for(R=v=0;R<D;R++)if(k[R]!=B[R]){v=k[R]>B[R]?1:-1;break}return v}function w(k,B,D,O){for(var R=0;D--;)k[D]-=R,R=k[D]<B[D]?1:0,k[D]=R*O+k[D]-B[D];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,B,D,O,R){var v,N,L,P,_,A,z,$,U,H,X,j,K,q,Q,J,te,G=k.s==B.s?1:-1,oe=k.c,Z=B.c;if(!oe||!oe[0]||!Z||!Z[0])return new y(!k.s||!B.s||(oe?Z&&oe[0]==Z[0]:!Z)?NaN:oe&&oe[0]==0||!Z?G*0:G/0);for($=new y(G),U=$.c=[],N=k.e-B.e,G=D+N+1,R||(R=lt,N=qe(k.e/ce)-qe(B.e/ce),G=G/ce|0),L=0;Z[L]==(oe[L]||0);L++);if(Z[L]>(oe[L]||0)&&N--,G<0)U.push(1),P=!0;else{for(q=oe.length,J=Z.length,L=0,G+=2,_=Ze(R/(Z[0]+1)),_>1&&(Z=C(Z,_,R),oe=C(oe,_,R),J=Z.length,q=oe.length),K=J,H=oe.slice(0,J),X=H.length;X<J;H[X++]=0);te=Z.slice(),te=[0].concat(te),Q=Z[0],Z[1]>=R/2&&Q++;do{if(_=0,v=S(Z,H,J,X),v<0){if(j=H[0],J!=X&&(j=j*R+(H[1]||0)),_=Ze(j/Q),_>1)for(_>=R&&(_=R-1),A=C(Z,_,R),z=A.length,X=H.length;S(A,H,z,X)==1;)_--,w(A,J<z?te:Z,z,R),z=A.length,v=1;else _==0&&(v=_=1),A=Z.slice(),z=A.length;if(z<X&&(A=[0].concat(A)),w(H,A,X,R),X=H.length,v==-1)for(;S(Z,H,J,X)<1;)_++,w(H,J<X?te:Z,X,R),X=H.length}else v===0&&(_++,H=[0]);U[L++]=_,H[0]?H[X++]=oe[K]||0:(H=[oe[K]],X=1)}while((K++<q||H[0]!=null)&&G--);P=H[0]!=null,U[0]||U.splice(0,1)}if(R==lt){for(L=1,G=U[0];G>=10;G/=10,L++);T($,D+($.e=L+N*ce-1)+1,O,P)}else $.e=N,$.r=+P;return $}}();function M(C,S,w,k){var B,D,O,R,v;if(w==null?w=r:be(w,0,8),!C.c)return C.toString();if(B=C.c[0],O=C.e,S==null)v=Ke(C.c),v=k==1||k==2&&(O<=c||O>=d)?oi(v,O):kt(v,O,"0");else if(C=T(new y(C),S,w),D=C.e,v=Ke(C.c),R=v.length,k==1||k==2&&(S<=D||D<=c)){for(;R<S;v+="0",R++);v=oi(v,D)}else if(S-=O+(k===2&&D>O),v=kt(v,D,"0"),D+1>R){if(--S>0)for(v+=".";S--;v+="0");}else if(S+=D-R,S>0)for(D+1==R&&(v+=".");S--;v+="0");return C.s<0&&B?"-"+v:v}function I(C,S){for(var w,k,B=1,D=new y(C[0]);B<C.length;B++)k=new y(C[B]),(!k.s||(w=jt(D,k))===S||w===0&&D.s===S)&&(D=k);return D}function E(C,S,w){for(var k=1,B=S.length;!S[--B];S.pop());for(B=S[0];B>=10;B/=10,k++);return(w=k+w*ce-1)>u?C.c=C.e=null:w<h?C.c=[C.e=0]:(C.e=w,C.c=S),C}o=function(){var C=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,w=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(D,O,R,v){var N,L=R?O:O.replace(B,"");if(k.test(L))D.s=isNaN(L)?null:L<0?-1:1;else{if(!R&&(L=L.replace(C,function(P,_,A){return N=(A=A.toLowerCase())=="x"?16:A=="b"?2:8,!v||v==N?_:P}),v&&(N=v,L=L.replace(S,"$1").replace(w,"0.$1")),O!=L))return new y(L,N);if(y.DEBUG)throw Error(He+"Not a"+(v?" base "+v:"")+" number: "+O);D.s=null}D.c=D.e=null}}();function T(C,S,w,k){var B,D,O,R,v,N,L,P=C.c,_=Os;if(P){e:{for(B=1,R=P[0];R>=10;R/=10,B++);if(D=S-B,D<0)D+=ce,O=S,v=P[N=0],L=Ze(v/_[B-O-1]%10);else if(N=Bs((D+1)/ce),N>=P.length)if(k){for(;P.length<=N;P.push(0));v=L=0,B=1,D%=ce,O=D-ce+1}else break e;else{for(v=R=P[N],B=1;R>=10;R/=10,B++);D%=ce,O=D-ce+B,L=O<0?0:Ze(v/_[B-O-1]%10)}if(k=k||S<0||P[N+1]!=null||(O<0?v:v%_[B-O-1]),k=w<4?(L||k)&&(w==0||w==(C.s<0?3:2)):L>5||L==5&&(w==4||k||w==6&&(D>0?O>0?v/_[B-O]:0:P[N-1])%10&1||w==(C.s<0?8:7)),S<1||!P[0])return P.length=0,k?(S-=C.e+1,P[0]=_[(ce-S%ce)%ce],C.e=-S||0):P[0]=C.e=0,C;if(D==0?(P.length=N,R=1,N--):(P.length=N+1,R=_[ce-D],P[N]=O>0?Ze(v/_[B-O]%_[O])*R:0),k)for(;;)if(N==0){for(D=1,O=P[0];O>=10;O/=10,D++);for(O=P[0]+=R,R=1;O>=10;O/=10,R++);D!=R&&(C.e++,P[0]==lt&&(P[0]=1));break}else{if(P[N]+=R,P[N]!=lt)break;P[N--]=0,R=1}for(D=P.length;P[--D]===0;P.pop());}C.e>u?C.c=C.e=null:C.e<h&&(C.c=[C.e=0])}return C}function V(C){var S,w=C.e;return w===null?C.toString():(S=Ke(C.c),S=w<=c||w>=d?oi(S,w):kt(S,w,"0"),C.s<0?"-"+S:S)}return s.absoluteValue=s.abs=function(){var C=new y(this);return C.s<0&&(C.s=1),C},s.comparedTo=function(C,S){return jt(this,new y(C,S))},s.decimalPlaces=s.dp=function(C,S){var w,k,B,D=this;if(C!=null)return be(C,0,De),S==null?S=r:be(S,0,8),T(new y(D),C+D.e+1,S);if(!(w=D.c))return null;if(k=((B=w.length-1)-qe(this.e/ce))*ce,B=w[B])for(;B%10==0;B/=10,k--);return k<0&&(k=0),k},s.dividedBy=s.div=function(C,S){return t(this,new y(C,S),a,r)},s.dividedToIntegerBy=s.idiv=function(C,S){return t(this,new y(C,S),0,1)},s.exponentiatedBy=s.pow=function(C,S){var w,k,B,D,O,R,v,N,L,P=this;if(C=new y(C),C.c&&!C.isInteger())throw Error(He+"Exponent not an integer: "+V(C));if(S!=null&&(S=new y(S)),R=C.e>14,!P.c||!P.c[0]||P.c[0]==1&&!P.e&&P.c.length==1||!C.c||!C.c[0])return L=new y(Math.pow(+V(P),R?C.s*(2-ni(C)):+V(C))),S?L.mod(S):L;if(v=C.s<0,S){if(S.c?!S.c[0]:!S.s)return new y(NaN);k=!v&&P.isInteger()&&S.isInteger(),k&&(P=P.mod(S))}else{if(C.e>9&&(P.e>0||P.e<-1||(P.e==0?P.c[0]>1||R&&P.c[1]>=24e7:P.c[0]<8e13||R&&P.c[0]<=9999975e7)))return D=P.s<0&&ni(C)?-0:0,P.e>-1&&(D=1/D),new y(v?1/D:D);p&&(D=Bs(p/ce+2))}for(R?(w=new y(.5),v&&(C.s=1),N=ni(C)):(B=Math.abs(+V(C)),N=B%2),L=new y(l);;){if(N){if(L=L.times(P),!L.c)break;D?L.c.length>D&&(L.c.length=D):k&&(L=L.mod(S))}if(B){if(B=Ze(B/2),B===0)break;N=B%2}else if(C=C.times(w),T(C,C.e+1,1),C.e>14)N=ni(C);else{if(B=+V(C),B===0)break;N=B%2}P=P.times(P),D?P.c&&P.c.length>D&&(P.c.length=D):k&&(P=P.mod(S))}return k?L:(v&&(L=l.div(L)),S?L.mod(S):D?T(L,p,r,O):L)},s.integerValue=function(C){var S=new y(this);return C==null?C=r:be(C,0,8),T(S,S.e+1,C)},s.isEqualTo=s.eq=function(C,S){return jt(this,new y(C,S))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(C,S){return jt(this,new y(C,S))>0},s.isGreaterThanOrEqualTo=s.gte=function(C,S){return(S=jt(this,new y(C,S)))===1||S===0},s.isInteger=function(){return!!this.c&&qe(this.e/ce)>this.c.length-2},s.isLessThan=s.lt=function(C,S){return jt(this,new y(C,S))<0},s.isLessThanOrEqualTo=s.lte=function(C,S){return(S=jt(this,new y(C,S)))===-1||S===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(C,S){var w,k,B,D,O=this,R=O.s;if(C=new y(C,S),S=C.s,!R||!S)return new y(NaN);if(R!=S)return C.s=-S,O.plus(C);var v=O.e/ce,N=C.e/ce,L=O.c,P=C.c;if(!v||!N){if(!L||!P)return L?(C.s=-S,C):new y(P?O:NaN);if(!L[0]||!P[0])return P[0]?(C.s=-S,C):new y(L[0]?O:r==3?-0:0)}if(v=qe(v),N=qe(N),L=L.slice(),R=v-N){for((D=R<0)?(R=-R,B=L):(N=v,B=P),B.reverse(),S=R;S--;B.push(0));B.reverse()}else for(k=(D=(R=L.length)<(S=P.length))?R:S,R=S=0;S<k;S++)if(L[S]!=P[S]){D=L[S]<P[S];break}if(D&&(B=L,L=P,P=B,C.s=-C.s),S=(k=P.length)-(w=L.length),S>0)for(;S--;L[w++]=0);for(S=lt-1;k>R;){if(L[--k]<P[k]){for(w=k;w&&!L[--w];L[w]=S);--L[w],L[k]+=lt}L[k]-=P[k]}for(;L[0]==0;L.splice(0,1),--N);return L[0]?E(C,L,N):(C.s=r==3?-1:1,C.c=[C.e=0],C)},s.modulo=s.mod=function(C,S){var w,k,B=this;return C=new y(C,S),!B.c||!C.s||C.c&&!C.c[0]?new y(NaN):!C.c||B.c&&!B.c[0]?new y(B):(g==9?(k=C.s,C.s=1,w=t(B,C,0,3),C.s=k,w.s*=k):w=t(B,C,0,g),C=B.minus(w.times(C)),!C.c[0]&&g==1&&(C.s=B.s),C)},s.multipliedBy=s.times=function(C,S){var w,k,B,D,O,R,v,N,L,P,_,A,z,$,U,H=this,X=H.c,j=(C=new y(C,S)).c;if(!X||!j||!X[0]||!j[0])return!H.s||!C.s||X&&!X[0]&&!j||j&&!j[0]&&!X?C.c=C.e=C.s=null:(C.s*=H.s,!X||!j?C.c=C.e=null:(C.c=[0],C.e=0)),C;for(k=qe(H.e/ce)+qe(C.e/ce),C.s*=H.s,v=X.length,P=j.length,v<P&&(z=X,X=j,j=z,B=v,v=P,P=B),B=v+P,z=[];B--;z.push(0));for($=lt,U=Nt,B=P;--B>=0;){for(w=0,_=j[B]%U,A=j[B]/U|0,O=v,D=B+O;D>B;)N=X[--O]%U,L=X[O]/U|0,R=A*N+L*_,N=_*N+R%U*U+z[D]+w,w=(N/$|0)+(R/U|0)+A*L,z[D--]=N%$;z[D]=w}return w?++k:z.splice(0,1),E(C,z,k)},s.negated=function(){var C=new y(this);return C.s=-C.s||null,C},s.plus=function(C,S){var w,k=this,B=k.s;if(C=new y(C,S),S=C.s,!B||!S)return new y(NaN);if(B!=S)return C.s=-S,k.minus(C);var D=k.e/ce,O=C.e/ce,R=k.c,v=C.c;if(!D||!O){if(!R||!v)return new y(B/0);if(!R[0]||!v[0])return v[0]?C:new y(R[0]?k:B*0)}if(D=qe(D),O=qe(O),R=R.slice(),B=D-O){for(B>0?(O=D,w=v):(B=-B,w=R),w.reverse();B--;w.push(0));w.reverse()}for(B=R.length,S=v.length,B-S<0&&(w=v,v=R,R=w,S=B),B=0;S;)B=(R[--S]=R[S]+v[S]+B)/lt|0,R[S]=lt===R[S]?0:R[S]%lt;return B&&(R=[B].concat(R),++O),E(C,R,O)},s.precision=s.sd=function(C,S){var w,k,B,D=this;if(C!=null&&C!==!!C)return be(C,1,De),S==null?S=r:be(S,0,8),T(new y(D),C,S);if(!(w=D.c))return null;if(B=w.length-1,k=B*ce+1,B=w[B]){for(;B%10==0;B/=10,k--);for(B=w[0];B>=10;B/=10,k++);}return C&&D.e+1>k&&(k=D.e+1),k},s.shiftedBy=function(C){return be(C,-Ds,Ds),this.times("1e"+C)},s.squareRoot=s.sqrt=function(){var C,S,w,k,B,D=this,O=D.c,R=D.s,v=D.e,N=a+4,L=new y("0.5");if(R!==1||!O||!O[0])return new y(!R||R<0&&(!O||O[0])?NaN:O?D:1/0);if(R=Math.sqrt(+V(D)),R==0||R==1/0?(S=Ke(O),(S.length+v)%2==0&&(S+="0"),R=Math.sqrt(+S),v=qe((v+1)/2)-(v<0||v%2),R==1/0?S="5e"+v:(S=R.toExponential(),S=S.slice(0,S.indexOf("e")+1)+v),w=new y(S)):w=new y(R+""),w.c[0]){for(v=w.e,R=v+N,R<3&&(R=0);;)if(B=w,w=L.times(B.plus(t(D,B,N,1))),Ke(B.c).slice(0,R)===(S=Ke(w.c)).slice(0,R))if(w.e<v&&--R,S=S.slice(R-3,R+1),S=="9999"||!k&&S=="4999"){if(!k&&(T(B,B.e+a+2,0),B.times(B).eq(D))){w=B;break}N+=4,R+=4,k=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(T(w,w.e+a+2,1),C=!w.times(w).eq(D));break}}return T(w,w.e+a+1,r,C)},s.toExponential=function(C,S){return C!=null&&(be(C,0,De),C++),M(this,C,S,1)},s.toFixed=function(C,S){return C!=null&&(be(C,0,De),C=C+this.e+1),M(this,C,S)},s.toFormat=function(C,S,w){var k,B=this;if(w==null)C!=null&&S&&typeof S=="object"?(w=S,S=null):C&&typeof C=="object"?(w=C,C=S=null):w=m;else if(typeof w!="object")throw Error(He+"Argument not an object: "+w);if(k=B.toFixed(C,S),B.c){var D,O=k.split("."),R=+w.groupSize,v=+w.secondaryGroupSize,N=w.groupSeparator||"",L=O[0],P=O[1],_=B.s<0,A=_?L.slice(1):L,z=A.length;if(v&&(D=R,R=v,v=D,z-=D),R>0&&z>0){for(D=z%R||R,L=A.substr(0,D);D<z;D+=R)L+=N+A.substr(D,R);v>0&&(L+=N+A.slice(D)),_&&(L="-"+L)}k=P?L+(w.decimalSeparator||"")+((v=+w.fractionGroupSize)?P.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):P):L}return(w.prefix||"")+k+(w.suffix||"")},s.toFraction=function(C){var S,w,k,B,D,O,R,v,N,L,P,_,A=this,z=A.c;if(C!=null&&(R=new y(C),!R.isInteger()&&(R.c||R.s!==1)||R.lt(l)))throw Error(He+"Argument "+(R.isInteger()?"out of range: ":"not an integer: ")+V(R));if(!z)return new y(A);for(S=new y(l),N=w=new y(l),k=v=new y(l),_=Ke(z),D=S.e=_.length-A.e-1,S.c[0]=Os[(O=D%ce)<0?ce+O:O],C=!C||R.comparedTo(S)>0?D>0?S:N:R,O=u,u=1/0,R=new y(_),v.c[0]=0;L=t(R,S,0,1),B=w.plus(L.times(k)),B.comparedTo(C)!=1;)w=k,k=B,N=v.plus(L.times(B=N)),v=B,S=R.minus(L.times(B=S)),R=B;return B=t(C.minus(w),k,0,1),v=v.plus(B.times(N)),w=w.plus(B.times(k)),v.s=N.s=A.s,D=D*2,P=t(N,k,D,r).minus(A).abs().comparedTo(t(v,w,D,r).minus(A).abs())<1?[N,k]:[v,w],u=O,P},s.toNumber=function(){return+V(this)},s.toPrecision=function(C,S){return C!=null&&be(C,1,De),M(this,C,S,2)},s.toString=function(C){var S,w=this,k=w.s,B=w.e;return B===null?k?(S="Infinity",k<0&&(S="-"+S)):S="NaN":(C==null?S=B<=c||B>=d?oi(Ke(w.c),B):kt(Ke(w.c),B,"0"):C===10&&b?(w=T(new y(w),a+B+1,r),S=kt(Ke(w.c),w.e,"0")):(be(C,2,x.length,"Base"),S=n(kt(Ke(w.c),B,"0"),10,C,k,!0)),k<0&&w.c[0]&&(S="-"+S)),S},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&y.set(e),y}function qe(e){var t=e|0;return e>0||e===t?t:t-1}function Ke(e){for(var t,n,o=1,s=e.length,l=e[0]+"";o<s;){for(t=e[o++]+"",n=ce-t.length;n--;t="0"+t);l+=t}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function jt(e,t){var n,o,s=e.c,l=t.c,a=e.s,r=t.s,c=e.e,d=t.e;if(!a||!r)return null;if(n=s&&!s[0],o=l&&!l[0],n||o)return n?o?0:-r:a;if(a!=r)return a;if(n=a<0,o=c==d,!s||!l)return o?0:!s^n?1:-1;if(!o)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function be(e,t,n,o){if(e<t||e>n||e!==Ze(e))throw Error(He+(o||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ni(e){var t=e.c.length-1;return qe(e.e/ce)==t&&e.c[t]%2!=0}function oi(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function kt(e,t,n){var o,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(o=e.length,++t>o){for(s=n,t-=o;--t;s+=n);e+=s}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var yr=pr();function Gt(e){return new yr(e)}function Rs(e,t){return Gt(e).plus(Gt(t)).toNumber()}function xr(e,t){return Gt(e).minus(Gt(t)).toNumber()}function Jb(e,t){return Gt(e).dividedBy(Gt(t)).toNumber()}function br(e,t){return Gt(e).decimalPlaces(t,yr.ROUND_DOWN).toNumber()}const Qb={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(e){const t={max:20,default:3},n=i.ref(),o=2,s=i.computed(()=>e.stores),l=i.computed(()=>e.orderedColumns),a=i.computed(()=>e.useCheckbox),r=i.computed(()=>e.styleOption),c=g=>g==null||g<0?t.default:g>t.max?t.max:g,d=(g,p)=>{if(typeof p=="string"&&p.length===0)return p;const{type:m,decimal:x}=g;let b=p;return m==="number"?(b=$t(p),b=b===!1?p:b):m==="float"&&(b=b.toFixed(c(x??t.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),b},h=g=>l.value.findIndex(p=>p.field===g),u=g=>{const{type:p,field:m,summaryType:x,summaryDecimal:b,summaryOnlyTopParent:y}=g;let M="";const I=h(m);if(I>=0){if(x==="count")return s.value.store.length;if(p==="number"||p==="float"){let E=[];switch(e.isTree?E=s.value.store.reduce((T,V)=>{var C,S;return y?V.parent||T.push((C=V.data)==null?void 0:C[m]):T.push((S=V.data)==null?void 0:S[m]),T},[]):E=s.value.store.map(T=>T[o][I]),x){case"sum":{const T=E.reduce((V,C)=>{const S=Number(C);return Number.isNaN(S)?V:Rs(V,S)},0);M=T&&br(T,c(b??t.default));break}case"average":{const T=E.reduce((V,C)=>{const S=Number(C);return Number.isNaN(S)?V:Rs(V,S)},0);M=T&&br(Jb(T,E.length),c(b??t.default));break}case"max":{const T=E.filter(V=>V!=null);M=T.length?Math.max(...T):"";break}case"min":{const T=E.filter(V=>V!=null);M=T.length?Math.min(...T):"";break}}M=d(g,M)}}return M},f=g=>{const p=g.summaryRenderer,m=g.summaryData?g.summaryData:[],x=[g.field,...m];let b=p;return x.forEach((y,M)=>{const I=h(y);if(I>=0){const E=u(s.value.orderedColumns[I]);b=b.replace(`{${M}}`,E)}}),b};return i.watch(()=>e.scrollLeft,g=>{i.nextTick(()=>{n.value.scrollLeft=g})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:f}}},e0={class:"column-list"},t0=["title"],n0=["title"];function o0(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{ref:"summaryRef",class:i.normalizeClass({"grid-summary":!0,"non-border":o.styleInfo.borderStyle==="none"})},[i.createElementVNode("ul",e0,[o.showCheckbox?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"non-border":!!o.styleInfo.borderStyle}),style:i.normalizeStyle({width:`${o.styleInfo.minWidth}px`,"line-height":`${o.styleInfo.rowHeight}px`})},[i.createElementVNode("span",{style:i.normalizeStyle({height:`${o.styleInfo.rowHeight}px`})},null,4)],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.columns,(a,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`summary_${r}`},[a.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"non-border":!!o.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:i.normalizeStyle({width:`${a.width}px`,"min-width":`${o.styleInfo.minWidth}px`,"line-height":`${o.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(i.openBlock(),i.createElementBlock("span",{key:0,style:i.normalizeStyle({width:"100%",height:`${o.styleInfo.rowHeight}px`})},[a.summaryRenderer?(i.openBlock(),i.createElementBlock("div",{key:0,title:o.getSummaryRenderer(a)},i.toDisplayString(o.getSummaryRenderer(a)),9,t0)):(i.openBlock(),i.createElementBlock("div",{key:1,title:o.getSummaryValue(a)},i.toDisplayString(o.getSummaryValue(a)),9,n0))],4)):(i.openBlock(),i.createElementBlock("span",{key:1,style:i.normalizeStyle({height:`${o.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Cr=le(Qb,[["render",o0],["__scopeId","data-v-4b9bef37"]]),i0={name:"EVGridColumnSetting",directives:{clickoutside:Ro},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(e,{emit:t}){const n=i.computed({get:()=>e.isShow,set:k=>t("update:isShow",k)}),o=i.ref(null),s=i.ref(""),l=i.ref(!1),a=i.ref([]),r=i.ref([]),c=i.ref([]),d=i.ref([]),h=i.computed(()=>l.value?c.value:r.value),u=i.computed(()=>!h.value.length);let f=null,g=null;const p=i.reactive({top:null,left:null}),m=i.computed({get:()=>e.isShowMenuOnClick,set:k=>t("update:isShowMenuOnClick",k)}),x=k=>{var B;(k==null?void 0:k.length)===1?g=k[0]:(k==null?void 0:k.length)<1&&(g==null&&(g=(B=r.value[0])==null?void 0:B.text),a.value.push(g))},b=k=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,k){const B=k.toString().toLowerCase();c.value=r.value.filter(D=>D.label.toString().toLowerCase().includes(B)),l.value=!0}},500)},y=()=>{s.value="",l.value=!1,c.value.length=0},M=()=>{const k=d.value.length?d.value:r.value;a.value=k.filter(B=>B.originChecked).map(B=>B.text),y()},I=()=>{d.value=r.value.filter(B=>a.value.includes(B.text));const k=d.value.map(B=>B.text);t("apply-column",k),n.value=!1,m.value=!1},E=i.ref(),T=i.ref(),V=()=>{T.value=Se(a.value),r.value=e.columns.filter(k=>!k.hide&&k.caption).map(k=>{var O,R;const B=(O=E.value)==null?void 0:O.find(v=>v.field===k.field);let D=!1;return B?D=(B==null?void 0:B.hiddenDisplay)!==(k==null?void 0:k.hiddenDisplay)||!((R=T.value)!=null&&R.length)?!(k!=null&&k.hiddenDisplay):T.value.includes(k.field):D=!k.hiddenDisplay,{label:k.caption,text:k.field,originChecked:!k.hiddenDisplay,checked:D,fixed:k.fixed}}),a.value=r.value.filter(k=>k.checked).map(k=>k.text),d.value.length=0,E.value=Se(e.columns)},C=()=>{n.value=!1,m.value=!1},S=()=>{const k=document.createElement("div");k.id="ev-grid-column-setting-modal",k.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(k)},w=async()=>{var A;await i.nextTick();const k=document.documentElement.clientWidth,B=document.documentElement.clientHeight,D=(A=o.value)==null?void 0:A.getBoundingClientRect(),O=D==null?void 0:D.width,R=D==null?void 0:D.height,{top:v,left:N,columnListMenuWidth:L}=e.position;let P;L?(P=N,k<N+O&&(P=N-O-L)):P=N-O;const _=B-R;p.top=`${Math.min(v,_)+document.documentElement.scrollTop}px`,p.left=`${P+document.documentElement.scrollLeft}px`};return i.onBeforeMount(()=>S()),i.watch(()=>e.columns,()=>{V()},{immediate:!0,deep:!0}),i.watch(()=>n.value,async()=>{M(),n.value&&await w()}),i.watch(()=>e.hiddenColumn,k=>{const B=d.value.length?d.value.filter(D=>D.text!==k):r.value.filter(D=>D.text!==k&&D.checked);d.value=B,a.value=B.map(D=>D.text)}),{columnSettingWrapper:o,columnSettingStyle:p,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:b,onApplyColumn:I,onCheckColumn:x,hideColumnSetting:C}}},s0={class:"ev-grid-column-setting__header"},l0={class:"header-title"},a0={class:"ev-grid-column-setting__content"},r0={key:1,class:"is-empty"},c0={class:"ev-grid-column-setting__footer"};function d0(e,t,n,o,s,l){const a=i.resolveComponent("ev-text-field"),r=i.resolveComponent("ev-checkbox"),c=i.resolveComponent("ev-checkbox-group"),d=i.resolveComponent("ev-button"),h=i.resolveDirective("clickoutside");return o.isShowColumnSetting?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[i.withDirectives((i.openBlock(),i.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:i.normalizeStyle(o.columnSettingStyle)},[i.createElementVNode("div",s0,[i.createElementVNode("p",l0,i.toDisplayString(n.textInfo.title),1),i.createVNode(a,{modelValue:o.searchVm,"onUpdate:modelValue":t[0]||(t[0]=u=>o.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:o.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),i.createElementVNode("div",a0,[o.columnList.length?(i.openBlock(),i.createBlock(c,{key:0,modelValue:o.checkColumnGroup,"onUpdate:modelValue":t[1]||(t[1]=u=>o.checkColumnGroup=u),onChange:o.onCheckColumn},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.columnList,(u,f)=>(i.openBlock(),i.createBlock(r,{key:`column_${f}`,label:u==null?void 0:u.text,disabled:!!(u!=null&&u.fixed),"tooltip-title":(u==null?void 0:u.label)??""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(i.openBlock(),i.createElementBlock("p",r0,i.toDisplayString(n.textInfo.empty),1))]),i.createElementVNode("div",c0,[i.createVNode(d,{type:"primary",disabled:o.isDisabled,onClick:o.onApplyColumn},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,o.hideColumnSetting]])])):i.createCommentVNode("",!0)}const Sr=le(i0,[["render",d0]]),h0={name:"EVGridFilterSetting",directives:{clickoutside:Ro},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(e,{emit:t}){const n=i.ref([]),o=i.computed(()=>e.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=I=>I==="string"||I==="stringNumber"?[...r,...c]:I==="number"||I==="float"?[...a,...c]:I==="boolean"?[{name:"=",value:"="}]:[],h=i.computed(()=>d(e.column.type)),u=i.computed({get:()=>e.isShow,set:I=>t("update:isShow",I)}),f=()=>{const I=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:I,value:"",caption:o.value.caption})},g=I=>{n.value.length>1?n.value.splice(I,1):I===0&&(n.value[0].comparison="=",n.value[0].value="")},p=(I,E)=>{(I==="isEmpty"||I==="isNotEmpty")&&(n.value[E].value="")},m=I=>{n.value=n.value.map(E=>({...E,operator:I}))},x=()=>{t("apply-filtering",o.value.field,n.value.filter(I=>I.value||I.comparison==="isEmpty"||I.comparison==="isNotEmpty"))};i.watch(()=>e.isShow,I=>{var V;const E=[],T=Se(e.items);I&&o.value.field&&((V=T[o.value.field])!=null&&V.length?T[o.value.field].forEach(C=>{E.push(C)}):E.push({comparison:"=",operator:"and",value:"",caption:o.value.caption}),n.value=E)});const b=(I,E)=>{var T;return((T=I.find(V=>V.value===E))==null?void 0:T.name)||""},y=()=>{const I=document.createElement("div");I.id="ev-grid-filter-setting-modal",I.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(I)};return i.onBeforeMount(()=>{y()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:f,removeRow:g,changeOperator:m,applyFiltering:x,changeComparison:p,getSelectTitle:b,validateValue:(I,E)=>{(I==="number"||I==="float")&&(E.value=E.value.replace(/[^0-9.,]/g,""))}}}},u0={class:"ev-grid-filter-setting__header"},f0={class:"header-title"},m0={class:"ev-grid-filter-setting__content"},g0={class:"ev-grid-filter-setting__row--button"},p0={class:"ev-grid-filter-setting__footer"};function y0(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-select"),c=i.resolveComponent("ev-text-field"),d=i.resolveComponent("ev-button"),h=i.resolveDirective("clickoutside");return o.isShowFilterSetting?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[i.withDirectives((i.openBlock(),i.createElementBlock("section",{class:"ev-grid-filter-setting",style:i.normalizeStyle({top:e.$props.position.top,left:e.$props.position.left})},[i.createElementVNode("div",u0,[i.createVNode(a,{icon:"ev-icon-filter-list"}),i.createElementVNode("span",f0," Filter ("+i.toDisplayString(e.$props.column.caption)+") ",1)]),i.createElementVNode("div",m0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteringItems,(u,f)=>(i.openBlock(),i.createElementBlock("div",{key:f,class:"ev-grid-filter-setting__row"},[i.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":g=>u.operator=g,class:"ev-grid-filter-setting__row--operator",title:o.getSelectTitle(o.items1,u.operator),items:o.items1,disabled:f>1,style:i.normalizeStyle({visibility:f>0?"visible":"hidden"}),onChange:o.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),i.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":g=>u.comparison=g,class:"ev-grid-filter-setting__row--comparison",title:o.getSelectTitle(o.items2,u.comparison),items:o.items2,onChange:g=>o.changeComparison(u.comparison,f)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),e.$props.column.type==="boolean"?(i.openBlock(),i.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":g=>u.value=g,class:"ev-grid-filter-setting__row--comparison",items:o.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(i.openBlock(),i.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":g=>u.value=g,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:g=>o.validateValue(e.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),i.createElementVNode("div",g0,[i.createVNode(a,{icon:"ev-icon-trash2",onClick:g=>o.removeRow(f)},null,8,["onClick"])])]))),128))]),i.createElementVNode("div",p0,[i.createVNode(d,{type:"primary",onClick:o.applyFiltering},{default:i.withCtx(()=>[...t[0]||(t[0]=[i.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{o.isShowFilterSetting=!1}]])])):i.createCommentVNode("",!0)}const x0=le(h0,[["render",y0]]),b0={name:"GridSortButton",props:{icon:{type:String,default:""}}},C0={key:0},S0={key:1},w0={key:2};function k0(e,t,n,o,s,l){return n.icon==="basic"?(i.openBlock(),i.createElementBlock("span",C0,[...t[0]||(t[0]=[i.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),i.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
4
+ `],...function({vnode:h,recurseCount:f}){const u=f>0?`... (${f} recursive calls)`:"",m=!!h.component&&h.component.parent==null,p=` at <${_l(h.component,h.type,m)}`,g=">"+u;return h.props?[p,...vc(h.props),g]:[p+g]}(c))}),r}(s)),console.warn(...l)}Js()}function vc(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...ml(o,e[o]))}),n.length>3&&t.push(" ..."),t}function ml(e,t,n){return dt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:ze(t)?(t=ml(e,ue(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Oe(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ue(t),n?t:[`${e}=`,t])}const gl={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"};function Ht(e,t,n,o){let s;try{s=o?e(...o):e()}catch(l){pl(l,t,n)}return s}function Ni(e,t,n,o){if(Oe(e)){const l=Ht(e,t,n,o);return l&&ec(l)&&l.catch(a=>{pl(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(Ni(e[l],t,n,o));return s}function pl(e,t,n,o=!0){const s=t?t.vnode:null;if(t){let l=t.parent;const a=t.proxy,r=process.env.NODE_ENV!=="production"?gl[n]:n;for(;l;){const d=l.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](e,a,r)===!1)return}l=l.parent}const c=t.appContext.config.errorHandler;if(c)return void Ht(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=gl[a];if(r&&(d=r,Ft.push(d)),ht("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ft.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,o)}let Eo=!1,Vi=!1;const et=[];let Bt=0;const en=[];let ft=null,Dt=0;const yl=Promise.resolve();let Pi=null;const Tc=100;function xl(e){const t=Pi||yl;return e?t.then(this?e.bind(this):e):t}function _i(e){et.length&&et.includes(e,Eo&&e.allowRecurse?Bt+1:Bt)||(e.id==null?et.push(e):et.splice(function(t){let n=Bt+1,o=et.length;for(;n<o;){const s=n+o>>>1,l=et[s],a=yn(l);a<t||a===t&&l.pre?n=s+1:o=s}return n}(e.id),0,e),bl())}function bl(){Eo||Vi||(Vi=!0,Pi=yl.then(Sl))}function Cl(e){pe(e)?en.push(...e):ft&&ft.includes(e,e.allowRecurse?Dt+1:Dt)||en.push(e),bl()}const yn=e=>e.id==null?1/0:e.id,Bc=(e,t)=>{const n=yn(e)-yn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Sl(e){Vi=!1,Eo=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),et.sort(Bc);const t=process.env.NODE_ENV!=="production"?n=>wl(e,n):Ws;try{for(Bt=0;Bt<et.length;Bt++){const n=et[Bt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;Ht(n,null,14)}}}finally{Bt=0,et.length=0,function(n){if(en.length){const o=[...new Set(en)];if(en.length=0,ft)return void ft.push(...o);for(ft=o,process.env.NODE_ENV!=="production"&&(n=n||new Map),ft.sort((s,l)=>yn(s)-yn(l)),Dt=0;Dt<ft.length;Dt++)process.env.NODE_ENV!=="production"&&wl(n,ft[Dt])||ft[Dt]();ft=null,Dt=0}}(e),Eo=!1,Pi=null,(et.length||en.length)&&Sl(e)}}function wl(e,t){if(e.has(t)){const n=e.get(t);if(n>Tc){const o=t.ownerInstance,s=o&&Pl(o.type);return ht(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`),!0}e.set(t,n+1)}else e.set(t,1)}const xn=new Set;process.env.NODE_ENV!=="production"&&(Ci().__VUE_HMR_RUNTIME__={createRecord:Ai(function(e,t){return vo.has(e)?!1:(vo.set(e,{initialDef:bn(t),instances:new Set}),!0)}),rerender:Ai(function(e,t){const n=vo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,bn(o.type).render=t),o.renderCache=[],o.update()}))}),reload:Ai(function(e,t){const n=vo.get(e);if(!n)return;t=bn(t),kl(n.initialDef,t);const o=[...n.instances];for(const s of o){const l=bn(s.type);xn.has(l)||(l!==n.initialDef&&kl(l,t),xn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(xn.add(l),s.ceReload(t.styles),xn.delete(l)):s.parent?_i(s.parent.update):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}Cl(()=>{for(const s of o)xn.delete(bn(s.type))})})});const vo=new Map;function bn(e){return Al(e)?e.__vccOpts:e}function kl(e,t){Qe(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function Ai(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Cn=null,Dc=null;const Oc=Symbol.for("v-ndc"),To={};function Lc(e,t,{immediate:n,deep:o,flush:s,onTrack:l,onTrigger:a}=xi){var r;process.env.NODE_ENV==="production"||t||(n!==void 0&&ht('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&ht('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=M=>{ht("Invalid watch source: ",M,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=Ys===((r=on)==null?void 0:r.scope)?on:null;let h,f,u=!1,m=!1;if(ze(e)?(h=()=>e.value,u=Di(e)):At(e)?(h=()=>e,o=!0):pe(e)?(m=!0,u=e.some(M=>At(M)||Di(M)),h=()=>e.map(M=>ze(M)?M.value:At(M)?tn(M):Oe(M)?Ht(M,d,2):void(process.env.NODE_ENV!=="production"&&c(M)))):Oe(e)?h=t?()=>Ht(e,d,2):()=>{if(!d||!d.isUnmounted)return f&&f(),Ni(e,d,3,[p])}:(h=Ws,process.env.NODE_ENV!=="production"&&c(e)),t&&o){const M=h;h=()=>tn(M())}let p=M=>{f=y.onStop=()=>{Ht(M,d,4),f=y.onStop=void 0}},g=m?new Array(e.length).fill(To):To;const x=()=>{if(y.active)if(t){const M=y.run();(o||u||(m?M.some((E,I)=>Qt(E,g[I])):Qt(M,g)))&&(f&&f(),Ni(t,d,3,[M,g===To?void 0:m&&g[0]===To?[]:g,p]),g=M)}else y.run()};let b;x.allowRecurse=!!t,s==="sync"?b=x:s==="post"?b=()=>Tl(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),b=()=>_i(x));const y=new cc(h,b);return process.env.NODE_ENV!=="production"&&(y.onTrack=l,y.onTrigger=a),t?n?x():g=y.run():s==="post"?Tl(y.run.bind(y),d&&d.suspense):y.run(),()=>{y.stop(),d&&d.scope&&Kr(d.scope.effects,y)}}function Rc(e,t,n){const o=this.proxy,s=dt(e)?e.includes(".")?function(c,d){const h=d.split(".");return()=>{let f=c;for(let u=0;u<h.length&&f;u++)f=f[h[u]];return f}}(o,e):()=>o[e]:e.bind(o,o);let l;Oe(t)?l=t:(l=t.handler,n=t);const a=on;Vl(this);const r=Lc(s,l.bind(o),n);return a?Vl(a):zc(),r}function tn(e,t){if(!_e(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),ze(e))tn(e.value,t);else if(pe(e))for(let n=0;n<e.length;n++)tn(e[n],t);else if(Qr(e)||Jt(e))e.forEach(n=>{tn(n,t)});else if(nc(e))for(const n in e)tn(e[n],t);return e}const zi=e=>e?4&e.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((o=t.exposed,ic(o,"__v_skip",!0),At(n=o)?n:new Proxy(n,Ec)),{get:(s,l)=>l in s?s[l]:l in Fi?Fi[l](t):void 0,has:(s,l)=>l in s||l in Fi}));var n,o}(e)||e.proxy:zi(e.parent):null,Fi=Qe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Io(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Io(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Io(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Io(e.refs):e.refs,$parent:e=>zi(e.parent),$root:e=>zi(e.root),$emit:e=>e.emit,$options:e=>function(t){const n=t.type,{mixins:o,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=t.appContext,c=a.get(n);let d;return c?d=c:l.length||o||s?(d={},l.length&&l.forEach(h=>Bo(d,h,r,!0)),Bo(d,n,r)):d=n,_e(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>_i(e.update)),$nextTick:e=>e.n||(e.n=xl.bind(e.proxy)),$watch:e=>Rc.bind(e)});function Ml(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function Bo(e,t,n,o=!1){const{mixins:s,extends:l}=t;l&&Bo(e,l,n,!0),s&&s.forEach(a=>Bo(e,a,n,!0));for(const a in t)if(o&&a==="expose")process.env.NODE_ENV!=="production"&&ht('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=Nc[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Nc={data:Il,props:vl,emits:vl,methods:Sn,computed:Sn,beforeCreate:Re,created:Re,beforeMount:Re,mounted:Re,beforeUpdate:Re,updated:Re,beforeDestroy:Re,beforeUnmount:Re,destroyed:Re,unmounted:Re,activated:Re,deactivated:Re,errorCaptured:Re,serverPrefetch:Re,components:Sn,directives:Sn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=Qe(Object.create(null),e);for(const o in t)n[o]=Re(e[o],t[o]);return n},provide:Il,inject:function(e,t){return Sn(El(e),El(t))}};function Il(e,t){return t?e?function(){return Qe(Oe(e)?e.call(this,this):e,Oe(t)?t.call(this,this):t)}:t:e}function El(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Re(e,t){return e?[...new Set([].concat(e,t))]:t}function Sn(e,t){return e?Qe(Object.create(null),e,t):t}function vl(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:Qe(Object.create(null),Ml(e),Ml(t??{})):t}const Tl=function(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):Cl(e)},Bl=Symbol.for("v-fgt"),Vc=Symbol.for("v-txt"),Pc=Symbol.for("v-cmt"),Dl="__vInternal",Ol=({key:e})=>e??null,Do=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?dt(e)||ze(e)||Oe(e)?{i:Cn,r:e,k:t,f:!!n}:e:null),_c=process.env.NODE_ENV!=="production"?(...e)=>Ll(...e):Ll;function Ll(e,t=null,n=null,o=0,s=null,l=!1){if(e&&e!==Oc||(process.env.NODE_ENV==="production"||e||ht(`Invalid vnode type when creating vnode: ${e}.`),e=Pc),(a=e)&&a.__v_isVNode===!0){const c=Oo(e,t,!0);return n&&Hi(c,n),c.patchFlag|=-2,c}var a;if(Al(e)&&(e=e.__vccOpts),t){t=function(h){return h?Oi(h)||Dl in h?Qe({},h):h:null}(t);let{class:c,style:d}=t;c&&!dt(c)&&(t.class=wi(c)),_e(d)&&(Oi(d)&&!pe(d)&&(d=Qe({},d)),t.style=Si(d))}const r=dt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:_e(e)?4:Oe(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Oi(e)&&ht("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
5
+ Component that was made reactive: `,e=ue(e)),function(c,d=null,h=null,f=0,u=null,m=c===Bl?0:1,p=!1,g=!1){const x={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Ol(d),ref:d&&Do(d),scopeId:Dc,slotScopeIds:null,children:h,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:m,patchFlag:f,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Cn};return g?(Hi(x,h),128&m&&c.normalize(x)):h&&(x.shapeFlag|=dt(h)?8:16),process.env.NODE_ENV!=="production"&&x.key!=x.key&&ht("VNode created with invalid key (NaN). VNode type:",x.type),x}(e,t,n,o,s,r,l,!0)}function Oo(e,t,n=!1){const{props:o,ref:s,patchFlag:l,children:a}=e,r=t?function(...c){const d={};for(let h=0;h<c.length;h++){const f=c[h];for(const u in f)if(u==="class")d.class!==f.class&&(d.class=wi([d.class,f.class]));else if(u==="style")d.style=Si([d.style,f.style]);else if(qr(u)){const m=d[u],p=f[u];!p||m===p||pe(m)&&m.includes(p)||(d[u]=m?[].concat(m,p):p)}else u!==""&&(d[u]=f[u])}return d}(o||{},t):o;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:r,key:r&&Ol(r),ref:t&&t.ref?n&&s?pe(s)?s.concat(Do(t)):[s,Do(t)]:Do(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&pe(a)?a.map(Rl):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Bl?l===-1?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:e.transition,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oo(e.ssContent),ssFallback:e.ssFallback&&Oo(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Rl(e){const t=Oo(e);return pe(e.children)&&(t.children=e.children.map(Rl)),t}function Ac(e=" ",t=0){return _c(Vc,null,e,t)}function Hi(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(pe(t))n=16;else if(typeof t=="object"){if(65&o){const s=t.default;return void(s&&(s._c&&(s._d=!1),Hi(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||Dl in t||(t._ctx=Cn)}}else Oe(t)?(t={default:t,_ctx:Cn},n=32):(t=String(t),64&o?(n=16,t=[Ac(t)]):n=8);e.children=t,e.shapeFlag|=n}let Wi,nn,on=null,Nl="__VUE_INSTANCE_SETTERS__";(nn=Ci()[Nl])||(nn=Ci()[Nl]=[]),nn.push(e=>on=e),Wi=e=>{nn.length>1?nn.forEach(t=>t(e)):nn[0](e)};const Vl=e=>{Wi(e),e.scope.on()},zc=()=>{on&&on.scope.off(),Wi(null)},Fc=/(?:^|[-_])(\w)/g,Hc=e=>e.replace(Fc,t=>t.toUpperCase()).replace(/[-_]/g,"");function Pl(e,t=!0){return Oe(e)?e.displayName||e.name:e.name||t&&e.__name}function _l(e,t,n=!1){let o=Pl(t);if(!o&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(o=s[1])}if(!o&&e&&e.parent){const s=l=>{for(const a in l)if(l[a]===t)return a};o=s(e.components||e.parent.type.components)||s(e.appContext.components)}return o?Hc(o):n?"App":"Anonymous"}function Al(e){return Oe(e)&&"__vccOpts"in e}function $i(e){return!(!e||!e.__v_isShallow)}function zl(e,t,n){if(arguments.length===2)for(var o,s=0,l=t.length;s<l;s++)!o&&s in t||(o||(o=Array.prototype.slice.call(t,0,s)),o[s]=t[s]);return e.concat(o||Array.prototype.slice.call(t))}function Fl(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!Fl(e[n],t[n]))return!1;return!0}return!1}process.env.NODE_ENV!=="production"&&function(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#0b1bc9"},n={style:"color:#b62e24"},o={style:"color:#9d288c"},s={header:f=>_e(f)?f.__isVue?["div",e,"VueInstance"]:ze(f)?["div",{},["span",e,h(f)],"<",r(f.value),">"]:At(f)?["div",{},["span",e,$i(f)?"ShallowReactive":"Reactive"],"<",r(f),">"+(zt(f)?" (readonly)":"")]:zt(f)?["div",{},["span",e,$i(f)?"ShallowReadonly":"Readonly"],"<",r(f),">"]:null:null,hasBody:f=>f&&f.__isVue,body(f){if(f&&f.__isVue)return["div",{},...l(f.$)]}};function l(f){const u=[];f.type.props&&f.props&&u.push(a("props",ue(f.props))),f.setupState!==xi&&u.push(a("setup",f.setupState)),f.data!==xi&&u.push(a("data",ue(f.data)));const m=c(f,"computed");m&&u.push(a("computed",m));const p=c(f,"inject");return p&&u.push(a("injected",p)),u.push(["div",{},["span",{style:o.style+";opacity:0.66"},"$ (internal): "],["object",{object:f}]]),u}function a(f,u){return u=Qe({},u),Object.keys(u).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},f],["div",{style:"padding-left:1.25em"},...Object.keys(u).map(m=>["div",{},["span",o,m+": "],r(u[m],!1)])]]:["span",{}]}function r(f,u=!0){return typeof f=="number"?["span",t,f]:typeof f=="string"?["span",n,JSON.stringify(f)]:typeof f=="boolean"?["span",o,f]:_e(f)?["object",{object:u?ue(f):f}]:["span",n,String(f)]}function c(f,u){const m=f.type;if(Oe(m))return;const p={};for(const g in f.ctx)d(m,g,u)&&(p[g]=f.ctx[g]);return p}function d(f,u,m){const p=f[m];return!!(pe(p)&&p.includes(u)||_e(p)&&u in p)||!(!f.extends||!d(f.extends,u,m))||!(!f.mixins||!f.mixins.some(g=>d(g,u,m)))||void 0}function h(f){return $i(f)?"ShallowRef":f.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var Wc=function(){function e(t,n){this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n)}return Object.defineProperty(e.prototype,"threshold",{get:function(){return this.options.intersection&&this.options.intersection.threshold||0},enumerable:!1,configurable:!0}),e.prototype.createObserver=function(t){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){var o;if(this.options=typeof(o=t)=="function"?{callback:o}:o,this.callback=function(l,a){n.options.callback(l,a),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var s=(this.options.throttleOptions||{}).leading;this.callback=function(l,a,r){var c,d,h;r===void 0&&(r={});var f=function(u){for(var m=[],p=1;p<arguments.length;p++)m[p-1]=arguments[p];if(h=m,!c||u!==d){var g=r.leading;typeof g=="function"&&(g=g(u,d)),c&&u===d||!g||l.apply(void 0,zl([u],h,!1)),d=u,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,zl([u],h,!1)),c=0},a)}};return f._clear=function(){clearTimeout(c),c=null},f}(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var a=l[0];if(l.length>1){var r=l.find(function(d){return d.isIntersecting});r&&(a=r)}if(n.callback){var c=a.isIntersecting&&a.intersectionRatio>=n.threshold;if(c===n.oldResult)return;n.oldResult=c,n.callback(c,a)}},this.options.intersection),xl(function(){n.observer&&n.observer.observe(n.el)})}},e.prototype.destroyObserver=function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)},e}(),Xi={beforeMount:function(e,t){var n=t.value;n&&(typeof IntersectionObserver>"u"?console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill"):e._vue_visibilityState=new Wc(e,n))},updated:function(e,t){var n=t.value;if(!Fl(n,t.oldValue)){var o=e._vue_visibilityState;n&&o&&o.createObserver(n)}},unmounted:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};const wn={mounted(e,t){if(typeof ResizeObserver>"u")return;const n=t.value;if(typeof n!="function")return;getComputedStyle(e).position==="static"&&e.style.setProperty("position","relative","important");const o=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});o.observe(e),e.__resizeObserver__=o},unmounted(e){const t=e.__resizeObserver__;t&&(t.disconnect(),e.__resizeObserver__=null)}},le=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},$c={name:"EvTabs",directives:{observeVisibility:Xi,resize:wn},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:e=>{const t=e.map(o=>o.value),n=[...new Set(t)];return e.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):e.every(o=>Object.hasOwnProperty.call(o,"value"))?!0:(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is essential."),!1)}},closable:{type:Boolean,default:!1},stretch:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:{"update:modelValue":[String,Number],"update:panels":[Array],change:[String,Number]},setup(e,{emit:t}){const n=i.ref(!1),o=i.ref([]),s=i.computed({get:()=>e.modelValue,set:C=>{t("update:modelValue",C),t("change",C)}});i.provide("evTabs",s);const l=i.computed({get:()=>e.panels,set:C=>t("update:panels",C)}),a=i.computed(()=>!e.draggable||!n.value?l.value:o.value),r=l.value.map(C=>C.value),c=i.ref(null),d=i.ref(null),h=i.ref(!1),f=i.reactive({x:0}),u=i.computed(()=>({transform:`translateX(${f.x}px)`})),m=()=>{const C=c.value.offsetWidth,S=d.value.offsetWidth;if(h.value=C<S,h.value){const w=C-S;w>f.x&&(f.x=w)}else f.x=0};i.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let C,S;r.length>l.value.length?(C=r,S=l.value.map(k=>k.value)):(C=l.value.map(k=>k.value),S=r);const w=C.filter(k=>!S.includes(k))[0];if(s.value===w){const k=r.findIndex(B=>B===w);k===0?s.value=l.value[0].value:s.value=l.value[k-1].value}}});const p=C=>{s.value=C},g=C=>{if(l.value.length<2)return;const S=l.value.findIndex(w=>w.value===C);if(S<0){s.value=l.value[0].value;return}C===s.value&&(S===0?s.value=l.value[1].value:s.value=l.value[S-1].value),l.value.splice(S,1),i.nextTick(()=>{r.splice(S,1)}),i.triggerRef(l)},x=(C,S=100)=>{const w=c.value.offsetWidth,k=d.value.offsetWidth,B=w-k;C==="next"&&f.x!==B?B>=f.x-S?f.x=B:f.x-=S:C==="prev"&&f.x!==0&&(S*-1<=f.x?f.x=0:f.x+=S)},b=i.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:p,removeTab:g,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:u,scrollTab:x,dragstartTab:(C,S)=>{e.draggable&&(o.value=[...l.value],b.item=C,b.idx=S,n.value=!0)},dragoverTab:C=>{var k;if(!e.draggable||((k=b.item)==null?void 0:k.value)===C)return;const S=o.value.findIndex(B=>{var D;return B.value===((D=b.item)==null?void 0:D.value)}),w=o.value.findIndex(B=>B.value===C);o.value.splice(S,1),o.value.splice(w,0,b.item)},dragendTab:()=>{e.draggable&&(l.value=[...o.value],b.item={},b.idx=null,n.value=!1,o.value.splice(0))},dragSelectCls:C=>{var S;return e.draggable&&((S=b.item)==null?void 0:S.value)===C},selectIdxCls:C=>e.draggable&&b.idx===C,onResize:()=>{m()}}}},Xc={class:"ev-tabs-header"},Uc={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},Yc=["onClick","onDragstart","onDragover"],jc=["title"],Gc=["onClick"],Zc={class:"ev-tabs-body"};function qc(e,t,n,o,s,l){const a=i.resolveDirective("resize"),r=i.resolveDirective("observe-visibility");return i.withDirectives((i.openBlock(),i.createElementBlock("section",{class:i.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[i.createElementVNode("div",Xc,[i.createElementVNode("div",{class:i.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":o.hasScroll}])},[o.hasScroll?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:t[0]||(t[0]=c=>o.scrollTab("prev"))},[...t[3]||(t[3]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),i.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:t[1]||(t[1]=c=>o.scrollTab("next"))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):i.createCommentVNode("",!0),i.createElementVNode("div",Uc,[i.createElementVNode("ul",{ref:"listRef",class:"ev-tabs-list",style:i.normalizeStyle(o.listRefStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.computedTabList,(c,d)=>(i.openBlock(),i.createElementBlock("li",i.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===o.mv,"has-icon":c.iconClass,"drag-select":o.dragSelectCls(c.value),"select-idx":o.selectIdxCls(d)},onClick:h=>o.clickTab(c.value),onDragstart:i.withModifiers(h=>o.dragstartTab(c,d),["stop"]),onDragover:i.withModifiers(h=>o.dragoverTab(c.value),["prevent"]),onDragend:t[2]||(t[2]=i.withModifiers((...h)=>o.dragendTab&&o.dragendTab(...h),["prevent"]))}),[c.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"text",title:c.text},i.toDisplayString(c.text),9,jc),n.closable?(i.openBlock(),i.createElementBlock("span",{key:1,class:"close-icon",onClick:i.withModifiers(h=>o.removeTab(c.value),["stop"])},[...t[5]||(t[5]=[i.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,Gc)):i.createCommentVNode("",!0)],16,Yc))),128))],4)],512)],2)]),i.createElementVNode("div",Zc,[i.renderSlot(e.$slots,"default")])],2)),[[a,o.onResize],[r,{callback:o.onResize,once:!0}]])}const kn=le($c,[["render",qc]]);kn.install=e=>{e.component(kn.name,kn)};const Kc={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1}},emits:{},setup(e){const t=i.inject("evTabs",null);return{isSelected:i.computed(()=>e.value===t.value)}}},Jc={class:"ev-tab-panel"};function Qc(e,t,n,o,s,l){return i.withDirectives((i.openBlock(),i.createElementBlock("article",Jc,[i.renderSlot(e.$slots,"default")],512)),[[i.vShow,o.isSelected]])}const Mn=le(Kc,[["render",Qc]]);Mn.install=e=>{e.component(Mn.name,Mn)};const ed={name:"EvButton",props:{disabled:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},type:{type:String,default:"default"},htmlType:{type:String,default:"button",validator:e=>["button","submit","reset"].includes(e)},shape:{type:String,default:"square"},size:{type:String,default:"medium"}},emits:{click:null},setup(e){const t=i.ref(null);return i.onMounted(()=>{e.autoFocus&&t.value.focus()}),{buttonRef:t}}},td=["type","disabled","autofocus"];function nd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("button",{ref:"buttonRef",class:i.normalizeClass(["ev-button",{disabled:n.disabled,[`type-${n.type}`]:!!n.type,[`shape-${n.shape}`]:n.shape!=="square",[`size-${n.size}`]:n.size!=="medium"}]),type:n.htmlType,disabled:n.disabled,autofocus:n.autoFocus,onClick:t[0]||(t[0]=a=>e.$emit("click",a))},[i.renderSlot(e.$slots,"default")],10,td)}const sn=le(ed,[["render",nd]]);sn.install=e=>{e.component(sn.name,sn)};const od={name:"EvButtonGroup"},id={class:"ev-button-group"};function sd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",id,[i.renderSlot(e.$slots,"default")])}const In=le(od,[["render",sd]]);In.install=e=>{e.component(In.name,In)};const ld={name:"EvCheckbox",props:{modelValue:{type:[String,Number,Boolean,Symbol,Array],default:!1},label:{type:[String,Number,Boolean,Symbol,Object],default:null},tooltipTitle:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:{"update:modelValue":null,"update:indeterminate":[Boolean],change:null},setup(e,{emit:t}){const n=i.ref();i.onMounted(()=>{n.value&&e.tooltipTitle&&(n.value.title=e.tooltipTitle)});const o=i.ref(null),s=i.inject("EvCheckboxGroupMv",i.computed({get:()=>e.modelValue,set:c=>{c&&!o.value.indeterminate&&t("update:indeterminate",!1),t("update:modelValue",c)}})),l=i.computed(()=>e.label),a=i.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=i.inject("EvCheckboxGroupChange",async c=>{await i.nextTick(),t("change",s.value,c)});return i.watch(()=>e.indeterminate,c=>{i.nextTick(()=>{o.value&&(o.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:o,checked:a,changeMv:r}}},ad=["disabled","value","readonly"],rd={ref:"checkboxLabel",class:"ev-checkbox-label"};function cd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:o.checked}]])},[i.withDirectives(i.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:t[1]||(t[1]=(...a)=>o.changeMv&&o.changeMv(...a))},null,40,ad),[[i.vModelCheckbox,o.mv]]),i.createElementVNode("span",rd,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.label),1)],64))],512)],2)}const ln=le(ld,[["render",cd]]);ln.install=e=>{e.component(ln.name,ln)};const dd={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});i.provide("EvCheckboxGroupMv",n);const o=async s=>{await i.nextTick(),t("change",n.value,s)};i.provide("EvCheckboxGroupChange",o)}};function hd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[i.renderSlot(e.$slots,"default")],2)}const an=le(dd,[["render",hd]]);an.install=e=>{e.component(an.name,an)};const fd={name:"EvRadio",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},label:{type:[String,Number,Symbol,Boolean],default:null},disabled:{type:Boolean,default:!1},size:{type:String,default:""}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.inject("EvRadioGroupMv",i.computed({get:()=>e.modelValue,set:l=>t("update:modelValue",l)})),o=i.inject("EvRadioGroupChange",async l=>{await i.nextTick(),t("change",n.value,l)}),s=i.computed(()=>n.value===e.label);return{mv:n,checked:s,changeMv:o}}},ud=["value","disabled"],md={class:"ev-radio-label"};function gd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:o.checked},n.size]])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:t[1]||(t[1]=i.withModifiers((...a)=>o.changeMv&&o.changeMv(...a),["stop"]))},null,40,ud),[[i.vModelRadio,o.mv]]),i.createElementVNode("span",md,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.label),1)],64))])],2)}const En=le(fd,[["render",gd]]);En.install=e=>{e.component(En.name,En)};const pd={name:"EvRadioGroup",props:{modelValue:{type:[String,Number,Symbol,Boolean],default:null},type:{type:String,default:"radio"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});i.provide("EvRadioGroupMv",n);const o=async s=>{await i.nextTick(),t("change",n.value,s)};i.provide("EvRadioGroupChange",o)}};function yd(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[i.renderSlot(e.$slots,"default")],2)}const vn=le(pd,[["render",yd]]);vn.install=e=>{e.component(vn.name,vn)};const Lo={mounted(e,t){const n=e,o=t.modifiers.bubbles,s=l=>{(o||n!==l.target&&!n.contains(l.target))&&t.value(l)};n.vueClickOutside=s,document.addEventListener("mousedown",s)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},xd={mounted(e,t){const n=e;let o=null;const s=t.modifiers.bubble,l=document.body.getElementsByClassName("ev-select-dropbox"),a="ev-tag-name",r="ev-tag-suffix-close",c=d=>{if(!(d.target.classList.contains(a)||d.target.classList.contains(r))&&l&&l.length&&(s||n!==d.target&&!n.contains(d.target))){for(let h=0;h<l.length;h++)if(o=l[h],o!==d.target&&!o.contains(d.target)){t.value(d);break}}};n.vueClickOutside=c,document.addEventListener("mousedown",c)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}},bd={mounted(e,t){const n=e,o=t.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(o||n!==a.target&&!n.contains(a.target))||s&&s[0]&&s[0]!==a.target&&!s[0].contains(a.target)&&n!==a.target&&!n.contains(a.target))&&t.value(a)};n.vueClickOutside=l,document.addEventListener("mousedown",l)},unmounted(e){const t=e;document.removeEventListener("mousedown",t.vueClickOutside),t.vueClickOutside=null}};var Ot=function(){return Ot=Object.assign||function(t){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Ot.apply(this,arguments)};function rn(e,t,n){if(n||arguments.length===2)for(var o=0,s=t.length,l;o<s;o++)(l||!(o in t))&&(l||(l=Array.prototype.slice.call(t,0,o)),l[o]=t[o]);return e.concat(l||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ro=44032,Tn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ne=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ee=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Lt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},Ui={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},Hl=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],Wl=[["ㄱ","r"],["ㄲ","R"],["ㄴ","s"],["ㄷ","e"],["ㄸ","E"],["ㄹ","f"],["ㅁ","a"],["ㅂ","q"],["ㅃ","Q"],["ㅅ","t"],["ㅆ","T"],["ㅇ","d"],["ㅈ","w"],["ㅉ","W"],["ㅊ","c"],["ㅋ","z"],["ㅌ","x"],["ㅍ","v"],["ㅎ","g"],["ㅏ","k"],["ㅐ","o"],["ㅑ","i"],["ㅒ","O"],["ㅓ","j"],["ㅔ","p"],["ㅕ","u"],["ㅖ","P"],["ㅗ","h"],["ㅛ","y"],["ㅜ","n"],["ㅠ","b"],["ㅡ","m"],["ㅣ","l"]];function $l(e){var t="",n="",o="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Tn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-Ro;a=r%Ee.length,l=(r-a)/Ee.length%Ne.length,s=((r-a)/Ee.length-l)/Ne.length,t=Tn[s],n=Ne[l],o=Ee[a]}return{initial:t,medial:n,finale:o,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(e,t){var n=t[0],o=t[1];return rn(rn([],e,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(o,"\\)(\\s+)"),"g"),n,o],[RegExp(`([가-힣]['" ]{0,1})`.concat(o,"\\(").concat(n,"\\)(\\s+)"),"g"),n,o]],!1)},[]);function Cd(e,t){var n=t===void 0?{}:t,o=n.grouped,s=o===void 0?!1:o,l=[];return e.split("").forEach(function(a){var r=$l(a),c=r.initial,d=r.medial,h=r.finale,f=r.initialOffset,u=r.medialOffset,m=r.finaleOffset;l.push((f!==-1||u!==-1||m!==-1?[c,Lt[d]&&Hl.indexOf(d)===-1?Lt[d]:d,Lt[h]&&Hl.indexOf(h)===-1?Lt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var Wt=Object.entries(Lt).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[s.join("")]=o,n))},{}),Xl=function(e){return typeof e<"u"};function Sd(e){var t=e.findIndex(function(d){return Ne.indexOf(d)!==-1}),n=t!==-1&&Ne.indexOf(e[t+1])!==-1?t+1:t,o=e.slice(0,t).join(""),s=e.slice(t,n+1).join(""),l=e.slice(n+1).join(""),a=Tn.indexOf(Wt[o]||o),r=Ne.indexOf(Wt[s]||s),c=Ee.indexOf(Wt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Ro+a*(Ne.length*Ee.length)+r*Ee.length+c):e.join("")}function wd(e){var t=[];(typeof e=="string"?e.split(""):e).forEach(function(l,a,r){typeof l=="string"&&t.length>0&&Ne.indexOf(r[a-1])!==-1&&Ne.indexOf(l)!==-1&&Wt["".concat(r[a-1]).concat(l)]?t[t.length-1]=Wt["".concat(r[a-1]).concat(l)]:t.push(l)});var n={medial:null,finales:[]},o=[n];t.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},o.push({grouped:l,finales:[]}),o.push(n)):Ne.indexOf(l)!==-1?(n={medial:l,finales:[]},o.push(n)):n.finales.push(l)}),o.forEach(function(l,a,r){if(a>0){var c=r[a-1];if(!c.medial||c.finales.length===1)l.initials=c.finales,c.finales=[];else{var d=c.finales,h=d[0],f=d.slice(1);l.initials=f,c.finales=h?[h]:[]}if(l.finales.length>2||a===o.length-1&&l.finales.length>1){var u=l.finales,m=u[0],p=u[1],g=u.slice(2);Wt["".concat(m).concat(p)]&&(l.finales=rn([Wt["".concat(m).concat(p)]],g,!0))}}});var s=[];return o.forEach(function(l){var a=l.initials,r=a===void 0?[]:a,c=l.medial,d=l.finales,h=l.grouped;if(h)s.push(h);else{var f=r.slice(),u=f.pop(),m=d[0],p=d.slice(1);Ee.indexOf(m)===-1&&(p=rn([m],p,!0),m=""),f.filter(Xl).forEach(function(g){return s.push([g])}),s.push([u,c,m].filter(Boolean)),p.filter(Xl).forEach(function(g){return s.push([g])})}}),s.map(Sd).join("")}var kd=Object.values(Wl).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[s]=o,n))},{});function Ul(e){return wd(e.split("").map(function(t){return kd[t]||t}).join(""))}var Yl=/[\\^$.*+?()[\]{}|]/g,Md=RegExp(Yl.source);function Yi(e){return e&&Md.test(e)?e.replace(Yl,"\\$&"):e||""}var No=function(e,t){t===void 0&&(t=!1);var n=Tn.indexOf(e);if(n!==-1){var o=n*Ne.length*Ee.length+Ro;return"[".concat(t?e:"").concat(String.fromCharCode(o),"-").concat(String.fromCharCode(o+Ne.length*Ee.length-1),"]")}return e},jl="__".concat(parseInt("fuzzy",36),"__"),Gl="__".concat(parseInt("ignorespace",36),"__"),ji=function(){var e,t;return function(n,o){var s=o===void 0?{}:o,l=s.initialSearch,a=l===void 0?!1:l,r=s.startsWith,c=r===void 0?!1:r,d=s.endsWith,h=d===void 0?!1:d,f=s.ignoreSpace,u=f===void 0?!1:f,m=s.ignoreCase,p=m===void 0?!0:m,g=s.global,x=g===void 0?!1:g,b=s.fuzzy,y=b===void 0?!1:b,M=s.nonCaptureGroup,E=M===void 0?!1:M,I=s.engToKor,T=I===void 0?!1:I;if(e===n)return t;var V=n,C=[];if(T&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var S=Ul(n.trim());S.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=S,C.push(Yi(n.trim())))}var w=V.split(""),k=w.slice(-1)[0],B="",D=$l(k||"");if(D.initialOffset!==-1){w=w.slice(0,-1);var O=D.initial,L=D.medial,v=D.finale,N=D.initialOffset,R=D.medialOffset,P=N*Ne.length*Ee.length+Ro,_=[];switch(!0){case v!=="":{_.push(k),Tn.includes(v)&&_.push("".concat(String.fromCharCode(P+R*Ee.length)).concat(No(v))),Lt[v]&&_.push("".concat(String.fromCharCode(P+R*Ee.length+Ee.join("").search(Lt[v][0])+1)).concat(No(Lt[v][1])));break}case L!=="":{var A=void 0,z=void 0;Ui[L]?(A=P+Ne.join("").search(Ui[L][0])*Ee.length,z=P+Ne.join("").search(Ui[L][1])*Ee.length+Ee.length-1):(A=P+R*Ee.length,z=A+Ee.length-1),_.push("[".concat(String.fromCharCode(A),"-").concat(String.fromCharCode(z),"]"));break}case O!=="":{_.push(No(O,!0));break}}B=_.length>1?E?"(?:".concat(_.join("|"),")"):"(".concat(_.join("|"),")"):_[0]}var X=y?jl:u?Gl:"",W=a?w.map(function(K){return K.search(/[ㄱ-ㅎ]/)!==-1?No(K,!0):Yi(K)}).join(X):Yi(w.join(X)),H=W.trim()!==""&&B.trim()!=="",U=H?"".concat(W).concat(X).concat(B):"".concat(W).concat(B),j=(c?"^":"")+U+(h?"$":"");return X&&(j=j.replace(RegExp(jl,"g"),".*").replace(RegExp(Gl,"g"),"\\s*")),C.length>0&&(j=rn(rn([],C,!0),[j],!1).map(function(K){return"(".concat(K,")")}).join("|")),t=RegExp(j,(x?"g":"")+(p?"i":"")),t}}(),Id=Object.values(Wl).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[o]=s,n))},{});function Ed(e){return e.split("").map(function(t){return Cd(t,{grouped:!1}).map(function(n){return Id[n]||n})}).flat().join("")}const vd=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n={get:()=>e.items.some(g=>g.value===e.modelValue)?e.modelValue:null,set:g=>t("update:modelValue",g)},o={get:()=>Array.isArray(e.modelValue)?e.modelValue:[],set:g=>t("update:modelValue",g)},s=i.computed(e.multiple?o:n),l=()=>{var g;return(g=e.items.find(x=>x.value===s.value))==null?void 0:g.name},a=()=>e.items.filter(g=>e.modelValue.includes(g.value)),r=i.computed(e.multiple?a:l),c=i.computed(()=>e.multiple&&s.value.length?null:e.placeholder),d=()=>s.value,h=()=>s.value.length,f=i.computed(e.multiple?h:d),u=()=>{e.disabled||(e.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},m=async()=>{await i.nextTick(),t("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:f,removeAllMv:u,removeMv:async g=>{if(!e.disabled){const x=s.value.indexOf(g);s.value.splice(x,1),s.value=[...s.value],await m()}},changeMv:m}},Td=e=>{const{props:t}=i.getCurrentInstance(),{mv:n,changeMv:o}=e,s=i.ref(!1),l=i.ref(t.filterText),a=i.ref(null),r=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref("100%"),f=i.ref(null),u=i.reactive({top:0}),m=i.computed(()=>{var v;if(!l.value||!t.filterable)return t.items;const D=(v=l.value)==null?void 0:v.trim(),O=Ul(D),L=Ed(D);return t.items.filter(({name:N})=>N.search(ji(D))>-1||N.search(ji(O))>-1||N.search(ji(L))>-1)}),p=D=>{var O;l.value=(O=D==null?void 0:D.target)==null?void 0:O.value},g=async()=>{var N,R,P;await i.nextTick();const D=(N=r.value)==null?void 0:N.getBoundingClientRect().height,O=(R=r.value)==null?void 0:R.getBoundingClientRect().y,L=(P=c.value)==null?void 0:P.getBoundingClientRect().height;document.documentElement.clientHeight<O+D+L?u.top=`-${L}px`:u.top=`${D}px`},x=()=>{var N,R,P;if(!((P=(R=(N=d.value)==null?void 0:N.children[0])==null?void 0:R.children)!=null&&P.length))return;const D="selected",O=d.value.children[0].children,L=d.value.offsetTop;let v=null;for(let _=0;_<O.length;_++)if(v=O[_],v.classList.contains(D)){if(!v.offsetTop)return;d.value.scrollTop=v.offsetTop-L;break}},b=async()=>{if(d.value&&c.value){await i.nextTick(),(f.value===null||f.value!==r.value.offsetWidth)&&(f.value=r.value.offsetWidth);const D=d.value.querySelectorAll(".ev-select-dropbox-item");let O=0;D.forEach(W=>{const H=W.scrollWidth;H>O&&(O=H)});const{borderLeftWidth:L,borderRightWidth:v}=window.getComputedStyle(c.value),N=parseInt(L)+parseInt(v),R=d.value.offsetWidth-d.value.clientWidth;O+=R+N;const P=window.innerWidth,A=c.value.getBoundingClientRect().left,z=P-A-20,X=Math.max(Math.min(O,z),f.value);h.value=`${X}px`}else h.value="100%"};i.watch(()=>s.value,async D=>{D&&(await x(),await b())}),i.watch(()=>m.value,async()=>{await g()}),t.filterable&&i.watch(()=>m.value,()=>g());const y=async()=>{t.items.length&&!t.disabled&&(s.value=!s.value,s.value&&await g())},M=()=>{t.filterable&&(l.value=""),s.value=!1},E=i.ref(!1),I=D=>{D||(E.value=!E.value),E.value?n.value=m.value.filter(O=>!O.disabled).map(O=>O.value):n.value=[]},T=D=>{t.filterable&&(l.value=""),s.value=!1,n.value!==D&&(n.value=D,o())},V=D=>{if(t.filterable&&(l.value=""),!n.value.includes(D))n.value.push(D);else{const O=n.value.indexOf(D);n.value.splice(O,1)}E.value=n.value.length===m.value.filter(O=>!O.disabled).length,n.value=[...n.value],o()},C=t.multiple?V:T,S=D=>D===n.value,w=D=>n.value.includes(D),k=t.multiple?w:S;i.watch(()=>n.value,D=>{t.multiple&&t.checkable&&(D.length===0?E.value=!1:E.value=D.length===m.value.filter(O=>!O.disabled).length,g())});const B=()=>{s.value&&(b(),g())};return i.onMounted(()=>{window.addEventListener("resize",B)}),i.onUnmounted(()=>{window.removeEventListener("resize",B)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:u,filterTextRef:l,filteredItems:m,clickSelectInput:y,clickOutsideDropbox:M,changeFilterText:p,changeDropboxPosition:g,clickItem:C,selectedItemClass:k,allCheck:E,changeAllCheck:I,dropboxWidth:h}},Bd={name:"EvSelect",components:{EvCheckbox:ln,EvCheckboxGroup:an},directives:{clickoutside:xd},props:{modelValue:{type:[Boolean,String,Number,Array,Object],default:null},placeholder:{type:String,default:""},searchPlaceholder:{type:String,default:"Please Enter a Search Words."},noMatchingText:{type:String,default:"NO MATCHING DATA"},items:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},filterText:{type:String,default:""},allCheckLabel:{type:String,default:"Select All"}},emits:{"update:modelValue":null,change:null},setup(){const{mv:e,selectedModel:t,computedPlaceholder:n,isClearableIcon:o,changeMv:s,removeMv:l,removeAllMv:a}=vd(),{select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:f,dropboxPosition:u,filterTextRef:m,filteredItems:p,clickSelectInput:g,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:M,selectedItemClass:E,allCheck:I,changeAllCheck:T,dropboxWidth:V}=Td({mv:e,changeMv:s});return{mv:e,selectedModel:t,computedPlaceholder:n,isClearableIcon:o,changeMv:s,removeMv:l,removeAllMv:a,select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:f,dropboxPosition:u,filterTextRef:m,filteredItems:p,clickSelectInput:g,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:M,selectedItemClass:E,allCheck:I,changeAllCheck:T,dropboxWidth:V}}},Dd={ref:"selectWrapper",class:"ev-select__wrapper"},Od=["placeholder","disabled"],Ld={key:1,class:"ev-select-tag-wrapper"},Rd=["placeholder","disabled"],Nd={class:"ev-tag-name"},Vd=["onClick"],Pd={key:0,class:"ev-select-tag"},_d={class:"ev-tag-name"},Ad={key:1,class:"ev-select-tag num"},zd={class:"ev-tag-name"},Fd={class:"ev-select-dropbox-wrapper"},Hd=["placeholder","value"],Wd={ref:"itemWrapper",class:"ev-select-dropbox-list"},$d={key:0,class:"ev-select-dropbox-ul"},Xd=["title","onClick"],Ud={key:1},Yd={class:"ev-select-dropbox-item disabled"},jd={key:0,class:"ev-select-dropbox-ul"},Gd=["title","onClick"],Zd={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},qd={key:0,class:"ev-select-dropbox-ul"},Kd=["title","onClick"],Jd={key:1},Qd={class:"ev-select-dropbox-item disabled"};function eh(e,t,n,o,s,l){const a=i.resolveComponent("ev-checkbox"),r=i.resolveComponent("ev-checkbox-group"),c=i.resolveDirective("clickoutside");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"select",class:i.normalizeClass(["ev-select",{selected:o.isDropbox,disabled:n.disabled}])},[i.createElementVNode("div",Dd,[n.multiple?(i.openBlock(),i.createElementBlock("div",Ld,[!n.clearable||!o.isClearableIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[3]||(t[3]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},[i.createElementVNode("i",{class:i.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:o.isDropbox}])},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",placeholder:o.computedPlaceholder,disabled:n.disabled,onClick:t[4]||(t[4]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},null,8,Rd),n.collapseTags?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o.selectedModel.length?(i.openBlock(),i.createElementBlock("div",Pd,[i.createElementVNode("span",_d,i.toDisplayString(o.selectedModel[0].name),1),i.createElementVNode("span",{class:"ev-tag-suffix",onClick:t[5]||(t[5]=i.withModifiers(d=>[o.removeMv(o.selectedModel[0].value),o.changeDropboxPosition()],["stop"]))},[...t[13]||(t[13]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):i.createCommentVNode("",!0),o.selectedModel.length>1?(i.openBlock(),i.createElementBlock("div",Ad,[i.createElementVNode("span",zd," + "+i.toDisplayString(o.selectedModel.length-1),1)])):i.createCommentVNode("",!0)],64)):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(o.selectedModel,d=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"ev-select-tag"},[i.createElementVNode("span",Nd,i.toDisplayString(d.name),1),i.createElementVNode("span",{class:"ev-tag-suffix",onClick:i.withModifiers(h=>[o.removeMv(d.value),o.changeDropboxPosition()],["stop"])},[...t[12]||(t[12]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Vd)]))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[!n.clearable||!o.isClearableIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[0]||(t[0]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},[i.createElementVNode("i",{class:i.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:o.isDropbox}])},null,2)])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>o.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:o.computedPlaceholder,disabled:n.disabled,onClick:t[2]||(t[2]=(...d)=>o.clickSelectInput&&o.clickSelectInput(...d))},null,8,Od),[[i.vModelText,o.selectedModel]])],64)),n.clearable?i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:t[6]||(t[6]=i.withModifiers(d=>[o.removeAllMv(),o.clickOutsideDropbox()],["stop"]))},[...t[14]||(t[14]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[i.vShow,o.isClearableIcon]]):i.createCommentVNode("",!0),i.createElementVNode("div",Fd,[o.isDropbox?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"dropbox",class:"ev-select-dropbox",style:i.normalizeStyle([o.dropboxPosition,{width:o.dropboxWidth}])},[n.filterable?i.renderSlot(e.$slots,"search-filter",{key:0,item:{value:o.filterTextRef,onInput:o.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[i.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:o.filterTextRef,onInput:t[7]||(t[7]=(...d)=>o.changeFilterText&&o.changeFilterText(...d))},null,40,Hd)]):i.createCommentVNode("",!0),n.checkable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.multiple?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-select-dropbox-item all-check",{selected:o.allCheck}]),onClick:t[10]||(t[10]=i.withModifiers(d=>[o.changeAllCheck(!1),o.changeDropboxPosition()],["self","prevent"]))},[i.createVNode(a,{modelValue:o.allCheck,"onUpdate:modelValue":t[8]||(t[8]=d=>o.allCheck=d),label:n.allCheckLabel,onChange:t[9]||(t[9]=d=>[o.changeAllCheck(!0),o.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):i.createCommentVNode("",!0),i.createElementVNode("div",Wd,[n.multiple?(i.openBlock(),i.createBlock(r,{key:0,modelValue:o.mv,"onUpdate:modelValue":t[11]||(t[11]=d=>o.mv=d)},{default:i.withCtx(()=>[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",$d,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(f=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["self","prevent"])},[i.createVNode(a,{label:d.value,disabled:d.disabled},{default:i.withCtx(()=>[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)]),_:2},1032,["label","disabled"])],10,Xd))),128))])):(i.openBlock(),i.createElementBlock("ul",Ud,[i.createElementVNode("li",Yd,i.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",jd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(f=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["stop","prevent"])},[i.createVNode(a,{"model-value":o.mv===d.value,disabled:d.disabled},{default:i.withCtx(()=>[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)]),_:2},1032,["model-value","disabled"])],10,Gd))),128))])):i.createCommentVNode("",!0)],64))],512)],64)):(i.openBlock(),i.createElementBlock("div",Zd,[o.filteredItems.length?(i.openBlock(),i.createElementBlock("ul",qd,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteredItems,(d,h)=>(i.openBlock(),i.createElementBlock("li",{key:`${d.value}_${h}`,class:i.normalizeClass(["ev-select-dropbox-item",{selected:o.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:i.withModifiers(f=>d.disabled?[]:[o.clickItem(d.value),o.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(d.iconClass)},null,2)):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.name),1)],10,Kd))),128))])):(i.openBlock(),i.createElementBlock("ul",Jd,[i.createElementVNode("li",Qd,i.toDisplayString(n.noMatchingText),1)]))],512))],4)):i.createCommentVNode("",!0)])],512)],2)),[[c,o.clickOutsideDropbox]])}const Bn=le(Bd,[["render",eh]]);Bn.install=e=>{e.component(Bn.name,Bn)};const th={name:"EvToggle",props:{modelValue:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeColor:{type:String,default:"#409EFF"},inactiveColor:{type:String,default:"#DCDFE6"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,clickMv:()=>{!e.disabled&&!e.readonly&&(n.value=!n.value)}}}};function nh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:i.normalizeStyle({width:`${n.width}px`,border:`1px solid ${n.modelValue?n.activeColor:n.inactiveColor}`,"background-color":`${n.modelValue?n.activeColor:n.inactiveColor}`}),onClick:t[0]||(t[0]=(...a)=>o.clickMv&&o.clickMv(...a))},null,6)}const Dn=le(th,[["render",nh]]);Dn.install=e=>{e.component(Dn.name,Dn)};const oh={name:"EvTextField",props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:"text"},placeholder:{type:String,default:""},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{type:Number,default:null},maxUnit:{type:String,default:"count"},showMaxLength:{type:Boolean,default:!1},errorMsg:{type:String,default:""},autocomplete:{type:String,default:"off"}},emits:["update:modelValue","focus","blur","input","change","search"],setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:g=>t("update:modelValue",g)}),o=i.ref(!1),s=()=>{e.type==="password"&&(o.value=!o.value)},l=i.computed(()=>e.type==="password"?o.value?"text":"password":e.type==="search"?"text":e.type);i.watch(()=>e.type,g=>{g!=="password"&&(o.value=!1)});const a=()=>{n.value=""},r=()=>{t("search",n.value)},c=g=>{e.type==="search"&&(g.key==="Enter"||g.keyCode===13)&&r()},d=g=>{t("focus",g)},h=g=>{t("blur",g)},f=g=>new TextEncoder().encode(g).length,u=i.computed(()=>e.maxUnit==="byte"?f(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:o,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:g=>{let x=g.target.value;if(e.maxLength&&e.maxUnit==="byte"){for(;f(x)>e.maxLength;)x=x.slice(0,-1);g.target.value=x}n.value=x,t("input",x,g)},changeMv:g=>t("change",n.value,g),currentLength:u}}},ih={class:"ev-text-field-wrapper"},sh=["placeholder","disabled","readonly","autocomplete","maxlength"],lh=["type","placeholder","disabled","readonly","autocomplete","maxlength"],ah={key:3,class:"ev-text-field-icon icon-suffix"},rh={key:4,class:"ev-text-field-icon icon-prefix"},ch={key:0,class:"ev-text-field-error"},dh={class:"curr-length"};function hh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-text-field",{disabled:n.disabled,clearable:n.clearable,readonly:n.readonly,error:!!n.errorMsg,"show-password":n.showPassword,"show-maxlength":n.showMaxLength,[`type-${n.type}`]:!!n.type,"ev-text-field-prefix":e.$slots["icon-prefix"],"ev-text-field-suffix":e.$slots["icon-suffix"],"ev-text-field-prefix-suffix":e.$slots["icon-prefix"]&&e.$slots["icon-suffix"]}])},[i.createElementVNode("div",ih,[n.type==="textarea"?i.withDirectives((i.openBlock(),i.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=a=>o.mv=a),class:"ev-textarea",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[1]||(t[1]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>o.blurInput&&o.blurInput(...a)),onInput:t[3]||(t[3]=(...a)=>o.inputMv&&o.inputMv(...a)),onChange:t[4]||(t[4]=(...a)=>o.changeMv&&o.changeMv(...a))},null,40,sh)),[[i.vModelText,o.mv]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>o.mv=a),class:"ev-input",type:o.inputType,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,autocomplete:n.autocomplete,maxlength:n.maxUnit==="byte"?null:n.maxLength,onFocus:t[6]||(t[6]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[7]||(t[7]=(...a)=>o.blurInput&&o.blurInput(...a)),onInput:t[8]||(t[8]=(...a)=>o.inputMv&&o.inputMv(...a)),onChange:t[9]||(t[9]=(...a)=>o.changeMv&&o.changeMv(...a)),onKeyup:t[10]||(t[10]=(...a)=>o.keyupInput&&o.keyupInput(...a))},null,40,lh),[[i.vModelDynamic,o.mv]]),n.type==="text"&&n.clearable?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:t[11]||(t[11]=(...a)=>o.clearValue&&o.clearValue(...a))},[...t[14]||(t[14]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):i.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["ev-text-field-icon icon-password",{on:o.isPasswordVisible}]),onClick:t[12]||(t[12]=(...a)=>o.changePasswordVisible&&o.changePasswordVisible(...a))},[i.createElementVNode("i",{class:i.normalizeClass(o.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):i.createCommentVNode("",!0),n.type==="search"?(i.openBlock(),i.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:t[13]||(t[13]=(...a)=>o.searchValue&&o.searchValue(...a))},[...t[15]||(t[15]=[i.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):i.createCommentVNode("",!0),e.$slots["icon-suffix"]?(i.openBlock(),i.createElementBlock("span",ah,[i.renderSlot(e.$slots,"icon-suffix")])):i.createCommentVNode("",!0),e.$slots["icon-prefix"]?(i.openBlock(),i.createElementBlock("span",rh,[i.renderSlot(e.$slots,"icon-prefix")])):i.createCommentVNode("",!0)],64))]),n.errorMsg?(i.openBlock(),i.createElementBlock("div",ch,i.toDisplayString(n.errorMsg),1)):i.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["ev-text-field-maxlength",{max:o.currentLength>n.maxLength}])},[i.createElementVNode("span",dh,i.toDisplayString(o.currentLength),1),i.createTextVNode(" / "+i.toDisplayString(n.maxLength)+i.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):i.createCommentVNode("",!0)],2)}const On=le(oh,[["render",hh]]);On.install=e=>{e.component(On.name,On)};function Zl(e){let t=null;if(typeof e=="string"||typeof e=="number"){const n=/^(normal|(-*\d+(?:\.\d+)?)(px|%)?)$/.exec(e);t=n?{value:+n[2],unit:n[3]||void 0}:null}return t}function ve(e){return typeof e=="number"&&!Number.isNaN(e)}function ut(...e){return e.every(ve)}function We(e,t){const n=e/t*100;return!ut(e,t,n)||e===0||t===0?0:n.toFixed(2)}function fh(e){return ut(e)?1e6*e:0}function uh(e){return ut(e)?1e9*e:0}function mh(e){return ut(e)?1e12*e:0}function gh(e){return ut(e)?1e15*e:0}function $t(e){const t=/\B(?=(\d{3})+(?!\d))/g;if(ut(e)){if(Number.isInteger(e))return e.toString().replace(t,",");const n=e.toString().split(".");return n[0].replace(t,",")+(n[1]?`.${n[1]}`:"")}return!1}function Ln(e){const t=(e==null?void 0:e.toString().split(".")[1])||0;return t?t.length:0}function Gi(e){return e==null}function ph(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function Rn(e,{min:t,max:n,step:o}){const s=Math.floor((e-t)/o),l=(e-t)%o,a=Math.floor((n-t)/o),r=Math.max(Ln(o),Ln(t));let c=!1,d;if(r){let h=+parseFloat(o*s).toFixed(r);d=+(h+t).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==o,l>o/2&&!c&&(d=+(d+o).toFixed(r)),d>n?(h=+parseFloat(o*a).toFixed(r),d=+(h+t).toFixed(r)):d<t&&(d=t)}else d=o*s+t,c=s===a&&n-d!==o,l>o/2&&!c&&(d+=o),d>n?d=o*a+t:d<t&&(d=t);return d}function yh(){const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(e.modelValue),o=i.ref(e.modelValue),s=d=>e.precision&&(d||d===0)?Number(d).toFixed(e.precision):d,l=d=>{let h=d;!d&&d!==0?h=e.stepStrictly?o.value:null:isNaN(d)?h=o.value:e.stepStrictly?(e.min===-1/0&&(e.min=0),h=Rn(d,{min:e.min,max:e.max,step:e.step})):(e.min||e.min===0)&&h<e.min?h=e.min:(e.max||e.max===0)&&h>e.max?h=e.max:h=+h,n.value=s(h),o.value=s(h),t("update:modelValue",h),t("change",h)},a=d=>{t("focus",d)},r=d=>{t("blur",d)},c=d=>{l(d.target.value)};return i.watch(()=>e.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function xh(e){const{props:t}=i.getCurrentInstance(),{currentValue:n,validateValue:o}=e;return{stepValue:l=>{if(t.readonly||t.disabled)return;let a;if(!n.value&&n.value!==0)a=t.min===-1/0?0:t.min;else{const r=+n.value,c=l==="up"?t.step:t.step*-1,h=10**Math.max(Ln(r),Ln(t.step));a=(Math.round(r*h)+Math.round(c*h))/h}a>=t.min&&a<=t.max&&o(a)}}}function bh(e){const{props:t}=i.getCurrentInstance(),{currentValue:n,validateValue:o}=e,s=t.max||t.max===0,l=t.min||t.min===0,a=()=>{s&&l&&t.max<=t.min&&console.warn("[EVUI][InputNumber] Max value must be greater than min value."),t.step&&(t.precision||t.precision===0)&&Ln(t.step)>t.precision&&console.warn("[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.")},r=()=>{let c=n.value;isNaN(n.value)&&(c=0),(c||c===0)&&(s&&c>t.max?c=t.max:l&&c<t.min&&(c=t.min)),o(c)};i.onBeforeMount(()=>{a(),r()})}const Ch={name:"EvInputNumber",props:{modelValue:{type:[String,Number],default:null},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},step:{type:Number,default:1,validator:e=>e>0},stepStrictly:{type:Boolean,default:!1},precision:{type:Number,default:0,validator:e=>e>=0&&e<=100&&e===parseInt(e,10)}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:e,validateValue:t,focusInput:n,blurInput:o,changeMv:s}=yh(),{stepValue:l}=xh({currentValue:e,validateValue:t});return bh({currentValue:e,validateValue:t}),{currentValue:e,validateValue:t,focusInput:n,blurInput:o,changeMv:s,stepValue:l}}},Sh={class:"ev-input-number__wrapper"},wh=["onClick"],kh=["placeholder","disabled","readonly"];function Mh(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[i.createElementVNode("div",Sh,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["up","down"],a=>i.createElementVNode("span",{key:`step-arrow-${a}`,class:i.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>o.stepValue(a)},[i.createElementVNode("i",{class:i.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,wh)),64)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>o.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:t[1]||(t[1]=(...a)=>o.focusInput&&o.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>o.blurInput&&o.blurInput(...a)),onChange:t[3]||(t[3]=(...a)=>o.changeMv&&o.changeMv(...a)),onKeydown:[t[4]||(t[4]=i.withKeys(i.withModifiers(a=>o.stepValue("up"),["prevent"]),["up"])),t[5]||(t[5]=i.withKeys(i.withModifiers(a=>o.stepValue("down"),["prevent"]),["down"])),t[6]||(t[6]=i.withKeys(i.withModifiers(a=>o.validateValue(o.currentValue),["prevent"]),["enter"]))]},null,40,kh),[[i.vModelText,o.currentValue,void 0,{trim:!0}]])])],2)}const Nn=le(Ch,[["render",Mh]]);Nn.install=e=>{e.component(Nn.name,Nn)};var ql=typeof global=="object"&&global&&global.Object===Object&&global,Ih=typeof self=="object"&&self&&self.Object===Object&&self,tt=ql||Ih||Function("return this")(),mt=tt.Symbol,Kl=Object.prototype,Eh=Kl.hasOwnProperty,vh=Kl.toString,Vn=mt?mt.toStringTag:void 0;function Th(e){var t=Eh.call(e,Vn),n=e[Vn];try{e[Vn]=void 0;var o=!0}catch{}var s=vh.call(e);return o&&(t?e[Vn]=n:delete e[Vn]),s}var Bh=Object.prototype,Dh=Bh.toString;function Oh(e){return Dh.call(e)}var Lh="[object Null]",Rh="[object Undefined]",Jl=mt?mt.toStringTag:void 0;function Rt(e){return e==null?e===void 0?Rh:Lh:Jl&&Jl in Object(e)?Th(e):Oh(e)}function nt(e){return e!=null&&typeof e=="object"}var Nh="[object Symbol]";function Vo(e){return typeof e=="symbol"||nt(e)&&Rt(e)==Nh}function Vh(e,t){for(var n=-1,o=e==null?0:e.length,s=Array(o);++n<o;)s[n]=t(e[n],n,e);return s}var Ye=Array.isArray,Ql=mt?mt.prototype:void 0,ea=Ql?Ql.toString:void 0;function ta(e){if(typeof e=="string")return e;if(Ye(e))return Vh(e,ta)+"";if(Vo(e))return ea?ea.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Ph=/\s/;function _h(e){for(var t=e.length;t--&&Ph.test(e.charAt(t)););return t}var Ah=/^\s+/;function zh(e){return e&&e.slice(0,_h(e)+1).replace(Ah,"")}function Ve(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var na=NaN,Fh=/^[-+]0x[0-9a-f]+$/i,Hh=/^0b[01]+$/i,Wh=/^0o[0-7]+$/i,$h=parseInt;function Po(e){if(typeof e=="number")return e;if(Vo(e))return na;if(Ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=zh(e);var n=Hh.test(e);return n||Wh.test(e)?$h(e.slice(2),n?2:8):Fh.test(e)?na:+e}var oa=1/0,Xh=17976931348623157e292;function ia(e){if(!e)return e===0?e:0;if(e=Po(e),e===oa||e===-oa){var t=e<0?-1:1;return t*Xh}return e===e?e:0}function Zi(e){return e}var Uh="[object AsyncFunction]",Yh="[object Function]",jh="[object GeneratorFunction]",Gh="[object Proxy]";function qi(e){if(!Ve(e))return!1;var t=Rt(e);return t==Yh||t==jh||t==Uh||t==Gh}var Ki=tt["__core-js_shared__"],sa=function(){var e=/[^.]+$/.exec(Ki&&Ki.keys&&Ki.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Zh(e){return!!sa&&sa in e}var qh=Function.prototype,Kh=qh.toString;function Xt(e){if(e!=null){try{return Kh.call(e)}catch{}try{return e+""}catch{}}return""}var Jh=/[\\^$.*+?()[\]{}|]/g,Qh=/^\[object .+?Constructor\]$/,ef=Function.prototype,tf=Object.prototype,nf=ef.toString,of=tf.hasOwnProperty,sf=RegExp("^"+nf.call(of).replace(Jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lf(e){if(!Ve(e)||Zh(e))return!1;var t=qi(e)?sf:Qh;return t.test(Xt(e))}function af(e,t){return e==null?void 0:e[t]}function Ut(e,t){var n=af(e,t);return lf(n)?n:void 0}var Ji=Ut(tt,"WeakMap"),la=Object.create,rf=function(){function e(){}return function(t){if(!Ve(t))return{};if(la)return la(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function aa(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cf(){}function df(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}var hf=800,ff=16,uf=Date.now;function mf(e){var t=0,n=0;return function(){var o=uf(),s=ff-(o-n);if(n=o,s>0){if(++t>=hf)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function gf(e){return function(){return e}}var _o=function(){try{var e=Ut(Object,"defineProperty");return e({},"",{}),e}catch{}}(),pf=_o?function(e,t){return _o(e,"toString",{configurable:!0,enumerable:!1,value:gf(t),writable:!0})}:Zi,yf=mf(pf);function xf(e,t){for(var n=-1,o=e==null?0:e.length;++n<o&&t(e[n],n,e)!==!1;);return e}function bf(e,t,n,o){for(var s=e.length,l=n+-1;++l<s;)if(t(e[l],l,e))return l;return-1}function Cf(e){return e!==e}function Sf(e,t,n){for(var o=n-1,s=e.length;++o<s;)if(e[o]===t)return o;return-1}function wf(e,t,n){return t===t?Sf(e,t,n):bf(e,Cf,n)}function kf(e,t){var n=e==null?0:e.length;return!!n&&wf(e,t,0)>-1}var Mf=9007199254740991,If=/^(?:0|[1-9]\d*)$/;function Qi(e,t){var n=typeof e;return t=t??Mf,!!t&&(n=="number"||n!="symbol"&&If.test(e))&&e>-1&&e%1==0&&e<t}function es(e,t,n){t=="__proto__"&&_o?_o(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Pn(e,t){return e===t||e!==e&&t!==t}var Ef=Object.prototype,vf=Ef.hasOwnProperty;function ra(e,t,n){var o=e[t];(!(vf.call(e,t)&&Pn(o,n))||n===void 0&&!(t in e))&&es(e,t,n)}function Tf(e,t,n,o){var s=!n;n||(n={});for(var l=-1,a=t.length;++l<a;){var r=t[l],c=void 0;c===void 0&&(c=e[r]),s?es(n,r,c):ra(n,r,c)}return n}var ca=Math.max;function Bf(e,t,n){return t=ca(t===void 0?e.length-1:t,0),function(){for(var o=arguments,s=-1,l=ca(o.length-t,0),a=Array(l);++s<l;)a[s]=o[t+s];s=-1;for(var r=Array(t+1);++s<t;)r[s]=o[s];return r[t]=n(a),aa(e,this,r)}}function da(e,t){return yf(Bf(e,t,Zi),e+"")}var Df=9007199254740991;function ts(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Df}function Ao(e){return e!=null&&ts(e.length)&&!qi(e)}function Of(e,t,n){if(!Ve(n))return!1;var o=typeof t;return(o=="number"?Ao(n)&&Qi(t,n.length):o=="string"&&t in n)?Pn(n[t],e):!1}function ha(e){return da(function(t,n){var o=-1,s=n.length,l=s>1?n[s-1]:void 0,a=s>2?n[2]:void 0;for(l=e.length>3&&typeof l=="function"?(s--,l):void 0,a&&Of(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),t=Object(t);++o<s;){var r=n[o];r&&e(t,r,o,l)}return t})}var Lf=Object.prototype;function ns(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Lf;return e===n}function Rf(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}var Nf="[object Arguments]";function fa(e){return nt(e)&&Rt(e)==Nf}var ua=Object.prototype,Vf=ua.hasOwnProperty,Pf=ua.propertyIsEnumerable,zo=fa(function(){return arguments}())?fa:function(e){return nt(e)&&Vf.call(e,"callee")&&!Pf.call(e,"callee")};function _f(){return!1}var ma=typeof se=="object"&&se&&!se.nodeType&&se,ga=ma&&typeof module=="object"&&module&&!module.nodeType&&module,Af=ga&&ga.exports===ma,pa=Af?tt.Buffer:void 0,zf=pa?pa.isBuffer:void 0,_n=zf||_f,Ff="[object Arguments]",Hf="[object Array]",Wf="[object Boolean]",$f="[object Date]",Xf="[object Error]",Uf="[object Function]",Yf="[object Map]",jf="[object Number]",Gf="[object Object]",Zf="[object RegExp]",qf="[object Set]",Kf="[object String]",Jf="[object WeakMap]",Qf="[object ArrayBuffer]",eu="[object DataView]",tu="[object Float32Array]",nu="[object Float64Array]",ou="[object Int8Array]",iu="[object Int16Array]",su="[object Int32Array]",lu="[object Uint8Array]",au="[object Uint8ClampedArray]",ru="[object Uint16Array]",cu="[object Uint32Array]",ye={};ye[tu]=ye[nu]=ye[ou]=ye[iu]=ye[su]=ye[lu]=ye[au]=ye[ru]=ye[cu]=!0,ye[Ff]=ye[Hf]=ye[Qf]=ye[Wf]=ye[eu]=ye[$f]=ye[Xf]=ye[Uf]=ye[Yf]=ye[jf]=ye[Gf]=ye[Zf]=ye[qf]=ye[Kf]=ye[Jf]=!1;function du(e){return nt(e)&&ts(e.length)&&!!ye[Rt(e)]}function os(e){return function(t){return e(t)}}var ya=typeof se=="object"&&se&&!se.nodeType&&se,An=ya&&typeof module=="object"&&module&&!module.nodeType&&module,hu=An&&An.exports===ya,is=hu&&ql.process,cn=function(){try{var e=An&&An.require&&An.require("util").types;return e||is&&is.binding&&is.binding("util")}catch{}}(),xa=cn&&cn.isTypedArray,ss=xa?os(xa):du,fu=Object.prototype,uu=fu.hasOwnProperty;function ba(e,t){var n=Ye(e),o=!n&&zo(e),s=!n&&!o&&_n(e),l=!n&&!o&&!s&&ss(e),a=n||o||s||l,r=a?Rf(e.length,String):[],c=r.length;for(var d in e)(t||uu.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Qi(d,c)))&&r.push(d);return r}function Ca(e,t){return function(n){return e(t(n))}}var mu=Ca(Object.keys,Object),gu=Object.prototype,pu=gu.hasOwnProperty;function yu(e){if(!ns(e))return mu(e);var t=[];for(var n in Object(e))pu.call(e,n)&&n!="constructor"&&t.push(n);return t}function Sa(e){return Ao(e)?ba(e):yu(e)}function xu(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bu=Object.prototype,Cu=bu.hasOwnProperty;function Su(e){if(!Ve(e))return xu(e);var t=ns(e),n=[];for(var o in e)o=="constructor"&&(t||!Cu.call(e,o))||n.push(o);return n}function wa(e){return Ao(e)?ba(e,!0):Su(e)}var wu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ku=/^\w*$/;function ls(e,t){if(Ye(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Vo(e)?!0:ku.test(e)||!wu.test(e)||t!=null&&e in Object(t)}var zn=Ut(Object,"create");function Mu(){this.__data__=zn?zn(null):{},this.size=0}function Iu(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Eu="__lodash_hash_undefined__",vu=Object.prototype,Tu=vu.hasOwnProperty;function Bu(e){var t=this.__data__;if(zn){var n=t[e];return n===Eu?void 0:n}return Tu.call(t,e)?t[e]:void 0}var Du=Object.prototype,Ou=Du.hasOwnProperty;function Lu(e){var t=this.__data__;return zn?t[e]!==void 0:Ou.call(t,e)}var Ru="__lodash_hash_undefined__";function Nu(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=zn&&t===void 0?Ru:t,this}function Yt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Yt.prototype.clear=Mu,Yt.prototype.delete=Iu,Yt.prototype.get=Bu,Yt.prototype.has=Lu,Yt.prototype.set=Nu;function Vu(){this.__data__=[],this.size=0}function Fo(e,t){for(var n=e.length;n--;)if(Pn(e[n][0],t))return n;return-1}var Pu=Array.prototype,_u=Pu.splice;function Au(e){var t=this.__data__,n=Fo(t,e);if(n<0)return!1;var o=t.length-1;return n==o?t.pop():_u.call(t,n,1),--this.size,!0}function zu(e){var t=this.__data__,n=Fo(t,e);return n<0?void 0:t[n][1]}function Fu(e){return Fo(this.__data__,e)>-1}function Hu(e,t){var n=this.__data__,o=Fo(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}function bt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}bt.prototype.clear=Vu,bt.prototype.delete=Au,bt.prototype.get=zu,bt.prototype.has=Fu,bt.prototype.set=Hu;var Fn=Ut(tt,"Map");function Wu(){this.size=0,this.__data__={hash:new Yt,map:new(Fn||bt),string:new Yt}}function $u(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ho(e,t){var n=e.__data__;return $u(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Xu(e){var t=Ho(this,e).delete(e);return this.size-=t?1:0,t}function Uu(e){return Ho(this,e).get(e)}function Yu(e){return Ho(this,e).has(e)}function ju(e,t){var n=Ho(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}function Ct(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Ct.prototype.clear=Wu,Ct.prototype.delete=Xu,Ct.prototype.get=Uu,Ct.prototype.has=Yu,Ct.prototype.set=ju;var Gu="Expected a function";function as(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Gu);var n=function(){var o=arguments,s=t?t.apply(this,o):o[0],l=n.cache;if(l.has(s))return l.get(s);var a=e.apply(this,o);return n.cache=l.set(s,a)||l,a};return n.cache=new(as.Cache||Ct),n}as.Cache=Ct;var Zu=500;function qu(e){var t=as(e,function(o){return n.size===Zu&&n.clear(),o}),n=t.cache;return t}var Ku=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ju=/\\(\\)?/g,Qu=qu(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Ku,function(n,o,s,l){t.push(s?l.replace(Ju,"$1"):o||n)}),t});function em(e){return e==null?"":ta(e)}function ka(e,t){return Ye(e)?e:ls(e,t)?[e]:Qu(em(e))}function Wo(e){if(typeof e=="string"||Vo(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ma(e,t){t=ka(t,e);for(var n=0,o=t.length;e!=null&&n<o;)e=e[Wo(t[n++])];return n&&n==o?e:void 0}function tm(e,t,n){var o=e==null?void 0:Ma(e,t);return o===void 0?n:o}function nm(e,t){for(var n=-1,o=t.length,s=e.length;++n<o;)e[s+n]=t[n];return e}var Ia=Ca(Object.getPrototypeOf,Object),om="[object Object]",im=Function.prototype,sm=Object.prototype,Ea=im.toString,lm=sm.hasOwnProperty,am=Ea.call(Object);function rm(e){if(!nt(e)||Rt(e)!=om)return!1;var t=Ia(e);if(t===null)return!0;var n=lm.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ea.call(n)==am}function cm(){this.__data__=new bt,this.size=0}function dm(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hm(e){return this.__data__.get(e)}function fm(e){return this.__data__.has(e)}var um=200;function mm(e,t){var n=this.__data__;if(n instanceof bt){var o=n.__data__;if(!Fn||o.length<um-1)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ct(o)}return n.set(e,t),this.size=n.size,this}function ot(e){var t=this.__data__=new bt(e);this.size=t.size}ot.prototype.clear=cm,ot.prototype.delete=dm,ot.prototype.get=hm,ot.prototype.has=fm,ot.prototype.set=mm;var va=typeof se=="object"&&se&&!se.nodeType&&se,Ta=va&&typeof module=="object"&&module&&!module.nodeType&&module,gm=Ta&&Ta.exports===va,Ba=gm?tt.Buffer:void 0,Da=Ba?Ba.allocUnsafe:void 0;function Oa(e,t){if(t)return e.slice();var n=e.length,o=Da?Da(n):new e.constructor(n);return e.copy(o),o}function pm(e,t){for(var n=-1,o=e==null?0:e.length,s=0,l=[];++n<o;){var a=e[n];t(a,n,e)&&(l[s++]=a)}return l}function ym(){return[]}var xm=Object.prototype,bm=xm.propertyIsEnumerable,La=Object.getOwnPropertySymbols,Cm=La?function(e){return e==null?[]:(e=Object(e),pm(La(e),function(t){return bm.call(e,t)}))}:ym;function Sm(e,t,n){var o=t(e);return Ye(e)?o:nm(o,n(e))}function rs(e){return Sm(e,Sa,Cm)}var cs=Ut(tt,"DataView"),ds=Ut(tt,"Promise"),dn=Ut(tt,"Set"),Ra="[object Map]",wm="[object Object]",Na="[object Promise]",Va="[object Set]",Pa="[object WeakMap]",_a="[object DataView]",km=Xt(cs),Mm=Xt(Fn),Im=Xt(ds),Em=Xt(dn),vm=Xt(Ji),it=Rt;(cs&&it(new cs(new ArrayBuffer(1)))!=_a||Fn&&it(new Fn)!=Ra||ds&&it(ds.resolve())!=Na||dn&&it(new dn)!=Va||Ji&&it(new Ji)!=Pa)&&(it=function(e){var t=Rt(e),n=t==wm?e.constructor:void 0,o=n?Xt(n):"";if(o)switch(o){case km:return _a;case Mm:return Ra;case Im:return Na;case Em:return Va;case vm:return Pa}return t});var Tm=Object.prototype,Bm=Tm.hasOwnProperty;function Dm(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Bm.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var $o=tt.Uint8Array;function hs(e){var t=new e.constructor(e.byteLength);return new $o(t).set(new $o(e)),t}function Om(e,t){var n=hs(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Lm=/\w*$/;function Rm(e){var t=new e.constructor(e.source,Lm.exec(e));return t.lastIndex=e.lastIndex,t}var Aa=mt?mt.prototype:void 0,za=Aa?Aa.valueOf:void 0;function Nm(e){return za?Object(za.call(e)):{}}function Fa(e,t){var n=t?hs(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Vm="[object Boolean]",Pm="[object Date]",_m="[object Map]",Am="[object Number]",zm="[object RegExp]",Fm="[object Set]",Hm="[object String]",Wm="[object Symbol]",$m="[object ArrayBuffer]",Xm="[object DataView]",Um="[object Float32Array]",Ym="[object Float64Array]",jm="[object Int8Array]",Gm="[object Int16Array]",Zm="[object Int32Array]",qm="[object Uint8Array]",Km="[object Uint8ClampedArray]",Jm="[object Uint16Array]",Qm="[object Uint32Array]";function eg(e,t,n){var o=e.constructor;switch(t){case $m:return hs(e);case Vm:case Pm:return new o(+e);case Xm:return Om(e);case Um:case Ym:case jm:case Gm:case Zm:case qm:case Km:case Jm:case Qm:return Fa(e,n);case _m:return new o;case Am:case Hm:return new o(e);case zm:return Rm(e);case Fm:return new o;case Wm:return Nm(e)}}function Ha(e){return typeof e.constructor=="function"&&!ns(e)?rf(Ia(e)):{}}var tg="[object Map]";function ng(e){return nt(e)&&it(e)==tg}var Wa=cn&&cn.isMap,og=Wa?os(Wa):ng,ig="[object Set]";function sg(e){return nt(e)&&it(e)==ig}var $a=cn&&cn.isSet,lg=$a?os($a):sg,ag=1,Xa="[object Arguments]",rg="[object Array]",cg="[object Boolean]",dg="[object Date]",hg="[object Error]",Ua="[object Function]",fg="[object GeneratorFunction]",ug="[object Map]",mg="[object Number]",Ya="[object Object]",gg="[object RegExp]",pg="[object Set]",yg="[object String]",xg="[object Symbol]",bg="[object WeakMap]",Cg="[object ArrayBuffer]",Sg="[object DataView]",wg="[object Float32Array]",kg="[object Float64Array]",Mg="[object Int8Array]",Ig="[object Int16Array]",Eg="[object Int32Array]",vg="[object Uint8Array]",Tg="[object Uint8ClampedArray]",Bg="[object Uint16Array]",Dg="[object Uint32Array]",ge={};ge[Xa]=ge[rg]=ge[Cg]=ge[Sg]=ge[cg]=ge[dg]=ge[wg]=ge[kg]=ge[Mg]=ge[Ig]=ge[Eg]=ge[ug]=ge[mg]=ge[Ya]=ge[gg]=ge[pg]=ge[yg]=ge[xg]=ge[vg]=ge[Tg]=ge[Bg]=ge[Dg]=!0,ge[hg]=ge[Ua]=ge[bg]=!1;function Xo(e,t,n,o,s,l){var a,r=t&ag;if(a!==void 0)return a;if(!Ve(e))return e;var c=Ye(e);if(c)a=Dm(e);else{var d=it(e),h=d==Ua||d==fg;if(_n(e))return Oa(e,r);if(d==Ya||d==Xa||h&&!s)a=h?{}:Ha(e);else{if(!ge[d])return s?e:{};a=eg(e,d,r)}}l||(l=new ot);var f=l.get(e);if(f)return f;l.set(e,a),lg(e)?e.forEach(function(p){a.add(Xo(p,t,n,p,e,l))}):og(e)&&e.forEach(function(p,g){a.set(g,Xo(p,t,n,g,e,l))});var u=rs,m=c?void 0:u(e);return xf(m||e,function(p,g){m&&(g=p,p=e[g]),ra(a,g,Xo(p,t,n,g,e,l))}),a}var Og=1,Lg=4;function Se(e){return Xo(e,Og|Lg)}var Rg="__lodash_hash_undefined__";function Ng(e){return this.__data__.set(e,Rg),this}function Vg(e){return this.__data__.has(e)}function Hn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ct;++t<n;)this.add(e[t])}Hn.prototype.add=Hn.prototype.push=Ng,Hn.prototype.has=Vg;function Pg(e,t){for(var n=-1,o=e==null?0:e.length;++n<o;)if(t(e[n],n,e))return!0;return!1}function ja(e,t){return e.has(t)}var _g=1,Ag=2;function Ga(e,t,n,o,s,l){var a=n&_g,r=e.length,c=t.length;if(r!=c&&!(a&&c>r))return!1;var d=l.get(e),h=l.get(t);if(d&&h)return d==t&&h==e;var f=-1,u=!0,m=n&Ag?new Hn:void 0;for(l.set(e,t),l.set(t,e);++f<r;){var p=e[f],g=t[f];if(o)var x=a?o(g,p,f,t,e,l):o(p,g,f,e,t,l);if(x!==void 0){if(x)continue;u=!1;break}if(m){if(!Pg(t,function(b,y){if(!ja(m,y)&&(p===b||s(p,b,n,o,l)))return m.push(y)})){u=!1;break}}else if(!(p===g||s(p,g,n,o,l))){u=!1;break}}return l.delete(e),l.delete(t),u}function zg(e){var t=-1,n=Array(e.size);return e.forEach(function(o,s){n[++t]=[s,o]}),n}function fs(e){var t=-1,n=Array(e.size);return e.forEach(function(o){n[++t]=o}),n}var Fg=1,Hg=2,Wg="[object Boolean]",$g="[object Date]",Xg="[object Error]",Ug="[object Map]",Yg="[object Number]",jg="[object RegExp]",Gg="[object Set]",Zg="[object String]",qg="[object Symbol]",Kg="[object ArrayBuffer]",Jg="[object DataView]",Za=mt?mt.prototype:void 0,us=Za?Za.valueOf:void 0;function Qg(e,t,n,o,s,l,a){switch(n){case Jg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Kg:return!(e.byteLength!=t.byteLength||!l(new $o(e),new $o(t)));case Wg:case $g:case Yg:return Pn(+e,+t);case Xg:return e.name==t.name&&e.message==t.message;case jg:case Zg:return e==t+"";case Ug:var r=zg;case Gg:var c=o&Fg;if(r||(r=fs),e.size!=t.size&&!c)return!1;var d=a.get(e);if(d)return d==t;o|=Hg,a.set(e,t);var h=Ga(r(e),r(t),o,s,l,a);return a.delete(e),h;case qg:if(us)return us.call(e)==us.call(t)}return!1}var ep=1,tp=Object.prototype,np=tp.hasOwnProperty;function op(e,t,n,o,s,l){var a=n&ep,r=rs(e),c=r.length,d=rs(t),h=d.length;if(c!=h&&!a)return!1;for(var f=c;f--;){var u=r[f];if(!(a?u in t:np.call(t,u)))return!1}var m=l.get(e),p=l.get(t);if(m&&p)return m==t&&p==e;var g=!0;l.set(e,t),l.set(t,e);for(var x=a;++f<c;){u=r[f];var b=e[u],y=t[u];if(o)var M=a?o(y,b,u,t,e,l):o(b,y,u,e,t,l);if(!(M===void 0?b===y||s(b,y,n,o,l):M)){g=!1;break}x||(x=u=="constructor")}if(g&&!x){var E=e.constructor,I=t.constructor;E!=I&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof I=="function"&&I instanceof I)&&(g=!1)}return l.delete(e),l.delete(t),g}var ip=1,qa="[object Arguments]",Ka="[object Array]",Uo="[object Object]",sp=Object.prototype,Ja=sp.hasOwnProperty;function lp(e,t,n,o,s,l){var a=Ye(e),r=Ye(t),c=a?Ka:it(e),d=r?Ka:it(t);c=c==qa?Uo:c,d=d==qa?Uo:d;var h=c==Uo,f=d==Uo,u=c==d;if(u&&_n(e)){if(!_n(t))return!1;a=!0,h=!1}if(u&&!h)return l||(l=new ot),a||ss(e)?Ga(e,t,n,o,s,l):Qg(e,t,c,n,o,s,l);if(!(n&ip)){var m=h&&Ja.call(e,"__wrapped__"),p=f&&Ja.call(t,"__wrapped__");if(m||p){var g=m?e.value():e,x=p?t.value():t;return l||(l=new ot),s(g,x,n,o,l)}}return u?(l||(l=new ot),op(e,t,n,o,s,l)):!1}function Yo(e,t,n,o,s){return e===t?!0:e==null||t==null||!nt(e)&&!nt(t)?e!==e&&t!==t:lp(e,t,n,o,Yo,s)}var ap=1,rp=2;function cp(e,t,n,o){var s=n.length,l=s;if(e==null)return!l;for(e=Object(e);s--;){var a=n[s];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++s<l;){a=n[s];var r=a[0],c=e[r],d=a[1];if(a[2]){if(c===void 0&&!(r in e))return!1}else{var h=new ot,f;if(!(f===void 0?Yo(d,c,ap|rp,o,h):f))return!1}}return!0}function Qa(e){return e===e&&!Ve(e)}function dp(e){for(var t=Sa(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,Qa(s)]}return t}function er(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function hp(e){var t=dp(e);return t.length==1&&t[0][2]?er(t[0][0],t[0][1]):function(n){return n===e||cp(n,e,t)}}function fp(e,t){return e!=null&&t in Object(e)}function up(e,t,n){t=ka(t,e);for(var o=-1,s=t.length,l=!1;++o<s;){var a=Wo(t[o]);if(!(l=e!=null&&n(e,a)))break;e=e[a]}return l||++o!=s?l:(s=e==null?0:e.length,!!s&&ts(s)&&Qi(a,s)&&(Ye(e)||zo(e)))}function mp(e,t){return e!=null&&up(e,t,fp)}var gp=1,pp=2;function yp(e,t){return ls(e)&&Qa(t)?er(Wo(e),t):function(n){var o=tm(n,e);return o===void 0&&o===t?mp(n,e):Yo(t,o,gp|pp)}}function xp(e){return function(t){return t==null?void 0:t[e]}}function bp(e){return function(t){return Ma(t,e)}}function Cp(e){return ls(e)?xp(Wo(e)):bp(e)}function Sp(e){return typeof e=="function"?e:e==null?Zi:typeof e=="object"?Ye(e)?yp(e[0],e[1]):hp(e):Cp(e)}function wp(e){return function(t,n,o){for(var s=-1,l=Object(t),a=o(t),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return t}}var kp=wp(),ms=function(){return tt.Date.now()},Mp="Expected a function",Ip=Math.max,Ep=Math.min;function jo(e,t,n){var o,s,l,a,r,c,d=0,h=!1,f=!1,u=!0;if(typeof e!="function")throw new TypeError(Mp);t=Po(t)||0,Ve(n)&&(h=!!n.leading,f="maxWait"in n,l=f?Ip(Po(n.maxWait)||0,t):l,u="trailing"in n?!!n.trailing:u);function m(T){var V=o,C=s;return o=s=void 0,d=T,a=e.apply(C,V),a}function p(T){return d=T,r=setTimeout(b,t),h?m(T):a}function g(T){var V=T-c,C=T-d,S=t-V;return f?Ep(S,l-C):S}function x(T){var V=T-c,C=T-d;return c===void 0||V>=t||V<0||f&&C>=l}function b(){var T=ms();if(x(T))return y(T);r=setTimeout(b,g(T))}function y(T){return r=void 0,u&&o?m(T):(o=s=void 0,a)}function M(){r!==void 0&&clearTimeout(r),d=0,o=c=s=r=void 0}function E(){return r===void 0?a:y(ms())}function I(){var T=ms(),V=x(T);if(o=arguments,s=this,c=T,V){if(r===void 0)return p(c);if(f)return clearTimeout(r),r=setTimeout(b,t),m(c)}return r===void 0&&(r=setTimeout(b,t)),a}return I.cancel=M,I.flush=E,I}function gs(e,t,n){(n!==void 0&&!Pn(e[t],n)||n===void 0&&!(t in e))&&es(e,t,n)}function vp(e){return nt(e)&&Ao(e)}function ps(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Tp(e){return Tf(e,wa(e))}function Bp(e,t,n,o,s,l,a){var r=ps(e,n),c=ps(t,n),d=a.get(c);if(d){gs(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,f=h===void 0;if(f){var u=Ye(c),m=!u&&_n(c),p=!u&&!m&&ss(c);h=c,u||m||p?Ye(r)?h=r:vp(r)?h=df(r):m?(f=!1,h=Oa(c,!0)):p?(f=!1,h=Fa(c,!0)):h=[]:rm(c)||zo(c)?(h=r,zo(r)?h=Tp(r):(!Ve(r)||qi(r))&&(h=Ha(c))):f=!1}f&&(a.set(c,h),s(h,c,o,l,a),a.delete(c)),gs(e,n,h)}function Go(e,t,n,o,s){e!==t&&kp(t,function(l,a){if(s||(s=new ot),Ve(l))Bp(e,t,a,n,Go,o,s);else{var r=o?o(ps(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),gs(e,a,r)}},wa)}function tr(e,t,n,o,s,l){return Ve(e)&&Ve(t)&&(l.set(t,e),Go(e,t,void 0,tr,l),l.delete(t)),e}var Dp=ha(function(e,t,n,o){Go(e,t,n,o)}),Fe=da(function(e){return e.push(void 0,tr),aa(Dp,void 0,e)}),Op=Math.max,Lp=Math.min;function Rp(e,t,n){return e>=Lp(t,n)&&e<Op(t,n)}function gt(e,t,n){return t=ia(t),n===void 0?(n=t,t=0):n=ia(n),e=Po(e),Rp(e,t,n)}function je(e,t){return Yo(e,t)}var Np="[object Number]";function Vp(e){return typeof e=="number"||nt(e)&&Rt(e)==Np}function pt(e){return e==null}function Pp(e){return e===void 0}var ys=ha(function(e,t,n){Go(e,t,n)}),_p=Array.prototype,Ap=_p.reverse;function zp(e){return e==null?e:Ap.call(e)}var Fp="Expected a function";function xs(e,t,n){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Fp);return Ve(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),jo(e,t,{leading:o,maxWait:t,trailing:s})}var Hp=1/0,Wp=dn&&1/fs(new dn([,-0]))[1]==Hp?function(e){return new dn(e)}:cf,$p=200;function Xp(e,t,n){var o=-1,s=kf,l=e.length,a=!0,r=[],c=r;if(l>=$p){var d=t?null:Wp(e);if(d)return fs(d);a=!1,s=ja,c=new Hn}else c=t?[]:r;e:for(;++o<l;){var h=e[o],f=t?t(h):h;if(h=h!==0?h:0,a&&f===f){for(var u=c.length;u--;)if(c[u]===f)continue e;t&&c.push(f),r.push(h)}else s(c,f,n)||(c!==r&&c.push(f),r.push(h))}return r}function Up(e,t){return e&&e.length?Xp(e,Sp(t)):[]}const Yp=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(e.modelValue),o=()=>{if(!e.showStep)return[];const u=e.max-e.min,m=u/e.step,p=We(e.step,u),g=[];for(let x=1;x<m;x++)g.push(x*p);return g},s=()=>{if(!e.mark||!Object.keys(e.mark).length)return[];const u=(p,g="value")=>{if(!p)return[];const x=e.mark.style&&typeof e.mark.style=="object"?e.mark.style:{},b=Object.keys(p),y=[];let M;for(let E=0;E<b.length;E++)M=+b[E],isNaN(M)||y.push({posX:g==="value"?We(M,e.max-e.min):M,label:p[M],style:x});return y};return e.mark.value||e.mark.percent?[...u(e.mark.value),...u(e.mark.percent,"percent")]:[...u(e.mark)]},l=i.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=i.reactive({valueRange:0,stepList:i.computed(o),markList:i.computed(s),offset:{left:0,width:0}}),r=i.ref(),c=i.computed(()=>{const u=e.tooltipFormat,m=u instanceof Function;return{left:m?u(l.leftValue):l.leftValue,right:m?u(l.rightValue):l.rightValue}}),d=u=>{const m={min:e.min,max:e.max,step:e.step};let p,g;e.range&&Array.isArray(u)?(p=typeof u[0]=="number"&&!isNaN(u[0])?u[0]:e.min,g=typeof u[1]=="number"&&!isNaN(u[1])?u[1]:e.min,l.leftValue=Rn(p,m),l.rightValue=Rn(g,m)):(p=e.min,g=typeof u=="number"&&!isNaN(u)?u:e.min,l.leftValue=Rn(p,m),l.rightValue=Rn(g,m))},h=u=>{if(a.valueRange<=0)return;d(u);let m;if(e.range&&Array.isArray(u)){const p=Math.min(l.leftValue,l.rightValue),g=Math.max(l.leftValue,l.rightValue);m=[p,g]}else m=l.rightValue;n.value=m,t("update:modelValue",m),t("change",m)},f=()=>{const u=r.value.getBoundingClientRect();a.offset.left=u.left,a.offset.width=u.width,a.valueRange=e.max-e.min};return i.watch(()=>e.modelValue,(u,m)=>{Vp(u)&&u>=0&&!je(u,m)&&!l.dragging&&(d(u),n.value=u)}),i.watch(()=>e.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:f,setSliderValue:h}},jp=e=>{const{props:t}=i.getCurrentInstance(),{state:n,slider:o}=e,s="transparent",l=i.computed(()=>({left:o.valueRange>0?`${We(n.leftValue-t.min,o.valueRange)}%`:0})),a=i.computed(()=>({left:o.valueRange>0?`${We(n.rightValue-t.min,o.valueRange)}%`:0})),r=i.computed(()=>!t.color||Array.isArray(t.color)&&t.color.length!==1?{}:{borderColor:(typeof t.color=="string"?t.color:t.color[0])||s}),c=i.computed(()=>t.color&&Array.isArray(t.color)),d=i.computed(()=>{const u=Math.min(n.leftValue,n.rightValue),p=+(Math.max(n.leftValue,n.rightValue)-u).toFixed(2),g=o.valueRange>0&&t.range?We(+(u-t.min).toFixed(2),o.valueRange):0,x=p>0?We(p,o.valueRange):0,b={};return t.color&&(typeof t.color=="string"||Array.isArray(t.color)&&t.color.length===1?b.backgroundColor=(typeof t.color=="string"?t.color:t.color[0])||s:Array.isArray(t.color)&&t.color.length>1&&(b.backgroundColor=(t.range?t.color[1]:t.color[0])||s)),{left:`${g}%`,width:`${x}%`,...b}}),h=i.computed(()=>{if(!c.value||t.color.length<2||!t.range)return{};const u=Math.min(n.leftValue,n.rightValue);return{width:`${We(Math.abs(u-t.min),o.valueRange)}%`,backgroundColor:t.color[0]||s}}),f=i.computed(()=>{if(!c.value||t.color.length<2)return{};const u=Math.max(n.leftValue,n.rightValue),m=We(+(u-t.min).toFixed(2),o.valueRange),p=We(+(t.max-u).toFixed(2),o.valueRange),g=t.range?2:t.color.length-1;return{left:`${m}%`,width:`${p}%`,backgroundColor:t.color[g]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:f}},Gp=e=>{const{props:t}=i.getCurrentInstance(),{currentValue:n,state:o,slider:s,updateSliderInfo:l,setSliderValue:a}=e,r=m=>{o.dragging||l();const p=m.type.indexOf("touch")!==-1?m.touches[0].clientX:m.clientX,{valueRange:g,offset:x}=s;let b=t.min+(p-x.left)*g/x.width;return b<t.min?b=t.min:b>t.max&&(b=t.max),b},c=m=>{if(t.readonly||t.disabled||o.dragging)return;const p=r(m);let g;if(t.range){const b=Math.min(o.leftValue,o.rightValue)+Math.abs((o.rightValue-o.leftValue)/2),y=o.leftValue>o.rightValue;p<b?o.handleType=y?"right":"left":o.handleType=y?"left":"right",g=o.handleType==="left"?[p,o.rightValue]:[o.leftValue,p]}else o.handleType="right",g=p;a(g)},d=m=>{const p=r(m);o.dragging=!0;let g;t.range?g=o.handleType==="left"?[p,o.rightValue]:[o.leftValue,p]:g=p,a(g)},h=()=>{o.handleType=null,o.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:m=>{t.readonly||t.disabled||(o.handleType=m,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(m,p)=>{if(t.showInput&&!o.dragging&&o.isInit)if(t.range&&Array.isArray(n.value)){const g=p==="left"?[m,n.value[1]]:[n.value[0],m];a(g)}else t.range||a(m)}}},Zp=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{currentValue:o,state:s,slider:l,updateSliderInfo:a,setSliderValue:r}=e,c=()=>{const h=t.max||t.max===0,f=t.min||t.min===0;h&&f&&t.max<=t.min&&console.warn("[EVUI][Slider] Max value must be greater than min value.")},d=()=>{a(),l.valueRange<=0&&(o.value=t.range?[t.min,t.min]:t.min,n("update:modelValue",o.value)),r(o.value),s.isInit=!0};i.onMounted(()=>{c(),d()})},qp={name:"EvSlider",components:{},props:{modelValue:{type:[Number,Array],default:null},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},max:{type:Number,default:100},min:{type:Number,default:0},step:{type:Number,default:1,validator:e=>e>0},mark:{type:Object,default:()=>{}},showStep:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},showInput:{type:Boolean,default:!1},color:{type:[String,Array],default:null},tooltipFormat:{type:Function,default:null}},emits:["update:modelValue","change"],setup(){const{currentValue:e,state:t,slider:n,formatValue:o,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=Yp(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:f,leftThumbStyle:u,rightThumbStyle:m}=jp({state:t,slider:n}),{startDrag:p,clickSlider:g,changeInput:x}=Gp({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a});return Zp({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a}),{currentValue:e,isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:f,leftThumbStyle:u,rightThumbStyle:m,sliderLine:s,...i.toRefs(t),...i.toRefs(n),formatValue:o,startDrag:p,clickSlider:g,changeInput:x}}},Kp={class:"ev-slider-wrapper"},Jp={ref:"sliderLine",class:"ev-slider-line"},Qp={key:0,class:"ev-slider-step-wrapper"},ey={key:2,class:"ev-slider-mark-wrapper"},ty={class:"ev-slider-mark-label"},ny=["innerHTML"],oy=["innerHTML"];function iy(e,t,n,o,s,l){const a=i.resolveComponent("ev-input-number");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":o.isColorArray,"show-mark":e.markList.length}])},[i.createElementVNode("div",Kp,[i.createElementVNode("div",Jp,[n.showStep&&n.step?(i.openBlock(),i.createElementBlock("div",Qp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.stepList,(r,c)=>(i.openBlock(),i.createElementBlock("span",{key:`slider-step-${c}`,style:i.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):i.createCommentVNode("",!0),o.isColorArray&&n.color.length>1?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.range?(i.openBlock(),i.createElementBlock("div",{key:0,style:i.normalizeStyle(o.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",{style:i.normalizeStyle(o.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ev-slider-thumb",style:i.normalizeStyle(o.rangeThumbStyle)},null,4),e.markList.length>0?(i.openBlock(),i.createElementBlock("div",ey,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.markList,(r,c)=>(i.openBlock(),i.createElementBlock("div",{key:`slider-step-${c}`,style:i.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[i.createElementVNode("span",ty,i.toDisplayString(r.label),1)],4))),128))])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ev-slider-line-layer",onClick:t[0]||(t[0]=(...r)=>o.clickSlider&&o.clickSlider(...r))})],512),n.range?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="left"}]),style:i.normalizeStyle(o.leftHandleStyle),onMousedown:t[1]||(t[1]=i.withModifiers(r=>o.startDrag("left"),["stop","prevent"]))},[i.createElementVNode("span",{style:i.normalizeStyle(o.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),i.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:o.formatValue.left},null,8,ny)],38)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="right"}]),style:i.normalizeStyle(o.rightHandleStyle),onMousedown:t[2]||(t[2]=i.withModifiers(r=>o.startDrag("right"),["stop","prevent"]))},[i.createElementVNode("span",{style:i.normalizeStyle(o.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),i.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:o.formatValue.right},null,8,oy)],38)]),n.showInput&&!n.range?(i.openBlock(),i.createBlock(a,{key:0,modelValue:o.currentValue,"onUpdate:modelValue":t[3]||(t[3]=r=>o.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:o.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createVNode(a,{modelValue:o.currentValue[0],"onUpdate:modelValue":t[4]||(t[4]=r=>o.currentValue[0]=r),step:n.step,min:n.min,max:o.currentValue[1],"step-strictly":"",onChange:t[5]||(t[5]=r=>o.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),i.createVNode(a,{modelValue:o.currentValue[1],"onUpdate:modelValue":t[6]||(t[6]=r=>o.currentValue[1]=r),step:n.step,min:o.currentValue[0],max:n.max,"step-strictly":"",onChange:t[7]||(t[7]=r=>o.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):i.createCommentVNode("",!0)],2)}const Wn=le(qp,[["render",iy]]);Wn.install=e=>{e.component(Wn.name,Wn)};const sy={name:"EvIcon",props:{icon:{type:String,default:""},size:{type:String,default:""},color:{type:String,default:""}},emits:{click:null,"dbl-click":null,"context-menu":null},setup(e,{emit:t}){return{onClick:l=>{t("click",l)},onDblClick:l=>{t("dbl-click",l)},onContextMenu:l=>{t("context-menu",l)}}}};function ly(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("i",{class:i.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:i.normalizeStyle({color:n.color}),onClick:t[0]||(t[0]=(...a)=>o.onClick&&o.onClick(...a)),"on:dblClick":t[1]||(t[1]=(...a)=>o.onDblClick&&o.onDblClick(...a)),onContextmenu:t[2]||(t[2]=(...a)=>o.onContextMenu&&o.onContextMenu(...a))},null,38)}const hn=le(sy,[["render",ly]]);hn.install=e=>{e.component(hn.name,hn)};const bs=6,Cs=7,Ss=4,ws=3,ks=5,Ms=4,$e=12,ay=24,ry=60,cy=60,st=12,nr=4,Is=20,Es={fullName:["January","February","March","April","May","June","July","August","September","October","November","December"],numberName:["1","2","3","4","5","6","7","8","9","10","11","12"],abbrName:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],korName:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},dy={abbrUpperName:["SUN","MON","TUE","WED","THU","FRI","SAT"],abbrLowerName:["sun","mon","tue","wed","thu","fri","sat"],abbrPascalName:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbrKorName:["일","월","화","수","목","금","토"]},Ge={DATE:"date",MONTH:"month",YEAR:"year"},Zo=864e5,qo=+new Date("1970-01-01 00:00:00"),or=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),ir=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),hy=(e,t)=>e.length?e.reduce((n,o)=>new Date(n).getTime()>new Date(o).getTime()?n:o):"",Te=e=>e===null?"00":+e<10?`0${e}`:e,fn=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),fy=(e,t)=>new Date(`${e}-${t}-1`).getDay(),vs=(e,t)=>{let n;switch(t){case 4:case 6:case 9:case 11:n=30;break;case 2:e%4===0&&e%100!==0||e%400===0?n=29:n=28;break;default:n=31;break}return n},$n=({year:e,month:t,date:n,hour:o,min:s,sec:l})=>o!==void 0&&s!==void 0&&l!==void 0?`${e}-${Te(t)}-${Te(n)} ${Te(o)}:${Te(s)}:${Te(l)}`:`${e}-${Te(t)}-${Te(n)}`,Be=(e,t)=>{var s,l,a,r,c,d;let n=i.unref(e);Array.isArray(n)&&(n=hy(e));const o={year:+((s=n==null?void 0:n.split(" ")[0])==null?void 0:s.split("-")[0])||null,month:+((l=n==null?void 0:n.split(" ")[0])==null?void 0:l.split("-")[1])||null,date:+((a=n==null?void 0:n.split(" ")[0])==null?void 0:a.split("-")[2])||null,hour:+((r=n==null?void 0:n.split(" ")[1])==null?void 0:r.split(":")[0])||0,min:+((c=n==null?void 0:n.split(" ")[1])==null?void 0:c.split(":")[1])||0,sec:+((d=n==null?void 0:n.split(" ")[1])==null?void 0:d.split(":")[2])||0};return t==="year"?o.year:t==="month"?o.month:t==="date"?o.date:t==="hour"?o.hour:t==="min"?o.min:t==="sec"?o.sec:o},sr=(e,t,n)=>e==="next"?{year:n===12?t+1:t,month:(n+1)%12||12}:{year:n===1?t-1:t,month:(n-1)%12||12},Xn=(e,t,n)=>{const o=Be(t,n);if(e){const s=e==null?void 0:e.split(":")[0],l=e==null?void 0:e.split(":")[1],a=e==null?void 0:e.split(":")[2];if(n==="hour")return s==="HH"?o:+s;if(n==="min")return l==="mm"?o:+l;if(n==="sec")return a==="ss"?o:+a}return o},we=(e,t)=>{if(!t)return"";const n=Te(Xn(e,t,"hour")),o=Te(Xn(e,t,"min")),s=Te(Xn(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${o}:${s}`},Ko=(e,t,n,o)=>{if(!o.length)return!1;let s=t==="main"?n:o[0],l=t==="expanded"?n:o[1],a=s,r=l;if(!n.split(" ")[1])if(e==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=o[0].split(" ")[1],d=o[1].split(" ")[1];a=`${s} ${c}`,r=`${l} ${d}`}else a=`${s} 00:00:00`,r=`${l} 23:59:59`;return a&&r&&new Date(a).getTime()>+new Date(r).getTime()},un=e=>new Date(`${e}`).getTime(),lr=e=>{const t=10**(e.toString().length-1),n=Math.floor(e/t),o=Math.floor(e%(t*n)),s=n*t+Math.floor(o/Is)*Is,l=s+Is-1;return{start:s,end:l}},uy=()=>{var g,x,b;const{props:e}=i.getCurrentInstance(),t=(g=e.options)==null?void 0:g.timeFormat,n=i.computed(()=>["dateRange","dateTimeRange"].includes(e.mode)?["main","expanded"]:["main"]);let o;if(e.mode!=="dateMulti"&&e.mode!=="dateRange"&&e.mode!=="dateTimeRange")if(e.modelValue&&(e.modelValue.length===10&&or.exec((x=e.modelValue)==null?void 0:x.toString())||e.modelValue.length===19&&ir.exec((b=e.modelValue)==null?void 0:b.toString())))if(e.mode==="dateTime"&&t){const y=we(t,e.modelValue);o=i.ref(y)}else o=i.ref(e.modelValue);else o=i.ref("");else if(Array.isArray(e.modelValue)&&e.modelValue.every(y=>!y||y.length===10&&or.exec(y)||y.length===19&&ir.exec(y)))if(e.mode==="dateTimeRange"&&e.modelValue.length===2&&t){const y=[];y.push(we(t[0],e.modelValue[0])),y.push(we(t[1],e.modelValue[1])),o=i.ref([...y])}else o=i.ref([...e.modelValue]);else o=i.ref([]);const s=()=>{e.mode==="date"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'date', v-model must be 'String' type."):e.mode==="dateTime"&&e.modelValue&&typeof e.modelValue!="string"?console.warn("[EVUI][Calendar] When mode is 'dateTime', v-model must be 'String' type."):e.mode==="dateMulti"&&e.modelValue&&!Array.isArray(e.modelValue)?console.warn("[EVUI][Calendar] When mode is 'dateMulti', v-model must be 'Array' type."):e.mode==="dateRange"&&e.modelValue?Array.isArray(e.modelValue)?un(`${e.modelValue[0]} 00:00:00`)>un(`${e.modelValue[1]} 00:00:00`)&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateRange', v-model must be 'Array' type."):e.mode==="dateTimeRange"&&e.modelValue&&(Array.isArray(e.modelValue)?un(e.modelValue[0])>un(e.modelValue[1])&&console.warn("[EVUI][Calendar] When mode is 'dateRange', fromDate must be less than toDate."):console.warn("[EVUI][Calendar] When mode is 'dateTimeRange', v-model must be 'Array' type."))};let l;const a=["dateRange","dateTimeRange"].includes(e.mode)?o.value[0]:o.value;a!=null&&a.length?l={year:Be(a,"year"),month:Be(a,"month"),hour:Math.floor(Be(a,"hour")/st)+1||1,min:Math.floor(Be(a,"min")/st)+1||1,sec:Math.floor(Be(a,"sec")/st)+1||1}:l={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};let r;if(["dateRange","dateTimeRange"].includes(e.mode)&&Array.isArray(o.value)&&o.value[1]){const y=o.value[1];r={year:Be(y,"year"),month:Be(y,"month")},e.mode==="dateTimeRange"&&(r.hour=Math.floor(Be(y,"hour")/st)+1||1,r.min=Math.floor(Be(y,"min")/st)+1||1,r.sec=Math.floor(Be(y,"sec")/st)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=i.reactive({main:l,expanded:r}),d=i.reactive({main:i.computed(()=>lr(c.main.year)),expanded:i.computed(()=>lr(c.expanded.year))}),h=i.computed(()=>Es[e.monthNotation][c.main.month-1]),f=i.computed(()=>Es[e.monthNotation][c.expanded.month-1]),u=i.reactive({main:h,expanded:f}),m=i.computed(()=>dy[e.dayOfTheWeekNotation]),p=i.reactive({main:Ge.DATE,expanded:Ge.DATE});return i.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:o,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:u,dayOfTheWeekList:m,selectedListType:p}},my=e=>{const{props:t}=i.getCurrentInstance(),{selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:s}=e,l=i.reactive({main:fn(ks,Ms),expanded:fn(ks,Ms)}),a=i.reactive({main:fn(Ss,ws),expanded:fn(Ss,ws)}),r=i.reactive({main:fn(bs,Cs),expanded:fn(bs,Cs)}),c=i.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:p=>{const g=o[p];let x=t.options.disabledDate;x&&Array.isArray(x)&&(x=p==="main"?x[0]:x[1]);const b=["dateRange","dateTimeRange"].includes(t.mode),y=$n({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),M=($e+g.month-1)%$e||$e,E=(g.month+1)%$e||$e,I=g.month===1?g.year-1:g.year,T=g.month===12?g.year+1:g.year,V=fy(g.year,g.month),C=vs(g.month===1?g.year-1:g.year,($e+g.month-1)%$e||$e),S=vs(g.year,g.month);let w="";t.mode.includes("Time")&&(t.mode==="dateTime"?w=n.value:w=p==="main"?n.value[0]:n.value[1]);let k=0,B=0,D=0,O=0,L="";const v=(N,R,P)=>{var U,j,K;L=$n({year:B,month:D,date:O});const _=(w==null?void 0:w.split(" ")[1])??"",A=b&&!x&&Ko(t.mode,p,L,n.value)||+new Date(`${L} ${_}`)<qo,z=x&&x(new Date(`${L} ${_}`))||A,X=+(p!=="main"),W=b&&n.value.length>X&&((j=(U=n.value)==null?void 0:U[X])==null?void 0:j.includes(L)),H=!z&&(b?W:(K=n.value)==null?void 0:K.includes(L));r[p][R][P]={monthType:`${N}${z?" disabled":""}`,isToday:y===L,isSelected:H,year:B,month:D,date:O}};for(let N=0;N<bs;N++)for(let R=0;R<Cs;R++)N===0?V!==0?R<V?(B=I,D=M,O=C-V+1+R,v("prev",N,R)):(k++,B=g.year,D=g.month,O=k,v("",N,R)):(B=I,D=M,O=C-6+R,v("prev",N,R)):S<=k?(k++,B=T,D=E,O=k-S,v("next",N,R)):(k++,B=g.year,D=g.month,O=k,v("",N,R))},setCalendarMonth:p=>{let g=0;const x=new Date().getFullYear(),b=new Date().getMonth()+1,{year:y,month:M}=o[p];for(let E=0;E<Ss;E++)for(let I=0;I<ws;I++)a[p][E][I]={label:Es.abbrName[g++],value:g,today:y===x&&g===b,isSelected:g===M}},setCalendarYear:p=>{let g=s[p].start;const x=new Date().getFullYear(),b=new Date(qo).getFullYear();for(let y=0;y<ks;y++)for(let M=0;M<Ms;M++)l[p][y][M]={label:g,value:g,today:g===x,isSelected:g===o[p].year,disabled:g<b},g++},setHmsTime:()=>{var V,C;const p=(V=t.options)==null?void 0:V.timeFormat,g=(C=t.options)==null?void 0:C.disabledDate,x=Array.isArray(p)?p[0]:p,b=Array.isArray(p)?p[1]:"",y=t.mode==="dateTimeRange"?n.value[0]:n.value,M=t.mode==="dateTimeRange"?n.value[1]:"",E=Array.isArray(g)?g[0]:g,I=Array.isArray(g)?g[1]:g,T=(S,w,k)=>{const B=S==="main"?y:M,D=S==="main"?E:I;if(!B)return!1;const O=B.split(" ")[0];let L=Be(B,"hour"),v=Be(B,"min"),N=Be(B,"sec");w==="hour"?L=k:w==="min"?v=k:w==="sec"&&(N=k);const R=`${O} ${Te(L)}:${Te(v)}:${Te(N)}`;return D&&D(new Date(R))?!0:!D&&Ko(t.mode,S,R,n.value)};["hour","min","sec"].forEach(S=>{let w=cy;S==="hour"?w=ay:S==="min"&&(w=ry);const k=y&&y.length>0?Xn(x,y,S):-1,B=M&&M.length>0?Xn(b,M,S):-1;for(let D=0;D<w;D++){let O=t.mode==="dateTimeRange"&&T("main",S,D);c.main[S][D]={timeType:S,num:D,isSelected:!O&&k===D,isDisabled:O},t.mode==="dateTimeRange"&&(O=T("expanded",S,D),c.expanded[S][D]={timeType:S,num:D,isSelected:!O&&B===D,isDisabled:O})}})},getTimeInfo:(p,g,x,b)=>{const y=o[b],M=c[b],E=y[p]-1,I=g-1,T=x-1,V=E*st+I*nr+T;return M[p][V]}}},gy=e=>{var L;const{props:t,emit:n}=i.getCurrentInstance(),o=(L=t.options)==null?void 0:L.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:f}=e,u=i.ref(""),m=i.ref(null),p=Array.isArray(o)?o[0]:o,g=Array.isArray(o)?o[1]:"",x={main:{hour:p&&p.split(":")[0]!=="HH",min:p&&p.split(":")[1]!=="mm",sec:p&&p.split(":")[2]!=="ss"},expanded:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"}},b=(v,N)=>{const R=l[v],{year:P,month:_,hour:A,min:z,sec:X}=N;P&&(R.year=P),_&&(R.month=_),A&&(R.hour=A),z&&(R.min=z),X&&(R.sec=X)},y=v=>{v==null||v.forEach((N,R)=>{const P=R===0?"main":"expanded";b(P,{year:Be(N,"year"),month:Be(N,"month"),hour:Math.floor(Be(N,"hour")/st)+1,min:Math.floor(Be(N,"min")/st)+1,sec:Math.floor(Be(N,"sec")/st)+1}),r(P)})},M=(v,N)=>{const R=f[v]===Ge.MONTH?1:20,P=N==="prev"?-R:R,_=new Date(qo).getFullYear(),A=l[v].year+P;l[v].year=A<_?_:A},E=(v,N)=>{const R=l[v];if(N==="prev"){const P=new Date(qo).getFullYear();if(R.year===P&&R.month===1)return;R.month===1?(R.year-=1,R.month=12):R.month-=1}else R.month===12?(R.year+=1,R.month=1):R.month+=1},I=(v,N)=>{switch(f[v]){case Ge.DATE:{E(v,N),r(v);break}case Ge.MONTH:M(v,N),c(v);break;case Ge.YEAR:M(v,N),d(v);break}},T=(v,N)=>{N===Ge.DATE?r(v):N===Ge.MONTH?c(v):N===Ge.YEAR&&d(v),f[v]=N},V=(v,N)=>{const{value:R}=N;N.disabled||(f[v]===Ge.YEAR?(l[v].year=R,f[v]=Ge.MONTH,c(v)):(l[v].month=R,f[v]=Ge.DATE,r(v)))},C=(v,N)=>{var J,te,G,oe;const{year:R,month:P,date:_,monthType:A}=N,z=$n({year:R,month:P,date:_}),X=t.modelValue?(Array.isArray(t.modelValue)?((J=t.modelValue)==null?void 0:J.map(Z=>Z==null?void 0:Z.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(z):!1;let W=t.options.disabledDate;if(W&&Array.isArray(W)&&(W=v==="main"?W[0]:W[1]),W&&W(new Date(z))&&!X)return;if(!W&&["dateRange","dateTimeRange"].includes(t.mode)&&Ko(t.mode,v,z,s.value))return;const H=l[v],U=($e+H.month-1)%$e||$e,j=H.month===1?H.year-1:H.year,K=(H.month+1)%$e||$e,q=H.month===12?H.year+1:H.year,ee=()=>{A.includes("prev")?(H.year=j,H.month=U):A.includes("next")&&(H.year=q,H.month=K)};switch(t.mode){case"date":n("update:modelValue",z);break;case"dateTime":{const ae=!!((te=s.value)!=null&&te.split(" ")[1])?(G=s.value)==null?void 0:G.split(" ")[1]:"00:00:00",me=we(o,`${z} ${ae}`);n("update:modelValue",me);break}case"dateMulti":{const Z=t.options.multiType,ae=t.options.multiDayLimit;if(Z==="date"){const me=s.value.indexOf(z);me>-1?(s.value.splice(me,1),n("update:modelValue",[...s.value])):s.value.length<ae&&(s.value.push(z),ee(),n("update:modelValue",[...s.value]))}else if(Z==="week"||Z==="weekday"){const me=Z==="week"?7:5,re=Z==="week"?6:5,fe=new Date(`${z} 00:00:00`),ke=fe.getDay(),rt=re-ke,ct=fe.getTime()+Zo*rt;for(let yt=0;yt<me;yt++){const ho=new Date(ct-yt*Zo).getFullYear(),fo=new Date(ct-yt*Zo).getMonth()+1,uo=new Date(ct-yt*Zo).getDate(),Zt=`${ho}-${Te(fo)}-${Te(uo)}`;if(yt===0)if(s.value.includes(Zt)){s.value.splice(0);break}else s.value.splice(0),ee();(!W||!W(new Date(Zt)))&&s.value.unshift(Zt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let Z=[...s.value];if(!s.value.length)Z=[z,z];else{const ae=+(v==="expanded");Z[ae]=z}n("update:modelValue",Z);break}case"dateTimeRange":{let Z=[...s.value];if(Z.length){const ae=+(v==="expanded"),me=((oe=Z[ae])==null?void 0:oe.split(" ")[1])||"00:00:00";let re=`${z} ${me}`;o&&o.length&&(re=we(o[ae],re)),Z[ae]=re}else{let ae=`${z} 00:00:00`,me=`${z} 00:00:00`;o&&o.length&&(ae=we(o[0],ae),me=we(o[1],me)),Z=[ae,me]}n("update:modelValue",Z);break}}},S=(v,N,R)=>{if(x[v][N])return;const P=l[v],_=1;N==="hour"?R==="down"&&P.hour<2?P.hour++:R==="up"&&P.hour>_&&P.hour--:N==="min"?R==="down"&&P.min<5?P.min++:R==="up"&&P.min>_&&P.min--:N==="sec"&&(R==="down"&&P.sec<5?P.sec++:R==="up"&&P.sec>_&&P.sec--)},w=(v,N,R,P)=>{var te;if(x[v][N])return;const _=l[v],A=a[v],z=_[N]-1,X=R-1,W=P-1,H=z*st+X*nr+W;if((te=A[N][H])!=null&&te.isDisabled)return;const U=new Date,j={year:U.getFullYear(),month:U.getMonth()+1,date:U.getDate()};let K=!0,q=[];const ee=()=>{let G;return N==="hour"?G=`${Te(H)}:00:00'`:N==="min"?G=`00:${Te(H)}:00`:N==="sec"&&(G=`00:00:${Te(H)}`),`${$n(j)} ${G}`},J=G=>{let re=11;return N==="min"?re=14:N==="sec"&&(re=17),`${G==null?void 0:G.substr(0,re)}${Te(H)}${G==null?void 0:G.substr(re+2)}`};if(t.mode==="dateTime"){let G;t.modelValue?G=we(o,J(t.modelValue)):(K=!1,G=we(o,ee())),n("update:modelValue",G),q.push(G)}else{const G=v!=="main"|0;let oe=[...s.value];if(t.modelValue.length){let Z=J(t.modelValue[G]);o&&o.length&&(Z=we(o[G],Z)),oe[G]=Z}else{const Z=ee();oe=[Z,Z],o&&o.length&&(oe=[...oe.map((ae,me)=>we(o[me],ae))]),K=!1,q=oe}n("update:modelValue",oe)}h(),K||y(q)},k=(v,N)=>{I(v,N.deltaY>0?"next":"prev")},B=(v,N,R)=>{x[v][N]||S(v,N,R.deltaY>0?"down":"up")},D=xs((v,N)=>{const R=N.target.tagName==="TD"?N.target:N.target.parentElement,P=R.classList.contains("disabled"),_=R.classList.contains("prev"),A=R.classList.contains("next");if(R.classList.length>0&&!P){const z=l[v];let X={year:+z.year,month:+z.month,date:N.target.innerText};_?X={...X,...sr("prev",X.year,X.month)}:A&&(X={...X,...sr("next",X.year,X.month)});const W=u.value,H=$n({year:X.year,month:X.month,date:X.date});un(H)<un(W)?(s.value[0]=H,s.value[1]=W):(s.value[0]=W,s.value[1]=H),r("main"),r("expanded")}},10),O=v=>{const N=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),R=t.options.disabledDate;if(N){const[P,_]=s.value;let[A,z]=[R,R];if(R&&Array.isArray(R)&&([A,z]=R),v[0]&&v[0]!==P&&A&&A(new Date(v[0])))return!0;if(v[1]&&v[1]!==_&&z&&z(new Date(v[1])))return!0;if(!R&&Ko(t.mode,"main",v[0],v))return!0}else{if(t.mode==="dateMulti")return v.some(P=>R&&R(new Date(P)));if(R&&R(new Date(v)))return!0}return!1};return i.watch(()=>t.modelValue,v=>{if(O(v)){n("update:modelValue",s.value);return}const N=["dateRange","dateMulti","dateTimeRange"].includes(t.mode);if(s.value=N?[...v]:v,t.mode==="dateRange")y(v);else if(t.mode.includes("Time")){let R=[];t.mode==="dateTime"?R=[v]:t.mode==="dateTimeRange"&&(R=v),y(R),h()}else t.mode==="date"&&y([v])}),{clickYearMonthBtn:T,clickPrevNextBtn:I,clickDate:C,clickYearMonth:V,clickHmsBtn:S,clickTime:w,wheelMonth:k,wheelTime:B,calendarEventName:m,onMousemoveDate:D,preventTimeEventType:x}},py={name:"EvCalendar",props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(o=>!!(!o||o.length===10&&t.exec(o))||o.length===19&&n.exec(o)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({multiType:"date",limit:1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,timeFormat:o})=>{const s=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&Array.isArray(o)?o.every(l=>!!(!l||s.exec(l))):!!(!o||s.exec(o))}}},emits:{"update:modelValue":[Array,String]},setup(e){const{calendarList:t,selectedValue:n,calendarPageInfo:o,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=uy(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:f,setCalendarDate:u,setCalendarMonth:m,setCalendarYear:p,setHmsTime:g,getTimeInfo:x}=my({selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:a}),{clickPrevNextBtn:b,clickYearMonthBtn:y,clickDate:M,clickYearMonth:E,clickHmsBtn:I,clickTime:T,wheelMonth:V,wheelTime:C,calendarEventName:S,onMousemoveDate:w,preventTimeEventType:k}=gy({selectedValue:n,calendarPageInfo:o,calendarTimeTableInfo:f,selectedListType:r,setCalendarDate:u,setCalendarMonth:m,setCalendarYear:p,setHmsTime:g});return u("main"),["dateRange","dateTimeRange"].includes(e.mode)&&u("expanded"),["dateTime","dateTimeRange"].includes(e.mode)&&g(),{calendarList:t,selectedValue:n,calendarPageInfo:o,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:f,getTimeInfo:x,clickPrevNextBtn:b,clickYearMonthBtn:y,clickDate:M,clickYearMonth:E,clickHmsBtn:I,clickTime:T,wheelMonth:V,wheelTime:C,calendarEventName:S,onMousemoveDate:w,preventTimeEventType:k}}},yy={class:"ev-calendar-wrapper"},xy={class:"ev-calendar-date-area"},by={class:"ev-calendar-header"},Cy=["onClick"],Sy={class:"ev-calendar-year-month-wrapper"},wy={key:0,class:"ev-calendar-year-range"},ky=["onClick"],My=["onClick"],Iy=["onClick"],Ey={class:"ev-calendar-body"},vy=["onWheel"],Ty=["onClick"],By=["onWheel"],Dy=["onClick"],Oy={key:2,class:"ev-calendar-selector-btn-wrapper"},Ly={key:0,class:"ev-calendar-time-area"},Ry={key:0,class:"ev-calendar-time-area-disabled"},Ny={class:"ev-calendar-time-side"},Vy={class:"ev-calendar-time-center"},Py=["onWheel"],_y=["onClick"],Ay={class:"ev-calendar-time-side"},zy=["onClick"];function Fy(e,t,n,o,s,l){const a=i.resolveComponent("ev-button");return i.openBlock(),i.createElementBlock("div",yy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.calendarList,r=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[i.createElementVNode("div",xy,[i.createElementVNode("div",by,[i.createElementVNode("div",{class:"move-month-arrow",onClick:c=>o.clickPrevNextBtn(r,"prev")},[...t[0]||(t[0]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Cy),i.createElementVNode("div",Sy,[o.selectedListType[r]==="year"?(i.openBlock(),i.createElementBlock("span",wy,i.toDisplayString(o.calendarYearRangeInfo[r].start+" - "+o.calendarYearRangeInfo[r].end),1)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>o.clickYearMonthBtn(r,"year")},i.toDisplayString(o.calendarPageInfo[r].year),9,ky),o.selectedListType[r]==="date"?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>o.clickYearMonthBtn(r,"month")},i.toDisplayString(o.calendarMonth[r]),9,My)):i.createCommentVNode("",!0)],64))]),i.createElementVNode("div",{class:"move-month-arrow",onClick:c=>o.clickPrevNextBtn(r,"next")},[...t[1]||(t[1]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Iy)]),i.createElementVNode("div",Ey,[o.selectedListType[r]==="date"?(i.openBlock(),i.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.dayOfTheWeekList,c=>(i.openBlock(),i.createElementBlock("th",{key:c},i.toDisplayString(c),1))),128))])]),i.createElementVNode("tbody",{onWheel:i.withModifiers(c=>o.wheelMonth(r,c),["prevent"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.calendarTableInfo[r],c=>(i.openBlock(),i.createElementBlock("tr",{key:c},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c,d=>(i.openBlock(),i.createElementBlock("td",i.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>o.clickDate(r,d)},{[i.toHandlerKey(`${o.calendarEventName}`)]:h=>o.onMousemoveDate(r,h)}),[i.createElementVNode("div",null,[i.createElementVNode("span",null,i.toDisplayString(d.date),1)])],16,Ty))),128))]))),128))],40,vy)])):(i.openBlock(),i.createElementBlock("table",{key:1,class:i.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${o.selectedListType[r]}`])},[i.createElementVNode("tbody",{onWheel:i.withModifiers(c=>o.wheelMonth(r,c),["prevent"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.selectedListType[r]==="month"?o.calendarMonthTableInfo[r]:o.calendarYearTableInfo[r],c=>(i.openBlock(),i.createElementBlock("tr",{key:c},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c,d=>(i.openBlock(),i.createElementBlock("td",{key:d.value,onClick:h=>o.clickYearMonth(r,d)},[i.createElementVNode("div",{class:i.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},i.toDisplayString(d.label),3)],8,Dy))),128))]))),128))],40,By)],2)),o.selectedListType[r]!=="date"?(i.openBlock(),i.createElementBlock("div",Oy,[i.createVNode(a,{onClick:c=>o.clickYearMonthBtn(r,"date")},{default:i.withCtx(()=>[...t[2]||(t[2]=[i.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):i.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(i.openBlock(),i.createElementBlock("div",Ly,[o.selectedListType[r]!=="date"?(i.openBlock(),i.createElementBlock("div",Ry)):i.createCommentVNode("",!0),i.createElementVNode("div",Ny,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["HOUR","MIN","SEC"],c=>i.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},i.toDisplayString(c),1)),64))]),i.createElementVNode("div",Vy,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["hour","min","sec"],c=>i.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[i.createElementVNode("tbody",{onWheel:i.withModifiers(d=>o.wheelTime(r,c,d),["prevent"])},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(3,d=>i.createElementVNode("tr",{key:`${c}_${d}_tr`},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(4,h=>i.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:i.normalizeClass(["ev-calendar-time-td",{selected:o.getTimeInfo(c,d,h,r).isSelected},{disabled:o.preventTimeEventType[r][c]||o.getTimeInfo(c,d,h,r).isDisabled}]),onClick:f=>o.clickTime(r,c,d,h)},[i.createElementVNode("div",null,i.toDisplayString(o.getTimeInfo(c,d,h,r).num),1)],10,_y)),64))])),64))],40,Py)])),64))]),i.createElementVNode("div",Ay,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["hour","min","sec"],c=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`${c}_btn_area`},[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(["up","down"],d=>i.createElementVNode("div",{key:`${c}_${d}_btn`,class:i.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:o.preventTimeEventType[r][c]}]),onClick:h=>o.clickHmsBtn(r,c,d)},[i.createElementVNode("i",{class:i.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,zy)),64))],64))),64))])])):i.createCommentVNode("",!0)],64))),128))])}const Un=le(py,[["render",Fy]]);Un.install=e=>{e.component(Un.name,Un)};const Hy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),Wy=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/),$y=()=>{var u;const{props:e,emit:t}=i.getCurrentInstance(),n=(u=e.options)==null?void 0:u.timeFormat,o=["dateTimeRange","dateRange","dateMulti"].includes(e.mode),s=m=>{let p;if(e.mode==="dateTime")p=we(n,m);else if(e.modelValue.length){const[g,x]=n;p=[we(g,m[0]),we(x,m[1])]}return p},l=i.computed({get:()=>e.modelValue?["dateTime","dateTimeRange"].includes(e.mode)&&n?s(e.modelValue):o?[...e.modelValue]:e.modelValue:e.mode==="date"||e.mode==="dateTime"?"":[],set:m=>{if(["dateTime","dateTimeRange"].includes(e.mode)&&n){t("update:modelValue",s(m));return}t("update:modelValue",m)}});let a;if(["dateTimeRange","dateTime"].includes(e.mode)&&n)if(e.mode==="dateTimeRange"&&Array.isArray(e.modelValue)&&e.modelValue.length===2){const[m,p]=e.modelValue,[g,x]=n;e.modelValue=[we(g,m),we(x,p)],a=i.ref([...e.modelValue])}else e.mode==="dateTime"&&e.modelValue?a=i.ref(we(n,e.modelValue)):a=i.ref(e.modelValue);else a=i.ref(o?[...e.modelValue]:e.modelValue);const r=m=>{const p=y=>!!(y.length===10&&Hy.exec(y)),g=y=>!!(y.length===19&&Wy.exec(y)),x=y=>{const M=y.split(" ")[0],E=+M.split("-")[0],I=+M.split("-")[1],T=+M.split("-")[2],V=vs(E,I);return+T<=V&&E>=new Date(0).getFullYear()};let b=!0;e.mode==="date"?b=p(m)&&x(m):e.mode==="dateTime"?b=g(m)&&x(m):e.mode==="dateRange"?b=m.every(y=>p(y)&&x(y)):e.mode==="dateTimeRange"&&(b=m.every(y=>g(y)&&x(y))),b&&(l.value=o?[...m]:m),a.value=o?[...l.value]:l.value},c=i.computed(()=>e.mode==="date"||e.mode==="dateTime"?l.value:l.value.length);return{mv:l,currentValue:a,isClearableIcon:c,validateValue:r,removeAllMv:()=>{e.mode==="date"||e.mode==="dateTime"?l.value=null:(l.value.splice(0),l.value=[...l.value])},changeMv:async m=>{await i.nextTick(),t("change",l.value,m)},removeMv:m=>{if(!e.disabled){const p=l.value.indexOf(m);l.value.splice(p,1),l.value=[...l.value]}}}},Xy=()=>{const{props:e}=i.getCurrentInstance(),t=i.ref(!1),n=i.ref(null),o=i.ref(null),s=i.ref(null),l=i.ref(null),a=i.reactive({top:null,right:null,left:null}),r=async()=>{var M,E;await i.nextTick();const h=(M=o.value)==null?void 0:M.getBoundingClientRect(),f=(E=s.value)==null?void 0:E.getBoundingClientRect(),u=h.height,m=h.y,p=h.x,g=f.height,x=f.width,b=document.documentElement.clientHeight,y=document.documentElement.clientWidth;b<m+u+g?(a.top=`-${g}px`,y<p+x?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${u}px`,y<p+x?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:t,datePicker:n,datePickerWrapper:o,dropbox:s,itemWrapper:l,dropboxPosition:a,clickSelectInput:async()=>{e.disabled||(t.value=e.enableTextInput?!0:!t.value,t.value&&await r())},clickOutsideDropbox:()=>{t.value=!1},changeDropboxPosition:r}},Uy=e=>{var m;const{props:t}=i.getCurrentInstance(),{mv:n,currentValue:o,clickOutsideDropbox:s}=e,l=i.reactive([]);(m=t.shortcuts)==null||m.forEach(({value:p,label:g,shortcutDate:x})=>{l.push({key:p,label:g,shortcutDate:x,isActive:!1})});const a=()=>{const p=l.find(g=>g.isActive);p&&(p.isActive=!1)},r=p=>{const g=l.find(x=>x.key===p);g&&(g.isActive=!0)},c=p=>p===null?"00":+p<10?`0${p}`:p,d=p=>{const g=p?new Date(p):new Date,x=g.getFullYear(),b=g.getMonth()+1,y=g.getDate();return`${x}-${c(b)}-${c(y)}`},h=p=>{const g=p?new Date(p):new Date,x=g.getHours(),b=g.getMinutes(),y=g.getSeconds();return`${d(g)} ${c(x)}:${c(b)}:${c(y)}`},f=()=>{var x,b;a();const p=["dateRange","dateTimeRange"].includes(t.mode);if(!l.length||t.mode==="dateMulti"&&((x=t.options)==null?void 0:x.multiType)!=="date"||p&&!n.value.length||!p&&!n.value)return;let g;if(p){const y=(b=t.options)==null?void 0:b.timeFormat,[M,E]=n.value;let I;t.mode==="dateTimeRange"&&(y!=null&&y.length)?I=l.find(({shortcutDate:T})=>{const[V,C]=T(),[S,w]=y,k=we(S,h(V)),B=we(w,h(C)),D=k===h(M),O=B===h(E);return D&&O}):I=l.find(({shortcutDate:T})=>{const[V,C]=T(),S=t.mode==="dateTimeRange"?h:d,w=S(V)===S(M),k=S(C)===S(E);return w&&k}),g=I==null?void 0:I.key}else{const y=t.mode==="dateTime"?h:d,M=y(n.value),E=l.find(({shortcutDate:I})=>y(I())===M);g=E==null?void 0:E.key}g&&r(g)},u=p=>{var M;const g=["dateRange","dateTimeRange"].includes(t.mode),x=l.find(({key:E})=>E===p);if(!x)return;const b=x.shortcutDate,y=(M=t.options)==null?void 0:M.timeFormat;if(g){const[E,I]=b();if(t.mode==="dateTimeRange")if(y!=null&&y.length){const[T,V]=y;n.value=[we(T,h(E)),we(V,h(I))]}else n.value=[h(E),h(I)];else n.value=[d(E),d(I)]}else{const E=b();n.value=t.mode==="dateTime"?we(y,h(E)):d(E)}a(),r(p)};return i.watch(()=>t.modelValue,p=>{var g,x;if(f(),!(t.mode==="dateMulti"&&((g=t==null?void 0:t.options)==null?void 0:g.multiType)==="date"&&((x=t==null?void 0:t.options)==null?void 0:x.multiDayLimit)>p.length)){if(t.mode==="dateRange"||t.mode==="dateTimeRange"){o.value=[...p];return}else if(t.mode==="dateTime"){o.value=p;return}o.value=p,s()}}),{usedShortcuts:l,clickShortcut:u,setActiveShortcut:f}},Yy={name:"EvDatePicker",directives:{clickoutside:bd},props:{modelValue:{type:[String,Array],default:"",validator:e=>{const t=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),n=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]:[0-5][0-9]/);return Array.isArray(e)?e.every(o=>!!(!o||o.length===10&&t.exec(o))||o.length===19&&n.exec(o)):!!(!e||e.length===10&&t.exec(e)||e.length===19&&n.exec(e))}},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},enableTextInput:{type:Boolean,default:!1},mode:{type:String,default:"date",validator:e=>["date","dateTime","dateMulti","dateRange","dateTimeRange"].indexOf(e)!==-1},monthNotation:{type:String,default:"fullName",validator:e=>["fullName","abbrName","numberName","korName"].indexOf(e)!==-1},dayOfTheWeekNotation:{type:String,default:"abbrUpperName",validator:e=>["abbrUpperName","abbrLowerName","abbrPascalName","abbrKorName"].indexOf(e)!==-1},options:{type:Object,default:()=>({type:"date",limit:1,tagShorten:!1}),validator:({multiType:e,multiDayLimit:t,disabledDate:n,tagShorten:o,timeFormat:s})=>{const l=new RegExp(/(HH|2[0-3]|[01][0-9]):(mm|[0-5][0-9]):(ss|[0-5][0-9])/);return(!e||["weekday","week","date"].indexOf(e)!==-1)&&(!t||typeof t=="number"&&t>0)&&(!n||typeof n=="function"||Array.isArray(n))&&(o===void 0||typeof o=="boolean")&&Array.isArray(s)?s.every(a=>!!(!a||l.exec(a))):!!(!s||l.exec(s))}},shortcuts:{type:Array,default:()=>[],validator:e=>e.length?e.every(({shortcutDate:t})=>{if(typeof t!="function")return!1;const n=t();return Array.isArray(n)&&n.every(o=>o instanceof Date)&&n[0]<=n[1]||typeof n=="object"&&n instanceof Date}):!0}},emits:{"update:modelValue":[Array,String]},setup(){const{mv:e,currentValue:t,isClearableIcon:n,validateValue:o,removeAllMv:s,changeMv:l,removeMv:a}=$y(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:f,dropboxPosition:u,clickSelectInput:m,clickOutsideDropbox:p,changeDropboxPosition:g}=Xy(),{usedShortcuts:x,clickShortcut:b,setActiveShortcut:y}=Uy({mv:e,currentValue:t,clickOutsideDropbox:p});return y(),{mv:e,currentValue:t,isClearableIcon:n,validateValue:o,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:f,dropboxPosition:u,clickSelectInput:m,clickOutsideDropbox:p,changeDropboxPosition:g,usedShortcuts:x,clickShortcut:b}}},jy={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},Gy=["placeholder","readonly","disabled"],Zy=["placeholder","disabled"],qy={class:"ev-tag-name"},Ky=["onClick"],Jy={key:0,class:"ev-select-tag num"},Qy={class:"ev-tag-name"},ex={class:"ev-select-tag num"},tx={class:"ev-tag-name"},nx={class:"ev-date-picker-dropbox-wrapper"},ox={key:0,class:"ev-date-picker-dropbox__button-layout"},ix={key:1,class:"ev-date-picker-dropbox__divider"};function sx(e,t,n,o,s,l){const a=i.resolveComponent("ev-button"),r=i.resolveComponent("ev-button-group"),c=i.resolveComponent("ev-calendar"),d=i.resolveDirective("clickoutside");return i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"datePicker",class:i.normalizeClass(["ev-date-picker",{disabled:e.$props.disabled}])},[i.createElementVNode("div",jy,[e.$props.mode==="date"||e.$props.mode==="dateTime"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[t[15]||(t[15]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>o.currentValue=h),type:"text",class:i.normalizeClass(["ev-input",{readonly:!e.$props.enableTextInput}]),placeholder:e.$props.placeholder,readonly:!e.$props.enableTextInput,disabled:e.$props.disabled,onClick:t[1]||(t[1]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h)),onKeydown:t[2]||(t[2]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[3]||(t[3]=h=>o.validateValue(o.currentValue))},null,42,Gy),[[i.vModelText,o.currentValue,void 0,{trim:!0}]])],64)):e.$props.mode==="dateMulti"||!e.$props.enableTextInput?(i.openBlock(),i.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:t[4]||(t[4]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h))},[t[18]||(t[18]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:e.$props.placeholder,disabled:e.$props.disabled},null,8,Zy),e.$props.mode==="dateMulti"&&(e.$props.options.multiType==="date"||!e.$props.options.tagShorten)?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(o.mv,(h,f)=>(i.openBlock(),i.createElementBlock("div",{key:`${h}_${f}`,class:i.normalizeClass(["ev-select-tag",{num:e.$props.options.multiType!=="date"}])},[i.createElementVNode("span",qy,i.toDisplayString(h),1),e.$props.options.multiType==="date"?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:i.withModifiers(u=>[o.removeMv(h),o.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[i.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,Ky)):i.createCommentVNode("",!0)],2))),128)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o.mv[0]?(i.openBlock(),i.createElementBlock("div",Jy,[i.createElementVNode("span",Qy,i.toDisplayString(o.mv[0]),1)])):i.createCommentVNode("",!0),o.mv[o.mv.length-1]?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[t[17]||(t[17]=i.createElementVNode("div",{class:"ev-select-tag num"},[i.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),i.createElementVNode("div",ex,[i.createElementVNode("span",tx,i.toDisplayString(o.mv[o.mv.length-1]),1)])],64)):i.createCommentVNode("",!0)],64))])):(i.openBlock(),i.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:t[11]||(t[11]=(...h)=>o.clickSelectInput&&o.clickSelectInput(...h))},[t[20]||(t[20]=i.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[i.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=h=>o.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[6]||(t[6]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[7]||(t[7]=h=>o.validateValue(o.currentValue))},null,544),[[i.vModelText,o.currentValue[0],void 0,{trim:!0}]]),o.currentValue[o.currentValue.length-1]?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[t[19]||(t[19]=i.createElementVNode("div",{class:"ev-date-picker-range-separator"},[i.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=h=>o.currentValue[o.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[9]||(t[9]=i.withKeys(i.withModifiers(h=>o.validateValue(o.currentValue),["prevent"]),["enter"])),onChange:t[10]||(t[10]=h=>o.validateValue(o.currentValue))},null,544),[[i.vModelText,o.currentValue[o.currentValue.length-1],void 0,{trim:!0}]])],64)):i.createCommentVNode("",!0)])),e.$props.clearable?i.withDirectives((i.openBlock(),i.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:t[12]||(t[12]=i.withModifiers(h=>[o.removeAllMv(),o.clickOutsideDropbox()],["stop"]))},[...t[21]||(t[21]=[i.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[i.vShow,o.isClearableIcon]]):i.createCommentVNode("",!0),i.createElementVNode("div",nx,[o.isDropbox?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"dropbox",class:i.normalizeClass(["ev-date-picker-dropdown",e.$props.mode]),style:i.normalizeStyle(o.dropboxPosition)},[o.usedShortcuts.length?(i.openBlock(),i.createElementBlock("div",ox,[o.usedShortcuts.length===1?(i.openBlock(),i.createBlock(a,{key:0,type:o.usedShortcuts[0].isActive?"primary":"default",onClick:t[13]||(t[13]=h=>o.clickShortcut(o.usedShortcuts[0].key))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.usedShortcuts[0].label),1)]),_:1},8,["type"])):(i.openBlock(),i.createBlock(r,{key:1},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.usedShortcuts,h=>(i.openBlock(),i.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:f=>o.clickShortcut(h.key)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):i.createCommentVNode("",!0),o.usedShortcuts.length?(i.openBlock(),i.createElementBlock("div",ix)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"ev-date-picker-dropbox__calendar":o.usedShortcuts.length})},[i.createVNode(c,{key:"fromCalendar",modelValue:o.mv,"onUpdate:modelValue":t[14]||(t[14]=h=>o.mv=h),mode:e.$props.mode,"month-notation":e.$props.monthNotation,"day-of-the-week-notation":e.$props.dayOfTheWeekNotation,options:e.$props.options},null,8,["modelValue","mode","month-notation","day-of-the-week-notation","options"])],2)],6)):i.createCommentVNode("",!0)])],512)],2)),[[d,o.clickOutsideDropbox]])}const Yn=le(Yy,[["render",sx]]);Yn.install=e=>{e.component(Yn.name,Yn)};const lx={name:"EvMessage",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},message:{type:String,default:""},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!1},iconClass:{type:String,default:""},onClose:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e,t){const n=i.reactive({timer:null,isShow:!0}),o=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,e.onClose&&e.onClose(),o(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(n.timer=setTimeout(()=>{n.isShow&&s()},e.duration))},a=c=>{c.keyCode===27&&n.isShow&&s()},r=()=>{s()};return i.onMounted(()=>{l(),document.addEventListener("keydown",a)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),o()}),t.expose({hide:r}),{startTimer:l,clearTimer:o,closeMsg:s,...i.toRefs(n),hide:r}}},ax={key:0,class:"ev-message-icon"},rx=["innerHTML"],cx={key:2,class:"ev-message-content"};function dx(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Teleport,{to:"#ev-message-modal"},[i.createVNode(i.Transition,{name:"ev-message-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{ref:"msgRef",class:i.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:t[1]||(t[1]=(...a)=>o.clearTimer&&o.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>o.startTimer&&o.startTimer(...a))},[n.iconClass?(i.openBlock(),i.createElementBlock("span",ax,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,rx)):(i.openBlock(),i.createElementBlock("div",cx,i.toDisplayString(n.message),1)),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:3,class:"ev-message-close",onClick:t[0]||(t[0]=(...a)=>o.closeMsg&&o.closeMsg(...a))},[...t[3]||(t[3]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],34),[[i.vShow,e.isShow]])]),_:1})])}const hx=le(lx,[["render",dx]]),fx=i.defineComponent(hx),ar="ev-message-modal",rr=document.createElement("div");rr.id=ar;const Jo=(e={})=>{document.getElementById(ar)||document.body.appendChild(rr);const n=document.createElement("div"),o=()=>i.render(null,n),s=typeof e=="string"?{message:e,unmount:o}:{...e,unmount:o},l=i.h(fx,s);return i.render(l,n),l.component.exposed};Jo.install=e=>{const t=e.config.globalProperties;t.$message=Jo};const ux={name:"EvNotification",props:{type:{type:String,default:"info",validator:e=>["info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:String,default:""},position:{type:String,default:"top-right",validator:e=>["top-left","top-right","bottom-left","bottom-right"].includes(e)},duration:{type:Number,default:3e3},showClose:{type:Boolean,default:!0},iconClass:{type:String,default:""},onClose:{type:Function,default:null},onClick:{type:Function,default:null},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null}},setup(e){const t=i.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(t.timer),t.timer=null},o=r=>{r.target.className!=="ev-notification-close"&&e.onClick&&e.onClick()},s=()=>{t.isShow=!1,e.onClose&&e.onClose(),n(),e.unmount&&setTimeout(e.unmount,1e3)},l=()=>{e.duration>0&&(t.timer=setTimeout(()=>{t.isShow&&s()},e.duration))},a=r=>{r.keyCode===27&&t.isShow&&s()};return i.onMounted(()=>{l(),document.addEventListener("keydown",a)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:o,closeMsg:s,...i.toRefs(t)}}},mx={key:0,class:"ev-notification-icon"},gx={class:"ev-notification-content"},px={key:0,class:"title"},yx=["innerHTML"],xx={key:2,class:"message"};function bx(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Transition,{name:"ev-notification-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(["ev-notification",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-click":!!n.onClick}]),onMouseenter:t[1]||(t[1]=(...a)=>o.clearTimer&&o.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>o.startTimer&&o.startTimer(...a)),onClick:t[3]||(t[3]=(...a)=>o.clickMsg&&o.clickMsg(...a))},[n.iconClass?(i.openBlock(),i.createElementBlock("span",mx,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("div",gx,[n.title?(i.openBlock(),i.createElementBlock("p",px,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,yx)):(i.openBlock(),i.createElementBlock("p",xx,i.toDisplayString(n.message),1))]),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:t[0]||(t[0]=(...a)=>o.closeMsg&&o.closeMsg(...a))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],34),[[i.vShow,e.isShow]])]),_:1})}const Cx=le(ux,[["render",bx]]),Sx=i.defineComponent(Cx),cr="ev-notification-modal",Qo=document.createElement("div");Qo.id=cr;const wx=["top-left","top-right","bottom-left","bottom-right"],ei=(e={})=>{const t=e.position||"top-right";if(!wx.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(cr)||document.body.appendChild(Qo);let o=Qo.getElementsByClassName(`modal-${t}`);o.length?o=o[0]:(o=document.createElement("div"),o.classList.add(`modal-${t}`),Qo.appendChild(o));const l=document.createElement("div"),a=()=>i.render(null,l),r=typeof e=="string"?{message:e,unmount:a}:{...e,unmount:a},c=i.h(Sx,r);i.render(c,l),o.appendChild(c.el)};ei.install=e=>{const t=e.config.globalProperties;t.$notify=ei};const kx={name:"EvMessageBox",components:{EvButton:sn},props:{type:{type:String,default:"",validator:e=>["","info","success","warning","error"].includes(e)},title:{type:String,default:""},message:{type:[String,Array],default:""},iconClass:{type:String,default:""},onClose:{type:Function,default:null},showClose:{type:Boolean,default:!0},showConfirmBtn:{type:Boolean,default:!0},showCancelBtn:{type:Boolean,default:!0},confirmBtnText:{type:String,default:"OK"},cancelBtnText:{type:String,default:"Cancel"},closeOnClickModal:{type:Boolean,default:!0},useHTML:{type:Boolean,default:!1},unmount:{type:Function,default:null},focusable:{type:Boolean,default:!1}},setup(e){const t=i.ref(null),n=i.reactive({isShow:!0,iconClass:""}),o=c=>{if(!e.closeOnClickModal&&c==="modal")return;const d=c==="modal"?"cancel":c;n.isShow=!1,e.onClose&&e.onClose(d),e.unmount&&setTimeout(e.unmount,1e3)},s=c=>{c.keyCode===27&&n.isShow&&o()},l=c=>{switch(c){case"success":return"ev-icon-arrow-check";case"warning":return"ev-icon-warning2";case"error":return"ev-icon-warning3";case"info":default:return"ev-icon-info2"}},a=()=>{e.iconClass?n.iconClass=e.iconClass:e.type&&(n.iconClass=l(e.type))},r=c=>{if(!e.focusable)return!1;switch(c){case"confirmBtn":return e.showConfirmBtn;case"cancelBtn":return!e.showConfirmBtn&&e.showCancelBtn;case"messagebox":return!e.showConfirmBtn&&!e.showCancelBtn;default:return!1}};return i.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&t.value.focus()}),i.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),i.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:o,...i.toRefs(n),msgRef:t,hasFocus:r}}},Mx={key:0,class:"ev-message-box-icon"},Ix={class:"ev-message-box-content"},Ex={key:0,class:"ev-message-box-title"},vx=["innerHTML"],Tx={key:2,class:"ev-message-box-message"},Bx={class:"ev-message-box-btn"};function Dx(e,t,n,o,s,l){const a=i.resolveComponent("ev-button");return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ev-message-box-fade",appear:""},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{id:"ev-message-box-modal",onClick:t[3]||(t[3]=i.withModifiers(r=>o.closeMsg("modal"),["self"])),onWheel:i.withModifiers(()=>{},["stop","prevent"])},[i.createElementVNode("div",{ref:"msgRef",class:i.normalizeClass(["ev-message-box",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass,"has-title":!!n.title}]),tabindex:"-1"},[n.iconClass?(i.openBlock(),i.createElementBlock("span",Mx,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("div",Ix,[n.title?(i.openBlock(),i.createElementBlock("p",Ex,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),n.useHTML?(i.openBlock(),i.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,vx)):(i.openBlock(),i.createElementBlock("p",Tx,i.toDisplayString(n.message),1))]),i.createElementVNode("div",Bx,[n.showCancelBtn?(i.openBlock(),i.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":o.hasFocus("cancelBtn"),onClick:t[0]||(t[0]=r=>o.closeMsg("cancel"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):i.createCommentVNode("",!0),n.showConfirmBtn?(i.openBlock(),i.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":o.hasFocus("confirmBtn"),onClick:t[1]||(t[1]=r=>o.closeMsg("ok"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):i.createCommentVNode("",!0)]),n.showClose?(i.openBlock(),i.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:t[2]||(t[2]=r=>o.closeMsg("cancel"))},[...t[4]||(t[4]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):i.createCommentVNode("",!0)],2)],544),[[i.vShow,e.isShow]])]),_:1})])}const Ox=le(kx,[["render",Dx]]),Lx=i.defineComponent(Ox),ti=(e={})=>{const t=document.createElement("div"),n=()=>i.render(null,t),o=typeof e=="string"?{message:e,unmount:n}:{...e,unmount:n},s=i.h(Lx,o);i.render(s,t)};ti.install=e=>{const t=e.config.globalProperties;t.$messagebox=ti};const dr=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Rx=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.computed({get:()=>e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length?dr(e.rowLabels.length,e.colLabels.length):e.modelValue,set:s=>{t("update:modelValue",s),t("change",s)}});return{mv:n,validateValue:()=>{(e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length)&&(n.value=[...dr(e.rowLabels.length,e.colLabels.length)])}}},Nx=e=>{const{mv:t}=e,n=i.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),o=(h,f)=>{if(n.dragCol===null||n.dragRow===null)return{};const u=n.startRow<n.dragRow?n.startRow:n.dragRow,m=n.startRow>n.dragRow?n.startRow:n.dragRow,p=n.startCol<n.dragCol?n.startCol:n.dragCol,g=n.startCol>n.dragCol?n.startCol:n.dragCol;if(u>h||m<h||p>f||g<f)return{};const x="2px solid #5292F7";let b={};return h===u&&(b={...b,"border-top":x}),h===m&&(b={...b,"border-bottom":x}),f===p&&(b={...b,"border-left":x}),f===g&&(b={...b,"border-right":x}),b},s=(h,f)=>{n.startRow=h,n.startCol=f,n.dragRow=h,n.dragCol=f,n.dragEventName="mousemove"},l=(h,f)=>{if(!n.dragEventName)return;n.endRow=h,n.endCol=f,n.dragEventName=null;const u=[...t.value],m=n.startRow<n.endRow?n.startRow:n.endRow,p=n.startRow>n.endRow?n.startRow:n.endRow,g=n.startCol<n.endCol?n.startCol:n.endCol,x=n.startCol>n.endCol?n.startCol:n.endCol;for(let b=m;b<=p;b++)for(let y=g;y<=x;y++)u[b][y]=!u[b][y];t.value=[...u],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:(h,f)=>{n.dragRow=h,n.dragCol=f},mouseleaveBoxArea:()=>{l(n.dragRow,n.dragCol)},selectColumn:h=>{const f=[...t.value],u=f[0][h];for(let m=0;m<f.length;m++)f[m][h]=!u;t.value=[...f]},selectRow:h=>{const f=[...t.value],u=f[h][0];for(let m=0;m<f[0].length;m++)f[h][m]=!u;t.value=[...f]}}},Vx={name:"EvScheduler",props:{modelValue:{type:Array,default:()=>[]},colLabels:{type:Array,default:()=>['<span style="color: #FF0000">SUN</span>',"MON","TUE","WED","THU","FRI",'<span style="color: #0006F9">SAT</span>']},rowLabels:{type:Array,default:()=>["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00"]}},emits:{"update:modelValue":Array,change:Array},setup(){const{mv:e,validateValue:t}=Rx();t();const{mousePos:n,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=Nx({mv:e});return{mv:e,selectionStyle:o,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...i.toRefs(n)}}},Px={class:"ev-scheduler-header"},_x=["onClick","innerHTML"],Ax=["onClick","innerHTML"],zx=["onMousedown","onMouseup"];function Fx(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("table",{class:i.normalizeClass(["ev-scheduler",{draggable:!!e.dragEventName}])},[i.createElementVNode("thead",null,[i.createElementVNode("tr",Px,[t[1]||(t[1]=i.createElementVNode("td",null,null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.colLabels.length,(a,r)=>(i.openBlock(),i.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>o.selectColumn(r),innerHTML:n.colLabels[r]},null,8,_x))),128))])]),i.createElementVNode("tbody",{onMouseleave:t[0]||(t[0]=(...a)=>o.mouseleaveBoxArea&&o.mouseleaveBoxArea(...a))},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.rowLabels.length,(a,r)=>(i.openBlock(),i.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(i.openBlock(),i.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>o.selectRow(r),innerHTML:n.rowLabels[r]},null,8,Ax)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.colLabels.length,(c,d)=>(i.openBlock(),i.createElementBlock("td",i.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:o.mv[r][d]}],style:o.selectionStyle(r,d),onMousedown:i.withModifiers(h=>o.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:i.withModifiers(h=>o.mouseupBox(r,d),["stop","prevent"])},{[i.toHandlerKey(`${e.dragEventName}`)]:h=>o.mousemoveBox(r,d)}),null,16,zx))),128))]))),128))],32)],2)}const jn=le(Vx,[["render",Fx]]);jn.install=e=>{e.component(jn.name,jn)};const Hx=()=>{const e=i.defineComponent(hr),t=i.ref([]);return{comp:e,childrenItems:t,initWrapperDiv:()=>{const o=document.createElement("div");o.id="ev-context-menu-modal",o.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(o)}}},Wx=()=>{const{props:e}=i.getCurrentInstance(),t=i.computed(()=>e.isShowMenuOnClick),n=i.ref(!1),o=i.ref(null),s=i.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:o,menuStyle:s,show:async r=>{var d,h;n.value=!0,await i.nextTick();const c=(h=(d=o.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const f=c.height,u=c.width,m=document.documentElement.clientHeight,p=document.documentElement.clientWidth,g=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,m<r.clientY+f?s.top=`${r.pageY-f}px`:s.top=`${r.pageY}px`,p<r.clientX+u+g?s.left=`${r.pageX-u}px`:s.left=`${r.pageX}px`}},hide:async()=>{await i.nextTick(),!t.value&&(n.value=!1)}}},$x=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.computed({get:()=>e.isShow,set:u=>t("update:isShow",u)}),o=i.computed(()=>!!e.items.some(u=>u.children)),s=i.ref([]),l=i.ref(!1),a=i.ref(null),r=i.reactive({top:null,left:null,right:null}),c=u=>{u||(n.value=!1)},d=u=>{var k,B,D;const m=document.documentElement.clientWidth,p=document.documentElement.clientHeight,g=20,x=(k=u.target.parentElement)==null?void 0:k.getBoundingClientRect(),{x:b,y,width:M,height:E}=x,I=(D=(B=a.value)==null?void 0:B.$el)==null?void 0:D.children[0].getBoundingClientRect(),{width:T,height:V}=I,C=u.target.offsetTop,S=p<y+C+V,w=m<b+M+T+g;S?r.top=`${E-V}px`:r.top=`${C}px`,w?r.left=`${0-T}px`:r.left=`${M}px`};return{computedIsShow:n,isExistChild:o,isShowChild:l,childMenu:a,menuStyle:r,childrenItems:s,handleItemClick:u=>{u.click&&!u.disabled&&u.click(u),u.isShowMenu||c(u.children)},handleMouseEnter:async(u,m)=>{!m.children||!Array.isArray(m.children)||m.disabled?l.value=!1:(l.value=!0,s.value=m.children,await i.nextTick(),d(u))},hideAll:c}},Xx={name:"EvMenuList",props:{isShow:{type:Boolean,default:!1},items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},comp:{type:Object,default:()=>{}}},emits:{"update:isShow":[Boolean]},setup(){const{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:o,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=$x();return{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:o,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},Ux={class:"ev-menu-list"},Yx={class:"ev-menu-ul"},jx=["onClick","onMouseenter"],Gx={class:"ev-menu-li-text"},Zx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function qx(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",Ux,[i.createElementVNode("ul",Yx,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(a,r)=>i.withDirectives((i.openBlock(),i.createElementBlock("li",{key:`${a.value}_${r}`,class:i.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>o.handleItemClick(a),onMouseenter:c=>o.handleMouseEnter(c,a)},[a.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",Gx,[a.slotKey?i.renderSlot(e.$slots,a.slotKey,{key:0,item:a},()=>[i.createTextVNode(i.toDisplayString(a.text),1)]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(i.openBlock(),i.createElementBlock("i",Zx)):i.createCommentVNode("",!0)],42,jx)),[[i.vShow,!a.hidden]])),128))]),o.isExistChild?i.withDirectives((i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:o.computedIsShow,"onUpdate:isShow":t[0]||(t[0]=a=>o.computedIsShow=a),comp:n.comp,items:o.childrenItems,style:i.normalizeStyle(o.menuStyle)},i.createSlots({_:2},[i.renderList(e.$slots,(a,r)=>({name:r,fn:i.withCtx(c=>[i.renderSlot(e.$slots,r,i.normalizeProps(i.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[i.vShow,o.childrenItems.length&&o.isShowChild]]):i.createCommentVNode("",!0)])}const hr=le(Xx,[["render",qx]]),Kx={name:"EvContextMenu",directives:{clickoutside:Lo},components:{MenuList:hr},props:{items:{type:Array,default:()=>[],validator:e=>e.some(t=>t.children!==void 0&&!Array.isArray(t.children))?(console.warn("[EVUI][ContextMenu] children attribute must be 'Array' type."),!1):e.some(t=>t.click!==void 0&&typeof t.click!="function")?(console.warn("[EVUI][ContextMenu] click attribute must be 'Function' type."),!1):!0},customClass:{type:String,default:""},isShowMenuOnClick:{type:Boolean,default:!1}},setup(){const{comp:e,initWrapperDiv:t}=Hx(),{isShow:n,rootMenuList:o,menuStyle:s,show:l,hide:a}=Wx();return i.onBeforeMount(()=>t()),{isShow:n,rootMenuList:o,menuStyle:s,comp:e,show:l,hide:a}}};function Jx(e,t,n,o,s,l){const a=i.resolveComponent("menu-list"),r=i.resolveDirective("clickoutside");return o.isShow&&n.items.length?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-context-menu-modal"},[i.withDirectives((i.openBlock(),i.createBlock(a,{ref:"rootMenuList",isShow:o.isShow,"onUpdate:isShow":t[0]||(t[0]=c=>o.isShow=c),class:i.normalizeClass(n.customClass),items:n.items,style:i.normalizeStyle(o.menuStyle),comp:o.comp},i.createSlots({_:2},[i.renderList(e.$slots,(c,d)=>({name:d,fn:i.withCtx(h=>[i.renderSlot(e.$slots,d,i.normalizeProps(i.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,o.hide]])])):i.createCommentVNode("",!0)}const Gn=le(Kx,[["render",Jx]]);Gn.install=e=>{e.component(Gn.name,Gn)};const Qx=()=>window.innerWidth-document.documentElement.clientWidth,eb=()=>{const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(),o=i.ref(),s=i.ref(!1),l=i.computed(()=>s.value?"ev-icon-compress":"ev-icon-expand");let a=document.getElementById("ev-window-modal");(()=>{if(!a){const g=document.createElement("div");g.id="ev-window-modal",document.body.appendChild(g),a=document.getElementById("ev-window-modal")}})();const c=g=>{let x,b;if(typeof g=="string"||typeof g=="number"){const y=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(g);x=y?{value:+y[2],unit:y[3]||void 0}:void 0}else x=void 0;return x==null?b=void 0:x.unit?b=`${x.value}${x.unit}`:b=`${x.value}px`,b},d=(g,x="horizontal")=>{if(typeof g=="number")return g;if(!g)return 0;let b=0;const y=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(g);if(x&&["%","vw","vh"].includes(y[3])&&y[2]){const M=x==="horizontal"?window.innerWidth:window.innerHeight;b=Math.floor(M*+y[2]/100)}else y[2]&&(b=+y[2]);return b},h=i.reactive({}),f=i.computed(()=>({...e.style,...h})),u=()=>{if(h.position="fixed",e.fullscreen){h.width="100%",h.height="100%",h.top=0,h.left=0;return}const g=d(e.width,"horizontal"),x=d(e.minWidth,"horizontal");g<x?(console.warn("[EVUI][Window] Since width is less than min-width, it is replaced by min-width."),h.width=c(e.minWidth)):h.width=c(e.width);const b=d(e.height,"vertical"),y=d(e.minHeight,"vertical");b<y?(console.warn("[EVUI][Window] Since height is less than min-height, it is replaced by min-height."),h.height=c(e.minHeight)):h.height=c(e.height),h.top=`calc((100% - ${h.height}) / 2)`,h.left=`calc((100% - ${h.width}) / 2)`,d(e.width,"horizontal")>window.innerWidth&&(h.left=0),d(e.height,"vertical")>window.innerHeight&&(h.top=0)},m=g=>{g==="layer"&&!e.closeOnClickModal||t("update:visible",!1)},p=g=>{var y;const x=(y=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:y.length,b=document.body;if(g){if(e.hideScroll){if(!x){const M=Qx();b.style.paddingRight=`${M}px`}b.classList.add("ev-window-scroll-lock")}}else e.hideScroll&&x===1&&(b.style.removeProperty("padding-right"),b.classList.remove("ev-window-scroll-lock"))};return u(),i.watch(()=>e.visible,async g=>{p(g),g&&await i.nextTick(()=>{u()})}),{windowRef:n,headerRef:o,isFullExpandWindow:s,maximizableIcon:l,baseStyle:f,closeWin:m,numberToUnit:c,removeUnit:d}},tb=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{windowRef:o,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=e,c=50,d=5,h=i.reactive({}),f=i.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),u=i.reactive({top:0,left:0}),m=i.reactive({top:!1,right:!1,left:!1,bottom:!1}),p=i.reactive({width:null,height:null,top:null,left:null}),g=(k,B)=>{if(k==null||B==null)return!1;const D=o.value.getBoundingClientRect(),O=+k-D.left,L=+B-D.top,v=s.value.style,N={top:r(v.paddingTop,"vertical"),left:r(v.paddingLeft,"horizontal"),right:r(v.paddingRight,"horizontal")},R=N.left,P=D.width-N.right,_=N.top,A=_+s.value.offsetHeight;return O>R&&O<P&&L>_&&L<A},x=k=>{if(k===null||typeof k!="object")return;let B,D,O,L,v,N;const R=o.value,P=Object.prototype.hasOwnProperty;P.call(k,"top")?B=k.top:B=f.top,P.call(k,"left")?D=k.left:D=f.left,P.call(k,"width")?O=k.width:O=R.offsetWidth,P.call(k,"height")?L=k.height:L=R.offsetHeight,P.call(k,"minWidth")?v=k.minWidth:v=t.minWidth,P.call(k,"minHeight")?N=k.minHeight:N=t.minHeight,O=r(O,"horizontal")>r(v,"horizontal")?O:v,L=r(L,"vertical")>r(N,"vertical")?L:N,h.top=a(B),h.left=a(D),h.width=a(O),h.height=a(L),h.minWidth=a(v),h.minHeight=a(N)},b=k=>{if(!(!o.value||f.pressedSpot))if(t.resizable){const B=o.value.getBoundingClientRect(),D=k.clientX-B.left,O=k.clientY-B.top,L=O<d,v=D<d,N=D>=B.width-d,R=O>=B.height-d;L&&v||R&&N?o.value.style.cursor="nwse-resize":L&&N||R&&v?o.value.style.cursor="nesw-resize":N||v?o.value.style.cursor="ew-resize":R||L?o.value.style.cursor="ns-resize":t.draggable&&g(k.clientX,k.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"}else t.draggable&&g(k.clientX,k.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"},y=k=>{const B=window.innerWidth,D=window.innerHeight,O=m.top,L=m.left,v=m.right,N=m.bottom,R=r(t.minWidth,"horizontal"),P=r(t.minHeight,"vertical"),_=k.clientX>=B?B:k.clientX;let A=k.clientY>=D?D:k.clientY;A=k.clientY>0?A:0;const z=_-f.clientX,X=A-f.clientY;let W=f.top,H=f.left,U=f.width,j=f.height;const K=W+f.height-P,q=H+f.width-R;O&&(W=f.top+X,j=f.height-X,W>K&&(W=K)),L&&(H=f.left+z,U=f.width-z,H>q&&(H=q)),v&&(U=f.width+z),N&&(j=f.height+X),U=Math.min(Math.max(U,R),B),j=Math.min(Math.max(j,P),D);const ee={top:W,left:H,width:U,height:j};x(ee),n("resize",k,{...ee})},M=(k,B)=>{let D=B;return D<0?D=0:D>k-c&&(D=Math.floor(k-c)),D},E=(k,B)=>{let D=B;return D<-(f.width-c)?D=-Math.floor(f.width-c):D>k-c&&(D=Math.floor(k-c)),D},I=k=>{if(k.preventDefault(),f.state="mousedown-mousemove",t.draggable&&f.pressedSpot==="header"){const B=document.documentElement.clientWidth,D=document.documentElement.clientHeight,O=k.clientY-f.clientY,L=k.clientX-f.clientX;let v=f.top+O,N=f.left+L;v=M(D,v),N=E(B,N),x({top:`${v}px`,left:`${N}px`,width:h.width??t.width,height:h.height??t.height})}else t.resizable&&f.pressedSpot==="border"&&y(k);n("mousedown-mousemove",k)},T=k=>{f.state="",f.pressedSpot="",n("mousedown-mouseup",k),window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",T)},V=k=>{if(!o.value||!t.resizable&&!t.draggable)return;let B="";if(t.resizable){const D=o.value.getBoundingClientRect(),O=k.clientX-D.left,L=k.clientY-D.top,v=L<d,N=O<d,R=O>=D.width-d,P=L>=D.height-d;m.top=v,m.left=N,m.right=R,m.bottom=P,(v||N||R||P)&&(B="border")}if(B!=="border"&&g(k.clientX,k.clientY)&&(B="header"),!B||!t.draggable&&B==="header"||!t.resizable&&B==="border"){f.state="mousedown",f.pressedSpot="",f.top=o.value.offsetTop,f.left=o.value.offsetLeft,f.width=o.value.offsetWidth,f.height=o.value.offsetHeight,f.clientX=k.clientX,f.clientY=k.clientY,n("mousedown",{...f,ref:o.value});return}f.state="mousedown",f.pressedSpot=B,f.top=o.value.offsetTop,f.left=o.value.offsetLeft,f.width=o.value.offsetWidth,f.height=o.value.offsetHeight,f.clientX=k.clientX,f.clientY=k.clientY,n("mousedown",{...f,ref:o.value}),window.addEventListener("mousemove",I),window.addEventListener("mouseup",T)},C=k=>{!t.draggable&&!t.resizable||b(k)},S=()=>{l.value=!l.value,i.nextTick(()=>{l.value?(p.top=o.value.offsetTop,p.left=o.value.offsetLeft,p.width=o.value.offsetWidth,p.height=o.value.offsetHeight,x({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):x({top:p.top,left:p.left,width:p.width,height:p.height}),n("expand",{top:p.top,left:p.left,width:p.width,height:p.height})})},w=()=>{l.value=!1,f.state="",f.pressedSpot="",f.top=0,f.left=0,f.width=0,f.height=0,f.clientX=0,f.clientY=0,u.top=0,u.left=0,m.top=!1,m.left=!1,m.right=!1,m.bottom=!1,p.top=null,p.left=null,p.width=null,p.height=null,Object.keys(h).forEach(k=>{delete h[k]})};return i.watch(()=>t.visible,k=>{k||w()}),{dragStyle:h,startDrag:V,moveMouse:C,clickExpandBtn:S}},St=(()=>{let e=[],t=0;return{add(n){if(n!=null)return n.sequence=t++,e.push(n),n.sequence},remove(n){n!=null&&(e=e.filter(o=>o.sequence!==n.sequence))},get windows(){return e.slice()},getWindowBySequence(n){return e.find(o=>o.sequence===n)},isEmpty(){return e.length<=0},isFirstWindowOpen(){return t===1}}})(),wt=(()=>{let l=700;return{getNext(){return l>=748?748:(l+=1,l)},getNextOverLimit(){return 749},getPrevFrom(a){const r=l-a*1;return r<=700?700:r},isUpperLimitClose(){return l>=748},resetToLower(){l=700},getAllocableCount(){return Math.floor(48/1)}}})(),nb=e=>{const t=window.getComputedStyle(e).getPropertyValue("z-index").trim();return!t||isNaN(t)?700:parseInt(t)},Ts=()=>{const e=(n,o)=>n.zIndex>o.zIndex?1:n.zIndex<o.zIndex?-1:n.sequence>o.sequence?1:-1;return Array.prototype.map.call(St.windows,n=>({...n,zIndex:nb(n.elem)})).sort(e)},ob=({closeWin:e,windowRef:t})=>{const{props:n}=i.getCurrentInstance();let o=null,s=null;const l=()=>St.add({sequence:o,closeWin:e,elem:t.value,escClose:n.escClose}),a=x=>{St.remove(x)},r=x=>{if(St.isEmpty())return;const{code:b}=x;if(b!=="Escape")return;const y=Ts(),M=y[y.length-1];M.escClose&&M.closeWin()},c=()=>{o=l(),t.value.dataset.sequence=o,St.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const x=St.getWindowBySequence(o);a(x)},h=({elem:x,zIndex:b})=>{if(n.isModal){const y=x.parentElement.getElementsByClassName("ev-window-dim-layer")[0];y.style.zIndex=b}x.style.zIndex=b},f=()=>{St.windows.length===1&&wt.resetToLower();const x=wt.getNext();h({elem:t.value,zIndex:x})},u=x=>String(x.sequence)===t.value.dataset.sequence,m=()=>{const x=Ts();if(St.windows.length>wt.getAllocableCount()){const y=x.reverse();let M=0;y.forEach(I=>{if(u(I))return;const T=wt.getPrevFrom(M++);h({elem:I.elem,zIndex:T})});const E=wt.getNextOverLimit();h({elem:t.value,zIndex:E})}else{wt.resetToLower(),x.forEach(M=>{if(u(M))return;const E=wt.getNext();h({elem:M.elem,zIndex:E})});const y=wt.getNext();h({elem:t.value,zIndex:y})}},p=()=>{wt.isUpperLimitClose()?m():f()},g=()=>{if(!t.value||!n.focusable)return;const x=Ts(),b=x[x.length-1];u(b)||p()};return i.onMounted(()=>{n.visible&&(c(),s=setTimeout(p,0))}),i.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),i.watch(()=>n.visible,x=>{i.nextTick(()=>{x?(c(),s=setTimeout(p,0)):(d(),clearTimeout(s))})}),i.watch(()=>n.escClose,x=>{if(!n.visible)return;const b=St.getWindowBySequence(o);b&&(b.escClose=x)}),{setFocus:g}},ib={name:"EvWindow",props:{style:{type:Object,default(){return{}}},visible:{type:Boolean,default:!1},title:{type:[String,Number],default:null},windowClass:{type:String,default:""},iconClass:{type:String,default:""},width:{type:[String,Number],default:"50vw"},height:{type:[String,Number],default:"50vh"},minWidth:{type:[String,Number],default:150},minHeight:{type:[String,Number],default:150},fullscreen:{type:Boolean,default:!1},isModal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!1},hideScroll:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},maximizable:{type:Boolean,default:!1},escClose:{type:Boolean,default:!1},focusable:{type:Boolean,default:!1}},emits:["update:visible","mousedown","mousedown-mouseup","mousedown-mousemove","resize","expand"],setup(){const{windowRef:e,headerRef:t,isFullExpandWindow:n,maximizableIcon:o,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=eb(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:f}=tb({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:u}=ob({closeWin:l,windowRef:e});return{windowRef:e,headerRef:t,baseStyle:s,dragStyle:c,maximizableIcon:o,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:f,setFocus:u}}},sb={key:0,ref:"headerRef",class:"ev-window-header"},lb={key:0,class:"ev-window-icon"},ab={key:1,class:"ev-window-title"},rb={class:"ev-window-content"},cb={key:1,class:"ev-window-footer"},db={class:"ev-window-top-right-icon"};function hb(e,t,n,o,s,l){return i.openBlock(),i.createBlock(i.Teleport,{to:"#ev-window-modal"},[i.createVNode(i.Transition,{name:"ev-window-fade",appear:""},{default:i.withCtx(()=>[n.visible?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:t[0]||(t[0]=a=>o.closeWin("layer")),onWheel:i.withModifiers(()=>{},["stop","prevent"])},null,32)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref:"windowRef",class:i.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:i.normalizeStyle({...o.baseStyle,...o.dragStyle}),onMousedown:t[3]||(t[3]=(...a)=>o.startDrag&&o.startDrag(...a)),onMousemove:t[4]||(t[4]=(...a)=>o.moveMouse&&o.moveMouse(...a)),onClick:t[5]||(t[5]=(...a)=>o.setFocus&&o.setFocus(...a))},[e.$slots.header||n.iconClass||n.title?(i.openBlock(),i.createElementBlock("div",sb,[e.$slots.header?i.renderSlot(e.$slots,"header",{key:0}):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.iconClass?(i.openBlock(),i.createElementBlock("span",lb,[i.createElementVNode("i",{class:i.normalizeClass(n.iconClass)},null,2)])):i.createCommentVNode("",!0),n.title?(i.openBlock(),i.createElementBlock("p",ab,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0)],64))],512)):i.createCommentVNode("",!0),i.createElementVNode("div",rb,[i.renderSlot(e.$slots,"default")]),e.$slots.footer?(i.openBlock(),i.createElementBlock("div",cb,[i.renderSlot(e.$slots,"footer")])):i.createCommentVNode("",!0),i.createElementVNode("div",db,[n.maximizable&&!n.fullscreen?(i.openBlock(),i.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:t[1]||(t[1]=(...a)=>o.clickExpandBtn&&o.clickExpandBtn(...a))},[i.createElementVNode("i",{class:i.normalizeClass(o.maximizableIcon)},null,2)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ev-window-close",onClick:t[2]||(t[2]=(...a)=>o.closeWin&&o.closeWin(...a))},[...t[6]||(t[6]=[i.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):i.createCommentVNode("",!0)]),_:3})])}const Zn=le(ib,[["render",hb]]);Zn.install=e=>{e.component(Zn.name,Zn)};const fb={name:"EvLoading",props:{modelValue:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},clickOutside:{type:Boolean,default:!1},iconClass:{type:String,default:null},iconStyle:{type:Object,default:()=>{}}},emits:{"update:modelValue":[Boolean]},setup(e,{emit:t}){return{clickEventName:i.computed(()=>e.clickOutside?"click":null),closeLoading:()=>t("update:modelValue",!1)}}},ub={class:"ev-loading-spinner"},mb={class:"ev-loading-spinner"};function gb(e,t,n,o,s,l){return n.fullscreen?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"body"},[n.modelValue?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:"ev-loading full-screen"},{[i.toHandlerKey(`${o.clickEventName}`)]:t[0]||(t[0]=(...a)=>o.closeLoading&&o.closeLoading(...a))}),[i.createElementVNode("div",ub,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock("i",{key:1,class:i.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:i.normalizeStyle(n.iconStyle)},null,6))])],16)):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n.modelValue?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:"ev-loading"},{[i.toHandlerKey(`${o.clickEventName}`)]:t[1]||(t[1]=(...a)=>o.closeLoading&&o.closeLoading(...a))}),[i.createElementVNode("div",mb,[e.$slots.default?i.renderSlot(e.$slots,"default",{key:0}):(i.openBlock(),i.createElementBlock("i",{key:1,class:i.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:i.normalizeStyle(n.iconStyle)},null,6))])],16)):i.createCommentVNode("",!0)],64))}const qn=le(fb,[["render",gb]]);qn.install=e=>{e.component(qn.name,qn)};const pb={name:"EvProgress",props:{modelValue:{type:Number,default:0,validator:e=>e>=0&&e<=100},color:{type:[String,Array],default:"#409EFF"},strokeWidth:{type:Number,default:6},innerText:{type:String,default:""}},emits:{},setup(e){const t=i.computed(()=>({height:`${e.strokeWidth}px`})),n=i.computed(()=>{if(Array.isArray(e.color)){const o=[...e.color].sort((l,a)=>l.value-a.value);let s=o[0].color;if(!e.modelValue)return{width:`${e.modelValue}%`,"background-color":s};for(let l=0;l<o.length;l++){const a=l===0?0:o[l-1].value,r=o[l].value;if(e.modelValue>a&&e.modelValue<=r){s=o[l].color;break}}return{width:`${e.modelValue}%`,"background-color":s}}return{width:`${e.modelValue}%`,"background-color":e.color}});return{wrapperStyle:t,innerStyle:n}}},yb={class:"ev-progress"},xb={key:0,class:"ev-progress-inner-text"},bb={key:0,class:"ev-progress-label"};function Cb(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",yb,[i.createElementVNode("div",{class:"ev-progress-wrapper",style:i.normalizeStyle(o.wrapperStyle)},[i.createElementVNode("div",{class:"ev-progress-inner",style:i.normalizeStyle(o.innerStyle)},[n.innerText?(i.openBlock(),i.createElementBlock("div",xb,i.toDisplayString(n.innerText),1)):i.createCommentVNode("",!0)],4)],4),e.$slots.default?(i.openBlock(),i.createElementBlock("div",bb,[i.renderSlot(e.$slots,"default")])):i.createCommentVNode("",!0)])}const Kn=le(pb,[["render",Cb]]);Kn.install=e=>{e.component(Kn.name,Kn)};const Sb={name:"MenuItem",props:{selectedItem:{type:[String,Number],default:""},item:{type:Object,default:()=>{},validator:e=>{if(e.value){if(e.children!==void 0&&!Array.isArray(e.children))return console.warn("[EVUI][Menu] children attribute must be 'Array' type."),!1;if(e.expand!==void 0&&typeof e.expand!="boolean")return console.warn("[EVUI][Menu] expand attribute must be 'Boolean' type."),!1;if(e.hidden!==void 0&&typeof e.hidden!="boolean")return console.warn("[EVUI][Menu] hidden attribute must be 'Boolean' type."),!1;if(e.disabled!==void 0&&typeof e.disabled!="boolean")return console.warn("[EVUI][Menu] disabled attribute must be 'Boolean' type."),!1;if(e.slotKey!==void 0&&typeof e.slotKey!="string")return console.warn("[EVUI][Menu] slotKey attribute must be 'String' type."),!1}else return console.warn("[EVUI][Menu] value attribute is required."),!1;return!0}},depth:{type:Number,default:1},expandable:{type:Boolean,default:!0},comp:{type:Object,default:()=>{}},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){const n=e.expandable&&e.item.expand!==void 0&&typeof e.item.expand=="boolean"?e.item.expand:!0,o=i.ref(n),s=i.computed(()=>!!e.item.children&&!!e.item.children.length);return{isExpand:o,hasChild:s,clickMenu:a=>{s.value&&a.depth===e.depth?e.expandable&&(o.value=!o.value):t("click",a)}}}},wb={class:"text"};function kb(e,t,n,o,s,l){return n.item.hidden?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[i.createElementVNode("div",{class:i.normalizeClass(["ev-menu-title",{expandable:o.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:t[0]||(t[0]=a=>o.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(i.openBlock(),i.createElementBlock("i",{key:0,class:i.normalizeClass(["front-icon",n.item.iconClass])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("span",wb,[n.item.slotKey?i.renderSlot(e.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[i.createTextVNode(i.toDisplayString(n.item.text||n.item.value),1)]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&o.hasChild?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["list-expend-icon",{expend:n.expandable&&o.isExpand}])},[...t[1]||(t[1]=[i.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):i.createCommentVNode("",!0)],2),o.hasChild?i.withDirectives((i.openBlock(),i.createElementBlock("ol",{key:0,class:i.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.item.children,(a,r)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:`${a.value}_${r}_${n.depth+1}`,depth:n.depth+1,item:a,"selected-item":n.selectedItem,expandable:n.expandable,disabled:n.disabled,comp:n.comp,onClick:o.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[i.vShow,o.isExpand]]):i.createCommentVNode("",!0)],2))}const fr=le(Sb,[["render",kb]]),Mb={name:"EvMenu",components:{MenuItem:fr},props:{modelValue:{type:[String,Number],default:""},items:{type:Array,default:()=>[]},expandable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=i.ref(e.items.filter(l=>e.modelValue===l.value));return{clickMenu:l=>{if(!l.disabled){const a=l.item;t("update:modelValue",a.value),t("change",a,n.value),n.value=a}},component:fr}}},Ib={class:"ev-menu"};function Eb(e,t,n,o,s,l){const a=i.resolveComponent("menu-item");return i.openBlock(),i.createElementBlock("ul",Ib,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(r,c)=>(i.openBlock(),i.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:o.component,onClick:o.clickMenu},i.createSlots({_:2},[i.renderList(e.$slots,(d,h)=>({name:h,fn:i.withCtx(f=>[i.renderSlot(e.$slots,h,i.mergeProps({ref_for:!0},f))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const Jn=le(Mb,[["render",Eb]]);Jn.install=e=>{e.component(Jn.name,Jn)};const vb={name:"TreeNode",props:{data:{type:Object,require:!0,default:()=>({})},useCheckbox:{type:Boolean,default:!1},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},comp:{type:Object,default:()=>{}}},emits:{"update-checked-info":null,"click-node":null,"dblclick-node":null,"show-context-menu":null},setup(e,{emit:t}){const n=i.reactive(e.data),o=i.computed(()=>e.data.children&&e.data.children.length),s=i.computed(()=>{const g=e.expandIcon?e.expandIcon:"ev-icon-s-play",x=e.expandIcon?e.collapseIcon:"ev-icon-s-play";return e.data.expand?x:g}),l=i.computed(()=>e.data.children);function a(g,x){t("update-checked-info",{nodeKey:x,isChecked:g})}function r({nodeKey:g,isChecked:x}){t("update-checked-info",{nodeKey:g,isChecked:x})}function c(){n.expand=!n.expand}function d(){n.disabled||(n.selected=!n.selected,t("click-node",n.nodeKey))}function h(g){t("click-node",g)}function f(){n.disabled||t("dblclick-node",n.nodeKey)}function u(g){t("dblclick-node",g)}function m(g){t("show-context-menu",!0,g)}return{expandIconClasses:s,showExpandIcon:o,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:f,emitDblClickedContent:u,handleContextmenu:m,emitContextMenuFlag:(g,x)=>{t("show-context-menu",g,x)}}}},Tb={class:"ev-tree-children"},Bb={class:"ev-tree-node"};function Db(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-checkbox");return i.withDirectives((i.openBlock(),i.createElementBlock("ul",Tb,[i.createElementVNode("li",null,[i.createElementVNode("span",{class:i.normalizeClass([{expand:o.treeData.expand},"ev-tree-toggle"])},[o.showExpandIcon?(i.openBlock(),i.createBlock(a,{key:0,icon:o.expandIconClasses,onClick:o.handleExpand},null,8,["icon","onClick"])):i.createCommentVNode("",!0)],2),i.createElementVNode("div",Bb,[n.useCheckbox?(i.openBlock(),i.createBlock(r,{key:0,modelValue:o.treeData.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>o.treeData.checked=c),indeterminate:o.treeData.indeterminate,disabled:o.treeData.disabled,onChange:t[1]||(t[1]=c=>o.handleCheck(o.treeData.checked,o.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):i.createCommentVNode("",!0),o.treeData.iconClass?(i.openBlock(),i.createBlock(a,{key:1,icon:o.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass([{"ev-tree-title-selected":o.treeData.selected,"ev-tree-title-disabled":o.treeData.disabled},"ev-tree-title"]),onContextmenu:t[2]||(t[2]=(...c)=>o.handleContextmenu&&o.handleContextmenu(...c)),onClick:t[3]||(t[3]=(...c)=>o.clickTreeContent&&o.clickTreeContent(...c)),onDblclick:t[4]||(t[4]=(...c)=>o.dblClickTreeContent&&o.dblClickTreeContent(...c))},i.toDisplayString(o.treeData.title),35)]),i.createVNode(i.TransitionGroup,{name:"fade"},{default:i.withCtx(()=>[o.treeData.expand?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(o.childrenInfo,(c,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.comp),{key:`${c.value}-${d}`,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:n.comp,onUpdateCheckedInfo:o.emitCheckedInfo,onClickNode:o.emitClickedContent,onDblclickNode:o.emitDblClickedContent,onShowContextMenu:o.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):i.createCommentVNode("",!0)]),_:1})])],512)),[[i.vShow,o.treeData.visible]])}const ur=le(vb,[["render",Db]]),Ob={name:"EvTree",components:{TreeNode:ur},props:{data:{type:Array,default:()=>[]},useCheckbox:{type:Boolean,default:!1},emptyText:{type:String,default:"No Data"},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},contextMenuItems:{type:Array,default:()=>[]},searchWord:{type:String,default:""},searchIncludeChildren:{type:Boolean,default:!1}},emits:{"click-node":null,"dblclick-node":null,check:Array},setup(e,{emit:t}){const n=i.ref(e.data);let o=[];const s=i.ref(null);let l=!1;const a=ur;function r(C){const S=o[C].parent;if(typeof S>"u")return;const w=o[C].node,k=o[S].node;if(!(w.checked===k.checked&&w.indeterminate===k.indeterminate)){if(w.checked)k.checked=k.children.every(B=>B.checked),k.indeterminate=!k.checked;else{const B=D=>D.checked||w.indeterminate;k.checked=!1,k.indeterminate=k.children.some(B)}r(S)}}function c(C,S={}){const w=Object.keys(S);for(let k=0;k<w.length;k++)C[w[k]]=S[w[k]];C.children&&C.children.forEach(k=>{c(k,S)})}function d(){let C=0;const S=[],w=[];function k(B,D){const O=B;O.nodeKey=C++,Object.hasOwnProperty.call(O,"selected")||(O.selected=!1),Object.hasOwnProperty.call(O,"visible")||(O.visible=!0),"value"in O&&w.includes(O.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),O.value+=O.nodeKey):"value"in O||(O.value=O.title+O.nodeKey),w.push(O.value),S[O.nodeKey]={node:O,nodeKey:O.nodeKey},typeof D<"u"&&(S[O.nodeKey].parent=D.nodeKey,S[D.nodeKey].children.push(O.nodeKey)),O.children&&(S[O.nodeKey].children=[],O.children.forEach(L=>k(L,O)))}return n.value.length&&k(n.value[0]),S}o=d();function h(){return o.filter(C=>C.node.checked).map(C=>C.node)}function f(){h().forEach(S=>{c(S,{checked:!0});const w=o[S.nodeKey].parent;if(!w&&w!==0)return;const k=o[w].node;typeof S.checked<"u"&&S.checked&&k.checked!==S.checked&&r(S.nodeKey)})}function u({nodeKey:C,isChecked:S}){const w=o[C].node;w.checked=S,w.indeterminate=!1,r(C),c(w,{checked:S,indeterminate:!1});const k=h();t("check",k),f()}function m(C){const S=o[C].node;for(let w=0;w<o.length;w++)o[w].node.nodeKey!==C&&(o[w].node.selected=!1);t("click-node",{title:S.title,value:S.value})}function p(C){const S=o[C].node;t("dblclick-node",{title:S.title,value:S.value})}const g=C=>{e.contextMenuItems.length&&l&&(s.value.show(C),l=!1)},x=(C,S)=>{l=C,g(S)},b=(C,S)=>C.toLowerCase().includes(S.toLowerCase()),y=C=>{var S;if(C.children){const w=!!((S=C.children.filter(k=>b(k.title,e.searchWord)))!=null&&S.length);C.children.forEach(k=>{y(k),k.visible=w&&b(k.title,e.searchWord)||!w})}};function M(C){C.children&&C.children.forEach(S=>{S.visible=!1,M(S)})}function E(C){if(!C&&C!==0)return;const S=o[C];S.node.visible=!0,S.parent!==void 0&&E(S.parent)}function I(C){o.forEach(w=>{const k=w.node;k.visible=!1}),o.filter(w=>b(w.node.title,C)).forEach(w=>{const k=w.node;k.visible=!0,e.searchIncludeChildren?y(k):M(k);const B=o[k.nodeKey].parent;E(B)})}const T=i.computed(()=>!n.value.length||n.value.every(C=>!C.visible));i.watch(()=>e.data,C=>{n.value=C,o=d()},{deep:!0});let V;return i.watch(()=>e.searchWord,C=>{V&&clearTimeout(V),V=setTimeout(()=>{C?I(C):o.forEach(S=>{const w=S.node;w.visible=!0})},200)}),i.onMounted(()=>{f();const C=h();C.length&&t("check",C)}),i.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:T,updateCheckedInfo:u,clickContent:m,dblClickContent:p,showContextMenu:g,getContextMenuFlag:x}}},Lb={class:"ev-tree-view"},Rb={key:0};function Nb(e,t,n,o,s,l){const a=i.resolveComponent("tree-node"),r=i.resolveComponent("ev-context-menu");return i.openBlock(),i.createElementBlock("div",Lb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.treeNodeData,(c,d)=>(i.openBlock(),i.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:o.component,onUpdateCheckedInfo:o.updateCheckedInfo,onClickNode:o.clickContent,onDblclickNode:o.dblClickContent,onShowContextMenu:o.getContextMenuFlag,onContextmenu:i.withModifiers(o.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),o.isShowEmptyText?(i.openBlock(),i.createElementBlock("div",Rb,i.toDisplayString(n.emptyText),1)):i.createCommentVNode("",!0),n.contextMenuItems.length?(i.openBlock(),i.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):i.createCommentVNode("",!0)])}const Qn=le(Ob,[["render",Nb]]);Qn.install=e=>{e.component(Qn.name,Qn)};const Vb={name:"EvTimePicker",props:{modelValue:{type:[Array,String],default:"",validator:e=>{const t=/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/;return Array.isArray(e)&&(!t.test(e[0])||!t.test(e[1]))||!Array.isArray(e)&&!t.test(e)?(console.warn("[EVUI][TimePicker] Please check the time format in the Timepicker."),!1):!0}},type:{type:String,default:"range"},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:[String,Array],required:!1,default:void 0}},emits:{"update:modelValue":null,focus:null,blur:null,change:null},setup(e,{emit:t}){const n=i.computed({get:()=>e.modelValue,set:I=>{if(e.type==="range"){if(Array.isArray(I)){const T=I[0]>I[1]?"00:00":I[0],V=T.value>I[1]?"23:59":I[1];t("update:modelValue",[T,V])}}else t("update:modelValue",I)}}),o=i.computed(()=>{const I=["start time","end time"];return Array.isArray(e.placeholder)?[typeof e.placeholder[0]=="string"?e.placeholder[0]:I[0],typeof e.placeholder[1]=="string"?e.placeholder[1]:I[1]]:typeof e.placeholder=="string"?[e.placeholder,e.placeholder]:I}),s=i.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=i.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=I=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(I),r=()=>{Array.isArray(n.value)&&(a(n.value[0])||(n.value[0]=s.value[0]),n.value[1]&&n.value[0]>n.value[1]&&(n.value[0]=n.value[1]),s.value[0]=n.value[0])},c=()=>{Array.isArray(n.value)&&(a(n.value[1])||(n.value[1]=s.value[1]),n.value[0]&&n.value[0]>n.value[1]&&(n.value[1]=s.value[1],n.value[0]>s.value[1]&&(n.value[1]=n.value[0])),s.value[1]=n.value[1])};return{time:n,isWrongType:l,previousValue:s,clearContents:()=>{n.value="",l.single=!0},clearStartTime:()=>{n.value[0]="",l.rangeStart=!0},clearEndTime:()=>{n.value[1]="",l.rangeEnd=!0},focusInputTime:I=>{t("focus",I)},blurInputTime:I=>{t("blur",I)},changeTime:I=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),t("change",I,n.value)},focusInputStartTime:I=>{t("focus",I)},blurInputStartTime:I=>{t("blur",I)},changeStartTime:I=>{r(),l.rangeStart=!1,t("change",I,n.value)},focusInputEndTime:I=>{t("focus",I)},blurInputEndTime:I=>{t("blur",I)},changeEndTime:I=>{c(),l.rangeEnd=!1,t("change",I,n.value)},placeholders:o}}},Pb={class:"ev-time-picker"},_b={key:0,class:"ev-time-picker-range"},Ab=["disabled","readonly","placeholder"],zb=["disabled","readonly","placeholder"],Fb={key:1,class:"ev-time-picker-single"},Hb=["disabled","readonly","placeholder"];function Wb(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon");return i.openBlock(),i.createElementBlock("div",Pb,[n.type==="range"?(i.openBlock(),i.createElementBlock("div",_b,[i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>o.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:o.placeholders[0],onFocus:t[1]||(t[1]=(...r)=>o.focusInputStartTime&&o.focusInputStartTime(...r)),onBlur:t[2]||(t[2]=(...r)=>o.blurInputStartTime&&o.blurInputStartTime(...r)),onChange:t[3]||(t[3]=(...r)=>o.changeStartTime&&o.changeStartTime(...r))},null,40,Ab),[[i.vModelText,o.time[0]]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearStartTime},null,8,["onClick"])):i.createCommentVNode("",!0)],2),t[12]||(t[12]=i.createElementVNode("p",{class:"tilde"},"~",-1)),i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>o.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:o.placeholders[1],onFocus:t[5]||(t[5]=(...r)=>o.focusInputEndTime&&o.focusInputEndTime(...r)),onBlur:t[6]||(t[6]=(...r)=>o.blurInputEndTime&&o.blurInputEndTime(...r)),onChange:t[7]||(t[7]=(...r)=>o.changeEndTime&&o.changeEndTime(...r))},null,40,zb),[[i.vModelText,o.time[1]]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearEndTime},null,8,["onClick"])):i.createCommentVNode("",!0)],2)])):(i.openBlock(),i.createElementBlock("div",Fb,[i.createElementVNode("div",{class:i.normalizeClass([{error:o.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>o.time=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:typeof n.placeholder=="string"?n.placeholder:"Enter time",onFocus:t[9]||(t[9]=(...r)=>o.focusInputTime&&o.focusInputTime(...r)),onBlur:t[10]||(t[10]=(...r)=>o.blurInputTime&&o.blurInputTime(...r)),onChange:t[11]||(t[11]=(...r)=>o.changeTime&&o.changeTime(...r))},null,40,Hb),[[i.vModelText,o.time]]),i.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(i.openBlock(),i.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:o.clearContents},null,8,["onClick"])):i.createCommentVNode("",!0)],2)]))])}const eo=le(Vb,[["render",Wb]]);eo.install=e=>{e.component(eo.name,eo)};const $b={name:"EvGridToolbar"},Xb={class:"gridToolbar"};function Ub(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",Xb,[i.renderSlot(e.$slots,"toolbarWrapper")])}const Yb=le($b,[["render",Ub]]),jb={name:"EvGridPagination",props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)}},emits:{"update:modelValue":null},setup(e,{emit:t}){const n=i.ref(e.modelValue),o=s=>{n.value=s>0?s:1,t("update:modelValue",n.value)};return i.watch(()=>e.modelValue,s=>{n.value=s}),{currentValue:n,changePage:o}}},Gb={class:"grid-pagination"};function Zb(e,t,n,o,s,l){const a=i.resolveComponent("ev-pagination");return i.openBlock(),i.createElementBlock("div",Gb,[i.createVNode(a,{modelValue:o.currentValue,"onUpdate:modelValue":t[0]||(t[0]=r=>o.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:o.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const mr=le(jb,[["render",Zb],["__scopeId","data-v-2e265290"]]);var qb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bs=Math.ceil,Ze=Math.floor,He="[BigNumber Error] ",gr=He+"Number primitive has more than 15 significant digits: ",lt=1e14,ce=14,Ds=9007199254740991,Os=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Nt=1e7,De=1e9;function pr(e){var t,n,o,s=y.prototype={constructor:y,toString:null,valueOf:null},l=new y(1),a=20,r=4,c=-7,d=21,h=-1e7,f=1e7,u=!1,m=1,p=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function y(C,S){var w,k,B,D,O,L,v,N,R=this;if(!(R instanceof y))return new y(C,S);if(S==null){if(C&&C._isBigNumber===!0){R.s=C.s,!C.c||C.e>f?R.c=R.e=null:C.e<h?R.c=[R.e=0]:(R.e=C.e,R.c=C.c.slice());return}if((L=typeof C=="number")&&C*0==0){if(R.s=1/C<0?(C=-C,-1):1,C===~~C){for(D=0,O=C;O>=10;O/=10,D++);D>f?R.c=R.e=null:(R.e=D,R.c=[C]);return}N=String(C)}else{if(!qb.test(N=String(C)))return o(R,N,L);R.s=N.charCodeAt(0)==45?(N=N.slice(1),-1):1}(D=N.indexOf("."))>-1&&(N=N.replace(".","")),(O=N.search(/e/i))>0?(D<0&&(D=O),D+=+N.slice(O+1),N=N.substring(0,O)):D<0&&(D=N.length)}else{if(be(S,2,x.length,"Base"),S==10&&b)return R=new y(C),T(R,a+R.e+1,r);if(N=String(C),L=typeof C=="number"){if(C*0!=0)return o(R,N,L,S);if(R.s=1/C<0?(N=N.slice(1),-1):1,y.DEBUG&&N.replace(/^0\.0*|\./,"").length>15)throw Error(gr+C)}else R.s=N.charCodeAt(0)===45?(N=N.slice(1),-1):1;for(w=x.slice(0,S),D=O=0,v=N.length;O<v;O++)if(w.indexOf(k=N.charAt(O))<0){if(k=="."){if(O>D){D=v;continue}}else if(!B&&(N==N.toUpperCase()&&(N=N.toLowerCase())||N==N.toLowerCase()&&(N=N.toUpperCase()))){B=!0,O=-1,D=0;continue}return o(R,String(C),L,S)}L=!1,N=n(N,S,10,R.s),(D=N.indexOf("."))>-1?N=N.replace(".",""):D=N.length}for(O=0;N.charCodeAt(O)===48;O++);for(v=N.length;N.charCodeAt(--v)===48;);if(N=N.slice(O,++v)){if(v-=O,L&&y.DEBUG&&v>15&&(C>Ds||C!==Ze(C)))throw Error(gr+R.s*C);if((D=D-O-1)>f)R.c=R.e=null;else if(D<h)R.c=[R.e=0];else{if(R.e=D,R.c=[],O=(D+1)%ce,D<0&&(O+=ce),O<v){for(O&&R.c.push(+N.slice(0,O)),v-=ce;O<v;)R.c.push(+N.slice(O,O+=ce));O=ce-(N=N.slice(O)).length}else O-=v;for(;O--;N+="0");R.c.push(+N)}}else R.c=[R.e=0]}y.clone=pr,y.ROUND_UP=0,y.ROUND_DOWN=1,y.ROUND_CEIL=2,y.ROUND_FLOOR=3,y.ROUND_HALF_UP=4,y.ROUND_HALF_DOWN=5,y.ROUND_HALF_EVEN=6,y.ROUND_HALF_CEIL=7,y.ROUND_HALF_FLOOR=8,y.EUCLID=9,y.config=y.set=function(C){var S,w;if(C!=null)if(typeof C=="object"){if(C.hasOwnProperty(S="DECIMAL_PLACES")&&(w=C[S],be(w,0,De,S),a=w),C.hasOwnProperty(S="ROUNDING_MODE")&&(w=C[S],be(w,0,8,S),r=w),C.hasOwnProperty(S="EXPONENTIAL_AT")&&(w=C[S],w&&w.pop?(be(w[0],-De,0,S),be(w[1],0,De,S),c=w[0],d=w[1]):(be(w,-De,De,S),c=-(d=w<0?-w:w))),C.hasOwnProperty(S="RANGE"))if(w=C[S],w&&w.pop)be(w[0],-De,-1,S),be(w[1],1,De,S),h=w[0],f=w[1];else if(be(w,-De,De,S),w)h=-(f=w<0?-w:w);else throw Error(He+S+" cannot be zero: "+w);if(C.hasOwnProperty(S="CRYPTO"))if(w=C[S],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))u=w;else throw u=!w,Error(He+"crypto unavailable");else u=w;else throw Error(He+S+" not true or false: "+w);if(C.hasOwnProperty(S="MODULO_MODE")&&(w=C[S],be(w,0,9,S),m=w),C.hasOwnProperty(S="POW_PRECISION")&&(w=C[S],be(w,0,De,S),p=w),C.hasOwnProperty(S="FORMAT"))if(w=C[S],typeof w=="object")g=w;else throw Error(He+S+" not an object: "+w);if(C.hasOwnProperty(S="ALPHABET"))if(w=C[S],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))b=w.slice(0,10)=="0123456789",x=w;else throw Error(He+S+" invalid: "+w)}else throw Error(He+"Object expected: "+C);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,f],CRYPTO:u,MODULO_MODE:m,POW_PRECISION:p,FORMAT:g,ALPHABET:x}},y.isBigNumber=function(C){if(!C||C._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var S,w,k=C.c,B=C.e,D=C.s;e:if({}.toString.call(k)=="[object Array]"){if((D===1||D===-1)&&B>=-De&&B<=De&&B===Ze(B)){if(k[0]===0){if(B===0&&k.length===1)return!0;break e}if(S=(B+1)%ce,S<1&&(S+=ce),String(k[0]).length==S){for(S=0;S<k.length;S++)if(w=k[S],w<0||w>=lt||w!==Ze(w))break e;if(w!==0)return!0}}}else if(k===null&&B===null&&(D===null||D===1||D===-1))return!0;throw Error(He+"Invalid BigNumber: "+C)},y.maximum=y.max=function(){return E(arguments,-1)},y.minimum=y.min=function(){return E(arguments,1)},y.random=function(){var C=9007199254740992,S=Math.random()*C&2097151?function(){return Ze(Math.random()*C)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var k,B,D,O,L,v=0,N=[],R=new y(l);if(w==null?w=a:be(w,0,De),O=Bs(w/ce),u)if(crypto.getRandomValues){for(k=crypto.getRandomValues(new Uint32Array(O*=2));v<O;)L=k[v]*131072+(k[v+1]>>>11),L>=9e15?(B=crypto.getRandomValues(new Uint32Array(2)),k[v]=B[0],k[v+1]=B[1]):(N.push(L%1e14),v+=2);v=O/2}else if(crypto.randomBytes){for(k=crypto.randomBytes(O*=7);v<O;)L=(k[v]&31)*281474976710656+k[v+1]*1099511627776+k[v+2]*4294967296+k[v+3]*16777216+(k[v+4]<<16)+(k[v+5]<<8)+k[v+6],L>=9e15?crypto.randomBytes(7).copy(k,v):(N.push(L%1e14),v+=7);v=O/7}else throw u=!1,Error(He+"crypto unavailable");if(!u)for(;v<O;)L=S(),L<9e15&&(N[v++]=L%1e14);for(O=N[--v],w%=ce,O&&w&&(L=Os[ce-w],N[v]=Ze(O/L)*L);N[v]===0;N.pop(),v--);if(v<0)N=[D=0];else{for(D=-1;N[0]===0;N.splice(0,1),D-=ce);for(v=1,L=N[0];L>=10;L/=10,v++);v<ce&&(D-=ce-v)}return R.e=D,R.c=N,R}}(),y.sum=function(){for(var C=1,S=arguments,w=new y(S[0]);C<S.length;)w=w.plus(S[C++]);return w},n=function(){var C="0123456789";function S(w,k,B,D){for(var O,L=[0],v,N=0,R=w.length;N<R;){for(v=L.length;v--;L[v]*=k);for(L[0]+=D.indexOf(w.charAt(N++)),O=0;O<L.length;O++)L[O]>B-1&&(L[O+1]==null&&(L[O+1]=0),L[O+1]+=L[O]/B|0,L[O]%=B)}return L.reverse()}return function(w,k,B,D,O){var L,v,N,R,P,_,A,z,X=w.indexOf("."),W=a,H=r;for(X>=0&&(R=p,p=0,w=w.replace(".",""),z=new y(k),_=z.pow(w.length-X),p=R,z.c=S(kt(Ke(_.c),_.e,"0"),10,B,C),z.e=z.c.length),A=S(w,k,B,O?(L=x,C):(L=C,x)),N=R=A.length;A[--R]==0;A.pop());if(!A[0])return L.charAt(0);if(X<0?--N:(_.c=A,_.e=N,_.s=D,_=t(_,z,W,H,B),A=_.c,P=_.r,N=_.e),v=N+W+1,X=A[v],R=B/2,P=P||v<0||A[v+1]!=null,P=H<4?(X!=null||P)&&(H==0||H==(_.s<0?3:2)):X>R||X==R&&(H==4||P||H==6&&A[v-1]&1||H==(_.s<0?8:7)),v<1||!A[0])w=P?kt(L.charAt(1),-W,L.charAt(0)):L.charAt(0);else{if(A.length=v,P)for(--B;++A[--v]>B;)A[v]=0,v||(++N,A=[1].concat(A));for(R=A.length;!A[--R];);for(X=0,w="";X<=R;w+=L.charAt(A[X++]));w=kt(w,N,L.charAt(0))}return w}}(),t=function(){function C(k,B,D){var O,L,v,N,R=0,P=k.length,_=B%Nt,A=B/Nt|0;for(k=k.slice();P--;)v=k[P]%Nt,N=k[P]/Nt|0,O=A*v+N*_,L=_*v+O%Nt*Nt+R,R=(L/D|0)+(O/Nt|0)+A*N,k[P]=L%D;return R&&(k=[R].concat(k)),k}function S(k,B,D,O){var L,v;if(D!=O)v=D>O?1:-1;else for(L=v=0;L<D;L++)if(k[L]!=B[L]){v=k[L]>B[L]?1:-1;break}return v}function w(k,B,D,O){for(var L=0;D--;)k[D]-=L,L=k[D]<B[D]?1:0,k[D]=L*O+k[D]-B[D];for(;!k[0]&&k.length>1;k.splice(0,1));}return function(k,B,D,O,L){var v,N,R,P,_,A,z,X,W,H,U,j,K,q,ee,J,te,G=k.s==B.s?1:-1,oe=k.c,Z=B.c;if(!oe||!oe[0]||!Z||!Z[0])return new y(!k.s||!B.s||(oe?Z&&oe[0]==Z[0]:!Z)?NaN:oe&&oe[0]==0||!Z?G*0:G/0);for(X=new y(G),W=X.c=[],N=k.e-B.e,G=D+N+1,L||(L=lt,N=qe(k.e/ce)-qe(B.e/ce),G=G/ce|0),R=0;Z[R]==(oe[R]||0);R++);if(Z[R]>(oe[R]||0)&&N--,G<0)W.push(1),P=!0;else{for(q=oe.length,J=Z.length,R=0,G+=2,_=Ze(L/(Z[0]+1)),_>1&&(Z=C(Z,_,L),oe=C(oe,_,L),J=Z.length,q=oe.length),K=J,H=oe.slice(0,J),U=H.length;U<J;H[U++]=0);te=Z.slice(),te=[0].concat(te),ee=Z[0],Z[1]>=L/2&&ee++;do{if(_=0,v=S(Z,H,J,U),v<0){if(j=H[0],J!=U&&(j=j*L+(H[1]||0)),_=Ze(j/ee),_>1)for(_>=L&&(_=L-1),A=C(Z,_,L),z=A.length,U=H.length;S(A,H,z,U)==1;)_--,w(A,J<z?te:Z,z,L),z=A.length,v=1;else _==0&&(v=_=1),A=Z.slice(),z=A.length;if(z<U&&(A=[0].concat(A)),w(H,A,U,L),U=H.length,v==-1)for(;S(Z,H,J,U)<1;)_++,w(H,J<U?te:Z,U,L),U=H.length}else v===0&&(_++,H=[0]);W[R++]=_,H[0]?H[U++]=oe[K]||0:(H=[oe[K]],U=1)}while((K++<q||H[0]!=null)&&G--);P=H[0]!=null,W[0]||W.splice(0,1)}if(L==lt){for(R=1,G=W[0];G>=10;G/=10,R++);T(X,D+(X.e=R+N*ce-1)+1,O,P)}else X.e=N,X.r=+P;return X}}();function M(C,S,w,k){var B,D,O,L,v;if(w==null?w=r:be(w,0,8),!C.c)return C.toString();if(B=C.c[0],O=C.e,S==null)v=Ke(C.c),v=k==1||k==2&&(O<=c||O>=d)?oi(v,O):kt(v,O,"0");else if(C=T(new y(C),S,w),D=C.e,v=Ke(C.c),L=v.length,k==1||k==2&&(S<=D||D<=c)){for(;L<S;v+="0",L++);v=oi(v,D)}else if(S-=O+(k===2&&D>O),v=kt(v,D,"0"),D+1>L){if(--S>0)for(v+=".";S--;v+="0");}else if(S+=D-L,S>0)for(D+1==L&&(v+=".");S--;v+="0");return C.s<0&&B?"-"+v:v}function E(C,S){for(var w,k,B=1,D=new y(C[0]);B<C.length;B++)k=new y(C[B]),(!k.s||(w=jt(D,k))===S||w===0&&D.s===S)&&(D=k);return D}function I(C,S,w){for(var k=1,B=S.length;!S[--B];S.pop());for(B=S[0];B>=10;B/=10,k++);return(w=k+w*ce-1)>f?C.c=C.e=null:w<h?C.c=[C.e=0]:(C.e=w,C.c=S),C}o=function(){var C=/^(-?)0([xbo])(?=\w[\w.]*$)/i,S=/^([^.]+)\.$/,w=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(D,O,L,v){var N,R=L?O:O.replace(B,"");if(k.test(R))D.s=isNaN(R)?null:R<0?-1:1;else{if(!L&&(R=R.replace(C,function(P,_,A){return N=(A=A.toLowerCase())=="x"?16:A=="b"?2:8,!v||v==N?_:P}),v&&(N=v,R=R.replace(S,"$1").replace(w,"0.$1")),O!=R))return new y(R,N);if(y.DEBUG)throw Error(He+"Not a"+(v?" base "+v:"")+" number: "+O);D.s=null}D.c=D.e=null}}();function T(C,S,w,k){var B,D,O,L,v,N,R,P=C.c,_=Os;if(P){e:{for(B=1,L=P[0];L>=10;L/=10,B++);if(D=S-B,D<0)D+=ce,O=S,v=P[N=0],R=Ze(v/_[B-O-1]%10);else if(N=Bs((D+1)/ce),N>=P.length)if(k){for(;P.length<=N;P.push(0));v=R=0,B=1,D%=ce,O=D-ce+1}else break e;else{for(v=L=P[N],B=1;L>=10;L/=10,B++);D%=ce,O=D-ce+B,R=O<0?0:Ze(v/_[B-O-1]%10)}if(k=k||S<0||P[N+1]!=null||(O<0?v:v%_[B-O-1]),k=w<4?(R||k)&&(w==0||w==(C.s<0?3:2)):R>5||R==5&&(w==4||k||w==6&&(D>0?O>0?v/_[B-O]:0:P[N-1])%10&1||w==(C.s<0?8:7)),S<1||!P[0])return P.length=0,k?(S-=C.e+1,P[0]=_[(ce-S%ce)%ce],C.e=-S||0):P[0]=C.e=0,C;if(D==0?(P.length=N,L=1,N--):(P.length=N+1,L=_[ce-D],P[N]=O>0?Ze(v/_[B-O]%_[O])*L:0),k)for(;;)if(N==0){for(D=1,O=P[0];O>=10;O/=10,D++);for(O=P[0]+=L,L=1;O>=10;O/=10,L++);D!=L&&(C.e++,P[0]==lt&&(P[0]=1));break}else{if(P[N]+=L,P[N]!=lt)break;P[N--]=0,L=1}for(D=P.length;P[--D]===0;P.pop());}C.e>f?C.c=C.e=null:C.e<h&&(C.c=[C.e=0])}return C}function V(C){var S,w=C.e;return w===null?C.toString():(S=Ke(C.c),S=w<=c||w>=d?oi(S,w):kt(S,w,"0"),C.s<0?"-"+S:S)}return s.absoluteValue=s.abs=function(){var C=new y(this);return C.s<0&&(C.s=1),C},s.comparedTo=function(C,S){return jt(this,new y(C,S))},s.decimalPlaces=s.dp=function(C,S){var w,k,B,D=this;if(C!=null)return be(C,0,De),S==null?S=r:be(S,0,8),T(new y(D),C+D.e+1,S);if(!(w=D.c))return null;if(k=((B=w.length-1)-qe(this.e/ce))*ce,B=w[B])for(;B%10==0;B/=10,k--);return k<0&&(k=0),k},s.dividedBy=s.div=function(C,S){return t(this,new y(C,S),a,r)},s.dividedToIntegerBy=s.idiv=function(C,S){return t(this,new y(C,S),0,1)},s.exponentiatedBy=s.pow=function(C,S){var w,k,B,D,O,L,v,N,R,P=this;if(C=new y(C),C.c&&!C.isInteger())throw Error(He+"Exponent not an integer: "+V(C));if(S!=null&&(S=new y(S)),L=C.e>14,!P.c||!P.c[0]||P.c[0]==1&&!P.e&&P.c.length==1||!C.c||!C.c[0])return R=new y(Math.pow(+V(P),L?C.s*(2-ni(C)):+V(C))),S?R.mod(S):R;if(v=C.s<0,S){if(S.c?!S.c[0]:!S.s)return new y(NaN);k=!v&&P.isInteger()&&S.isInteger(),k&&(P=P.mod(S))}else{if(C.e>9&&(P.e>0||P.e<-1||(P.e==0?P.c[0]>1||L&&P.c[1]>=24e7:P.c[0]<8e13||L&&P.c[0]<=9999975e7)))return D=P.s<0&&ni(C)?-0:0,P.e>-1&&(D=1/D),new y(v?1/D:D);p&&(D=Bs(p/ce+2))}for(L?(w=new y(.5),v&&(C.s=1),N=ni(C)):(B=Math.abs(+V(C)),N=B%2),R=new y(l);;){if(N){if(R=R.times(P),!R.c)break;D?R.c.length>D&&(R.c.length=D):k&&(R=R.mod(S))}if(B){if(B=Ze(B/2),B===0)break;N=B%2}else if(C=C.times(w),T(C,C.e+1,1),C.e>14)N=ni(C);else{if(B=+V(C),B===0)break;N=B%2}P=P.times(P),D?P.c&&P.c.length>D&&(P.c.length=D):k&&(P=P.mod(S))}return k?R:(v&&(R=l.div(R)),S?R.mod(S):D?T(R,p,r,O):R)},s.integerValue=function(C){var S=new y(this);return C==null?C=r:be(C,0,8),T(S,S.e+1,C)},s.isEqualTo=s.eq=function(C,S){return jt(this,new y(C,S))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(C,S){return jt(this,new y(C,S))>0},s.isGreaterThanOrEqualTo=s.gte=function(C,S){return(S=jt(this,new y(C,S)))===1||S===0},s.isInteger=function(){return!!this.c&&qe(this.e/ce)>this.c.length-2},s.isLessThan=s.lt=function(C,S){return jt(this,new y(C,S))<0},s.isLessThanOrEqualTo=s.lte=function(C,S){return(S=jt(this,new y(C,S)))===-1||S===0},s.isNaN=function(){return!this.s},s.isNegative=function(){return this.s<0},s.isPositive=function(){return this.s>0},s.isZero=function(){return!!this.c&&this.c[0]==0},s.minus=function(C,S){var w,k,B,D,O=this,L=O.s;if(C=new y(C,S),S=C.s,!L||!S)return new y(NaN);if(L!=S)return C.s=-S,O.plus(C);var v=O.e/ce,N=C.e/ce,R=O.c,P=C.c;if(!v||!N){if(!R||!P)return R?(C.s=-S,C):new y(P?O:NaN);if(!R[0]||!P[0])return P[0]?(C.s=-S,C):new y(R[0]?O:r==3?-0:0)}if(v=qe(v),N=qe(N),R=R.slice(),L=v-N){for((D=L<0)?(L=-L,B=R):(N=v,B=P),B.reverse(),S=L;S--;B.push(0));B.reverse()}else for(k=(D=(L=R.length)<(S=P.length))?L:S,L=S=0;S<k;S++)if(R[S]!=P[S]){D=R[S]<P[S];break}if(D&&(B=R,R=P,P=B,C.s=-C.s),S=(k=P.length)-(w=R.length),S>0)for(;S--;R[w++]=0);for(S=lt-1;k>L;){if(R[--k]<P[k]){for(w=k;w&&!R[--w];R[w]=S);--R[w],R[k]+=lt}R[k]-=P[k]}for(;R[0]==0;R.splice(0,1),--N);return R[0]?I(C,R,N):(C.s=r==3?-1:1,C.c=[C.e=0],C)},s.modulo=s.mod=function(C,S){var w,k,B=this;return C=new y(C,S),!B.c||!C.s||C.c&&!C.c[0]?new y(NaN):!C.c||B.c&&!B.c[0]?new y(B):(m==9?(k=C.s,C.s=1,w=t(B,C,0,3),C.s=k,w.s*=k):w=t(B,C,0,m),C=B.minus(w.times(C)),!C.c[0]&&m==1&&(C.s=B.s),C)},s.multipliedBy=s.times=function(C,S){var w,k,B,D,O,L,v,N,R,P,_,A,z,X,W,H=this,U=H.c,j=(C=new y(C,S)).c;if(!U||!j||!U[0]||!j[0])return!H.s||!C.s||U&&!U[0]&&!j||j&&!j[0]&&!U?C.c=C.e=C.s=null:(C.s*=H.s,!U||!j?C.c=C.e=null:(C.c=[0],C.e=0)),C;for(k=qe(H.e/ce)+qe(C.e/ce),C.s*=H.s,v=U.length,P=j.length,v<P&&(z=U,U=j,j=z,B=v,v=P,P=B),B=v+P,z=[];B--;z.push(0));for(X=lt,W=Nt,B=P;--B>=0;){for(w=0,_=j[B]%W,A=j[B]/W|0,O=v,D=B+O;D>B;)N=U[--O]%W,R=U[O]/W|0,L=A*N+R*_,N=_*N+L%W*W+z[D]+w,w=(N/X|0)+(L/W|0)+A*R,z[D--]=N%X;z[D]=w}return w?++k:z.splice(0,1),I(C,z,k)},s.negated=function(){var C=new y(this);return C.s=-C.s||null,C},s.plus=function(C,S){var w,k=this,B=k.s;if(C=new y(C,S),S=C.s,!B||!S)return new y(NaN);if(B!=S)return C.s=-S,k.minus(C);var D=k.e/ce,O=C.e/ce,L=k.c,v=C.c;if(!D||!O){if(!L||!v)return new y(B/0);if(!L[0]||!v[0])return v[0]?C:new y(L[0]?k:B*0)}if(D=qe(D),O=qe(O),L=L.slice(),B=D-O){for(B>0?(O=D,w=v):(B=-B,w=L),w.reverse();B--;w.push(0));w.reverse()}for(B=L.length,S=v.length,B-S<0&&(w=v,v=L,L=w,S=B),B=0;S;)B=(L[--S]=L[S]+v[S]+B)/lt|0,L[S]=lt===L[S]?0:L[S]%lt;return B&&(L=[B].concat(L),++O),I(C,L,O)},s.precision=s.sd=function(C,S){var w,k,B,D=this;if(C!=null&&C!==!!C)return be(C,1,De),S==null?S=r:be(S,0,8),T(new y(D),C,S);if(!(w=D.c))return null;if(B=w.length-1,k=B*ce+1,B=w[B]){for(;B%10==0;B/=10,k--);for(B=w[0];B>=10;B/=10,k++);}return C&&D.e+1>k&&(k=D.e+1),k},s.shiftedBy=function(C){return be(C,-Ds,Ds),this.times("1e"+C)},s.squareRoot=s.sqrt=function(){var C,S,w,k,B,D=this,O=D.c,L=D.s,v=D.e,N=a+4,R=new y("0.5");if(L!==1||!O||!O[0])return new y(!L||L<0&&(!O||O[0])?NaN:O?D:1/0);if(L=Math.sqrt(+V(D)),L==0||L==1/0?(S=Ke(O),(S.length+v)%2==0&&(S+="0"),L=Math.sqrt(+S),v=qe((v+1)/2)-(v<0||v%2),L==1/0?S="5e"+v:(S=L.toExponential(),S=S.slice(0,S.indexOf("e")+1)+v),w=new y(S)):w=new y(L+""),w.c[0]){for(v=w.e,L=v+N,L<3&&(L=0);;)if(B=w,w=R.times(B.plus(t(D,B,N,1))),Ke(B.c).slice(0,L)===(S=Ke(w.c)).slice(0,L))if(w.e<v&&--L,S=S.slice(L-3,L+1),S=="9999"||!k&&S=="4999"){if(!k&&(T(B,B.e+a+2,0),B.times(B).eq(D))){w=B;break}N+=4,L+=4,k=1}else{(!+S||!+S.slice(1)&&S.charAt(0)=="5")&&(T(w,w.e+a+2,1),C=!w.times(w).eq(D));break}}return T(w,w.e+a+1,r,C)},s.toExponential=function(C,S){return C!=null&&(be(C,0,De),C++),M(this,C,S,1)},s.toFixed=function(C,S){return C!=null&&(be(C,0,De),C=C+this.e+1),M(this,C,S)},s.toFormat=function(C,S,w){var k,B=this;if(w==null)C!=null&&S&&typeof S=="object"?(w=S,S=null):C&&typeof C=="object"?(w=C,C=S=null):w=g;else if(typeof w!="object")throw Error(He+"Argument not an object: "+w);if(k=B.toFixed(C,S),B.c){var D,O=k.split("."),L=+w.groupSize,v=+w.secondaryGroupSize,N=w.groupSeparator||"",R=O[0],P=O[1],_=B.s<0,A=_?R.slice(1):R,z=A.length;if(v&&(D=L,L=v,v=D,z-=D),L>0&&z>0){for(D=z%L||L,R=A.substr(0,D);D<z;D+=L)R+=N+A.substr(D,L);v>0&&(R+=N+A.slice(D)),_&&(R="-"+R)}k=P?R+(w.decimalSeparator||"")+((v=+w.fractionGroupSize)?P.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):P):R}return(w.prefix||"")+k+(w.suffix||"")},s.toFraction=function(C){var S,w,k,B,D,O,L,v,N,R,P,_,A=this,z=A.c;if(C!=null&&(L=new y(C),!L.isInteger()&&(L.c||L.s!==1)||L.lt(l)))throw Error(He+"Argument "+(L.isInteger()?"out of range: ":"not an integer: ")+V(L));if(!z)return new y(A);for(S=new y(l),N=w=new y(l),k=v=new y(l),_=Ke(z),D=S.e=_.length-A.e-1,S.c[0]=Os[(O=D%ce)<0?ce+O:O],C=!C||L.comparedTo(S)>0?D>0?S:N:L,O=f,f=1/0,L=new y(_),v.c[0]=0;R=t(L,S,0,1),B=w.plus(R.times(k)),B.comparedTo(C)!=1;)w=k,k=B,N=v.plus(R.times(B=N)),v=B,S=L.minus(R.times(B=S)),L=B;return B=t(C.minus(w),k,0,1),v=v.plus(B.times(N)),w=w.plus(B.times(k)),v.s=N.s=A.s,D=D*2,P=t(N,k,D,r).minus(A).abs().comparedTo(t(v,w,D,r).minus(A).abs())<1?[N,k]:[v,w],f=O,P},s.toNumber=function(){return+V(this)},s.toPrecision=function(C,S){return C!=null&&be(C,1,De),M(this,C,S,2)},s.toString=function(C){var S,w=this,k=w.s,B=w.e;return B===null?k?(S="Infinity",k<0&&(S="-"+S)):S="NaN":(C==null?S=B<=c||B>=d?oi(Ke(w.c),B):kt(Ke(w.c),B,"0"):C===10&&b?(w=T(new y(w),a+B+1,r),S=kt(Ke(w.c),w.e,"0")):(be(C,2,x.length,"Base"),S=n(kt(Ke(w.c),B,"0"),10,C,k,!0)),k<0&&w.c[0]&&(S="-"+S)),S},s.valueOf=s.toJSON=function(){return V(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&y.set(e),y}function qe(e){var t=e|0;return e>0||e===t?t:t-1}function Ke(e){for(var t,n,o=1,s=e.length,l=e[0]+"";o<s;){for(t=e[o++]+"",n=ce-t.length;n--;t="0"+t);l+=t}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function jt(e,t){var n,o,s=e.c,l=t.c,a=e.s,r=t.s,c=e.e,d=t.e;if(!a||!r)return null;if(n=s&&!s[0],o=l&&!l[0],n||o)return n?o?0:-r:a;if(a!=r)return a;if(n=a<0,o=c==d,!s||!l)return o?0:!s^n?1:-1;if(!o)return c>d^n?1:-1;for(r=(c=s.length)<(d=l.length)?c:d,a=0;a<r;a++)if(s[a]!=l[a])return s[a]>l[a]^n?1:-1;return c==d?0:c>d^n?1:-1}function be(e,t,n,o){if(e<t||e>n||e!==Ze(e))throw Error(He+(o||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ni(e){var t=e.c.length-1;return qe(e.e/ce)==t&&e.c[t]%2!=0}function oi(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function kt(e,t,n){var o,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(o=e.length,++t>o){for(s=n,t-=o;--t;s+=n);e+=s}else t<o&&(e=e.slice(0,t)+"."+e.slice(t));return e}var yr=pr();function Gt(e){return new yr(e)}function Ls(e,t){return Gt(e).plus(Gt(t)).toNumber()}function Kb(e,t){return Gt(e).minus(Gt(t)).toNumber()}function Jb(e,t){return Gt(e).dividedBy(Gt(t)).toNumber()}function xr(e,t){return Gt(e).decimalPlaces(t,yr.ROUND_DOWN).toNumber()}const Qb={name:"EvGridSummary",props:{stores:{type:Object,default:()=>({})},orderedColumns:{type:Object,default:()=>({})},useCheckbox:{type:Boolean,default:!1},styleOption:{type:Object,default:()=>({})},isTree:{type:Boolean,default:!1},scrollLeft:{type:Number,default:0}},setup(e){const t={max:20,default:3},n=i.ref(),o=2,s=i.computed(()=>e.stores),l=i.computed(()=>e.orderedColumns),a=i.computed(()=>e.useCheckbox),r=i.computed(()=>e.styleOption),c=m=>m==null||m<0?t.default:m>t.max?t.max:m,d=(m,p)=>{if(typeof p=="string"&&p.length===0)return p;const{type:g,decimal:x}=m;let b=p;return g==="number"?(b=$t(p),b=b===!1?p:b):g==="float"&&(b=b.toFixed(c(x??t.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),b},h=m=>l.value.findIndex(p=>p.field===m),f=m=>{const{type:p,field:g,summaryType:x,summaryDecimal:b,summaryOnlyTopParent:y}=m;let M="";const E=h(g);if(E>=0){if(x==="count")return s.value.store.length;if(p==="number"||p==="float"){let I=[];switch(e.isTree?I=s.value.store.reduce((T,V)=>{var C,S;return y?V.parent||T.push((C=V.data)==null?void 0:C[g]):T.push((S=V.data)==null?void 0:S[g]),T},[]):I=s.value.store.map(T=>T[o][E]),x){case"sum":{const T=I.reduce((V,C)=>{const S=Number(C);return Number.isNaN(S)?V:Ls(V,S)},0);M=T&&xr(T,c(b??t.default));break}case"average":{const T=I.reduce((V,C)=>{const S=Number(C);return Number.isNaN(S)?V:Ls(V,S)},0);M=T&&xr(Jb(T,I.length),c(b??t.default));break}case"max":{const T=I.filter(V=>V!=null);M=T.length?Math.max(...T):"";break}case"min":{const T=I.filter(V=>V!=null);M=T.length?Math.min(...T):"";break}}M=d(m,M)}}return M},u=m=>{const p=m.summaryRenderer,g=m.summaryData?m.summaryData:[],x=[m.field,...g];let b=p;return x.forEach((y,M)=>{const E=h(y);if(E>=0){const I=f(s.value.orderedColumns[E]);b=b.replace(`{${M}}`,I)}}),b};return i.watch(()=>e.scrollLeft,m=>{i.nextTick(()=>{n.value.scrollLeft=m})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:f,getSummaryRenderer:u}}},e0={class:"column-list"},t0=["title"],n0=["title"];function o0(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",{ref:"summaryRef",class:i.normalizeClass({"grid-summary":!0,"non-border":o.styleInfo.borderStyle==="none"})},[i.createElementVNode("ul",e0,[o.showCheckbox?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"non-border":!!o.styleInfo.borderStyle}),style:i.normalizeStyle({width:`${o.styleInfo.minWidth}px`,"line-height":`${o.styleInfo.rowHeight}px`})},[i.createElementVNode("span",{style:i.normalizeStyle({height:`${o.styleInfo.rowHeight}px`})},null,4)],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.columns,(a,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`summary_${r}`},[a.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"non-border":!!o.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:i.normalizeStyle({width:`${a.width}px`,"min-width":`${o.styleInfo.minWidth}px`,"line-height":`${o.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(i.openBlock(),i.createElementBlock("span",{key:0,style:i.normalizeStyle({width:"100%",height:`${o.styleInfo.rowHeight}px`})},[a.summaryRenderer?(i.openBlock(),i.createElementBlock("div",{key:0,title:o.getSummaryRenderer(a)},i.toDisplayString(o.getSummaryRenderer(a)),9,t0)):(i.openBlock(),i.createElementBlock("div",{key:1,title:o.getSummaryValue(a)},i.toDisplayString(o.getSummaryValue(a)),9,n0))],4)):(i.openBlock(),i.createElementBlock("span",{key:1,style:i.normalizeStyle({height:`${o.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const br=le(Qb,[["render",o0],["__scopeId","data-v-4b9bef37"]]),i0={name:"EVGridColumnSetting",directives:{clickoutside:Lo},props:{isShow:{type:Boolean,default:!1},columns:{type:[Array],default:()=>[]},hiddenColumn:{type:String,default:""},position:{type:Object,default:()=>({top:0,left:0,columnListMenuWidth:0})},isShowMenuOnClick:{type:Boolean,default:!1},textInfo:{type:Object,default:()=>({title:"Column List",search:"Search",empty:"No records",ok:"OK"})}},emits:{"update:isShow":[Boolean],"update:isShowMenuOnClick":[Boolean],"apply-column":null},setup(e,{emit:t}){const n=i.computed({get:()=>e.isShow,set:k=>t("update:isShow",k)}),o=i.ref(null),s=i.ref(""),l=i.ref(!1),a=i.ref([]),r=i.ref([]),c=i.ref([]),d=i.ref([]),h=i.computed(()=>l.value?c.value:r.value),f=i.computed(()=>!h.value.length);let u=null,m=null;const p=i.reactive({top:null,left:null}),g=i.computed({get:()=>e.isShowMenuOnClick,set:k=>t("update:isShowMenuOnClick",k)}),x=k=>{var B;(k==null?void 0:k.length)===1?m=k[0]:(k==null?void 0:k.length)<1&&(m==null&&(m=(B=r.value[0])==null?void 0:B.text),a.value.push(m))},b=k=>{u&&clearTimeout(u),u=setTimeout(()=>{if(l.value=!1,k){const B=k.toString().toLowerCase();c.value=r.value.filter(D=>D.label.toString().toLowerCase().includes(B)),l.value=!0}},500)},y=()=>{s.value="",l.value=!1,c.value.length=0},M=()=>{const k=d.value.length?d.value:r.value;a.value=k.filter(B=>B.originChecked).map(B=>B.text),y()},E=()=>{d.value=r.value.filter(B=>a.value.includes(B.text));const k=d.value.map(B=>B.text);t("apply-column",k),n.value=!1,g.value=!1},I=i.ref(),T=i.ref(),V=()=>{T.value=Se(a.value),r.value=e.columns.filter(k=>!k.hide&&k.caption).map(k=>{var O,L;const B=(O=I.value)==null?void 0:O.find(v=>v.field===k.field);let D=!1;return B?D=(B==null?void 0:B.hiddenDisplay)!==(k==null?void 0:k.hiddenDisplay)||!((L=T.value)!=null&&L.length)?!(k!=null&&k.hiddenDisplay):T.value.includes(k.field):D=!k.hiddenDisplay,{label:k.caption,text:k.field,originChecked:!k.hiddenDisplay,checked:D,fixed:k.fixed}}),a.value=r.value.filter(k=>k.checked).map(k=>k.text),d.value.length=0,I.value=Se(e.columns)},C=()=>{n.value=!1,g.value=!1},S=()=>{const k=document.createElement("div");k.id="ev-grid-column-setting-modal",k.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(k)},w=async()=>{var A;await i.nextTick();const k=document.documentElement.clientWidth,B=document.documentElement.clientHeight,D=(A=o.value)==null?void 0:A.getBoundingClientRect(),O=D==null?void 0:D.width,L=D==null?void 0:D.height,{top:v,left:N,columnListMenuWidth:R}=e.position;let P;R?(P=N,k<N+O&&(P=N-O-R)):P=N-O;const _=B-L;p.top=`${Math.min(v,_)+document.documentElement.scrollTop}px`,p.left=`${P+document.documentElement.scrollLeft}px`};return i.onBeforeMount(()=>S()),i.watch(()=>e.columns,()=>{V()},{immediate:!0,deep:!0}),i.watch(()=>n.value,async()=>{M(),n.value&&await w()}),i.watch(()=>e.hiddenColumn,k=>{const B=d.value.length?d.value.filter(D=>D.text!==k):r.value.filter(D=>D.text!==k&&D.checked);d.value=B,a.value=B.map(D=>D.text)}),{columnSettingWrapper:o,columnSettingStyle:p,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:f,onSearchColumn:b,onApplyColumn:E,onCheckColumn:x,hideColumnSetting:C}}},s0={class:"ev-grid-column-setting__header"},l0={class:"header-title"},a0={class:"ev-grid-column-setting__content"},r0={key:1,class:"is-empty"},c0={class:"ev-grid-column-setting__footer"};function d0(e,t,n,o,s,l){const a=i.resolveComponent("ev-text-field"),r=i.resolveComponent("ev-checkbox"),c=i.resolveComponent("ev-checkbox-group"),d=i.resolveComponent("ev-button"),h=i.resolveDirective("clickoutside");return o.isShowColumnSetting?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[i.withDirectives((i.openBlock(),i.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:i.normalizeStyle(o.columnSettingStyle)},[i.createElementVNode("div",s0,[i.createElementVNode("p",l0,i.toDisplayString(n.textInfo.title),1),i.createVNode(a,{modelValue:o.searchVm,"onUpdate:modelValue":t[0]||(t[0]=f=>o.searchVm=f),type:"search",placeholder:n.textInfo.search,onInput:o.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),i.createElementVNode("div",a0,[o.columnList.length?(i.openBlock(),i.createBlock(c,{key:0,modelValue:o.checkColumnGroup,"onUpdate:modelValue":t[1]||(t[1]=f=>o.checkColumnGroup=f),onChange:o.onCheckColumn},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.columnList,(f,u)=>(i.openBlock(),i.createBlock(r,{key:`column_${u}`,label:f==null?void 0:f.text,disabled:!!(f!=null&&f.fixed),"tooltip-title":(f==null?void 0:f.label)??""},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f==null?void 0:f.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(i.openBlock(),i.createElementBlock("p",r0,i.toDisplayString(n.textInfo.empty),1))]),i.createElementVNode("div",c0,[i.createVNode(d,{type:"primary",disabled:o.isDisabled,onClick:o.onApplyColumn},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,o.hideColumnSetting]])])):i.createCommentVNode("",!0)}const Cr=le(i0,[["render",d0]]),h0={name:"EVGridFilterSetting",directives:{clickoutside:Lo},props:{isShow:{type:Boolean,default:!1},position:{type:Object,default:()=>({top:0,left:0})},column:{type:Object,default:()=>({})},items:{type:Object,default:()=>({})}},emits:{"update:isShow":null,"apply-filtering":null},setup(e,{emit:t}){const n=i.ref([]),o=i.computed(()=>e.column),s=[{name:"AND",value:"and"},{name:"OR",value:"or"}],l=[{name:"true",value:"true"},{name:"false",value:"false"}],a=[{name:"=",value:"="},{name:"!=",value:"!="},{name:"<",value:"<"},{name:">",value:">"},{name:"<=",value:"<="},{name:">=",value:">="}],r=[{name:"s%",value:"s%"},{name:"%s",value:"%s"},{name:"%s%",value:"%s%"},{name:"Not Like",value:"notLike"},{name:"=",value:"="},{name:"!=",value:"!="}],c=[{name:"Is empty",value:"isEmpty"},{name:"Is not empty",value:"isNotEmpty"}],d=E=>E==="string"||E==="stringNumber"?[...r,...c]:E==="number"||E==="float"?[...a,...c]:E==="boolean"?[{name:"=",value:"="}]:[],h=i.computed(()=>d(e.column.type)),f=i.computed({get:()=>e.isShow,set:E=>t("update:isShow",E)}),u=()=>{const E=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:E,value:"",caption:o.value.caption})},m=E=>{n.value.length>1?n.value.splice(E,1):E===0&&(n.value[0].comparison="=",n.value[0].value="")},p=(E,I)=>{(E==="isEmpty"||E==="isNotEmpty")&&(n.value[I].value="")},g=E=>{n.value=n.value.map(I=>({...I,operator:E}))},x=()=>{t("apply-filtering",o.value.field,n.value.filter(E=>E.value||E.comparison==="isEmpty"||E.comparison==="isNotEmpty"))};i.watch(()=>e.isShow,E=>{var V;const I=[],T=Se(e.items);E&&o.value.field&&((V=T[o.value.field])!=null&&V.length?T[o.value.field].forEach(C=>{I.push(C)}):I.push({comparison:"=",operator:"and",value:"",caption:o.value.caption}),n.value=I)});const b=(E,I)=>{var T;return((T=E.find(V=>V.value===I))==null?void 0:T.name)||""},y=()=>{const E=document.createElement("div");E.id="ev-grid-filter-setting-modal",E.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(E)};return i.onBeforeMount(()=>{y()}),{filteringItems:n,isShowFilterSetting:f,items1:s,items2:h,booleanItems:l,addRow:u,removeRow:m,changeOperator:g,applyFiltering:x,changeComparison:p,getSelectTitle:b,validateValue:(E,I)=>{(E==="number"||E==="float")&&(I.value=I.value.replace(/[^0-9.,]/g,""))}}}},f0={class:"ev-grid-filter-setting__header"},u0={class:"header-title"},m0={class:"ev-grid-filter-setting__content"},g0={class:"ev-grid-filter-setting__row--button"},p0={class:"ev-grid-filter-setting__footer"};function y0(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-select"),c=i.resolveComponent("ev-text-field"),d=i.resolveComponent("ev-button"),h=i.resolveDirective("clickoutside");return o.isShowFilterSetting?(i.openBlock(),i.createBlock(i.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[i.withDirectives((i.openBlock(),i.createElementBlock("section",{class:"ev-grid-filter-setting",style:i.normalizeStyle({top:e.$props.position.top,left:e.$props.position.left})},[i.createElementVNode("div",f0,[i.createVNode(a,{icon:"ev-icon-filter-list"}),i.createElementVNode("span",u0," Filter ("+i.toDisplayString(e.$props.column.caption)+") ",1)]),i.createElementVNode("div",m0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.filteringItems,(f,u)=>(i.openBlock(),i.createElementBlock("div",{key:u,class:"ev-grid-filter-setting__row"},[i.createVNode(r,{modelValue:f.operator,"onUpdate:modelValue":m=>f.operator=m,class:"ev-grid-filter-setting__row--operator",title:o.getSelectTitle(o.items1,f.operator),items:o.items1,disabled:u>1,style:i.normalizeStyle({visibility:u>0?"visible":"hidden"}),onChange:o.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),i.createVNode(r,{modelValue:f.comparison,"onUpdate:modelValue":m=>f.comparison=m,class:"ev-grid-filter-setting__row--comparison",title:o.getSelectTitle(o.items2,f.comparison),items:o.items2,onChange:m=>o.changeComparison(f.comparison,u)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),e.$props.column.type==="boolean"?(i.openBlock(),i.createBlock(r,{key:0,modelValue:f.value,"onUpdate:modelValue":m=>f.value=m,class:"ev-grid-filter-setting__row--comparison",items:o.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(i.openBlock(),i.createBlock(c,{key:1,modelValue:f.value,"onUpdate:modelValue":m=>f.value=m,class:"ev-grid-filter-setting__row--value",disabled:f.comparison==="isEmpty"||f.comparison==="isNotEmpty",onInput:m=>o.validateValue(e.$props.column.type,f)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),i.createElementVNode("div",g0,[i.createVNode(a,{icon:"ev-icon-trash2",onClick:m=>o.removeRow(u)},null,8,["onClick"])])]))),128))]),i.createElementVNode("div",p0,[i.createVNode(d,{type:"primary",onClick:o.applyFiltering},{default:i.withCtx(()=>[...t[0]||(t[0]=[i.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{o.isShowFilterSetting=!1}]])])):i.createCommentVNode("",!0)}const x0=le(h0,[["render",y0]]),b0={name:"GridSortButton",props:{icon:{type:String,default:""}}},C0={key:0},S0={key:1},w0={key:2};function k0(e,t,n,o,s,l){return n.icon==="basic"?(i.openBlock(),i.createElementBlock("span",C0,[...t[0]||(t[0]=[i.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),i.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508 4.795L5.41508
6
6
  5.5L7.00008 3.915ZM7.00008 10.085L5.41508 8.5L4.71008 9.205L7.00008
7
7
  11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#121212"}),i.createElementVNode("path",{d:`M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008
8
8
  2.5L4.70508 4.795L5.41508 5.5L7.00008 3.915ZM7.00008 10.085L5.41508
@@ -12,6 +12,6 @@ Component that was made reactive: `,e=fe(e)),function(c,d=null,h=null,u=0,f=null
12
12
  8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(i.openBlock(),i.createElementBlock("span",w0,[...t[2]||(t[2]=[i.createStaticVNode(`<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="14" height="14" rx="2" fill="#F1F3F5"></rect><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
13
13
  8.705L5.41508 8L7.00008 9.585Z" fill="#121212"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
14
14
  8.705L5.41508 8L7.00008 9.585Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
15
- 4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):i.createCommentVNode("",!0)}const wr=le(b0,[["render",k0]]),M0={name:"GridOptionButton"},E0={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function I0(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("svg",E0,[...t[0]||(t[0]=[i.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),i.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),i.createElementVNode("path",{d:`M17.498 10.498C18.3265 10.498 18.998 11.1696 18.998 11.998C18.998
15
+ 4.795L5.41508 5.5L7.00008 3.915Z" fill="#DEE2E6"></path></svg>`,1)])])):i.createCommentVNode("",!0)}const Sr=le(b0,[["render",k0]]),M0={name:"GridOptionButton"},I0={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function E0(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("svg",I0,[...t[0]||(t[0]=[i.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),i.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),i.createElementVNode("path",{d:`M17.498 10.498C18.3265 10.498 18.998 11.1696 18.998 11.998C18.998
16
16
  12.8265 18.3265 13.498 17.498 13.498C16.6696 13.498 15.998 12.8265
17
- 15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const Ls=le(M0,[["render",I0]]),Mt=0,mn=1,de=2,to=3,Ns=4,v0=()=>{const{props:e}=i.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let u=0;u<h.length;u++)d+=r(h[u])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=$t(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>e.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},ii=e=>{var o;const t=((o=e.movedColumns)!=null&&o.length?e.movedColumns:e.originColumns)??[],n=new Map((e.filteredColumns??[]).map(s=>[s.index,s]));return t.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},T0=e=>{const{scrollInfo:t,stores:n,elementInfo:o,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=e,h=p=>{var y,M;const m=o.body,x=s.rowHeight,b=d.detailRowHeight??0;if(m){let I=n.store;l.isClientPaging&&(I=r());const E=((y=d.expandedRows)==null?void 0:y.length)??0,T=((M=d.expandedRows)==null?void 0:M.map(v=>I.findIndex(N=>N[de]===v)))??[],V=I.length*x+E*b;let C=0,S=0;if(E)for(C=0;S+x<m.scrollTop;C++)T.includes(C)&&(S+=b),S+=x;else C=Math.floor(m.scrollTop/x),S=Math.max(C,0)*x;C>I.length-1&&(C=0);let w=0,k=0;if(E)for(let v=C;k<=m.clientHeight;v++)T.includes(v)&&(k+=b),k+=x,w+=1;else w=m.clientHeight>x?Math.ceil(m.clientHeight/x):I.length,k=w*x;const B=C+w+1,D=Math.max(C,0),O=B,R=o.table;n.viewStore=I.slice(D,O),t.hasVerticalScrollBar=w<I.length||m.clientHeight<R.clientHeight,t.vScrollTopHeight=S,t.vScrollBottomHeight=V-k-t.vScrollTopHeight,p&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(O/l.perPage)+1,l.startIndex=O,c({onScrollEnd:!0}))}},u=p=>{if(d.useRowDetail&&!d.detailRowHeight){let m=n.store;l.isClientPaging&&(m=r()),n.viewStore=[...m],t.vScrollTopHeight=0,t.vScrollBottomHeight=0}else h(p)},f=()=>{const p=o.header,m=o.body,x=o.table;p.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,t.hasHorizontalScrollBar=m.clientWidth<x.clientWidth};return{updateVScroll:u,updateHScroll:f,onScroll:()=>{const p=o.body,m=p.scrollTop,x=p.scrollLeft,b=t.lastScroll.top,y=t.lastScroll.left,M=x!==y;m!==b&&(p!=null&&p.clientHeight)&&u(!0),M&&f(),t.lastScroll.top=m,t.lastScroll.left=x}}},B0=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{resizeInfo:o,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=e,f=()=>{var y;let x=o.columnWidth,b=0;if(o.adjust){const M=s.body;let I=M.offsetWidth;const E=M.offsetHeight,T=((y=M.querySelector("tr"))==null?void 0:y.offsetHeight)||o.rowHeight,V=I-M.clientWidth,C=r.orderedColumns.reduce((S,w)=>(w.hide||w.hiddenDisplay||(w.width?S.totalWidth+=w.width:S.emptyCount++),S),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(T*t.rows.length>E&&(I-=V),l.useCheckbox.use&&(I-=o.minWidth),a.useRowDetail&&(I-=o.minWidth),x=I-C.totalWidth,x>0){const S=C.emptyCount===0?0:Math.floor(x/C.emptyCount);b=x-S*C.emptyCount,x=C.emptyCount!==0?S:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(r.orderedColumns.forEach(M=>{const I=c(M)?o.rendererMinWidth:o.minWidth;M.width&&M.width<I&&(M.width=I),!M.width&&!M.hide&&(M.width=x)}),b&&r.orderedColumns.length){let M=r.orderedColumns.length-1,I=r.orderedColumns[M];for(;M>0&&I&&(I.hide||I.hiddenDisplay);)M-=1,I=r.orderedColumns[M];I&&(I.width+=b)}},g=()=>{const x=new Map(t.columns.map(b=>[b.field,b.width]));i.nextTick(()=>{var b,y;o.adjust&&r.orderedColumns.forEach(M=>{const I=M;return I.resized||(I.width=x.get(I.field)??0),I},void 0),f(),(b=s.body)!=null&&b.clientHeight&&d(),(y=s.body)!=null&&y.clientWidth&&h()})};return{calculatedColumn:f,onResize:g,onShow:x=>{x&&g()},onColumnResize:(x,b)=>{b.preventDefault();const y=s.header,M=s.body,I=y.getBoundingClientRect().left,E=y.querySelector(`li[data-index="${x}"]`),T=c(r.orderedColumns[x])?o.rendererMinWidth:o.minWidth,V=E.getBoundingClientRect(),C=s.resizeLine,S=V.left-I+T,w=V.right-I,k=b.clientX,B=V.left-I;M.style.overflow="auto",C.style.left=`${w}px`,o.showResizeLine=!0;const D=R=>{const v=R.clientX-k,N=w+v,L=Math.max(S,N);C.style.left=`${L}px`},O=()=>{const v=parseInt(C.style.left,10)-B;r.orderedColumns[x]&&(r.orderedColumns[x].width=v,r.orderedColumns[x].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),g();const N=ii(r);n("resize-column",{column:r.orderedColumns[x],columns:N}),n("change-column-info",{type:"resize",columns:N})};document.addEventListener("mousemove",D),document.addEventListener("mouseup",O,{once:!0})}}},D0=e=>{const{emit:t}=i.getCurrentInstance(),{selectInfo:n,stores:o}=e,s=(d,h)=>{var g;const u=(g=d.target.tagName)==null?void 0:g.toLowerCase();let f={};return u==="td"?f=d.target.dataset:f=d.target.parentNode.dataset,{event:d,rowData:h[de],rowIndex:h[Mt],cellName:f.name,cellIndex:f.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var p,m,x;if((p=d.target.parentElement.classList)!=null&&p.contains("row-checkbox-input"))return!1;const f=!!((x=(m=d.target.closest("td"))==null?void 0:m.classList)!=null&&x.contains("row-contextmenu")),g=(b,y,M)=>{if(b==="shift"){const I=h[Mt];if(a>-1)for(let E=Math.min(I,a);E<=Math.max(I,a);E++)if(!y)o.originStore[E][to]=!0,a!==E&&n.selectedRow.push(o.originStore[E][de]);else{o.originStore[E][to]=!1;const T=n.selectedRow.indexOf(o.originStore[E][de]);T>-1&&n.selectedRow.splice(T,1)}}else b==="ctrl"&&(y?n.selectedRow.splice(n.selectedRow.indexOf(h[de]),1):n.selectedRow.push(M))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const b=h[de],y=h[to];h[to]=!h[to];let M="";d.shiftKey?M="shift":d.ctrlKey&&(M="ctrl"),n.multiple&&M?g(M,y,b):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(b)||(n.selectedRow=[b])):y?n.selectedRow=[]:n.selectedRow=[b],a=h[Mt],t("update:selected",n.selectedRow),t("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),t("dblclick-row",s(d,h))}}},O0=e=>{const{checkInfo:t,stores:n,pageInfo:o,getPagingData:s}=e,{props:l,emit:a}=i.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(f=>f[de]===h[de]);u!==-1&&(n.originStore[u][mn]=h[mn])};return{onCheck:(h,u)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),u[mn]){t.useCheckbox.mode==="single"?t.checkedRows=[u[de]]:t.checkedRows.push(u[de]);let f=n.store;o.isClientPaging&&(f=s());const g=f.filter(p=>!l.uncheckable.includes(p[de])).filter(p=>!l.disabledRows.includes(p[de])).every(p=>p[mn]);f.length&&g&&(t.isHeaderChecked=!0),t.isHeaderIndeterminate=f.length&&!g}else t.useCheckbox.mode==="single"?t.checkedRows=[]:t.checkedRows.splice(t.checkedRows.indexOf(u[de]),1),t.isHeaderChecked=!1,t.isHeaderIndeterminate=!!(n.store.length&&t.checkedRows.length);t.prevCheckedRow=u.slice(),a("update:checked",t.checkedRows),a("check-row",h,u[Mt],u[de])},onCheckAll:h=>{const u=t.isHeaderChecked;let f=n.store;o.isClientPaging&&(f=s()),f.forEach(g=>{const p=l.uncheckable.includes(g[de])||l.disabledRows.includes(g[de]);u?!t.checkedRows.includes(g[de])&&!p&&t.checkedRows.push(g[de]):t.checkedRows.splice(t.checkedRows.indexOf(g[de]),1),p||(g[mn]=u)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},R0=e=>{const{expandedInfo:t}=e,{emit:n}=i.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[de],r=t.expandedRows.indexOf(a);r===-1?t.expandedRows.push(a):t.expandedRows.splice(r,1),l[Ns]=!l[Ns],n("update:expanded",t.expandedRows),n("expand-row",s,l[de],l[Ns],l[Mt])}}},L0=e=>{const{sortInfo:t,stores:n,updatePagingInfo:o}=e,{emit:s}=i.getCurrentInstance(),l=(m=!0)=>m?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=m=>this.orders.push(m)}const r=(m,x="init")=>{n.orderedColumns.forEach(b=>{b.index===(m==null?void 0:m.index)&&x?b.sortOption={sortType:x}:b.sortOption={sortType:"init"}})},c=()=>{const m=n.originColumns.filter(x=>x.hiddenDisplay||x.hide);m.length&&m.forEach(x=>{x.sortOption={sortType:"init"}})},d=new a,h=(m,x=!0)=>{const{sortType:b}=(m==null?void 0:m.sortOption)||{};t.sortColumn=m,t.sortField=m==null?void 0:m.field,t.sortOrder=b,t.isSorting=!!b,x&&(r(m,b),s("change-column-info",{type:"sort",columns:ii(n)}))},u=(m,x)=>{if(m.sortable===void 0?!0:m.sortable){t.sortColumn=m,t.sortField!==(m==null?void 0:m.field)&&(d.orders=l(),t.sortField=m==null?void 0:m.field),x&&(d.orders=l(),x==="desc"&&(t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder))),t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder),t.isSorting=!0,o({onSort:!0}),c(),r(m,t.sortOrder);const y=ii(n);s("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:y}),s("change-column-info",{type:"sort",columns:y})}},f=()=>{var w;const{field:m,index:x}=t.sortColumn||{},b=((w=t.sortFunction)==null?void 0:w[m])??null,y=(k,B)=>k>B?-1:1,M=(k,B)=>k<B?-1:1,I=(k,B)=>(k===null)-(B===null)||Number(B)-Number(k),E=(k,B)=>(k===null)-(B===null)||Number(k)-Number(B);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((k,B)=>typeof k[Mt]=="number"?M(k[Mt],B[Mt]):0);return}const T=t.sortColumn.type||"string",V=t.sortOrder==="desc"?y:M,C=t.sortOrder==="desc"?I:E,S=(k,B)=>{var R,v;let D=k[de][x],O=B[de][x];return k[de][x]&&typeof k[de][x]=="object"&&(D=k[de][x][(R=n.originColumns[x])==null?void 0:R.field],O=B[de][x][(v=n.originColumns[x])==null?void 0:v.field]),{aCol:D,bCol:O}};if(b){n.store.sort((k,B)=>{const D=k[de][x],O=B[de][x],R=b(D,O);return t.sortOrder==="desc"?-R:R});return}switch(T){case"string":n.store.sort((k,B)=>{let{aCol:D,bCol:O}=S(k,B);if((!D||typeof D=="string")&&(!O||typeof O=="string")){D=D||"",O=O||"";const R=D.toLowerCase(),v=O.toLowerCase();if(D!==O&&R===v){const N=Array.from(D).findIndex((L,P)=>L!==O[P]);return V(D[N],O[N])}return V(R,v)}return 0});break;case"stringNumber":n.store.sort((k,B)=>{let{aCol:D,bCol:O}=S(k,B);return!D||typeof D=="string"||typeof D=="number"?(D=D===""?null:D,O=O===""?null:O,C(D??null,O??null)):0});break;default:n.store.sort((k,B)=>{const{aCol:D,bCol:O}=S(k,B);return!D||typeof D=="number"||typeof D=="boolean"?C(D??null,O??null):0});break}},g=()=>{var m;return(m=n.orderedColumns)==null?void 0:m.find(x=>(x==null?void 0:x.sortOption)&&l(!1).includes(x.sortOption.sortType))};return{onSort:u,getSortTarget:g,setSort:f,setSortInfo:h,hasSortTarget:()=>!!g()}},N0=e=>{const{props:t}=i.getCurrentInstance(),{columnSettingInfo:n,filterInfo:o,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=e,f=E=>{let T=0;E.forEach(V=>{const C=l.checkedRows.includes(V[de]);V[mn]=C,T+=C?1:0}),E.length&&(l.isHeaderChecked=E.length===T,l.isHeaderIndeterminate=E.length!==T&&T>0,l.isHeaderUncheckable=E.every(V=>t.uncheckable.includes(V[de])||t.disabledRows.includes(V[de])))},g=(E,T,V)=>{if(typeof E!="string"||T===null)return!1;const C=T==null?void 0:T.toLowerCase(),S=E==null?void 0:E.toLowerCase();let w=C.includes(S);return V&&(V==="start"?w=C.startsWith(S):V==="end"&&(w=C.endsWith(S))),w},p=(E,T)=>{const V=T.comparison,C=T.value;let S=E[de][T.index];(S||S===0)&&(S=`${E[de][T.index]}`);let w;return V==="="?w=(C==null?void 0:C.toLowerCase())===(S==null?void 0:S.toLowerCase()):V==="!="?w=(C==null?void 0:C.toLowerCase())!==(S==null?void 0:S.toLowerCase()):V==="%s%"?w=g(C,S):V==="notLike"?w=!g(C,S):V==="s%"?w=g(C,S,"start"):V==="%s"?w=g(C,S,"end"):V==="isEmpty"?w=S==null||S==="":V==="isNotEmpty"&&(w=!!S),w},m=(E,T,V)=>{const C=T.comparison,S=Number(T.value.replace(/,/g,""));let w=Number(E[de][T.index]),k;return V==="float"&&(w=Number(w.toFixed(3))),C==="="?k=w===S:C===">"?k=w>S:C==="<"?k=w<S:C==="<="?k=w<=S:C===">="?k=w>=S:C==="!="?k=w!==S:C==="isEmpty"?k=w==null||isNaN(w):C==="isNotEmpty"&&(k=!!w||w===0),k},x=(E,T)=>{const V=T.comparison,C=T.value,S=`${E[de][T.index]}`;let w;return V==="="&&(w=S===C),w},b=(E,T,V)=>{let C=T==="string"||T==="stringNumber"?p:m;return T==="boolean"&&(C=x),E.filter(S=>C(S,V,T))||[]},y=()=>{const E=o.filteringItemsByColumn,T=Object.keys(E),V=s.originStore;let C=[],S=!1,w=[];T.forEach((k,B)=>{const D=E[k],O=u(k),R=t.columns[O].type,v=o.columnOperator==="or",N=B>0&&o.columnOperator==="and";D.forEach((L,P)=>{!C.length&&!S?C=b(V,R,{...L,index:O}):N&&L.operator==="or"?P>0?C.push(...b(w,R,{...L,index:O})):C=b(w,R,{...L,index:O}):P===0&&v||P!==0&&L.operator==="or"?C.push(...b(V,R,{...L,index:O})):C=b(C,R,{...L,index:O}),S=!0}),w=JSON.parse(JSON.stringify(C))}),S?s.filterStore=Yp(C,JSON.stringify):s.filterStore=V};let M=null;return{onSearch:E=>{M&&clearTimeout(M),M=setTimeout(()=>{o.isSearch=!1,o.searchWord=E,E&&(s.searchStore=s.store.filter(T=>{let V=!1;const C=n.isFilteringColumn?T[de].filter((S,w)=>n.visibleColumnIdx.includes(w)):T[de];for(let S=0;S<s.orderedColumns.length;S++){const w=s.orderedColumns[S]||{};let k=C[w.index]??null;if(w.type=w.type||"string",k!==null&&(k instanceof Array?k=JSON.stringify(k):typeof k=="object"&&(k=k[w.field]),!w.hide&&((w==null?void 0:w.searchable)===void 0||w!=null&&w.searchable)&&(k=r(w,k).toString(),V=k.toLowerCase().includes(E.toString().toLowerCase()),V)))break}return V}),o.isSearch=!0),f(s.store),!E&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:y,setHeaderCheckboxByFilter:f}},V0=e=>{const{contextInfo:t,stores:n,selectInfo:o,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=e;let d=null;const{emit:h}=i.getCurrentInstance(),u=m=>{d&&clearTimeout(d);const x=[];d=setTimeout(()=>{if(t.customContextMenu.length){const b=t.customContextMenu.map(y=>{const M=y;return M.validate&&(M.disabled=!M.validate(M.itemId,o.selectedRow)),M.selectedRow=o.selectedRow??[],M.contextmenuInfo=o.contextmenuInfo??[],M});x.push(...b)}t.contextMenuItems=x,t.menu.show(m)},200)};return{setContextMenu:u,onContextMenu:m=>{var M,I,E;m.preventDefault();const b=(I=(M=m.target.closest(".row"))==null?void 0:M.dataset)==null?void 0:I.index;let y=null;b&&(y=(E=n.viewStore.find(T=>T[Mt]===+b))==null?void 0:E[de]),y&&(o.contextmenuInfo=[y],u(m))},onColumnContextMenu:(m,x)=>{var b,y,M,I,E,T,V,C;if(m.target.className==="column-name"){const S=x.sortable===void 0?!0:x.sortable,w=l.isFiltering&&x.filterable===void 0?!0:x.filterable,k=[{text:((b=t.columnMenuTextInfo)==null?void 0:b.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!S,hidden:(y=t.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>s(x,"asc")},{text:((M=t.columnMenuTextInfo)==null?void 0:M.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!S,hidden:(I=t.hiddenColumnMenuItem)==null?void 0:I.descending,click:()=>s(x,"desc")},{text:((E=t.columnMenuTextInfo)==null?void 0:E.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const B=document.documentElement.clientWidth,D=t.columnMenu.menuStyle.clientX,O=t.columnMenu.menuStyle.pageX,R=350;B<D+R&&(t.columnMenu.menuStyle.left=`${O-R}px`),l.filterSettingPosition={top:t.columnMenu.menuStyle.top,left:t.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=x,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!w,hidden:((T=t.hiddenColumnMenuItem)==null?void 0:T.filter)||!l.isFiltering},{text:((V=t.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||x.fixed,hidden:((C=t.hiddenColumnMenuItem)==null?void 0:C.hide)||!a.value,click:()=>{c(x.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(t.columnMenuItems=[],!S&&!w&&!a.value)return;t.columnMenuItems=k.filter(B=>!B.hidden)}},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:x,columnSettingTextInfo:b}=r,y={text:(b==null?void 0:b.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,t.isShowMenuOnClick=!0}};t.customGridSettingContextMenu.length&&(t.gridSettingContextMenuItems=[...t.customGridSettingContextMenu]),x&&t.gridSettingContextMenuItems.push(y),t.gridSettingMenu.show(m)}}},P0=e=>{const{props:t}=i.getCurrentInstance(),{selectInfo:n,checkInfo:o,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:f}=e;return{setStore:({rows:p,isMakeIndex:m=!0,isInit:x=!1})=>{var y,M,I;const b=s.orderedColumns.find(E=>(E==null?void 0:E.sortOption)&&["asc","desc"].includes(E.sortOption.sortType));if(m){const E=[];let T=!1;p.forEach((V,C)=>{const S=t.checked.includes(V),w=t.uncheckable.includes(V)||t.disabledRows.includes(V);let k=!1;n.useSelect&&(k=t.selected.includes(V)),!S&&!w&&(T=!0);let B=!1;c.useRowDetail&&(B=t.expanded.includes(V));const D=t.disabledRows.includes(V);E.push([C,S,V,k,B,w,D])}),p.length!==t.checked.length&&(p.length===((y=t.uncheckable)==null?void 0:y.length)||p.length===((M=t.disabledRows)==null?void 0:M.length))&&(T=!0),o.isHeaderChecked=p.length>0?!T:!1,o.isHeaderIndeterminate=T&&!!o.checkedRows.length,o.isHeaderUncheckable=p.every(V=>t.uncheckable.includes(V)||t.disabledRows.includes(V)),s.originStore=E}r.isFiltering&&f(),b&&x&&h(b,!1),l.sortField&&d(),(I=a.body)!=null&&I.clientHeight&&u()}}},_0=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,pageInfo:o,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(o.currentPage-1)*o.perPage,f=parseInt(u,10)+parseInt(o.perPage,10);return n.store.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:o.currentPage,prevPage:o.prevPage,startIndex:o.startIndex,total:o.pageTotal,perPage:o.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),o.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(o.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(o.isClientPaging)if(o.prevPage=u,n.store.length<=o.perPage)n.pagingStore=n.store;else{const f=(o.currentPage-1)*o.perPage,g=parseInt(f,10)+parseInt(o.perPage,10);n.pagingStore=n.store.slice(f,g),a.body.scrollTop=0,o.startIndex=f}d({onChangePage:!0})}}},kr=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{stores:o,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=e,c=m=>{var x,b,y;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const M=l.gridSettingContextMenuItems.length-1,I=(y=(b=(x=l.gridSettingMenu)==null?void 0:x.rootMenuList)==null?void 0:b.$el)==null?void 0:y.children[0].children[M].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=I.width,s.columnSettingPosition.top=I.top,s.columnSettingPosition.left=I.right}else{const M=m==null?void 0:m.getBoundingClientRect(),I=M==null?void 0:M.height;s.columnSettingPosition.top=(M==null?void 0:M.top)+I,s.columnSettingPosition.left=M==null?void 0:M.right}},d=()=>{o.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(o.movedColumns)&&o.movedColumns.length?o.movedColumns:o.originColumns||[],u=(m,x)=>{var y;if(!m)return;m.hiddenDisplay=x;const b=(y=o.originColumns)==null?void 0:y.find(M=>M.index===m.index);if(b&&b!==m&&(b.hiddenDisplay=x),Array.isArray(o.movedColumns)){const M=o.movedColumns.find(I=>I.index===m.index);M&&M!==m&&(M.hiddenDisplay=x)}},f=()=>{s.visibleColumnIdx=o.filteredColumns.map(b=>b.index);const m=o.originColumns.filter(b=>!b.hide||b.hiddenDisplay).map(b=>b.index),x=s.visibleColumnIdx;s.isFilteringColumn=x.length!==m.length,t.option.searchValue&&a(t.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:m=>{const x=o.orderedColumns.filter(I=>!I.hide&&!I.hiddenDisplay);if(m.length===x.length&&x.every(I=>m.includes(I.field)))return;const y=h(),M=new Set(m);o.filteredColumns=y.filter(I=>{const E=M.has(I.field)||!I.caption;return u(I,!E),E}),s.hiddenColumn="",f(),n("change-column-status",{columns:o.updatedColumns}),n("change-column-info",{type:"display",columns:o.updatedColumns})},setColumnHidden:m=>{const x=o.orderedColumns.filter(y=>!y.hide&&!y.hiddenDisplay);if(x.length===1)return;o.filteredColumns=x.filter(y=>{const M=y.field===m;return u(y,M),!M}),h().forEach(y=>{y.field===m&&u(y,!0)}),s.hiddenColumn=m,f()}}},A0=({stores:e})=>{const{emit:t}=i.getCurrentInstance(),n=r=>{var u;const c=(u=e.movedColumns)!=null&&u.length?[...e.movedColumns]:[...e.originColumns],d=[...r],h=new Set(d.map(f=>f.index));e.movedColumns=c.map(f=>h.has(f.index)?d.shift():f)},o=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const u=[...e.orderedColumns],f=u[d];u.splice(d,1),u.splice(h,0,f),e.filteredColumns.length&&(e.filteredColumns=u),n(u)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;o(c,d),t("change-column-order",{column:e.orderedColumns[d],columns:e.updatedColumns}),t("change-column-info",{type:"order",columns:e.updatedColumns})}}},z0={name:"EvGrid",directives:{clickoutside:Ro,observeVisibility:Xi,resize:wn},components:{Toolbar:jb,GridPagination:mr,GridSummary:Cr,ColumnSetting:Sr,FilterSetting:x0,GridSortButton:wr,GridOptionButton:Ls},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-order":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var zr,Fr,Hr,Wr,$r,Xr,Ur,Yr,jr;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=v0(),u=i.ref(null),f=i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ee.use)||!1}),g=i.computed(()=>e.option.showHeader??!0),p=i.computed(()=>{var F;return((F=e.option)==null?void 0:F.useSummary)||!1}),m=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.stripe)||!1}),x=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.border)||""}),b=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.highlight)??-1}),y=i.computed(()=>e.option.emptyText??"No records"),M=e.option.rowMinHeight||35,I=i.ref(0),E=i.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),T=i.reactive({isSearch:!1,searchWord:"",isFiltering:i.computed(()=>e.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=i.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ee.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((Fr=(zr=e.option)==null?void 0:zr.useGridSetting)==null?void 0:Fr.columnMenuText)??"Column List",search:((Wr=(Hr=e.option)==null?void 0:Hr.useGridSetting)==null?void 0:Wr.searchText)??"Search",empty:((Xr=($r=e.option)==null?void 0:$r.useGridSetting)==null?void 0:Xr.emptyText)??"No records",ok:((Yr=(Ur=e.option)==null?void 0:Ur.useGridSetting)==null?void 0:Yr.okBtnText)??"OK"}}),C=i.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:i.computed(()=>{const F=T.isFiltering?C.filterStore:C.originStore;return T.isSearch?C.searchStore:F}),filteredColumns:[],movedColumns:[],originColumns:i.computed(()=>e.columns.map((F,ee)=>{var Ce;return{index:ee,hiddenDisplay:!1,...F,width:isFinite(F.width)?F.width:void 0,sortOption:{sortType:((Ce=F==null?void 0:F.sortOption)==null?void 0:Ce.sortType)||"init"}}})),orderedColumns:i.computed(()=>{const F=C.movedColumns.length?C.movedColumns:C.originColumns;return C.filteredColumns.length?C.filteredColumns:F}),updatedColumns:i.computed(()=>ii(C))}),S=i.reactive({usePage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.use)||!1}),useClient:((jr=e.option.page)==null?void 0:jr.useClient)||!1,isInfinite:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:i.computed(()=>{var F,ee;return(F=e.option.page)!=null&&F.useClient?C.store.length:(ee=e.option.page)==null?void 0:ee.total}),perPage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.perPage)||20}),visiblePage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.visiblePage)||8}),order:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.order)||"center"}),showPageInfo:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.showPageInfo)||!1}),isClientPaging:i.computed(()=>S.useClient&&S.usePage&&!S.isInfinite),isHighlight:!1,highlightPage:0}),w=i.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:i.computed(()=>e.option.useCheckbox||{})}),k=i.reactive({expandedRows:e.expanded,useRowDetail:i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:ee.use)??!1}),detailRowHeight:i.computed(()=>{var F,ee;return(ee=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:ee.detailRowHeight})}),B=i.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),D=i.reactive({contextmenuInfo:e.contextmenuInfo,selectedRow:e.selected,useSelect:i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.useSelection)==null?void 0:ee.use)??!0}),multiple:i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.useSelection)==null?void 0:ee.multiple)??!1})}),O=i.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),R=i.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:i.computed(()=>{var F,ee;return((ee=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ee.customContextMenu)||[]}),isShowMenuOnClick:!1}),v=i.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:i.computed(()=>e.option.rowHeight>M?e.option.rowHeight:M),gridWidth:i.computed(()=>e.width?h(e.width):"100%"),gridHeight:i.computed(()=>e.height?h(e.height):"100%")}),N=()=>{w.checkedRows=[],w.isHeaderChecked=!1,w.isHeaderIndeterminate=!1,C.store.forEach(F=>{F[1]=!1})},L=()=>{D.selectedRow=[],C.store.forEach(F=>{F[3]=!1})},P=()=>{C.store.forEach(F=>{F[4]=!1}),k.expandedRows=[]},{getPagingData:_,updatePagingInfo:A,changePage:z}=_0({stores:C,pageInfo:S,sortInfo:O,filterInfo:T,elementInfo:E,clearCheckInfo:N}),$=i.ref(0),{updateVScroll:U,updateHScroll:H,onScroll:X}=T0({scrollInfo:B,stores:C,elementInfo:E,resizeInfo:v,pageInfo:S,summaryScroll:$,expandedInfo:k,getPagingData:_,updatePagingInfo:A}),{onCheck:j,onCheckAll:K}=O0({checkInfo:w,stores:C,pageInfo:S,getPagingData:_}),{onExpanded:q}=R0({expandedInfo:k}),{onSort:Q,getSortTarget:J,setSort:te,setSortInfo:G,hasSortTarget:oe}=L0({sortInfo:O,stores:C,updatePagingInfo:A}),{onSearch:Z,setFilter:ae,setHeaderCheckboxByFilter:me}=N0({columnSettingInfo:V,filterInfo:T,stores:C,checkInfo:w,pageInfo:S,getConvertValue:c,updateVScroll:U,getPagingData:_,updatePagingInfo:A,getColumnIndex:d}),{setStore:re}=P0({selectInfo:D,checkInfo:w,stores:C,sortInfo:O,elementInfo:E,filterInfo:T,expandedInfo:k,setSort:te,setSortInfo:G,updateVScroll:U,setFilter:ae}),{calculatedColumn:ue,onResize:ke,onShow:rt,onColumnResize:ct}=B0({resizeInfo:v,elementInfo:E,checkInfo:w,expandedInfo:k,stores:C,isRenderer:a,updateVScroll:U,updateHScroll:H,contextInfo:R}),{setPositionColumnSetting:yt,initColumnSettingInfo:ho,onApplyColumn:uo,setColumnHidden:fo}=kr({stores:C,columnSettingInfo:V,contextInfo:R,onSearch:Z,onResize:ke}),{setContextMenu:Zt,onContextMenu:_s,onColumnContextMenu:As,onGridSettingContextMenu:ci}=V0({contextInfo:R,stores:C,selectInfo:D,useGridSetting:f,filterInfo:T,columnSettingInfo:V,setColumnHidden:fo,onSort:Q}),{onRowClick:di,onRowDblClick:hi}=D0({selectInfo:D,stores:C}),{onDragStart:ui,onDragOver:fi,onDrop:mi}=A0({stores:C}),gi=F=>{R.gridSettingContextMenuItems.length=0,R.customGridSettingContextMenu.length?ci(F):V.isShowColumnSetting=!0},qt=F=>{var ee,Ce,xt,Kt,mo,Et,Je,pi,yi,Gr;F.type==="wheel"&&((ee=R.menu)==null||ee.hide(F)),F.type==="scroll"&&!((Ce=F.target.classList)!=null&&Ce.contains("table-body"))&&!((Kt=(xt=F.target.offsetParent)==null?void 0:xt.classList)!=null&&Kt.contains("ev-select-dropbox"))&&!((Et=(mo=F.target.offsetParent)==null?void 0:mo.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((pi=(Je=F.target.offsetParent)==null?void 0:Je.classList)!=null&&pi.contains("ev-text-field-wrapper"))&&(T.isShowFilterSetting=!1,V.isShowColumnSetting=!1,R.isShowMenuOnClick=!1,(yi=R.columnMenu)==null||yi.hide(F),(Gr=R.gridSettingMenu)==null||Gr.hide())};i.onMounted(()=>{ue(),re({rows:e.rows,isInit:!0}),document.addEventListener("wheel",qt,{capture:!1}),document.addEventListener("scroll",qt,{capture:!0})}),i.onUnmounted(()=>{document.removeEventListener("wheel",qt,{capture:!1}),document.removeEventListener("scroll",qt,{capture:!0})}),i.onActivated(()=>{ke()}),i.onUpdated(()=>{var F;I.value=((F=E["grid-wrapper"])==null?void 0:F.offsetWidth)/1.5||0}),i.watch(()=>V.isShowColumnSetting,F=>{var ee;if(!F){(ee=R.gridSettingMenu)==null||ee.hide();return}yt(u.value)}),i.watch(()=>e.columns,()=>{oe()?G(J()):(G(J()),te()),T.filteringColumn=null,T.filteringItemsByColumn={},C.filterStore=[],re({rows:[],isMakeIndex:!1}),ho(),C.movedColumns.length=0},{deep:!0}),i.watch(()=>O.isSorting,F=>{F&&(re({rows:C.originStore,isMakeIndex:!1}),O.isSorting=!F,S.isClientPaging&&(S.currentPage=1,C.pagingStore=_(),N()))}),i.watch(()=>e.rows,F=>{re({rows:F}),T.isSearch&&Z(T.searchWord),ke()},{deep:!0}),i.watch(()=>e.uncheckable,()=>{re({rows:e.rows})},{deep:!0}),i.watch(()=>e.checked,F=>{w.checkedRows=F}),i.watch(()=>e.disabledRows,()=>{C.store.length&&C.store.forEach(F=>{F[6]=e.disabledRows.includes(F[2])})},{deep:!0}),i.watch(()=>w.checkedRows,F=>{w.isHeaderChecked=!1;let ee=C.store;S.isClientPaging&&(ee=_()),ee.length&&(ee.forEach(Ce=>{Ce[1]=F.includes(Ce[2])}),w.isHeaderChecked=F.length===ee.length),U()}),i.watch(()=>e.selected,F=>{D.useSelect&&(D.selectedRow=F)}),i.watch(()=>D.selectedRow,F=>{D.useSelect&&(C.store.forEach(ee=>{ee[3]=F.includes(ee[2])&&!e.disabledRows.includes(ee[2])}),U())}),i.watch(()=>b.value,async F=>{if(await i.nextTick(),F>=0){if(S.usePage&&!S.isInfinite&&(S.highlightPage=Math.ceil(F/S.perPage)||1,S.highlightPage!==S.currentPage)){S.currentPage=S.highlightPage,S.isHighlight=!0;return}E.body.scrollTop=v.rowHeight*b.value}}),i.watch(()=>w.useCheckbox.mode,()=>{N()}),i.watch(()=>D.useSelect,()=>{L()}),i.watch(()=>D.multiple,()=>{L()}),i.watch(()=>e.checked.length,F=>{F||N()}),i.watch(()=>e.expanded.length,F=>{F||P(),U()}),i.watch(()=>[e.option.columnWidth,v.gridWidth],async()=>{await i.nextTick(),v.columnWidth=e.option.columnWidth;const F=E["grid-wrapper"];F.style.width=v.gridWidth,F.style.height=v.gridHeight,C.orderedColumns.map(ee=>{var xt;const Ce=ee;return!((xt=e.columns[ee.index])!=null&&xt.width)&&!Ce.resized&&(Ce.width=0),Ce}),ke()}),i.watch(()=>e.option.searchValue,F=>{F!==void 0&&(Z((F==null?void 0:F.value)??F),S.isClientPaging&&(N(),L()))},{immediate:!0}),i.watch(()=>{var F;return(F=e.option.page)==null?void 0:F.currentPage},F=>{var Ce;const ee=F||1;S.currentPage=(Ce=e.option.page)!=null&&Ce.isInfinite?1:ee},{immediate:!0}),i.watch(()=>S.currentPage,(F,ee)=>{i.nextTick(()=>{z(ee),S.isClientPaging&&F!==ee&&(N(),L()),U(),F===S.highlightPage&&S.isHighlight&&(E.body.scrollTop=v.rowHeight*b.value,S.isHighlight=!S.isHighlight)})});const gn=i.reactive({boxTop:0,boxLeft:0}),W=i.ref(null),ne=i.ref(!1),he=i.ref(!1),xe=i.ref(null),Me=i.ref({}),Pe=i.reactive({caption:"",field:""}),Xe=i.ref([]),sw=[{name:"AND",value:"and"},{name:"OR",value:"or"}],zs=i.ref(0),lw=({caption:F,field:ee},Ce)=>{if(Pe.caption=F,Pe.field=ee,Xe.value=Ce,(Ce==null?void 0:Ce.length)>1){ne.value=!0;const xt=W.value.getBoundingClientRect().left,Kt=window.pageYOffset+W.value.getBoundingClientRect().top+W.value.getBoundingClientRect().height;gn.boxTop=`${Kt}px`,gn.boxLeft=`${xt}px`}},aw=()=>{C.filterStore=[],re({rows:[],isMakeIndex:!1})},Fs=async F=>{var Kt,mo;F&&he.value&&(zs.value=0);const ee=(Kt=W.value)==null?void 0:Kt.getElementsByClassName("filtering-items__item"),Ce=[];let xt=0;if(ee){for(let Et=0;Et<ee.length;Et++){const Je=ee[Et];Je.classList.remove("non-display");const pi=(mo=W.value.getBoundingClientRect())==null?void 0:mo.width,{width:yi}=Je.getBoundingClientRect();xt+=yi+10,pi-150<=xt&&!Je.classList.contains("filtering-items__item--count")?(zs.value++,Ce.push(Je),Me.value={...Me.value,[Je.dataset.field]:Se(T.filteringItemsByColumn[Je.dataset.field])}):delete Me.value[Je.dataset.field]}ee.forEach(Et=>{const Je=Ce.includes(Et);Et.classList.toggle("non-display",Je)})}},rw=async(F,ee)=>{ee!=null&&ee.length?(T.filteringItemsByColumn[F]=ee,he.value=!0):(delete Me.value[F],delete T.filteringItemsByColumn[F]),await i.nextTick(),Fs(!0),T.isShowFilterSetting=!1,C.filterStore=[],re({rows:[],isMakeIndex:!1}),me(C.filterStore)};let Hs=null;const cw=()=>{Hs&&clearTimeout(Hs),Hs=setTimeout(()=>{he.value=!he.value,Fs(he.value)},150)},dw=()=>{T.filteringColumn=null,T.filteringItemsByColumn={},Me.value={},C.filterStore=[],re({rows:[],isMakeIndex:!1})},hw=i.computed(()=>{var F;return{width:`${I.value}px`,top:`${((F=W.value)==null?void 0:F.getBoundingClientRect().height)||0}px`}}),uw=F=>{const ee=T.filteringItemsByColumn[F];return ee==null?void 0:ee[ee.length-1]},fw=()=>{const F=document.createElement("div");F.id="ev-grid-filtering-items-modal",F.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(F)};return i.onBeforeMount(()=>fw()),{idColIndex:i.computed(()=>{var F;return(F=C.orderedColumns.find(ee=>ee.field==="id"))==null?void 0:F.index}),summaryScroll:$,showHeader:g,stripeStyle:m,borderStyle:x,highlightIdx:b,useSummary:p,useGridSetting:f,toolbarRef:u,stores:C,emptyText:y,...i.toRefs(E),...i.toRefs(C),...i.toRefs(T),...i.toRefs(B),...i.toRefs(S),...i.toRefs(v),...i.toRefs(D),...i.toRefs(w),...i.toRefs(k),...i.toRefs(O),...i.toRefs(R),...i.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:U,updateHScroll:H,onScroll:X,calculatedColumn:ue,onResize:ke,onShow:rt,onColumnResize:ct,onRowClick:di,onRowDblClick:hi,onCheck:j,onCheckAll:K,onExpanded:q,onSort:Q,setSort:te,setStore:re,setContextMenu:Zt,onContextMenu:_s,onSearch:Z,setGridSetting:gi,onApplyColumn:uo,onColumnContextMenu:As,filteringItemsWidth:I,isShowColumnFilteringItems:he,operatorItems:sw,selectedFilteringItems:Xe,selectedFilteringColumn:Pe,filteringItemsRef:W,isShowFilteringItemsBox:ne,filteringItemsStyle:hw,hiddenFilteringItemsCount:zs,...i.toRefs(gn),hiddenFilteringItemsRef:xe,hiddenFilteringItemsByColumn:Me,removeAllFiltering:dw,onExpandFilteringItems:cw,setColumnFilteringItems:Fs,onChangeOperator:aw,onApplyFilter:rw,onClickFilteringItem:lw,getFilteringItemByField:uw,onDragStart:ui,onDragOver:fi,onDrop:mi,ROW_DISABLED_INDEX:6}}},F0={key:0,class:"filtering-items filtering-items--used"},H0={key:1,ref:"filteringItemsRef",class:"filtering-items"},W0=["data-field","onClick"],$0={class:"filtering-items__item--title"},X0=["title"],U0={key:1,class:"filtering-items__item--value"},Y0=["onClick"],j0={class:"filtering-items__item--title"},G0=["title"],Z0={key:1,class:"filtering-items__item--value"},q0={class:"column-list"},K0=["data-index"],J0=["title","onClick"],Q0=["onClick"],eC=["onMousedown"],tC={ref:"table"},nC=["data-index","disabled","onClick","onContextmenu","onDblclick"],oC=["data-name","data-index","disabled"],iC={key:0},sC=["title"],lC=["disabled"],aC=["disabled"],rC={key:0},cC=["colspan"],dC={key:0},hC={class:"is-empty"},uC={ref:"resizeLine",class:"table-resize-line"};function fC(e,t,n,o,s,l){var I;const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-select"),c=i.resolveComponent("grid-option-button"),d=i.resolveComponent("toolbar"),h=i.resolveComponent("ev-checkbox"),u=i.resolveComponent("grid-sort-button"),f=i.resolveComponent("ev-context-menu"),g=i.resolveComponent("grid-summary"),p=i.resolveComponent("grid-pagination"),m=i.resolveComponent("filter-setting"),x=i.resolveComponent("column-setting"),b=i.resolveDirective("clickoutside"),y=i.resolveDirective("resize"),M=i.resolveDirective("observe-visibility");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.$slots.toolbar||o.useGridSetting?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:i.normalizeStyle(`width: ${e.gridWidth};`)},[i.createVNode(d,null,{toolbarWrapper:i.withCtx(()=>[i.createElementVNode("div",{class:"filtering",style:i.normalizeStyle({width:`${o.filteringItemsWidth}px`})},[e.isFiltering&&!Object.keys(e.filteringItemsByColumn).length?(i.openBlock(),i.createElementBlock("div",F0,[i.createVNode(a,{icon:"ev-icon-filter-list"}),t[18]||(t[18]=i.createElementVNode("span",null,"Filter",-1))])):i.createCommentVNode("",!0),e.isFiltering&&Object.keys(e.filteringItemsByColumn).length?(i.openBlock(),i.createElementBlock("div",H0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(e.filteringItemsByColumn),(E,T)=>{var V,C,S,w;return i.openBlock(),i.createElementBlock(i.Fragment,{key:T},[T===0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=i.withModifiers((...k)=>o.onExpandFilteringItems&&o.onExpandFilteringItems(...k),["stop"]))},[i.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),i.createElementVNode("span",null," Filter ("+i.toDisplayString(Object.keys(e.filteringItemsByColumn).length)+") ",1),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:i.withModifiers(o.removeAllFiltering,["stop"])},null,8,["onClick"])])):i.createCommentVNode("",!0),T===1?(i.openBlock(),i.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=k=>e.columnOperator=k),items:o.operatorItems,class:"filtering-items__item--operator",onChange:o.onChangeOperator},null,8,["modelValue","items","onChange"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"filtering-items__item non-display","data-field":E,onClick:i.withModifiers(k=>{var B;return o.onClickFilteringItem({caption:(B=o.getFilteringItemByField(E))==null?void 0:B.caption,field:E},e.filteringItemsByColumn[E])},["stop"])},[i.createElementVNode("span",$0,i.toDisplayString((V=o.getFilteringItemByField(E))==null?void 0:V.caption)+" "+i.toDisplayString((C=o.getFilteringItemByField(E))==null?void 0:C.comparison),1),e.filteringItemsByColumn[E].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=o.getFilteringItemByField(E))==null?void 0:S.value},i.toDisplayString((w=o.getFilteringItemByField(E))==null?void 0:w.value),9,X0)):(i.openBlock(),i.createElementBlock("span",U0," + "+i.toDisplayString(e.filteringItemsByColumn[E].length),1)),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:k=>o.onApplyFilter(E,[])},null,8,["onClick"])],8,W0)],64)}),128)),o.isShowColumnFilteringItems&&Object.keys(e.filteringItemsByColumn).length&&o.hiddenFilteringItemsCount>0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:t[2]||(t[2]=(...E)=>o.onExpandFilteringItems&&o.onExpandFilteringItems(...E))}," + "+i.toDisplayString(o.hiddenFilteringItemsCount),1)):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),!o.isShowColumnFilteringItems&&Object.keys(o.hiddenFilteringItemsByColumn).length?i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:i.normalizeStyle(o.filteringItemsStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(o.hiddenFilteringItemsByColumn),(E,T)=>{var V,C,S,w;return i.openBlock(),i.createElementBlock("div",{key:T,class:"filtering-items__item",onClick:i.withModifiers(k=>{var B;return o.onClickFilteringItem({caption:(B=o.getFilteringItemByField(E))==null?void 0:B.caption,field:E},o.hiddenFilteringItemsByColumn[E])},["stop"])},[i.createElementVNode("span",j0,i.toDisplayString((V=o.getFilteringItemByField(E))==null?void 0:V.caption)+" "+i.toDisplayString((C=o.getFilteringItemByField(E))==null?void 0:C.comparison),1),o.hiddenFilteringItemsByColumn[E].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=o.getFilteringItemByField(E))==null?void 0:S.value},i.toDisplayString((w=o.getFilteringItemByField(E))==null?void 0:w.value),9,G0)):(i.openBlock(),i.createElementBlock("span",Z0," + "+i.toDisplayString(o.hiddenFilteringItemsByColumn[E].length),1)),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:k=>o.onApplyFilter(E,[],!0)},null,8,["onClick"])],8,Y0)}),128))],4)),[[b,()=>{o.isShowColumnFilteringItems||o.onExpandFilteringItems()}]]):i.createCommentVNode("",!0)],4),o.useGridSetting?(i.openBlock(),i.createBlock(c,{key:0,class:"grid-setting__icon",onClick:t[3]||(t[3]=E=>o.setGridSetting(E))})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"toolbar",{item:{onSearch:o.onSearch}},void 0,!0)]),_:3})],4)):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createElementBlock("div",i.mergeProps({ref:"grid-wrapper"},e.$attrs,{class:"grid-wrapper",style:`width: ${e.gridWidth}; height: ${e.gridHeight};`}),[i.createElementVNode("div",{ref:"grid",class:i.normalizeClass({table:!0,adjust:e.adjust,"ev-grid":!0,"non-header":!o.showHeader,"ev-grid--empty":!e.viewStore.length})},[i.withDirectives(i.createElementVNode("div",{ref:"header",class:i.normalizeClass({"table-header":!0,"non-border":!!o.borderStyle})},[i.createElementVNode("ul",q0,[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[e.useCheckbox.use&&e.useCheckbox.headerCheck&&e.useCheckbox.mode!=="single"?(i.openBlock(),i.createBlock(h,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[4]||(t[4]=E=>e.isHeaderChecked=E),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:o.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0),e.useRowDetail?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({column:!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(E,T)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:T},[!E.hide&&!E.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":T,class:i.normalizeClass({column:!0,render:o.isRenderer(E),"non-border":!!o.borderStyle,[E.field]:E.field}),style:i.normalizeStyle({width:`${E.width}px`,"min-width":`${o.isRenderer(E)?e.rendererMinWidth:e.minWidth}px`,"margin-right":e.orderedColumns.length-1===T&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===T?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:t[6]||(t[6]=(...V)=>o.onDragStart&&o.onDragStart(...V)),onDragover:t[7]||(t[7]=(...V)=>o.onDragOver&&o.onDragOver(...V)),onDrop:t[8]||(t[8]=(...V)=>o.onDrop&&o.onDrop(...V))},[E.customHeader&&e.$slots.customHeader?i.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:E.caption,class:"column-name",onClick:[V=>o.onColumnContextMenu(V,E),t[5]||(t[5]=i.withModifiers((...V)=>e.columnMenu.show&&e.columnMenu.show(...V),["prevent"]))]},[i.createTextVNode(i.toDisplayString(E.caption)+" ",1),i.createElementVNode("span",{onClick:i.withModifiers(V=>o.onSort(E),["stop"])},[e.$slots.sortIcon?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[E.sortable===void 0||E.sortable?(i.openBlock(),i.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):i.createCommentVNode("",!0),e.sortField===E.field?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[E.sortable===void 0||E.sortable?(i.openBlock(),i.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):i.createCommentVNode("",!0),e.sortField===E.field?(i.openBlock(),i.createBlock(u,{key:1,class:i.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),icon:e.sortOrder,style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?E.hidden:!0})},null,8,["class","icon","style"])):i.createCommentVNode("",!0)],64))],8,Q0)],8,J0)),i.createElementVNode("span",{class:"column-resize",onMousedown:i.withModifiers(V=>o.onColumnResize(T,V),["stop","left"])},null,40,eC)],46,K0)):i.createCommentVNode("",!0)],64))),128)),(I=e.$props.option.customContextMenu)!=null&&I.length?(i.openBlock(),i.createElementBlock("li",{key:2,class:i.normalizeClass({column:!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):i.createCommentVNode("",!0)])],2),[[i.vShow,o.showHeader]]),i.createElementVNode("div",{ref:"body",class:i.normalizeClass({stripe:o.stripeStyle,"table-body":!0,"bottom-border":!!e.viewStore.length,"non-border":!!o.borderStyle}),onScroll:t[11]||(t[11]=(...E)=>o.onScroll&&o.onScroll(...E)),onContextmenu:t[12]||(t[12]=E=>o.onContextMenu(E))},[i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),i.createElementVNode("table",tC,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(E,T)=>{var V,C;return i.openBlock(),i.createElementBlock(i.Fragment,{key:o.idColIndex!=null?E[2][o.idColIndex]:T},[i.createElementVNode("tr",{"data-index":E[0],class:i.normalizeClass({row:!0,selected:E[3],highlight:E[0]===o.highlightIdx,"non-border":!!o.borderStyle&&o.borderStyle!=="rows"}),disabled:E[o.ROW_DISABLED_INDEX],onClick:S=>o.onRowClick(S,E),onContextmenu:S=>o.onRowClick(S,E,!0),onDblclick:S=>o.onRowDblClick(S,E)},[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("td",{key:0,class:i.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(h,{modelValue:E[1],"onUpdate:modelValue":S=>E[1]=S,class:"row-checkbox-input",disabled:E[5]||E[o.ROW_DISABLED_INDEX],onChange:S=>o.onCheck(S,E)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):i.createCommentVNode("",!0),e.useRowDetail?(i.openBlock(),i.createElementBlock("td",{key:1,class:i.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!o.borderStyle,"row-detail-toggle--expanded":E[4]}),style:i.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(a,{modelValue:E[4],"onUpdate:modelValue":S=>E[4]=S,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:i.withModifiers(S=>o.onExpanded(S,E),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(S,w)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`${o.idColIndex!=null?E[2][o.idColIndex]:T}-${w}`},[!S.hide&&!S.hiddenDisplay?(i.openBlock(),i.createElementBlock("td",{key:0,"data-name":S.field,"data-index":S.index,class:i.normalizeClass({cell:!0,render:o.isRenderer(S),[S.type]:S.type,[S.align]:S.align,[S.field]:S.field,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${S.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${o.isRenderer(S)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===w?"none":"1px solid #CFCFCF"}),disabled:E[o.ROW_DISABLED_INDEX]},[e.$slots[S.field]?(i.openBlock(),i.createElementBlock("div",iC,[i.renderSlot(e.$slots,S.field,{item:{row:E,column:S},disabled:E[o.ROW_DISABLED_INDEX]},void 0,!0)])):(i.openBlock(),i.createElementBlock("div",{key:1,title:o.getConvertValue(S,E[2][S.index])},i.toDisplayString(o.getConvertValue(S,E[2][S.index])),9,sC))],14,oC)):i.createCommentVNode("",!0)],64))),128)),(V=e.$props.option.customContextMenu)!=null&&V.length?(i.openBlock(),i.createElementBlock("td",{key:2,class:i.normalizeClass({"row-contextmenu":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${e.rowHeight}px`,"min-width":"30px","line-height":`${e.rowHeight}px`}),disabled:E[o.ROW_DISABLED_INDEX]},[e.$slots.contextmenuIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:E[o.ROW_DISABLED_INDEX],onClick:t[9]||(t[9]=S=>o.onContextMenu(S))},[i.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,aC)):(i.openBlock(),i.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:E[o.ROW_DISABLED_INDEX],onClick:t[10]||(t[10]=S=>o.onContextMenu(S))},null,8,["disabled"]))],14,lC)):i.createCommentVNode("",!0)],42,nC),e.useRowDetail&&((C=e.$slots)!=null&&C.rowDetail)&&E[4]?(i.openBlock(),i.createElementBlock("tr",rC,[i.createElementVNode("td",{colspan:E.length},[i.createElementVNode("div",{style:i.normalizeStyle({width:"100%",height:`${e.detailRowHeight}px`,"min-height":`${e.detailRowHeight}px`,"max-height":`${e.detailRowHeight}px`})},[i.renderSlot(e.$slots,"rowDetail",{item:{row:E}},void 0,!0)],4)],8,cC)])):i.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("tr",dC,[i.createElementVNode("td",hC,i.toDisplayString(o.emptyText),1)]))])],512),i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),i.createVNode(f,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),i.createVNode(f,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),i.createVNode(f,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),i.withDirectives(i.createElementVNode("div",uC,null,512),[[i.vShow,e.showResizeLine]])],2)],16)),[[y,o.onResize],[M,{callback:o.onShow,once:!0}]]),o.useSummary?(i.openBlock(),i.createBlock(g,{key:1,"ordered-columns":e.orderedColumns,stores:o.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:o.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":o.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):i.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(i.openBlock(),i.createBlock(p,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[13]||(t[13]=E=>e.currentPage=E),total:e.pageTotal,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):i.createCommentVNode("",!0),i.createVNode(m,{"is-show":e.isShowFilterSetting,"onUpdate:isShow":t[14]||(t[14]=E=>e.isShowFilterSetting=E),items:e.filteringItemsByColumn,"onUpdate:items":t[15]||(t[15]=E=>e.filteringItemsByColumn=E),column:e.filteringColumn,position:e.filterSettingPosition,onApplyFiltering:o.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),i.createVNode(x,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[16]||(t[16]=E=>e.isShowColumnSetting=E),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[17]||(t[17]=E=>e.isShowMenuOnClick=E),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:o.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const no=le(z0,[["render",fC],["__scopeId","data-v-22cd2bf6"]]);no.install=e=>{e.component(no.name,no)};var mC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mr={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(mC,function(){var n=1e3,o=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",f="quarter",g="year",p="date",m="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var R=["th","st","nd","rd"],v=O%100;return"["+O+(R[(v-20)%10]||R[v]||R[0])+"]"}},M=function(O,R,v){var N=String(O);return!N||N.length>=R?O:""+Array(R+1-N.length).join(v)+O},I={s:M,z:function(O){var R=-O.utcOffset(),v=Math.abs(R),N=Math.floor(v/60),L=v%60;return(R<=0?"+":"-")+M(N,2,"0")+":"+M(L,2,"0")},m:function O(R,v){if(R.date()<v.date())return-O(v,R);var N=12*(v.year()-R.year())+(v.month()-R.month()),L=R.clone().add(N,u),P=v-L<0,_=R.clone().add(N+(P?-1:1),u);return+(-(N+(v-L)/(P?L-_:_-L))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:u,y:g,w:h,d,D:p,h:c,m:r,s:a,ms:l,Q:f}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},E="en",T={};T[E]=y;var V="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[V])},S=function O(R,v,N){var L;if(!R)return E;if(typeof R=="string"){var P=R.toLowerCase();T[P]&&(L=P),v&&(T[P]=v,L=P);var _=R.split("-");if(!L&&_.length>1)return O(_[0])}else{var A=R.name;T[A]=R,L=A}return!N&&L&&(E=L),L||!N&&E},w=function(O,R){if(C(O))return O.clone();var v=typeof R=="object"?R:{};return v.date=O,v.args=arguments,new B(v)},k=I;k.l=S,k.i=C,k.w=function(O,R){return w(O,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var B=function(){function O(v){this.$L=S(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[V]=!0}var R=O.prototype;return R.parse=function(v){this.$d=function(N){var L=N.date,P=N.utc;if(L===null)return new Date(NaN);if(k.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var _=L.match(x);if(_){var A=_[2]-1||0,z=(_[7]||"0").substring(0,3);return P?new Date(Date.UTC(_[1],A,_[3]||1,_[4]||0,_[5]||0,_[6]||0,z)):new Date(_[1],A,_[3]||1,_[4]||0,_[5]||0,_[6]||0,z)}}return new Date(L)}(v),this.init()},R.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},R.$utils=function(){return k},R.isValid=function(){return this.$d.toString()!==m},R.isSame=function(v,N){var L=w(v);return this.startOf(N)<=L&&L<=this.endOf(N)},R.isAfter=function(v,N){return w(v)<this.startOf(N)},R.isBefore=function(v,N){return this.endOf(N)<w(v)},R.$g=function(v,N,L){return k.u(v)?this[N]:this.set(L,v)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(v,N){var L=this,P=!!k.u(N)||N,_=k.p(v),A=function(q,Q){var J=k.w(L.$u?Date.UTC(L.$y,Q,q):new Date(L.$y,Q,q),L);return P?J:J.endOf(d)},z=function(q,Q){return k.w(L.toDate()[q].apply(L.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(Q)),L)},$=this.$W,U=this.$M,H=this.$D,X="set"+(this.$u?"UTC":"");switch(_){case g:return P?A(1,0):A(31,11);case u:return P?A(1,U):A(0,U+1);case h:var j=this.$locale().weekStart||0,K=($<j?$+7:$)-j;return A(P?H-K:H+(6-K),U);case d:case p:return z(X+"Hours",0);case c:return z(X+"Minutes",1);case r:return z(X+"Seconds",2);case a:return z(X+"Milliseconds",3);default:return this.clone()}},R.endOf=function(v){return this.startOf(v,!1)},R.$set=function(v,N){var L,P=k.p(v),_="set"+(this.$u?"UTC":""),A=(L={},L[d]=_+"Date",L[p]=_+"Date",L[u]=_+"Month",L[g]=_+"FullYear",L[c]=_+"Hours",L[r]=_+"Minutes",L[a]=_+"Seconds",L[l]=_+"Milliseconds",L)[P],z=P===d?this.$D+(N-this.$W):N;if(P===u||P===g){var $=this.clone().set(p,1);$.$d[A](z),$.init(),this.$d=$.set(p,Math.min(this.$D,$.daysInMonth())).$d}else A&&this.$d[A](z);return this.init(),this},R.set=function(v,N){return this.clone().$set(v,N)},R.get=function(v){return this[k.p(v)]()},R.add=function(v,N){var L,P=this;v=Number(v);var _=k.p(N),A=function(U){var H=w(P);return k.w(H.date(H.date()+Math.round(U*v)),P)};if(_===u)return this.set(u,this.$M+v);if(_===g)return this.set(g,this.$y+v);if(_===d)return A(1);if(_===h)return A(7);var z=(L={},L[r]=o,L[c]=s,L[a]=n,L)[_]||1,$=this.$d.getTime()+v*z;return k.w($,this)},R.subtract=function(v,N){return this.add(-1*v,N)},R.format=function(v){var N=this,L=this.$locale();if(!this.isValid())return L.invalidDate||m;var P=v||"YYYY-MM-DDTHH:mm:ssZ",_=k.z(this),A=this.$H,z=this.$m,$=this.$M,U=L.weekdays,H=L.months,X=L.meridiem,j=function(Q,J,te,G){return Q&&(Q[J]||Q(N,P))||te[J].slice(0,G)},K=function(Q){return k.s(A%12||12,Q,"0")},q=X||function(Q,J,te){var G=Q<12?"AM":"PM";return te?G.toLowerCase():G};return P.replace(b,function(Q,J){return J||function(te){switch(te){case"YY":return String(N.$y).slice(-2);case"YYYY":return k.s(N.$y,4,"0");case"M":return $+1;case"MM":return k.s($+1,2,"0");case"MMM":return j(L.monthsShort,$,H,3);case"MMMM":return j(H,$);case"D":return N.$D;case"DD":return k.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return j(L.weekdaysMin,N.$W,U,2);case"ddd":return j(L.weekdaysShort,N.$W,U,3);case"dddd":return U[N.$W];case"H":return String(A);case"HH":return k.s(A,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return q(A,z,!0);case"A":return q(A,z,!1);case"m":return String(z);case"mm":return k.s(z,2,"0");case"s":return String(N.$s);case"ss":return k.s(N.$s,2,"0");case"SSS":return k.s(N.$ms,3,"0");case"Z":return _}return null}(Q)||_.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(v,N,L){var P,_=this,A=k.p(N),z=w(v),$=(z.utcOffset()-this.utcOffset())*o,U=this-z,H=function(){return k.m(_,z)};switch(A){case g:P=H()/12;break;case u:P=H();break;case f:P=H()/3;break;case h:P=(U-$)/6048e5;break;case d:P=(U-$)/864e5;break;case c:P=U/s;break;case r:P=U/o;break;case a:P=U/n;break;default:P=U}return L?P:k.a(P)},R.daysInMonth=function(){return this.endOf(u).$D},R.$locale=function(){return T[this.$L]},R.locale=function(v,N){if(!v)return this.$L;var L=this.clone(),P=S(v,N,!0);return P&&(L.$L=P),L},R.clone=function(){return k.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},O}(),D=B.prototype;return w.prototype=D,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",g],["$D",p]].forEach(function(O){D[O[1]]=function(R){return this.$g(R,O[0],O[1])}}),w.extend=function(O,R){return O.$i||(O(R,B,w),O.$i=!0),w},w.locale=S,w.isDayjs=C,w.unix=function(O){return w(1e3*O)},w.en=T[E],w.Ls=T,w.p={},w})})(Mr);var pC=Mr.exports;const at=gC(pC),si=document.createElement("canvas").getContext("2d"),Y={hexToRgb(e){if(!e)return!1;const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),n=parseInt(t[1],16),o=parseInt(t[2],16),s=parseInt(t[3],16);return`${n},${o},${s}`},getColorStringType(e){if(!e)return"";const t=e.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(t),o=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(t),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(t);let l="";return n?l="HEX":o?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(e,t=1){const n=e.replace(/ /g,""),o=this.getColorStringType(n);let s="";switch(o){case"HEX":s=`rgba(${this.hexToRgb(n)},${t})`;break;case"RGB":s=n.replace(")",`, ${t})`).replace("rgb","rgba");break;case"RGBA":s=n.replace(`${this.getOpacity(e)})`,`${t})`);break;default:s=`rgba(0, 0, 0, ${t})`;break}return s},getOpacity(e){const t=e==null?void 0:e.replace(/ /g,"");return this.getColorStringType(t)==="RGBA"?t.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(e){return Math.floor(Math.log(e)/Math.LN10)},aliasPixel(e){return e%2===0?0:.5},getLabelStyle(e){const{fontStyle:t="normal",fontWeight:n="normal",fontSize:o="12",fontFamily:s="Roboto"}=e;return`${t} normal ${n} ${o}px ${s}`},labelSignFormat(e,t=null){const n=ph(1),o=gh(1),s=mh(1),l=fh(1),a=1e3;let r;if(!ft(e))return e;const c=e<0,d=Math.abs(e),h=(u,f,g)=>{let p;return u%f===0?p=pt(t)?`${u/f}${g}`:`${(u/f).toFixed(t)}${g}`:p=`${(u/f).toFixed(1)}${g}`,c?`-${p}`:p};if(d>=n)r=h(d,n,"P");else if(d>=o)r=h(d,o,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const u=pt(t)?d:d.toFixed(t);r=c?`-${u}`:`${u}`}return r},calcTextSize(e,t,n=0){const o=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${t}; padding: 0 ${n}px`;o.setAttribute("style",s),o.style.font=t,o.textContent=e,document.body.appendChild(o);const l=o.getBoundingClientRect(),a=l.width||2,r=l.height||2;return o.remove(),{width:a,height:r}},calcTextSizeCanvas(e,t){if(!e)return{width:2,height:2};si.save(),si.font=t;const n=si.measureText(e),o=t.match(/(\d+(?:\.\d+)?)px/),l=(o?Number(o[1]):14)*1.2;return si.restore(),{width:Math.max(Math.ceil(n.width),2),height:Math.max(Math.ceil(l),2)}},getStringMinMax(e){const t={min:e[0],max:e[0]};return e.forEach(n=>{var o,s;((o=t==null?void 0:t.max)==null?void 0:o.length)<(n==null?void 0:n.length)&&(t.max=n),((s=t==null?void 0:t.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(t.min=n)}),t},truncateLabelWithEllipsis(e,t,n,o="right"){if(!e)return"";if(!t)return e;const s="…",l=n.measureText(s).width;let a=e,r=n.measureText(a).width;if(r<=t||r<=l)return e;let c=a.length;for(;r>=t-l&&c-- >0;)a=o==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return o==="right"?a+s:s+a},showLabelTip(e){const{ctx:t,width:n,height:o,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=e,u=s-n/2,f=s+n/2,g=l-o,p=l;t.beginPath(),t.save(),t.fillStyle=d||"#E96E2C",t.strokeStyle=d||"#E96E2C",t.shadowBlur=0,t.moveTo(u+r,g),t.quadraticCurveTo(u,g,u,g+r),t.lineTo(u,p-r),t.quadraticCurveTo(u,p,u+r,p),t.lineTo(f-r,p),t.quadraticCurveTo(f,p,f,p-r),t.lineTo(f,g+r),t.quadraticCurveTo(f,g,f-r,g),t.lineTo(s-a,g),t.lineTo(s,g-a),t.lineTo(s+a,g),t.lineTo(u+r,g),t.closePath(),t.fill(),t.restore(),t.save(),t.font="normal normal bold 12px Roboto",t.fillStyle=h||"#FFF",t.textBaseline="middle",t.textAlign="center",t.fillText(`${c}`,s,g+o/2),t.restore(),t.beginPath()},isPieType(e){return e==="pie"||e==="doughnut"||e==="sunburst"},isDoughnutHole(e){return e==="doughnut"||e==="sunburst"},setDOMStyle(e,t){var n;!e||!t||(n=Object.keys(t))==null||n.forEach(o=>{e.style[o]=t[o]})},checkSafeInteger(e){return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER},htmlToElement(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},isNullOrUndefined(e){return e==null},rgbaAdjustHalfOpacity(e){const t=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(t.test(e)){const[,o,s,l]=e.match(t);return`rgba(${o}, ${s}, ${l}, 0.5)`}if(n.test(e)){const[,o,s,l,a]=e.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${o}, ${s}, ${l}, ${r})`}return e.startsWith("#")&&e.length>7?e:`${e}80`}},yC={createDataSet(e,t){Object.keys(this.seriesInfo.charts).forEach(n=>{const o=this.seriesInfo.charts[n];o.length&&(n==="pie"?this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,o):n==="scatter"?o.forEach(s=>{const l=this.seriesList[s],a=e[s],r=l==null?void 0:l.passingValue;l&&a&&(l.data=this.addSeriesDSforScatter(a),l.minMax=this.getSeriesMinMax(l.data,r))}):n==="heatMap"?o.forEach(s=>{const l=this.seriesList[s],a=l==null?void 0:l.passingValue,r=e[s];l&&r&&(l.labels=t,l.data=this.addSeriesDSForHeatMap(r),l.minMax=this.getSeriesMinMax(l.data,a),l.valueOpt=this.getSeriesValueOptForHeatMap(l))}):o.forEach(s=>{var c,d;const l=this.seriesList[s],a=(c=e==null?void 0:e[s])==null?void 0:c.some(h=>h===l.passingValue);l.hasPassingValueInData=a;const r=(d=e==null?void 0:e[s])==null?void 0:d.map(h=>l.interpolation==="zero"&&!h?0:h===l.passingValue?null:h);l&&r&&(l.isExistGrp&&l.stackIndex&&!l.isOverlapping?l.data=this.addSeriesStackDS(r,t,l.bsIds,l.stackIndex):l.data=this.addSeriesDS(r,t,l.isExistGrp),l.minMax=this.getSeriesMinMax(l.data,l.passingValue))}))})},createRealTimeScatterDataSet(e){var o,s,l;const t=Object.keys(e),n={maxY:0,minY:1/0,fromTime:0,toTime:0};for(let a=0;a<t.length;a++){const r=t[a],c=e[r],d=c==null?void 0:c.length;if(!this.isInit||this.updateSeries||!this.dataSet[r]){const w={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0};this.dataSet[r]={...w,...this.dataSet[r]}}const h=this.dataSet[r],u=h.dataGroup,f=this.options.realTimeScatter.range||300,g=h.length!==f;h.length=f;const p=h.length;let m=0;for(let w=0;w<d;w++){const k=c[w];k&&m<k.x&&(m=k.x)}m=m?Math.floor(m/1e3)*1e3:0;const x=((l=(s=(o=u.at(-1))==null?void 0:o.data)==null?void 0:s.at(-1))==null?void 0:l.x)||Date.now(),b=Math.floor(x/1e3)*1e3,y=h.toTime||b,M=m||y;if(h.endIndex==null||g){h.startIndex=0,h.endIndex=p-1,u.length=p;for(let w=0;w<p;w++)u[w]=u[w]||{data:[],max:0,min:1/0},u[w].data.length=0,u[w].max=0,u[w].min=1/0;h.toTime=M,h.fromTime=h.toTime-p*1e3}const I=(M-y)/1e3,E=Number.isFinite(I)?Math.max(0,Math.floor(I)):0;if(h.toTime=M,h.fromTime=h.toTime-p*1e3,m&&(h.toTime-m)/1e3>p&&r==="")return;const T=w=>{w.data.length=0,w.max=0,w.min=1/0};for(let w=0;w<p;w++)u[w]?u[w].data||(u[w].data=[],u[w].max=0,u[w].min=1/0):u[w]={data:[],max:0,min:1/0};if(E>0)if(E>=p){for(let w=0;w<p;w++)T(u[w]);h.startIndex=0,h.endIndex=p-1}else{let w=h.startIndex,k=h.endIndex;for(let B=0;B<E;B++)T(u[w]),w=(w+1)%p,k=(k+1)%p;h.startIndex=w,h.endIndex=k}for(let w=0;w<d;w++){const k=c[w];if(k){const B=Math.floor(k.x/1e3)*1e3;if(h.fromTime<=B){let D=h.endIndex-(h.toTime-B)/1e3;D<0&&(D=p+D);const O=u[D];O.data.push({x:k.x,y:k.y,o:k.value??k.y,color:k.color}),O.max=Math.max(O.max,k.y),O.min=Math.min(O.min,k.y)}}}const V=1e3,C={maxY:0,minY:1/0};for(let w=0;w<p;w++){const k=u[w];for(let B=0;B<k.data.length;B++){const D=k.data[B],O=Math.floor(D.x/V)*V;O>=h.fromTime&&O<=h.toTime&&Number.isFinite(D.y)&&(D.y>C.maxY&&(C.maxY=D.y),D.y<C.minY&&(C.minY=D.y))}}Number.isFinite(C.minY)&&(n.maxY=Math.max(n.maxY,C.maxY),n.minY=Math.min(n.minY,C.minY)),n.fromTime=h.fromTime,n.toTime=h.toTime}Number.isFinite(n.minY)||(n.minY=0,n.maxY=1),this.seriesInfo.charts.scatter.forEach(a=>{const r=this.seriesList[a];r.data=this.dataSet,r.minMax={minX:at(n.fromTime),minY:n.minY,maxX:at(n.toTime),maxY:n.maxY}})},createSunburstDataSet(e){this.pieDataSet=[];const t=this.pieDataSet,n=[];for(let o=0;o<e.length;o++){const s=e[o],l=this.seriesList[s.id];let a=!1;if(t[0]||(t[0]={ir:0,or:0,total:0,data:[]}),l.show){if(t[0].total+=s.value||0,t[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(t[0].data.sort((o,s)=>s.value-o.value);n.length;){const o=n.shift(),s=o.parent,l=o.data,a=o.depth;let r=!1;t[a]||(t[a]={ir:0,or:0,total:{},data:[]}),t[a].total[s]||(t[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")t[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value;else if(c&&c.show){if(t[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}t[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(e,t){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},t.forEach(o=>{if(this.seriesList[o].show){const s=e[o][0]??0;n[0].total+=s,n[0].data.push({id:o,value:s,sa:0,ea:0})}}),n.forEach(o=>{o.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(e,t,n,o=0){const s=this.seriesList,l=this.options.horizontal,a=[],r=new Map,c=(h,u,f)=>{const g=`${h}-${u}-${f>=0?"pos":"neg"}`;if(r.has(g))return r.get(g);let p=0,m=h;for(;m>=0;){const x=s[n[m]];if(x!=null&&x.show){const b=x.data[u],y=l?b==null?void 0:b.x:b==null?void 0:b.y,M=b==null?void 0:b.o,I=!Y.isNullOrUndefined(x.passingValue)&&x.passingValue===M,E=f>=0&&M>=0||f<0&&M<0;if(y!=null&&!I&&E){p=y;break}}m--}return r.set(g,p),p},d=n.length-1;return e.forEach((h,u)=>{const f=Math.max(0,d);let g=c(f,u,h),p=h,m=t[u],x=h;if(g!=null&&m!=null){x&&typeof x=="object"&&("x"in x||"y"in x)&&(p=l?h.x:h.y,m=l?h.y:h.x);const b=(p==null?void 0:p.value)??p;o>0?b!=null?x=g+b:x=p:(g=0,x=b),a.push(this.addData(x,m,p,g))}}),a},addSeriesDS(e,t,n){var a;const o=this.options.horizontal,s=[],l=(a=this.seriesList[Object.keys(this.seriesList)[0]])==null?void 0:a.passingValue;return e.forEach((r,c)=>{let d=r,h=t[c];if(d&&typeof d=="object"&&(r.x||r.y)&&(d=o?r.x:r.y,h=o?r.y:r.x),h!==null){const u=n&&!Y.isNullOrUndefined(l)&&d===l;s.push(this.addData(u?0:d,h,d))}}),s},addSeriesDSforScatter(e){return e.map(t=>{const n=t.x,o={value:t.y,color:(t==null?void 0:t.color)||null};return this.addData(o,n,o)})},addSeriesDSForHeatMap(e){return e.map(({x:t,y:n,value:o,color:s=null})=>({x:t,y:n,o,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(e,t,n=null,o=null){let s,l=null,a=null,r=null,c=null,d=null;return e!==null&&typeof e=="object"?(l=e.value,r=e.color,d=e.textColor):l=e??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null,this.options.horizontal?s={x:l,y:t,o:a,b:o}:s={x:t,y:l,o:a,b:o},s.xp=null,s.yp=null,s.w=null,s.h=null,s.dataColor=r??c,s.dataTextColor=d,s},getSeriesMinMax(e,t){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},o=this.options.horizontal;if(e.length){const s=!Y.isNullOrUndefined(t);return e.reduce((l,a,r)=>{var f,g,p;const c=l,d=((f=a.x)==null?void 0:f.value)||a.x,h=((g=a.y)==null?void 0:g.value)||a.y,u=((p=a.o)==null?void 0:p.value)||a.o;return(s?u!==t&&d<=c.minX:d<=c.minX)&&(c.minX=d===null?0:d),(s?u!==t&&h<=c.minY:h<=c.minY)&&(c.minY=h===null?0:h),(s?u!==t&&d>=c.maxX:d>=c.maxX)&&(c.maxX=d===null?0:d,o&&d!==null&&(c.maxDomain=h,c.maxDomainIndex=r)),(s?u!==t&&h>=c.maxY:h>=c.maxY)&&(c.maxY=h===null?0:h,!o&&h!==null&&(c.maxDomain=d,c.maxDomainIndex=r)),c},{minX:e[0].x,minY:e[0].y,maxX:e[0].x,maxY:e[0].y,maxDomain:o?e[0].y:e[0].x,maxDomainIndex:0})}return n},getSeriesValueOptForHeatMap(e){const{data:t,colorState:n,isGradient:o}=e,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;t.forEach(({o:u})=>{c<u&&(c=Math.max(c,u)),u<0?d=!0:r===void 0?r=u:r=Math.min(r,u)}),d&&!o&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(e){if(e<0)return!1;const t=Object.keys(this.seriesList),n=!!this.options.horizontal;let o=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(e>-1){for(let h=0;h<t.length;h++){const u=t[h],f=this.seriesList[u],g=f.data[e];if(g&&f.show&&f.showLegend){const p=n?g.y:g.x,m=n?g.yp:g.xp;if(p!=null){const x=n?g.o||g.x:g.o||g.y;f.stackIndex?(r+=isNaN(g.o)?0:g.o,c=!0):r+=g.y,(l===null||l<=x)&&(l=x,a=u,o=p,s=m)}}}d={label:o,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:e}}return d},getItem(e,t=!1){const{seriesID:n,dataIndex:o}=e;let s;if("seriesID"in e){const l=this.getDataByValues(n,o);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getItemByPosition([l.xp,l.yp],t,o,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=o==null?void 0:o.map(r=>{const c=this.getDataByValues(a,r);return c?this.getItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0):null})}return s},getDataByValues(e,t){const n=this.seriesList[e];return!n||isNaN(t)||t<0||(n==null?void 0:n.data.length)<=t?!1:n.data[t]},getItemByPosition(e,t=!1,n,o=!1){const s=Object.keys(this.seriesList),l=!!this.options.horizontal;let a=null,r=null,c=null,d=null,h="",u=0,f=!1,g=null;for(let p=0;p<s.length;p++){const m=s[p],x=this.seriesList[m],b=t?x.findApproximateData:x.findGraphData;if(b){const y=b.call(x,e,l,n,o),M=y.data,I=y.index;if(M)if(Y.isPieType(y.type))r=m,h=m,c=(M.ea-M.sa)/2,d=M.o,g=M.index,a=y.type;else{const E=l?M.y:M.x,T=l?M.yp:M.xp;if(E!=null){const V=l?M.o||M.x:M.o||M.y;x.stackIndex!=null?(u+=isNaN(M.o)?0:M.o,f=!0):u+=M.y,a==="bar"&&f?y.hit&&(d=V,h=m,g=I,r=E,c=T,a=x.type):(d===null||d<=V)&&(d=V,h=m,r=E,c=T,g=I,a=x.type)}}}}return{type:a,label:r,pos:c,value:d??0,sId:h,acc:u,useStack:f,maxIndex:g}},getLabelInfoByPosition(e,t){var m,x,b;const[n,o]=e,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((m=Object.values(l).sort((y,M)=>M.pointSize??0-y.pointSize??0)[0])==null?void 0:m.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;t==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):t==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const u=s[d.units.rectStart],f=s[d.units.rectEnd];let g,p;if(h!=null&&h.use&&((x=d==null?void 0:d.labels)!=null&&x.length)){const{type:y,range:M,interval:I=1}=h,[E,T]=M??[0,d.labels.length],V=Math.floor((+T-+E)/I)+1,C=(f-u)/V,w=Math.floor(((t==="yAxis"||r?o:n)-u)/C);y==="step"?g=E+w:g=(d==null?void 0:d.labels.findIndex(B=>B===+E))+w}else if((b=d==null?void 0:d.labels)!=null&&b.length){const y=(f-u)/d.labels.length,I=Math.floor(((t==="yAxis"?o:n)-u)/y);g=d.labels.length>I?I:-1}else{let y,M;n<u-a?(y=u,M=0):n>f+a?(y=f,M=this.data.labels.length-1):y=n,p=this.getItemByPosition([y,o],c==null?void 0:c.useApproximateValue,M,!0),g=p.maxIndex??-1}return{labelIndex:g,hitInfo:p}},getCurMouseLabelVal(e,t,n){const{type:o,horizontal:s}=this.options,l=e==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(o){case"bar":case"line":{u=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{u=this.data.labels[a][n];break}}return u},h=()=>{let u="";const f={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:g,interval:p,graphMin:m}=this.axesSteps[a][0],{width:x,height:b}=this.axesRange[a][0].size,y=l?this.axesX:this.axesY,M=f[y[0].units.rectStart],I=f[y[0].units.rectEnd],E=Math.abs(t[l?0:1]-M),T=(l?x:b)/2,V=Math.abs(M-I)/g,C=Math.floor((E+T)/V);return V*C+T>E&&V*C-T<E&&(u=C*p+m),u};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const e=Object.keys(this.seriesList),t=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return e.length?e.reduce((o,s)=>{const l=o,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){t?((l.x[c].min===null||r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,u=l.x[c].max<0;(h&&u||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const f=l.y[d].max<0;(h&&f||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const e=this.pieDataSet;let t,n,o,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let f=0;f<e.length;f++){const g=e[f];d=!0;for(let p=0;p<g.data.length;p++)if(t=g.data[p],n=t.value,d&&(d=t.id==="dummy"),!f)a=u["$ev-root"],l=2*Math.PI*(n/g.total),r=a+l,t.sa=a,t.ea=r,u["$ev-root"]+=l;else{if(o=this.getParentInfo(f-1,t.parent),!o)break;u[t.parent]||(u[t.parent]=o.sa),a=u[t.parent],c=o.ea-o.sa,s=g.total[t.parent]||0,l=c*(n/s),r=a+l,t.sa=a,t.ea=r,u[t.parent]+=l}d&&h.push(f)}for(let f=0;f<h.length;f++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=Fp(this.pieDataSet))},getParentInfo(e,t){for(let n=e;n>=0;n--){const o=this.pieDataSet[n];for(let s=0;s<o.data.length;s++)if(o.data[s].id===t)return o.data[s]}return null},getAggregations(){const e=this.data.data,t=this.data.series,n={},o=Object.keys(t);return o==null||o.forEach(s=>{const l=e[s].map(f=>f!=null&&f.value?f.value:f),a=l[l.length-1],r=l.filter(f=>f!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((f,g)=>f+g,0),u=h/r.length||0;(!Y.checkSafeInteger(c)||!Y.checkSafeInteger(d)||!Y.checkSafeInteger(u)||!Y.checkSafeInteger(h)||!Y.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:u,total:h,last:a}}),n}},xC={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:e=>e==="top"?"y2":"y1",rectOffset:e=>e==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:e=>e==="left"?"x2":"x1",rectOffset:e=>e==="left"?"x1":"x2"}},Vt=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],Er={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},bC={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},CC={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Ir={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},lastLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},vr={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null},Tr={color:"#FF0000",lineWidth:1,label:vr},Br={color:"#FAE59D"},SC={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},li={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},Vs=Object.freeze([1,2,2.5,5,10]),ie={calculateX(e,t,n,o,s=0){if(e==null||e>n||e<t)return null;const l=o/(n-t);return Math.ceil(s+l*(e-t))},calculateSubX(e,t,n,o,s=0){if(e==null)return null;const l=o/(n-t);return Math.ceil(s+l*(e-t))},calculateY(e,t,n,o,s=0){let l;if(e==null||e>n||e<t)return null;const a=o/(n-t);return s?l=s-a*(e-(t||0)):l=-(a*(e-(t||0))),Math.floor(l)},drawPoint(e,t,n,o,s){let l,a,r,c,d;if(isNaN(n)||n<=0)return;let h,u,f,g;switch(t){case"triangle":e.beginPath(),l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,e.moveTo(o-l/2,s+c/3),e.lineTo(o+l/2,s+c/3),e.lineTo(o,s-2*c/3),e.closePath(),e.fill();break;case"rect":d=1/Math.SQRT2*n,e.beginPath(),e.fillRect(o-d,s-d,2*d,2*d),e.strokeRect(o-d,s-d,2*d,2*d);break;case"rectRounded":h=n/Math.SQRT2,u=o-h,f=s-h,g=Math.SQRT2*n,e.beginPath(),this.roundedRect(e,u,f,g,g,n/2),e.closePath(),e.fill();break;case"rectRot":d=1/Math.SQRT2*n,e.beginPath(),e.moveTo(o-d,s),e.lineTo(o,s+d),e.lineTo(o+d,s),e.lineTo(o,s-d),e.closePath(),e.fill();break;case"cross":e.beginPath(),e.moveTo(o,s+n),e.lineTo(o,s-n),e.moveTo(o-n,s),e.lineTo(o+n,s),e.closePath();break;case"crossRot":e.beginPath(),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(o-a,s-r),e.lineTo(o+a,s+r),e.moveTo(o-a,s+r),e.lineTo(o+a,s-r),e.closePath();break;case"star":e.beginPath(),e.moveTo(o,s+n),e.lineTo(o,s-n),e.moveTo(o-n,s),e.lineTo(o+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(o-a,s-r),e.lineTo(o+a,s+r),e.moveTo(o-a,s+r),e.lineTo(o+a,s-r),e.closePath();break;case"line":e.beginPath(),e.moveTo(o-n,s),e.lineTo(o+n,s),e.closePath();break;default:e.beginPath(),e.arc(o,s,n,0,Math.PI*2),e.closePath(),e.fill();break}e.stroke()},roundedRect(e,t,n,o,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,o/2),d=t+c,h=n+c,u=t+o-c,f=n+s-c;e.moveTo(t,h),d<u&&h<f?(e.arc(d,h,c,-a,-r),e.arc(u,h,c,-r,0),e.arc(u,f,c,0,r),e.arc(d,f,c,r,a)):d<u?(e.moveTo(d,n),e.arc(u,h,c,-r,r),e.arc(d,h,c,r,a+r)):h<f?(e.arc(d,h,c,-a,0),e.arc(d,f,c,0,a)):e.arc(d,h,c,-a,a),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,s)},createGradient(e,t,n,o,s,l){const{x:a,y:r,w:c,h:d}=n;let h;t?h=e.createLinearGradient(a,0,a+c,0):h=e.createLinearGradient(0,r,0,r+d);for(let u=0;u<o.length;u++){const f=o[u][0]??0,g=o[u][1]??"rgba(255, 255, 255, 0)",p=g.includes("rgba")?Y.getOpacity(g):1,m=s?l:p;h.addColorStop(f,Y.colorStringToRgba(g,m))}return h}};class wC{constructor(t,n,o){const s=Fe({},n,Er);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${o}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Vt[o%Vt.length])}),this.type="line",this.sId=t,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}draw(t){var P,_,A,z,$,U,H;if(!this.show)return;const{ctx:n,chartRect:o,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h}=t,u=a==null?void 0:a.option,f=(u==null?void 0:u.use)&&(u==null?void 0:u.useSeriesOpacity),g=((P=a==null?void 0:a.selected)==null?void 0:P.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((_=r==null?void 0:r.option)!=null&&_.use&&((z=(A=r==null?void 0:r.selected)==null?void 0:A.seriesId)!=null&&z.length)){const X=(U=($=r==null?void 0:r.selected)==null?void 0:$.seriesId)==null?void 0:U.includes(this.sId);p=this.extent[X?"highlight":"downplay"]}else f&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const m=X=>X!=null&&X.includes("rgba")?Y.getOpacity(X):p.opacity,x=this.color,b=m(x),y=this.pointFill,M=m(y),I=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,E=this.lineWidth*p.lineWidth;n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=E,n.strokeStyle=Y.colorStringToRgba(x,b),this.segments&&n.setLineDash(this.segments);const T=this.useLinearInterpolation();let V=0;const C=l.x[this.xAxisIndex],S=l.y[this.yAxisIndex];let w=o.chartWidth-(s.left+s.right);const k=o.chartHeight-(s.top+s.bottom);this.combo&&(V=w/(this.data.length||1),w-=V,this.size.comboOffset=V);const B=o.x1+s.left+V/2,D=o.y2-s.bottom,O=X=>{const j=Math.min(Math.max(X,C.graphMin),C.graphMax);return ie.calculateX(j,C.graphMin,C.graphMax,w,B)},R=X=>{const j=Math.min(Math.max(X,S.graphMin),S.graphMax);return ie.calculateY(j,S.graphMin,S.graphMax,k,D)},v=this.data.some(X=>X.o<0),N=v?R(0):o.y2-s.bottom;let L;if(this.data.forEach(X=>{let j=O(X.x),K=R(X.y);this.isExistGrp&&T&&X.o===null&&(K=R(X.b??0)),j!==null&&(j+=Y.aliasPixel(j)),X.xp=j,X.yp=K,!(T&&X.o===null)&&(pt(L==null?void 0:L.y)&&!this.isExistGrp||!T&&(pt(L==null?void 0:L.y)||pt(X.o))?n.moveTo(j,K):n.lineTo(j,K),L=X)}),n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const X=Y.colorStringToRgba(this.fillColor||x,I);if((H=this.fill)!=null&&H.gradient){let J=this.data[0].yp,te=this.data[0].y;this.data.forEach(Z=>{Z.yp&&Z.yp<=J?J=Z.yp:Z.y&&Z.y>=te&&(te=Z.y)});const G=n.createLinearGradient(0,o.y2,0,J),oe=p.opacity<1?X:x;G.addColorStop(0,v?oe:X),G.addColorStop(.5,X),G.addColorStop(1,oe),n.fillStyle=G}else n.fillStyle=X;let j=null,K=null;const q=this.data.map(J=>J==null?void 0:J.o),Q=[];for(let J=0;J<q.length+1;J++)if(T&&_p(q[J])||!T&&pt(q[J])){if(j!==null&&K!==null){const G=q.slice(j,J).findLastIndex(oe=>!pt(oe)&&oe!==null);Q.push([j,j+G]),j=null,K=null}}else T&&q[J]===null||(j=j===null?J:j),K=J;Q.forEach(([J,te])=>{if(J===te){const G=this.data[J];n.moveTo(G.xp-E,G.yp),n.lineTo(G.xp+E,G.yp),n.lineTo(G.xp+E,R(G.b)??N),n.closePath();return}for(let G=J;G<=te;G++){const oe=this.data[G];if(G===J?n.moveTo(oe.xp,oe.yp):oe.o!==null&&n.lineTo(oe.xp,oe.yp),G===te){for(let Z=te;Z>=J;Z--){const ae=this.data[Z],me=O(ae.x);if(ae.o!==null){const re=R(ae.b)??R(0);n.lineTo(me,re)}}n.closePath()}}}),n.fill()}if(!d){n.strokeStyle=Y.colorStringToRgba(x,b);const X=Y.colorStringToRgba(y,1),j=Y.colorStringToRgba(y,M),K=this.interpolation==="linear"&&this.data.filter(q=>q.o!==null).length===1;this.data.forEach((q,Q)=>{var Z,ae;if(q.xp===null||q.yp===null||q.o===null)return;const J=(Z=this.data[Q-1])==null?void 0:Z.o,te=(ae=this.data[Q+1])==null?void 0:ae.o,G=!T&&pt(J)&&pt(te)||K,oe=g.includes(Q);(this.point||G||oe)&&(n.fillStyle=oe&&!c?X:j,ie.drawPoint(n,this.pointStyle,this.pointSize,q.xp,q.yp))})}n.restore()}itemHighlight(t,n){const o=t.data,s=n,{xp:l,yp:a,o:r}=o;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=Y.colorStringToRgba(this.color,0),s.fillStyle=Y.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),ie.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,ie.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ie.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(t,n,o,s){var h;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this.data.filter(u=>!Y.isNullOrUndefined(u.x)),d=this.useLinearInterpolation();if(c!=null&&c.length)if(typeof o=="number"&&this.show){if(r.data=c[o],r.index=o,r.data){const u=c[o];Math.abs(a-u.yp)<=15&&(r.hit=!0)}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let u=1/0,f=-1;const g=[];c.forEach((b,y)=>{b.xp!==null&&b.yp!==null&&b.o!==null&&g.push({...b,originalIndex:y})}),g.length===0&&c.forEach((b,y)=>{g.push({...b,originalIndex:y})});let p=0,m=g.length-1;for(;p<=m;){const b=Math.floor((p+m)/2),y=g[b],M=Math.abs(l-y.xp);if(M<u&&(u=M,f=y.originalIndex),y.xp<l){if(p=b+1,p<g.length){const I=Math.abs(l-g[p].xp);I<u&&(u=I,f=g[p].originalIndex)}}else if(y.xp>l){if(m=b-1,m>=0){const I=Math.abs(l-g[m].xp);I<u&&(u=I,f=g[m].originalIndex)}}else break}const x=g.findIndex(b=>b.originalIndex===f);if(x!==-1)for(let b=Math.max(0,x-2);b<=Math.min(g.length-1,x+2);b++){const y=g[b],M=Math.abs(l-y.xp);M<u&&(u=M,f=y.originalIndex)}if(f!==-1){let b=50;if(c.length>1){const M=[];for(let I=1;I<c.length;I++)c[I].xp!==null&&c[I-1].xp!==null&&M.push(Math.abs(c[I].xp-c[I-1].xp));M.length>0&&(b=M.reduce((I,E)=>I+E,0)/M.length)}const y=Math.max(b,1);if(u<=y)r.data=c[f],r.index=f;else{let M=!1,I=d?1/0:y;const E=d?g:c;for(let T=0;T<E.length;T++){const V=Math.abs(l-E[T].xp);V<=I&&(M=!0,I=V,f=d?E[T].originalIndex:T)}M&&(r.data=c[f],r.index=f)}if(r.data){const M=c[f];Math.abs(a-M.yp)<=15&&(r.hit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((h=r==null?void 0:r.data)==null?void 0:h.o)===null&&(r.data=null),r}findApproximateData(t){var f,g;const n=t[0],o=t[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(p=>!Y.isNullOrUndefined(p.x));if(!l.length)return s;const a=l.length>1?Math.abs(((f=l[1])==null?void 0:f.xp)-((g=l[0])==null?void 0:g.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const p=Math.floor((c+d)/2),m=l[p].xp;if(m-r<=n&&n<=m+r){const x=Math.max(0,p-2),b=Math.min(l.length-1,p+2);for(let y=x;y<=b;y++)if(l[y].xp!==null&&l[y].yp!==null){const M=Math.sqrt((n-l[y].xp)**2+(o-l[y].yp)**2);M<u&&(u=M,h=y)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(m+r<n){if(p<d&&n<l[p+1].xp){const x=Math.abs(l[p].xp-n),b=Math.abs(l[p+1].xp-n);s.data=x>b?l[p+1]:l[p],s.index=x>b?p+1:p;const y=s.data;return Math.abs(o-y.yp)<10&&(s.hit=!0),s}c=p+1}else{if(p>0&&n>l[p-1].xp){const x=Math.abs(l[p-1].xp-n),b=Math.abs(l[p].xp-n);s.data=x>b?l[p]:l[p-1],s.index=x>b?p:p-1;const y=s.data;return Math.abs(o-y.yp)<10&&(s.hit=!0),s}d=p-1}}return s}findItems({xsp:t,width:n}){const o=t+n;return this.data.filter(s=>t-1<=s.xp&&s.xp<=o+1)}}class kC{constructor(t,n,o,s=!1){const l=ys({},Er,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${o}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Vt[o%Vt.length])}),this.sId=t,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(t,n){const o=`${t}_${n}`;if(this._colorCache.has(o))return this._colorCache.get(o);const s=Y.colorStringToRgba(t,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(o,s),s}draw(t){this.show&&(this.realTimeScatter?this.realTimeScatterDraw(t):this.defaultScatterDraw(t))}getOpacity(t,n,o){const s=n.includes("rgba")?Y.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=t;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==o),l?c:s}calcItem(t,n){const{chartRect:o,labelOffset:s,axesSteps:l,displayOverflow:a}=n;let r;const c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex],h=o.chartWidth-(s.left+s.right),u=o.chartHeight-(s.top+s.bottom),f=o.x1+s.left,g=o.y2-s.bottom;let p=ie.calculateX(t.x,c.graphMin,c.graphMax,h,f);const m=ie.calculateY(a&&t.y>d.graphMax?d.graphMax:t.y,d.graphMin,d.graphMax,u,g);p!==null&&(r=Y.aliasPixel(p),p+=r),t.xp=p,t.yp=m}defaultScatterDraw(t){const{ctx:n,axesSteps:o,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=o.y[this.yAxisIndex];for(let c=0;c<this.data.length;c++){const d=this.data[c],h=c,u=a!==!1;let f;if(l?f=l.sId===this.sId:u?f=s.get(`${d.x}${d.y}`)===this.sId:f=!0,f&&(this.calcItem(d,t),d.xp!==null&&d.yp!==null)){const p=d.y>r.graphMax&&this.overflowColor||d.dataColor||this.color,m=this.getOpacity(t,p,h);n.strokeStyle=this.getCachedColor(p,m);const x=d.dataColor||this.pointFill,b=this.getOpacity(t,x,h);n.fillStyle=this.getCachedColor(x,b),ie.drawPoint(n,this.pointStyle,this.pointSize,d.xp,d.yp)}}}realTimeScatterDraw(t){var u,f,g,p,m,x;const{ctx:n,axesSteps:o,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=o.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;for(let b=0;b<((f=(u=this.data[this.sId])==null?void 0:u.dataGroup)==null?void 0:f.length);b++)for(let y=0;y<((p=(g=this.data[this.sId])==null?void 0:g.dataGroup[b])==null?void 0:p.data.length);y++){const M=(x=(m=this.data[this.sId])==null?void 0:m.dataGroup[b])==null?void 0:x.data[y];h++;const I=a!==!1;let E;if(l?E=l.sId===this.sId:I?E=s.get(`${M.x}${M.y}`)===this.sId:E=!0,E&&(this.calcItem(M,t),M.xp!==null&&M.yp!==null)){const T=M.y>r.graphMax&&this.overflowColor,V=T||M.color||this.color,C=T||M.color||this.pointFill||this.color,S=this.getOpacity(t,V,y),w=this.getOpacity(t,C,y);n.strokeStyle=this.getCachedColor(V,S),n.fillStyle=this.getCachedColor(C,w),ie.drawPoint(n,c,d,M.xp,M.yp)}}this._rtTotalCount=h}findItemsInRange(t,n,o,s,l){return t.filter(a=>n-1<=a.xp&&a.xp<=s+1&&o-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(t,n,o,s,l){return this.findItemsInRange(t,n,o,s,l)}realTimeScatterFindItems(t,n,o,s,l){const a=[];for(let r=0;r<t[this.sId].dataGroup.length;r++){const c=t[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,o,s,l))}return a}findItems({xsp:t,ysp:n,width:o,height:s}){const l=this.data,a=t+o,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,t,n,a,r):c=this.defaultScatterFindItems(l,t,n,a,r),c}itemHighlight(t,n){const o=t.data,s=n,l=o.xp,a=o.yp;if(s.save(),l!==null&&a!==null){const r=o.dataColor||this.color,c=o.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),ie.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,ie.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ie.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(t){var c;const n=t[0],o=t[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let u=this._rtTotalCount-1;for(let f=d.length-1;f>=0;f--){const g=d[f];if(g!=null&&g.data)for(let p=g.data.length-1;p>=0;p--){const m=g.data[p];if(m.xp!==null&&m.yp!==null){const x=m.xp,b=m.yp;if(x-l<=n&&n<=x+l&&b-l<=o&&o<=b+l)return s.data=m,s.index=u,s.hit=!0,s}u--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,u=d.yp;return h-l<=n&&n<=h+l&&u-l<=o&&o<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class Dr{constructor(t,n,o,s){const l=Fe({},n,bC);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Vt[o%Vt.length]),this.type="bar",this.sId=t,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}draw(t){var z,$,U,H,X;if(!this.show)return;const{isHorizontal:n,showValue:o}=this,s=t.ctx,l=t.chartRect,a=t.labelOffset,r=t.axesSteps,c=t.showIndex,d=t.thickness,h=t.showSeriesCount;let u,f;const g=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let m=this.data.length;const[x,b]=n?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];ve(x)&&ve(b)&&(m=b-x+1);const y=l.chartWidth-(a.left+a.right),M=l.chartHeight-(a.top+a.bottom),I=l.x1+a.left,E=l.y2-a.bottom,T=ie.calculateX(0,g.graphMin,g.graphMax,y),V=ie.calculateY(0,p.graphMin,p.graphMax,M),C=n?I+T:I,S=n?E:E+V,w=n?M:y,k=w/(m||1);let B;t.cPadRatio>=1||t.cPadRatio<=0?B=2:B=Math.max(w*(t.cPadRatio/2)/m,2);let O,R,v;O=k>B*2?k-B*2:k,O=this.isExistGrp?O:O/h;const N=this.calculateBarSize(d,O);R=n?null:N,v=n?N:null;const L=n?(O-v)/2:(O-R)/2,P=this.isExistGrp?1:c+1;this.size.cat=k,this.size.bar=O,this.size.cPad=B,this.size.bPad=L,this.size.w=R,this.size.h=v,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=t.borderRadius,this.filteredCount=m;const _=ve(x)?x:0,A=ve(b)?b:this.data.length-1;this.visibleStartIndex=_;for(let j=_;j<=A;j++){const K=j-_,q=this.data[j];if(q){const Q=n?S-k*K-B:C+k*K+B;if(n?(u=C,f=Math.round(Q-(O*P-(v+L)))):(u=Math.round(Q+(O*P-(R+L))),f=S),n){const ue=q.b?q.o:q.x,ke=Math.min(Math.max(ue,g.graphMin),g.graphMax);if(R=ie.calculateX(ke,g.graphMin,g.graphMax,y,-T),q.b){const ct=Math.min(Math.max(q.b,g.graphMin),g.graphMax);u=ie.calculateX(ct,g.graphMin,g.graphMax,y,C-T)}const rt=ue>0?-1:1;R=ue&&Math.abs(R)===0?rt:R}else{const ue=q.b?q.o:q.y,ke=Math.min(Math.max(ue,p.graphMin),p.graphMax);if(v=ie.calculateY(ke,p.graphMin,p.graphMax,M,-V),q.b){const ct=Math.min(Math.max(q.b,p.graphMin),p.graphMax);f=ie.calculateY(ct,p.graphMin,p.graphMax,M,S-V)}const rt=ue>0?-1:1;v=ue&&Math.abs(v)===0?rt:v}const J=q.dataColor||this.color,te=t==null?void 0:t.legendHitInfo,G=(z=t==null?void 0:t.selectLabel)==null?void 0:z.option,oe=($=t==null?void 0:t.selectItem)==null?void 0:$.option,Z=((H=(U=t==null?void 0:t.selectLabel)==null?void 0:U.selected)==null?void 0:H.dataIndex)??[],{dataIndex:ae,seriesID:me}=((X=t==null?void 0:t.selectItem)==null?void 0:X.selected)??{};let re=!1;if(te?re=(te==null?void 0:te.sId)!==this.sId:G!=null&&G.use&&(G!=null&&G.useSeriesOpacity)?re=Z.length&&!Z.includes(j):ft(ae)&&(oe!=null&&oe.useSeriesOpacity)&&(this.isExistGrp?re=ae!==j:re=ae!==j||me!==this.sId),typeof J!="string")s.fillStyle=ie.createGradient(s,n,{x:u,y:f,w:R,h:v},J,re,t.unSelectedOpacity);else{const ue=J.includes("rgba")?Y.getOpacity(J):1,ke=re?t.unSelectedOpacity:ue;s.fillStyle=Y.colorStringToRgba(J,ke)}this.drawBar({ctx:s,positions:{x:u,y:f,w:R,h:v}}),o.use&&this.drawValueLabels({context:s,data:q,positions:{x:u,y:f,h:v,w:R},isHighlight:!1,textColor:q.dataTextColor,index:j}),q.xp=u,q.yp=f,q.w=R,q.h=n?-v:v,q.index=j}}}itemHighlight(t,n,o,s){const l=this.showValue,a=t.data,r=n,c=a.xp,d=a.yp,h=a.w,u=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const f=t.data.dataColor||this.color;if(typeof f!="string"){const g=ie.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},f,!1,s);r.fillStyle=g,r.shadowColor=f[f.length-1][1]}else r.fillStyle=f,r.shadowColor=f;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-u:u}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:u,w:h},isHighlight:!0,textColor:t.data.dataTextColor||t.dataTextColor,index:o}),r.restore()}findGraphData(t,n,o,s){if(typeof o=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(o,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(t,l[d])),a}return n?this.findGraphRangeCount(t):this.findGraphRange(t)}binarySearchBar(t,n){const[o,s]=t,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=r+c-1;for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u],{xp:g,yp:p,w:m,h:x}=f,b=g+m,y=p+x;if(n?y<=s&&s<=p:g<=o&&o<=b)return l.data=f,l.index=f.index,l.hit=this.isPointInBar(t,f),l;(n?!(y<s):g+4<o)?d=u+1:h=u-1}return l}findGraphRange(t){return this.binarySearchBar(t,!1)}findGraphRangeCount(t){return this.binarySearchBar(t,!0)}drawValueLabels({context:t,data:n,positions:o,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:f}=this.showValue,{x:g,y:p,w:m,h:x}=o,b=t;b.save(),b.beginPath(),b.font=`normal normal normal ${c}px Roboto`,b.fillStyle=l||d,b.lineWidth=1,b.textBaseline="middle",b.textAlign=r&&h!=="center"?"left":"center";let y;const M=ft(this.stackIndex);M?y=n.o:y=(r?n.x:n.y)??"";let I;u&&(I=u(y,{label:r?n.y:n.x,index:a})),(!u||typeof I!="string")&&(I=Y.labelSignFormat(y,f)??"");const E=y<0,T=Math.round(b.measureText(I).width),V=c,C=10,S=E?g-C:g+C,w=E?p+C:p-C,k=g+m/2,B=s?p+x/2:p-x/2,D=Math.abs(m)-C,O=Math.abs(x)-C;switch(h){case"start":{if(r&&T<D){const R=E?S-T:S;b.fillText(I,R,B)}else if(!r&&V<O){const R=E?p+C:p-C;b.fillText(I,k,R)}break}case"center":{r&&T<D?b.fillText(I,k,B):!r&&V<O&&b.fillText(I,k,p+x/2);break}case"out":{if(M){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const R=this.chartRect.x1+this.labelOffset.left,v=this.chartRect.x2-this.labelOffset.right;if(E){const N=g-C+m-T;N>R&&b.fillText(I,N,B)}else{const N=g+C+m;N+T<v&&b.fillText(I,N,B)}}else{const R=E?p+x+C:p+x-C;b.fillText(I,k,R)}break}default:case"end":{if(r&&T<D){const R=E?g+m+C:g+m-T-C;b.fillText(I,R,B)}else if(!r){if(E){const R=p+x-C;R>w&&b.fillText(I,k,R)}else if(V<O){const R=p+x+C;b.fillText(I,k,R)}}break}}b.restore()}calculateBarSize(t,n){return typeof t=="string"&&/[0-9]+px/.test(t)?Math.min(n,Number(t.replace("px",""))):typeof t=="number"&&t<=1&&t>=0?Math.ceil(n*t):n}drawBar({ctx:t,positions:n}){const{isHorizontal:o,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=o?-n.h:n.h;if(!(d===0||h===0)){if(t.save(),a&&!l)try{this.drawRoundedRect(t,n)}catch{t.fillRect(r,c,d,h)}else t.fillRect(r,c,d,h);t.restore()}}isPointInBar(t,n){const[o,s]=t,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=o&&o<=d&&h<=s&&s<=a}drawRoundedRect(t,n){const{chartRect:o,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,u=a;const f=new Path2D;f.rect(o.x1+s.left,o.y1,o.chartWidth-s.right,o.chartHeight-s.bottom),t.clip(f),t.beginPath(),t.moveTo(r,c),Math.abs(d)<u*2&&(u=Math.abs(d)/2),Math.abs(h)<u*2&&(u=Math.abs(h)/2),l?d<0?(d+=u,t.lineTo(r+d,c),t.arcTo(r+d-u,c,r+d-u,c-u,u),t.arcTo(r+d-u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):(d-=u,t.lineTo(r+d,c),t.arcTo(r+d+u,c,r+d+u,c-u,u),t.arcTo(r+d+u,c-h,r+d,c-h,u),t.lineTo(r,c-h),t.lineTo(r,c)):h>0?(h-=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h+u,r-d+u,c+h+u,u),t.arcTo(r,c+h+u,r,c+h,u),t.lineTo(r,c)):(h+=u,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h-u,r+d-u,c+h-u,u),t.arcTo(r,c+h-u,r,c+h,u),t.lineTo(r,c)),t.fill(),t.closePath()}}class MC extends Dr{draw(t){if(!this.show)return;const n=t.ctx,o=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.isHorizontal,c=t.thickness,d=t.showSeriesCount;let h,u;const f=l.x[this.xAxisIndex],g=l.y[this.yAxisIndex],p=o.chartWidth-(s.left+s.right),m=o.chartHeight-(s.top+s.bottom),x=o.x1+s.left,b=o.y2-s.bottom,y=o.x2-s.right,I=(r?m:p)/(this.data.length||1),E=2;let T;this.isExistGrp?T=I-E*2:T=(I-E*2)/d;const C=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(T,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(T*c):T;let S=r?null:C,w=r?null:C,k=r?C:null;const B=r?(T-k)/2:(T-S)/2,D=this.isExistGrp?1:a+1;this.size.cat=I,this.size.bar=T,this.size.cPad=E,this.size.bPad=B,this.size.w=S,this.size.ix=D,this.chartRect=o,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((O,R)=>{if(n.beginPath(),r?(h=x,u=ie.calculateY(O.y,g.graphMin,g.graphMax,m,b)):(h=ie.calculateSubX(O.x,f.graphMin,f.graphMax,p,x),h<x?(w-=x-h,h=h+S<x?null:x):h+S>y&&(w-=w-(y-h)),h>=y&&(h=null),h!==null&&(h+=Math.ceil(T*D)-Math.round(S+B)),u=b),r?O.b?(S=ie.calculateX(O.x-O.b,f.graphMin,f.graphMax,p),h=ie.calculateX(O.b,f.graphMin,f.graphMax,p,x)):S=ie.calculateX(O.x,f.graphMin,f.graphMax,p):O.b?(k=ie.calculateY(O.y-O.b,g.graphMin,g.graphMax,m),u=ie.calculateY(O.b,g.graphMin,g.graphMax,m,b)):k=ie.calculateY(O.y,g.graphMin,g.graphMax,m),h!==null&&u!==null){const v=O.dataColor||this.color,N=v.includes("rgba")?Y.getOpacity(v):1,L=this.state==="downplay"?t.unSelectedOpacity:N;typeof v!="string"?(S=S!==w?w:S,n.fillStyle=ie.createGradient(n,r,{x:h,y:u,w:S,h:k},v,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=Y.colorStringToRgba(v,L),this.drawBar({ctx:n,positions:{x:h,y:u,w:S,h:k}}),this.showValue.use&&this.drawValueLabels({context:n,data:O,positions:{x:h,y:u,h:k,w:S},isHighlight:!1,index:R})}w=S,O.xp=h,O.yp=u,O.w=S,O.h=r?-k:k})}}class EC{constructor(t,n,o){const s=ys({},CC,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Vt[o%Vt.length]),this.sId=t,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(t,n,o){var h;const s=t??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?Y.getOpacity(r):1,d=this.isDownplay?o:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=Y.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([t,n]){const o={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((t-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(t-r,n-c),u=s>d&&h>=l&&h<=a;return this.show&&u&&(o.type=this.type,o.data=this.data,o.hit=!0,o.color=this.color,o.index=0),o}itemHighlight(t,n){var a,r;const o=n,s=this.isSelect?this.radius+5:this.radius;o.save(),o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=4;const l=((a=t==null?void 0:t.data)==null?void 0:a.dataColor)||this.color;o.fillStyle=l,o.shadowColor=l,o.beginPath(),o.moveTo(this.centerX,this.centerY),o.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),o.lineTo(this.centerX,this.centerY),o.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(o),o.closePath(),o.restore()}drawValueLabels(t){const n=t,o=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:o,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=Y.labelSignFormat(o));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,u=s+4,f=Math.round(n.measureText(r).width);if(h>=f*c&&h>=u*c&&d>=f*c&&d>=u*c){n.save(),n.beginPath();const g=l.includes("rgba")?Y.getOpacity(l):1,p=this.state==="downplay"?this.unSelectedOpacity:g;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=Y.colorStringToRgba(l,p),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const m=d/2+this.doughnutHoleSize,x=(this.endAngle-this.startAngle)/2+this.startAngle,b=m*Math.cos(x)+this.centerX,y=m*Math.sin(x)+this.centerY;n.fillText(r,b,y),n.restore()}}}class IC{constructor(t,n,o,s,l){const a=ys({},SC,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(o),this.sId=t,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(t){const n=[],o=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=t,h=s.includes("#")?Y.hexToRgb(s):s.replace(o,""),u=l.includes("#")?Y.hexToRgb(l):l.replace(o,""),[f,g,p]=h.split(","),[m,x,b]=u.split(",");if(this.isGradient)n.push({minColor:{minR:f,minG:g,minB:p},maxColor:{maxR:m,maxG:x,maxB:b},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:y,label:M},I)=>{n.push({id:`color#${I}`,color:y,label:M,state:"normal",show:!0})});else{const y=Math.floor((f-m)/(a-1)),M=Math.floor((g-x)/(a-1)),I=Math.floor((p-b)/(a-1));for(let E=0;E<a;E++){const T=+f-y*E,V=+g-M*E,C=+p-I*E;n.push({id:`color#${E}`,color:`rgb(${T},${V},${C})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(t){const{minColor:n,maxColor:o}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=o,h=+s-Math.floor((s-r)*t/100),u=+l-Math.floor((l-c)*t/100),f=+a-Math.floor((a-d)*t/100);return`rgb(${h},${u},${f})`}getColorIndexByValue(t){const{existError:n,min:o,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&t<0)return a;const r=Math.floor(+(t-o).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(t){const{min:n,max:o}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=We(t-n,o-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(t<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(t)===Math.floor(n+(o-n)*(c/100)),s.dataColor=t<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(t),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=t<0?this.errorColor:c,s.id=d}return s}drawItem(t,n,o,s,l,a){if(t.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),t.moveTo(n+d,o),t.arcTo(n+s,o,n+s,o+l,d),t.arcTo(n+s,o+l,n,o+l,d),t.arcTo(n,o+l,n,o,d),t.arcTo(n,o,n+s,o,d),t.stroke(),t.fill()}else t.strokeRect(n,o,s,l),t.fillRect(n,o,s,l)}else{const r=Y.aliasPixel(1);t.fillRect(n,o-r,s+r,l+r)}t.closePath()}}calculateXY(t,n,o,s){let l=null;if(this.labels[t]&&this.labels[t].length){let a=this.labels[t].findIndex(f=>f===n);a===-1&&(a=this.labels[t].findIndex(f=>+f==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(ve(c)&&a>c||ve(r)&&a<r||Gi(r)&&Gi(c)&&(n<d||n>h))return null;const u=r??this.labels[t].findIndex(f=>+f==+d);a>-1&&(a-=u>-1?u:0,l=t==="x"?o+this.size.w*a:o-this.size.h*(a+1))}return l}draw(t){if(!this.show)return;const{ctx:n,chartRect:o,labelOffset:s,overlayCtx:l,selectLabel:a,legendHitInfo:r,selectItem:c,axesSteps:d}=t,h=o.chartWidth-(s.left+s.right),u=o.chartHeight-(s.top+s.bottom),f=o.x1+s.left,g=o.y2-s.bottom,p=d.x[this.xAxisIndex],m=d.y[this.yAxisIndex];this.size.w=h/p.oriSteps,this.size.h=u/m.oriSteps,this.currentLabelInfo={x:{steps:p.oriSteps,min:p.graphMin,max:p.graphMax},y:{steps:m.oriSteps,min:m.graphMin,max:m.graphMax}};const x=(b,y,M)=>{var I,E;if(!r){let T;const{option:V,selected:C}=c,{option:S,selected:w}=a,k=ft(C==null?void 0:C.dataIndex)&&(C==null?void 0:C.dataIndex)>-1,B=((I=w==null?void 0:w.label)==null?void 0:I.length)>0;return k?T=V.useSeriesOpacity?M!==(C==null?void 0:C.dataIndex):!1:B&&(T=S.useSeriesOpacity?!((E=w==null?void 0:w.label)!=null&&E.includes(this.getItemLabel(a,b))):!1),T?.1:y}return y};this.data.forEach((b,y)=>{var S;let I=this.calculateXY("x",b.x,f,p),E=this.calculateXY("y",b.y,g,m),T=this.size.w,V=this.size.h;const C=b.o;if(I!==null&&E!==null&&C!==null&&C!==void 0){const{show:w,opacity:k,dataColor:B,id:D,isHighlight:O}=this.getItemInfo(C);let R=k;k===1&&Y.getColorStringType(b.dataColor)==="RGBA"&&(R=Y.getOpacity(b.dataColor));const v=x(b,R,y);if(b.dataColor||(b.dataColor=B),b.cId=D,n.save(),w){n.fillStyle=Y.colorStringToRgba(b.dataColor,v);let N=this.stroke;const L=c==null?void 0:c.option,P=(L==null?void 0:L.use)&&(L==null?void 0:L.showBorder),_=y===((S=c==null?void 0:c.selected)==null?void 0:S.dataIndex);P&&_&&(N={show:L==null?void 0:L.showBorder,...L==null?void 0:L.borderStyle});let A=!1;if(N.show&&N.lineWidth>0){const{color:z,lineWidth:$,opacity:U}=N,H=$*2;A=H<Math.floor(T)&&H<Math.floor(V),n.strokeStyle=A?Y.colorStringToRgba(z,v===1?U:v):void 0,A?(n.lineWidth=$,I+=$,E+=$,T-=H,V-=H):n.lineWidth=0}I+=1,b.xp=I,b.yp=E,b.w=T,b.h=V,this.drawItem(n,I,E,T,V,{...N,show:A}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:b}),O&&this.itemHighlight({data:b},l)}}})}drawValueLabels({context:t,data:n}){const{fontSize:o,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:f}=n,g=t;g.save(),g.beginPath(),g.font=`normal normal normal ${o}px Roboto`,g.fillStyle=s,g.lineWidth=1,g.textBaseline="middle",g.textAlign=l!=="center"?"left":"center";let p;a&&(p=a(f)),(!a||typeof p!="string")&&(p=Y.labelSignFormat(f,r));const m=Math.round(g.measureText(p).width),x=o,b=c+h/2,y=d+u/2;if(!(m>=h||x>=u||p<0)){switch(l){case"top":{const M=b-m/2,I=y-x/2;g.fillText(p,M,I);break}case"right":{const M=c+h-m;g.fillText(p,M,y);break}case"bottom":{const M=b-m/2,I=y+x/2;g.fillText(p,M,I);break}case"left":g.fillText(p,c,y);break;default:{const M=b-m/2;g.fillText(p,M,y);break}}g.restore()}}getAdjustedBounds({xp:t,yp:n,width:o,height:s}){const a=Math.max(0,o),r=Math.max(0,s);return{xsp:Math.floor(t*100)/100,xep:Math.ceil((t+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(t){const n=this.data,{xsp:o,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:t.xsp,yp:t.ysp,width:t.width,height:t.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:u,xep:f,ysp:g,yep:p}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=o&&f<=s&&g>=l&&p<=a})}itemHighlight(t,n){var m;const o=t.data,s=n,{stroke:l,shadow:a}=this.highlight,r=o.xp,c=o.yp,d=o.w,h=o.h,u=o.cId;let f;if(this.isGradient){const{min:x,max:b}=this.valueOpt,y=We(o.o-x,b-x),{start:M,end:I}=this.colorState[0];f=M<=y&&y<=I||o.o===-1}else f=(m=this.colorState.find(({id:x})=>x===u))==null?void 0:m.show;if(r===null||c===null||!f)return;s.save();const g=Y.getColorStringType(o.dataColor)==="RGBA"?t.dataColor:Y.colorStringToRgba(o.dataColor,1);s.fillStyle=g,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const p={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:x,width:b,radius:y}=l;p.show=!0,p.radius=y,s.lineWidth=b,p.lineWidth=b,s.strokeStyle=x||g,p.color=x||g}else p.show=!1,s.strokeStyle=g,p.color=g;this.drawItem(s,r-.5,c-.5,d+1,h+1,p),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:o})}findGraphData(t){const n=t[0],o=t[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:u}=r;return c<=n&&n<=c+h&&d<=o&&o<=d+u});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:t,xep:n,ycp:o,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(t,n),ysp:Math.min(o,s),width:Math.ceil(Math.abs(n-t)),height:Math.ceil(Math.abs(s-o))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:u,x2:f,y1:g,y2:p}=l,m=(f-u)/d,x=(p-g)/h,b={xsp:t,xep:n,ysp:o,yep:s},y=(M,I,E)=>{let T,V,C;M==="x"?(V=m,C=u+r):(V=x,C=g),a[M].findIndex((w,k)=>(T=C+V*k,T<=I&&I<=T+V))>-1?b[E]=["xsp","ysp"].includes(E)?T:T+V:I<C&&(b[E]=C)};y("x",Math.min(t,n),"xsp"),y("x",Math.max(t,n),"xep"),y("y",Math.min(o,s),"ysp"),y("y",Math.max(o,s),"yep"),c.xsp=Math.min(b.xsp,b.xep),c.ysp=Math.min(b.ysp,b.yep),c.width=Math.abs(b.xep-b.xsp),c.height=Math.abs(b.yep-b.ysp)}return c}getFilteredLabel(t,n,o,s){return t.length!==n?t.filter(l=>o<=l&&l<=s):t}findSelectionRange(t){const{xsp:n,ysp:o,width:s,height:l,range:a}=t;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:f,y:g}=this.labels;if(f.length&&g.length){const{x:{steps:p,min:m,max:x},y:{steps:b,min:y,max:M}}=this.currentLabelInfo,I=p||f.length,E=b||g.length,T=(d-c)/I,V=(u-h)/E,C=n+s,S=o+l,w={min:Math.floor((n-c)/T),max:Math.floor((C-c-T)/T)},k=E-1,B={min:k-Math.round((S-h-V)/V),max:k-Math.round((o-h)/V)},D=this.getFilteredLabel(f,I,m,x),O=this.getFilteredLabel(g,E,y,M);r={xMin:D[w.min],xMax:D[w.max],yMin:O[B.min],yMax:O[B.max]}}return r}getItemLabel(t,n){const{option:o,selected:s}=t;let l=this.isHorizontal?n.y:n.x;return o!=null&&o.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const Or={Store:yC,Series:{createSeriesSet(e,t,n,o){let s=Object.keys(e);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(e,t,o)),s.forEach((l,a)=>{const r=e[l].type||t;this.seriesList[l]=this.addSeries({type:r,id:l,opt:e[l],index:a,isHorizontal:n})})},getOverlappingSeriesKeys(e,t,n){const o=[],s=[],l=n.flat();return Object.keys(e).forEach(a=>{if((e[a].type||t)==="bar"&&l.length){const d=l.findIndex(h=>h===a);o.push({key:a,overlappingIdx:d})}else s.push({key:a})}),o.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...o,...s].map(({key:a})=>a)},addSeries(e){var a;const{type:t,id:n,opt:o,index:s,isHorizontal:l}=e;if(t==="line")return this.seriesInfo.charts.line.push(n),new wC(n,o,s);if(t==="scatter")return this.seriesInfo.charts.scatter.push(n),new kC(n,o,s,(a=this.options.realTimeScatter)==null?void 0:a.use);if(t==="bar")return this.seriesInfo.charts.bar.push(n),o.timeMode?new MC(n,o,s,l):new Dr(n,o,s,l);if(t==="pie")return this.seriesInfo.charts.pie.push(n),new EC(n,o,s);if(t==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:r,legend:c}=this.options,d=c.type==="gradient";return new IC(n,o,r,l,d)}return!1},addGroupInfo(e){e.forEach((t,n)=>{let o=0;t.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+o,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=t.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||o--,r.show?l:s},t[0])})}}};class oo{constructor(t,n,o,s){const l=Fe({},n,Ir);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=o,this.units=xC[this.type],this.options=s,this.position||(this.position=t==="x"?"bottom":"left")}calculateLabelRange(t,n,o,s){let l,a,r;t==="x"?(l=n.chartWidth,r=Math.floor(s*1.1),a=[o.left,o.right]):(l=n.chartHeight,a=[o.top,o.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r)-1,1);return{min:d,max:h}}calculateScaleRange(t,n){var d;let o,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(o=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(o=a[1],s=a[0]):typeof a=="function"?[s,o]=a(t.min,t.max):(o=t.max,s=t.min),this.autoScaleRatio&&(o=Math.ceil(o*(this.autoScaleRatio+1))),this.startToZero&&(s=0),o===s&&(o+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(o,{isMaxValueSameAsMin:l});return{min:s,max:o,minLabel:r,maxLabel:c,size:Y.calcTextSizeCanvas(c,Y.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n){return(t??[]).reduce((o,s)=>{var r;const l=this.getLabelFormat(s),a=((r=Y.calcTextSizeCanvas(l,Y.getLabelStyle(this.labelStyle)))==null?void 0:r.width)??0;return Math.max(o,a)},0)}calculateSteps(t){const{maxValue:n,minValue:o}=t;let{maxSteps:s}=t,l=this.getInterval(t),a=o,r;for(;a<n;)a+=l;const c=a,d=o,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(t,n){const o=this.title;if(!(o!=null&&o.use)||isNaN(o.fontSize))return;const s=this.ctx;s.save(),s.font=Y.getLabelStyle(o),s.fillStyle=o.color,s.textAlign=o.textAlign;const l={xLeft:t.x1+n.left,xRight:t.x2-n.right,yTop:t.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=t.y2+o.fontSize+c):(r=l.yTop-o.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(o.text,a,r),s.restore()}draw(t,n,o,s,l,a){var I,E,T,V,C,S,w,k,B,D,O,R,v,N,L,P,_,A,z,$;const r=this.ctx,c=this.options,d={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},h=o.steps,u=o.graphMin,f=o.graphMax,g=o.interval,p=d[this.units.rectStart],m=d[this.units.rectEnd],x=d[this.units.rectOffset(this.position)],b=d[this.units.rectOffsetCounter(this.position)],y=5;let M;if(this.drawAxisTitle(t,n),r.font=Y.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,M=Y.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(p,x+M),r.lineTo(m,x+M)):(r.moveTo(x+M,p),r.lineTo(x+M,m)),r.stroke(),r.closePath()),!(h===0||u===null)){if((I=this.labelStyle)!=null&&I.show){const U=m-p,H=U/h,X=[],j=o.interval;let K=null,q=null,Q=p,J=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const G=Math.floor(u/j)*j;G!==+u&&(J=G+j,Q+=U/(f-u)*(J-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,M=Y.aliasPixel(r.lineWidth);let te;for(let G=0;G<=h;G++)if(K=Math.round(Q+H*G),K<=m||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),X[G]=J+G*g,X[G]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,q=K+M,te=this.getLabelFormat(Math.min(f,X[G]),{prev:X[G-1]??""});const Z=((T=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:T.use)&&((C=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:C.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((S=l==null?void 0:l.dataIndex)==null?void 0:S.length)&&!(l!=null&&l.label.map(ue=>this.getLabelFormat(Math.min(f,ue),{prev:X[G-1]??""})).includes(te));let ae;G===h&&this.lastLabelFontStyle?(r.font=Y.getLabelStyle(this.lastLabelFontStyle),ae=this.lastLabelFontStyle.color):(r.font=Y.getLabelStyle(this.labelStyle),ae=this.labelStyle.color);let me=1;Y.getColorStringType(ae)==="RGBA"&&(me=Y.getOpacity(ae)),r.fillStyle=Y.colorStringToRgba(ae,Z?(w=this.options)==null?void 0:w.unSelectedOpacity:me);let re;if(this.type==="x"){if(re=this.position==="top"?x-10:x+10,((k=c==null?void 0:c.brush)!=null&&k.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),K,re),!Z&&((B=c==null?void 0:c.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((D=this.options)!=null&&D.horizontal)){const ue=this.getLabelFormat(Math.min(f,s.label+0*g));if(ue===te){const ke=Math.round(r.measureText((O=this.labelStyle)==null?void 0:O.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(ue).width)+10,height:ke,x:K,y:re+(ke-2),borderRadius:2,arrowSize:3,text:te,backgroundColor:(v=(R=c==null?void 0:c.selectItem)==null?void 0:R.labelTipStyle)==null?void 0:v.backgroundColor,textColor:(L=(N=c==null?void 0:c.selectItem)==null?void 0:N.labelTipStyle)==null?void 0:L.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(q,x),r.lineTo(q,x+y),r.stroke(),r.closePath()),(G!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(q,x),r.lineTo(q,b),r.stroke(),r.closePath())}else re=this.position==="left"?x-10:x+10,((P=c==null?void 0:c.brush)!=null&&P.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),re,K),G===h&&(q-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(x+(this.axisLineWidth??1),q),r.lineTo(x-y,q),r.stroke(),r.closePath()),G!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(x,q),r.lineTo(b,q),r.stroke(),r.closePath())}}if((_=this.plotBands)!=null&&_.length||(A=this.plotLines)!=null&&A.length){const U=t.chartWidth-(n.left+n.right),H=t.chartHeight-(n.top+n.bottom),X=M+1,j=d.x1,K=d.x2+X,q=d.y1-X,Q=d.y2;(z=this.plotBands)==null||z.forEach(J=>{const te=Fe({},J,Br),{from:G,to:oe,label:Z}=te,ae=Y.isNullOrUndefined(G)?u:Math.max(G,u),me=Y.isNullOrUndefined(oe)?f:Math.min(oe,f);this.setPlotBandStyle(te);let re,ue;if(this.type==="x"){if(re=ie.calculateX(ae,u,f,U,j),ue=ie.calculateX(me,u,f,U,j),re===null||ue===null)return;this.drawXPlotBand(re,ue,j,K,q,Q)}else{if(re=ie.calculateY(ae,u,f,H,Q),ue=ie.calculateY(me,u,f,H,Q),re===null||ue===null)return;this.drawYPlotBand(re,ue,j,K,q,Q)}if(Z.show){const ke=this.getNormalizedLabelOptions(t,Z),rt=this.getPlotBandLabelPosition(re,ue,ke,K,q);this.drawPlotLabel(ke,rt)}r.restore()}),($=this.plotLines)==null||$.forEach(J=>{if(typeof+J.value!="number")return;const te=Fe({},J,Tr),{value:G,label:oe}=te;let Z;if(this.type==="x"){if(Z=ie.calculateX(G,u,f,U,j),Z===null)return;this.setPlotLineStyle(te),this.drawXPlotLine(Z,j,K,q,Q)}else{if(Z=ie.calculateY(G,u,f,H,Q),Z===null)return;this.setPlotLineStyle(te),this.drawYPlotLine(Z,j,K,q,Q)}if(oe.show){const ae=this.getNormalizedLabelOptions(t,oe),me=this.getPlotLineLabelPosition(Z,ae,K,q);this.drawPlotLabel(ae,me)}r.restore()})}}}setPlotLineStyle(t){const n=this.ctx,{color:o,lineWidth:s}=t;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=o,t.segments&&n.setLineDash(t.segments)}setPlotBandStyle(t){const n=this.ctx,{color:o}=t;n.beginPath(),n.save(),n.fillStyle=o}drawXPlotBand(t,n,o,s,l,a){const r=this.ctx,c=d=>d||d>o||d<s;if(!c(t)||!c(n)){r.closePath(),r.restore();return}r.moveTo(t,l),r.lineTo(t,a),r.lineTo(n,a),r.lineTo(n,l),r.lineTo(t,l),r.stroke(),r.fill(),r.restore(),r.closePath()}drawXPlotLine(t,n,o,s,l){const a=this.ctx;if(!t||t<n||t>o){a.closePath(),a.restore();return}let r=t;r+=Y.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(t,n,o,s,l){const a=this.ctx;if(!t||t>l||t<s){a.closePath(),a.restore();return}let r=t;r+=Y.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(o,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(t,n,o,s,l,a){const r=this.ctx,c=d=>d||d>l||d<a;if(!c(t)||!c(n)){r.closePath(),r.restore();return}r.moveTo(o,t),r.lineTo(o,n),r.lineTo(s,n),r.lineTo(s,t),r.lineTo(o,t),r.fill(),r.restore(),r.closePath()}getNormalizedLabelOptions(t,n){const o=Fe({},n,vr),s=this.ctx,{maxWidth:l}=o,a=o.fontSize>20?20:o.fontSize;let r=o.text,c=l??s.measureText(r).width;const d=this.type==="y"?t.width-t.chartWidth:l??t.width;return d<s.measureText(r).width&&o.textOverflow==="ellipsis"&&(r=Y.truncateLabelWithEllipsis(o.text,d,s),c=s.measureText(r).width),{label:r,fontSize:a,labelWidth:c,labelBoxPadding:a/4,labelHalfWidth:c/2,labelHalfHeight:a/2,...o}}getPlotBandLabelPosition(t,n,o,s,l){const{fontSize:a,labelWidth:r,labelHalfWidth:c,labelHalfHeight:d,labelBoxPadding:h,textAlign:u,verticalAlign:f}=o;if(a<=0)return{textX:0,textY:0};let g,p;if(this.type==="x")switch(p=l-h-a,u){case"left":g=t+c+h;break;case"right":g=n-c-h;break;case"center":default:g=(n-t)/2+t;break}else switch(g=s+r+h,f){case"top":p=n+d+h;break;case"bottom":p=t-d-h;break;case"middle":default:p=(t-n)/2+n;break}return{textX:g,textY:p}}getPlotLineLabelPosition(t,n,o,s){const{fontSize:l,labelWidth:a,labelHalfWidth:r,labelHalfHeight:c,labelBoxPadding:d}=n;if(l<=0)return{textX:0,textY:0};let h,u;if(this.type==="x")switch(u=s-d-l,n.textAlign){case"left":h=t-r-d;break;case"right":h=t+r+d;break;case"center":default:h=t;break}else switch(h=o+a+d,n.verticalAlign){case"top":u=t-c-d;break;case"bottom":u=t+c+d;break;case"middle":default:u=t;break}return{textX:h,textY:u}}drawPlotLabel(t,n){if(!n)return;const{textX:o,textY:s}=n,{label:l,fontSize:a,fontColor:r,fillColor:c,lineColor:d,lineWidth:h,labelBoxPadding:u,labelWidth:f,labelHalfWidth:g,labelHalfHeight:p}=t;if(a<=0)return;const m=this.ctx;m.save(),m.beginPath(),m.font=Y.getLabelStyle(t);let x=0,b=0,y=0,M=0;this.type==="x"?(x=s-u,b=s+a,y=o-g-u,M=o+g+u):(x=s-p-u,b=s+p+u,y=o-f,M=o+u),m.fillStyle=c,m.strokeStyle=d,m.lineWidth=h,m.moveTo(y,b),m.lineTo(y,x),m.lineTo(M,x),m.lineTo(M,b),m.lineTo(y,b),m.fill(),h>0&&m.stroke(),m.fillStyle=r,m.fillText(l,o,s),m.closePath()}checkFixWidth(t){const{fixWidth:n,fitDir:o}=this.labelStyle;return ve(n)&&n>0?Y.truncateLabelWithEllipsis(t,n,this.ctx,o):t}}class vC extends oo{getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return at(t).format(this.timeFormat)}getInterval(t){const n=t.maxValue,o=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return li[this.interval].size;if(typeof this.interval=="object")return this.interval.time*li[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-o)/s)}calculateSteps(t){const{maxValue:n,minValue:o}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=1e-10,h=+o;let u=+n;if(l&&c){const x=r,y=(u-h)/x;if(Math.abs(y-Math.round(y))<d&&this.fixedSteps)return{steps:Math.round(y),interval:x,graphMin:h,graphMax:u}}if(c){const x=u-h;let b=r,y=Math.ceil(x/b);for(;y>s;)b*=2,y=Math.ceil(x/b);return u=h+b*y,{steps:y,interval:b,graphMin:h,graphMax:u}}let f=this.getInterval(t),g=o;for(;g<n;)g+=f;u=g;const p=u-h;let m=Math.round(p/f);for(;m>s;){f*=2,m=Math.round(p/f);const x=p/m;f=this.decimalPoint?x:Math.ceil(x)}if(p>m*f){const x=p/m;f=this.decimalPoint?x:Math.ceil(x)}return{steps:m,interval:f,graphMin:h,graphMax:u}}}class TC extends oo{getTruthyValue(t){const n=this.adjustedDecimalPoint??this.decimalPoint;return ve(t)?Number(t.toFixed(n)):t}getLabelFormat(t,n={}){if(this.formatter){const s=this.getTruthyValue(t),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:t,currentDecimalPointValue:s});if(typeof l=="string")return l}const o=this.adjustedDecimalPoint??this.decimalPoint;return Y.labelSignFormat(t,o)}getInterval(t){if(this.interval)return this.interval;let n=0;const o=t.maxValue,s=t.minValue,l=t.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(o),r=Math.abs(s)/a,c=Math.abs(o)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(o)/(h||1))}else n=(o-s)/l;return this.decimalPoint?n:Math.ceil(n)}getNiceInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),o=Math.floor(Math.log10(n)),s=n/10**o;let l=10;for(let r=0;r<Vs.length;r++)if(Vs[r]>=s){l=Vs[r];break}const a=l*10**o;return t<0?-a:a}getStepsWithNiceScale({max:t,min:n,maxSteps:o}){let s=t,l=n,a=0,r=0,c=1/0;const d=Math.max(1,o-1),h=o+1;for(let u=d;u<=h;u++){const f=(t-n)/u,g=this.getNiceInterval(f);if(g>0){const p=Math.floor(n/g)*g,m=p+g*u;if(m>=t){const x=n-p,b=m-t,y=x+b;y<c&&(s=m,l=p,a=g,r=u,c=y)}}}if(!(a>0)||r<=0){const u=Math.max(1,o),f=(t-n)/u||1;return{max:t,min:n,interval:f,steps:u}}return{max:s,min:l,interval:a,steps:r}}getDecimalPointFromInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),o=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=o;c+=1)if(a(n,c))return c;return o}calculateSteps(t){const{minValue:n,maxValue:o}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,u=1e-10,f=y=>{if(this.decimalPoint==="auto"){const M=this.getDecimalPointFromInterval(y);M!=null&&!Number.isNaN(M)?this.adjustedDecimalPoint=M:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(y):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},g=(y,M)=>Math.max(1,Math.round(y/M+u)),p=({min:y,max:M,interval:I})=>{let E=0,T=0;return y>=0?(E=+y,T=Math.ceil(M/I)*I):M>=0?(E=Math.floor(y/I)*I,T=Math.ceil(M/I)*I):(T=+M,E=Math.floor(y/I)*I),{graphMin:E,graphMax:T}};if(l&&c){const y=d,M=h,I=r,T=(M-y)/I;if(Math.abs(T-Math.round(T))<u||this.fixedSteps){const C=Math.round(T);return f(I),{steps:C,interval:I,graphMin:y,graphMax:M}}}if(l){const y=d,M=h,I=M-y,E=s,T=I/E;return f(T),{steps:E,interval:T,graphMin:y,graphMax:M}}if(c){let y=r,M=0,I=0,E=0,T=0;for({graphMin:M,graphMax:I}=p({min:n,max:o,interval:y}),E=I-M,T=g(E,y);T>s;)y*=2,{graphMin:M,graphMax:I}=p({min:n,max:o,interval:y}),E=I-M,T=g(E,y);return f(y),{steps:T,interval:y,graphMin:M,graphMax:I}}const m=this.startToZero&&n>=0?0:n,x=this.startToZero&&o<=0?0:o,b=this.getStepsWithNiceScale({min:m,max:x,maxSteps:s});return f(b.interval),{steps:b.steps,interval:b.interval,graphMin:b.min,graphMax:b.max}}calculateScaleRange(t,n){var h;let o,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(o=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(o=a[1],s=a[0]):typeof a=="function"?[s,o]=a(t.min,t.max):(o=t.max,s=t.min);const r=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!r){const u=o,f=o*(this.autoScaleRatio+1);if(o=this.decimalPoint?f:Math.ceil(f),o>0&&s<0){const g=u-o;s+=g}else if(o<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!r&&(s>0&&(s=0),o<0&&(o=0)),o===s&&(o+=1,l=!0);const c=this.getLabelFormat(s),d=this.getLabelFormat(o,{isMaxValueSameAsMin:l});return{min:s,max:o,minLabel:c,maxLabel:d,size:Y.calcTextSizeCanvas(d,Y.getLabelStyle(this.labelStyle),(h=this.labelStyle)==null?void 0:h.padding)}}}class BC extends oo{calculateScaleRange(t){let n,o,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],o=this.range[0]):typeof range=="function"?[o,n]=this.range(t.min,t.max):(n=t.max,o=t.min);const l=Y.calculateMagnitude(n-o);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(o=0),n===o&&(n+=1,s=!0);const a=this.getLabelFormat(o),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:o,max:n,minLabel:a,maxLabel:r,size:Y.calcTextSize(r,Y.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const o=t.maxValue,s=t.minValue,l=t.maxSteps,a=Y.calculateMagnitude(o-s);let r=this.getInterval(t),c;const d=o,h=s,u=d-h;for(c=Math.round(u/r),o===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(u/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(u/r);else break;else r/=2,c=Math.ceil(u/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return Y.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,o=t.minValue;return 10**Y.calculateMagnitude(n-o)}}class DC extends oo{constructor(t,n,o,s,l){super(t,n,o,l),this.labels=s}getMaxWidth(t,n){var s;const o=(s=this.labelStyle)==null?void 0:s.maxWidth;if(o==null)return n;if(typeof o=="string"){const l=o.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:t.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return o}calculateScaleRange(t,n,o){const s=this.labelStyle.alignToGridLine?t:Y.getStringMinMax(this.labels);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[f,g]=h;ve(f)&&ve(g)&&(r=f<r?r:f,c=g>c?c:g,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[f,g]=h(a,l);r=f<r?r:f,c=g>c?c:g,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(o,o.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:Y.calcTextSizeCanvas(this.getLabelFormat(l,u),Y.getLabelStyle(this.labelStyle))}}getIndexInterval(t){const n=t.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(t){const{minValue:n,maxValue:o,minIndex:s,maxIndex:l}=t,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(t)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:o,minIndex:s,maxIndex:l}}draw(t,n,o,s,l){var y,M,I,E,T,V,C,S,w,k,B;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=o.steps,h=o.indexInterval,u=o.minIndex,f=c[this.units.rectStart],g=c[this.units.rectEnd],p=c[this.units.rectOffset(this.position)],m=c[this.units.rectOffsetCounter(this.position)],x=this.getMaxWidth(t,t.chartWidth/(d+2)),b=5;if(this.drawAxisTitle(t,n),(y=this.labelStyle)!=null&&y.show){a.font=Y.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const D=Y.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,p+D),a.lineTo(g,p+D)):(a.moveTo(p+D,f),a.lineTo(p+D,g)),a.stroke(),d===0)return;const O=(g-f)/d,R=this.labelStyle.alignToGridLine;let v=null,N=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let L,P,_;const A=[];for(_=0;_<d;_+=h){const z=u+_,$=this.labels[z];v=Math.round(f+O*_),N=v+D,L=this.getLabelFormat($,x);const{selectLabel:U,selectItem:H,horizontal:X}=this.options;let j;l!=null&&l.targetAxis?j=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":j=X?"y":"x";const K=(U==null?void 0:U.use)&&(U==null?void 0:U.useLabelOpacity)&&j===this.type&&((M=l==null?void 0:l.dataIndex)==null?void 0:M.length)&&!((I=l==null?void 0:l.dataIndex)!=null&&I.includes(z)),q=this.labelStyle.color;let Q=1;if(Y.getColorStringType(q)==="RGBA"&&(Q=Y.getOpacity(q)),a.fillStyle=Y.colorStringToRgba(q,K?(E=this.options)==null?void 0:E.unSelectedOpacity:Q),this.type==="x"){P=this.position==="top"?p-10:p+10;const J=R?v:v+O/2;if(a.fillText(this.checkFixWidth(L),J,P),!K&&(H!=null&&H.showLabelTip)&&(s!=null&&s.label)&&!X){const te=s.label;if(te===L){const G=Math.round(a.measureText((T=this.labelStyle)==null?void 0:T.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(te).width)+10,height:G,x:v+O/2,y:P+(G-2),borderRadius:2,arrowSize:3,text:L,backgroundColor:(V=H==null?void 0:H.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(C=H==null?void 0:H.labelTipStyle)==null?void 0:C.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(v+O/2,p),a.lineTo(v+O/2,p+b),a.stroke(),a.closePath()),_>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(N,p),a.lineTo(N,m),a.stroke(),a.closePath())}else{P=this.position==="left"?p-10:p+10;const J=R?v:v+O/2;a.fillText(this.checkFixWidth(L),P,J),A.push(L),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(p+(this.axisLineWidth??1),J),a.lineTo(p-b,J),a.stroke(),a.closePath()),_>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(p,N),a.lineTo(m,N),a.stroke(),a.closePath())}a.stroke()}if(R&&_>=this.labels.length){const z=xr(+r[1],+r[0]),$=Rs(+r[r.length-1],z);if(isNaN($)||h!==1&&xr($,A[A.length-1])<=z)return;v=Math.round(f+O*r.length),N=v+D;const U=this.getLabelFormat(`${$}`,x);this.type==="x"?(a.fillText(this.checkFixWidth(U),v,P),this.showGrid&&(a.moveTo(N,p),a.lineTo(N,m))):(a.fillText(this.checkFixWidth(U),P,v),this.showGrid&&(a.moveTo(p,N),a.lineTo(m,N))),a.stroke()}a.closePath()}if((S=this.plotBands)!=null&&S.length||(w=this.plotLines)!=null&&w.length){const D=Y.aliasPixel(a.lineWidth)+1,O=c.x1+D,R=c.x2,v=c.y1+D,N=c.y2,L=(g-f)/(this.labelStyle.show?r.length:1);(k=this.plotBands)==null||k.forEach(P=>{if(!P.from&&!P.to)return;const _=Fe({},P,Br),{from:A=0,to:z=r.length,label:$}=_,U=Math.round(f+L*A),H=Math.round(f+L*z);if(this.setPlotBandStyle(_),this.type==="x"?this.drawXPlotBand(U,H,O,R,v,N):this.drawYPlotBand(U,H,O,R,v,N),$.show){const X=this.getNormalizedLabelOptions(t,$),j=this.getPlotBandLabelPosition(U,H,X,R,v);this.drawPlotLabel(X,j)}a.restore()}),(B=this.plotLines)==null||B.forEach(P=>{if(!P.value)return;const _=Fe({},P,Tr),{value:A,label:z}=_,$=Math.round(f+L*A)+L/2;if(this.setPlotLineStyle(_),this.type==="x"?this.drawXPlotLine($,O,R,v,N):this.drawYPlotLine($,O,R,v,N),z.show){const U=this.getNormalizedLabelOptions(t,z),H=this.getPlotLineLabelPosition($,U,R,v);this.drawPlotLabel(U,H)}a.restore()})}}getLabelFormat(t,n,o={}){if(this.formatter){const s=this.formatter(t,o);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(t,n):t}fittingString(t,n){const o=this.ctx;o.save(),o.font=Y.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return Y.truncateLabelWithEllipsis(t,n,o,s)}getLabelWidthHasMaxLength(t,n){const o=Y.getLabelStyle(this.labelStyle),s=(t==null?void 0:t.length)??0,l=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(s+2));return(t??[]).reduce((a,r)=>{var h;const c=this.getLabelFormat(r,l),d=((h=Y.calcTextSizeCanvas(c,o))==null?void 0:h.width)??0;return Math.max(a,d)},0)}}class OC extends oo{constructor(t,n,o,s,l){super(t,n,o),this.labels=s,this.options=l}getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return at(t).format(this.timeFormat)}getInterval(t){const n=t.maxValue,o=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return li[this.interval].size;if(typeof this.interval=="object")return this.interval.time*li[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-o)/s)}calculateSteps(t){const{maxValue:n,minValue:o,maxSteps:s}=t,l=this.getInterval(t);let a=l,r=o,c;for(;r<n;)r+=a;const d=r>n?n:r,h=o,u=d-h;c=Math.round(u/a)+1;const f=c;for(n===1&&(a=.2,c=5);c>s;)a*=2,c=Math.round(u/a),a=Math.ceil(u/c);return d-h>c*a&&(a=Math.ceil((d-h)/c)),{steps:c,oriSteps:f,interval:a,rawInterval:l,graphMin:h,graphMax:d}}draw(t,n,o,s,l){var R,v,N,L,P,_,A,z,$,U,H,X,j,K,q,Q;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=o.steps,h=o.graphMin,u=o.graphMax,f=o.rawInterval,g=o.oriSteps;let p=c[this.units.rectStart];const m=c[this.units.rectEnd],x=c[this.units.rectOffset(this.position)],b=c[this.units.rectOffsetCounter(this.position)],y=5;this.drawAxisTitle(t,n),a.font=Y.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const M=Y.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(p,x+M),a.lineTo(m,x+M)):(a.moveTo(x+M,p),a.lineTo(x+M,m)),a.stroke(),a.closePath(),d===0||h===null)return;const I=this.labelStyle.alignToGridLine,E=(m-p)/(g||1);this.categoryMode&&!I&&(p+=Math.ceil(E/2)-2);const T=[];let V=null,C=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let S,w,k,B=d<=2?g:Math.round(g/d);const D=p>Math.ceil(c[this.units.rectStart]);this.type==="x"&&D&&B===g&&(B=1);const O=B===g?g:g-1;for(k=0;k<=O;k+=B){T[k]=at(h).valueOf()+k*f,V=Math.round(p+E*k),C=V+M;let J;for(let Z=0;Z<T.length;Z++)T[Z]!==void 0&&Z!==k&&(J=T[Z]);S=this.getLabelFormat(Math.min(u,T[k]),{prev:J});const te=((v=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:v.use)&&((L=(N=this.options)==null?void 0:N.selectLabel)==null?void 0:L.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((P=l==null?void 0:l.dataIndex)==null?void 0:P.length)&&!(l!=null&&l.label.map(Z=>this.getLabelFormat(Math.min(u,Z),{prev:J})).includes(S)),G=this.labelStyle.color;let oe=1;if(Y.getColorStringType(G)==="RGBA"&&(oe=Y.getOpacity(G)),a.fillStyle=Y.colorStringToRgba(G,te?(_=this.options)==null?void 0:_.unSelectedOpacity:oe),this.type==="x"){if(w=this.position==="top"?x-10:x+10,a.fillText(this.checkFixWidth(S),V,w),!te&&((z=(A=this.options)==null?void 0:A.selectItem)!=null&&z.showLabelTip)&&(s!=null&&s.label)&&!(($=this.options)!=null&&$.horizontal)){const Z=this.getLabelFormat(Math.min(u,s.label+0*f));if(Z===S){const ae=Math.round(a.measureText((U=this.labelStyle)==null?void 0:U.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(Z).width)+10,height:ae,x:V,y:w+(ae-2),borderRadius:2,arrowSize:3,text:S,backgroundColor:(j=(X=(H=this.options)==null?void 0:H.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:j.backgroundColor,textColor:(Q=(q=(K=this.options)==null?void 0:K.selectItem)==null?void 0:q.labelTipStyle)==null?void 0:Q.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(C,x),a.lineTo(C,x+y),a.stroke(),a.closePath()),k<g&&this.showGrid&&(D||!D&&k!==0)&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(C,x),a.lineTo(C,b),a.stroke(),a.closePath())}else w=this.position==="left"?x-10:x+10,a.fillText(this.checkFixWidth(S),w,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(x+(this.axisLineWidth??1),C),a.lineTo(x-y,C),a.stroke(),a.closePath()),k<g&&this.showGrid&&(D||!D&&k!==0)&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(x,C),a.lineTo(b,C),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&I&&k*B===g){const J=at(r[1]).diff(at(r[0])),te=this.getLabelFormat(at(T[g-1]+J));V=Math.round(p+E*g),C=V+M,this.type==="x"?(a.fillText(this.checkFixWidth(te),V,w),this.showGrid&&(a.moveTo(C,x),a.lineTo(C,b))):(a.fillText(this.checkFixWidth(te),w,V),this.showGrid&&(a.moveTo(x,C),a.lineTo(b,C))),a.stroke()}a.closePath()}}const RC={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const e=this.options.title;Object.keys(e.style).forEach(t=>{this.titleDOM.style[t]=e.style[t]}),this.titleDOM.textContent=e.text,this.titleDOM.style.height=`${e.height}px`,this.titleDOM.style.lineHeight=`${e.height}px`}},LC={createLegendLayout(){var e,t;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(t=(e=this.options)==null?void 0:e.legend)!=null&&t.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var o;const e=(o=this.options.legend)==null?void 0:o.table,t=e.columns;["color",...Object.keys(t)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=t[s])!=null&&a.use||s==="color"||s==="name"){const c=t[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,Y.setDOMStyle(l,(r=e==null?void 0:e.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var e,t;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((t=(e=this.options.legend)==null?void 0:e.table)!=null&&t.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const e=this.options.legend.position==="right"||this.options.legend.position==="left",t=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,o=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=e?1:Math.floor(n/o),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=t>this.legendItemHeight?Math.round(t/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var t;const e=Math.max(Math.floor(((t=this.legendBoxDOM)==null?void 0:t.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(e,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const e=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(e&&e.length)for(const c of e)c.remove();const t=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,o=Math.max(t-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${o}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:e}=this.data,{seriesList:t}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(e,t,this.useTable),this.addStandaloneLegends(t,this.useTable))},addLegendForGroups(e,t,n){e==null||e.forEach(o=>{o==null||o.forEach(s=>{const l=t[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(e,t){Object.values(e).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,t)})},addLegendBasedOnType(e,t){t?this.addLegendWithValues(e):this.addLegend(e)},addColorLegendList(){const e=this.seriesList;Object.values(e).forEach(t=>{if(!t.isExistGrp&&t.showLegend){const{colorState:n,valueOpt:o}=t,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=o,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:f,color:g,label:p=""}=n[u],m=s+a*u;let x=m+a;u<h?x-=.1**c:x=l+.1**c;let b=p;if(!b)if(b=`${m.toFixed(c)} - ${x.toFixed(c)}`,s===void 0||l===void 0)if(u===0)b="0";else break;else{if(m>l)break;a<=1&&c===0&&(b=m)}this.addLegend({cId:f,color:g,name:b,show:!0})}}})},getContainerDOM(e){let t=null;const n=e.target.dataset.type;return n==="container"?t=e.target:["name","color","min","max","avg","total","last"].includes(n)&&(t=e.target.parentElement,t!=null&&t.series||(t=t.parentElement)),t},initEvent(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},t=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=l==null?void 0:l.getElementsByClassName(e.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const u of d)u.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var f,g;let r;const c=l==null?void 0:l.getElementsByClassName(e.color)[0],d=l==null?void 0:l.getElementsByClassName(e.name)[0],h=l==null?void 0:l.getElementsByClassName(e.value),u=l==null?void 0:l.series;if(typeof u.color!="string"?r=u.color[u.color.length-1][1]:r=u.color,u.type==="line"&&u.fill?(c.style.height="8px",c.style.backgroundColor=Y.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const p of h){const m=(g=(f=this.options.legend.table)==null?void 0:f.columns[p.dataset.type])==null?void 0:g.style;p.style.color=m!=null&&m.color?m.color:a}u.show=!0,l.dataset.inactive=!1},o=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var x;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));b.every(I=>I.dataset.inactive==="false")?(b.forEach(I=>{t(I,a.inactive)}),o(),n(c,a.color),this.seriesInfo.count=1):u?(t(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),b.every(I=>I.dataset.inactive==="true")&&(b.forEach(I=>{n(I,a.color)}),s(),this.seriesInfo.count=b.length)}if(a.clickMode!=="active"){if(u&&this.seriesInfo.count===1)return;u?(t(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const b=[...this.brushSeries.list];b[r]=this.seriesList,this.brushSeries.list=b,this.brushSeries.chartIdx=r}((x=this.options.eventBehavior)==null?void 0:x.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const g=Object.values(this.seriesList).filter(b=>b.show).map(b=>b.sId),p=g.length===Object.values(this.seriesList).length,m={e:l,data:{seriesIds:p?[]:g,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](m)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},t=(l,a)=>{var f;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var f,g;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(f=l==null?void 0:l.series)==null?void 0:f.cId;r.style.backgroundColor=(g=l==null?void 0:l.series)==null?void 0:g.color,c.style.color=a;const u=d.colorState.findIndex(p=>p.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},o=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var b;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],u=(c==null?void 0:c.dataset.inactive)==="false",f=r.colorState.filter(y=>y.show).length;if(!d||!h)return;if(a.clickMode==="active"){const y=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));y.every(E=>E.dataset.inactive==="false")?(y.forEach(E=>{t(E,a.inactive)}),o(),n(c,a.color)):u?t(c,a.inactive):u||n(c,a.color),y.every(E=>E.dataset.inactive==="true")&&(y.forEach(E=>{n(E,a.color)}),s())}if(a.clickMode!=="active"){if(u&&f===1)return;u?t(c,a.inactive):n(c,a.color)}((b=this.options.eventBehavior)==null?void 0:b.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const g=r.colorState.filter(y=>y.show),p=g.map(y=>+y.id.split("#")[1]),m=r.colorState.length===g.length,x={e:l,data:{seriesIndices:m?[]:p,isActiveAll:m}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](x)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,u;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(u=r==null?void 0:r.series)==null?void 0:u.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(f=>{f.state=f.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=this.options,n=t.legend.position,o=t.title.show?t.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${o}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var o,s,l,a,r;const e=(l=(s=(o=this.options)==null?void 0:o.legend)==null?void 0:s.table)==null?void 0:l.columns,t=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const u=h.dataset.type;if(u!=="name"){const f=c.series.sId,g=(r=t==null?void 0:t[f])==null?void 0:r[u];h.textContent=this.getFormattedValue(e[u],g)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var t,n;const e=this.legendBoxDOM;if(e){if(this.useTable){const o=this.legendTableDOM;for(;o.hasChildNodes();)o.removeChild(o.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(t=this.legendDOM)==null?void 0:t.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;e.hasChildNodes();)e.removeChild(e.firstChild);this.seriesInfo.count=0}},destroyLegend(){const e=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),e&&(e.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(e){const t=this.options.legend,n=document.createElement("div"),o=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!e.show,n.series=e,o.className="ev-chart-legend-color",e.type==="line"&&e.point&&!e.fill&&(o.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;e.show?typeof e.color!="string"?l=e.color[e.color.length-1][1]:l=e.color:l=t.inactive,e.type==="line"&&e.fill?(o.style.height="8px",o.style.backgroundColor=e.show?Y.rgbaAdjustHalfOpacity(l):t.inactive,o.style.border=`1px solid ${l}`):o.style.backgroundColor=l,o.dataset.type="color",s.style.color=t.color,s.textContent=e.name,s.setAttribute("title",e.name),s.dataset.type="name",n.appendChild(o),n.appendChild(s),t.position==="top"||t.position==="bottom"?(n.style.width=`${t.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),e.show&&this.seriesInfo.count++},addLegendWithValues(e){var h,u,f,g,p;const t=this.options.legend,n=(h=t==null?void 0:t.table)==null?void 0:h.columns,o=(u=this.getAggregations())==null?void 0:u[e==null?void 0:e.sId];if(!o||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!e.show,Y.setDOMStyle(s,(g=(f=t.table)==null?void 0:f.style)==null?void 0:g.row),s.series=e,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(e.show?typeof e.color!="string"?r=e.color[e.color.length-1][1]:r=e.color:r=t.inactive,e.type){case"line":{e.fill?(a.style.backgroundColor=Y.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(e.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}e.type==="line"&&e.fill?(a.style.height="8px",a.style.backgroundColor=e.show?Y.rgbaAdjustHalfOpacity(r):t.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=e.show?t.color:t.inactive,c.textContent=e.name,c.setAttribute("title",e.name),c.dataset.type="name",Y.setDOMStyle(c,(p=n==null?void 0:n.name)==null?void 0:p.style),e.show||(c.style.color=t.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(m=>{var x;if(m!=="name"&&n[m].use){const b=this.getFormattedValue(n[m],o[m]),y=document.createElement("td");y.className="ev-chart-legend--table__value",y.style.color=e.show?t.color:t.inactive,y.textContent=b,y.dataset.type=m.toString(),Y.setDOMStyle(y,(x=n[m])==null?void 0:x.style),e.show||(y.style.color=t.inactive),s.appendChild(y)}}),this.legendTableDOM.appendChild(s),e.show&&this.seriesInfo.count++},setLegendPosition(){var p,m,x,b,y,M,I,E,T;const e=this.options,t=(p=e==null?void 0:e.legend)==null?void 0:p.position,n=(m=this.wrapperDOM)==null?void 0:m.style,o=(x=this.legendDOM)==null?void 0:x.style,s=(b=this.legendBoxDOM)==null?void 0:b.style,l=(y=this.resizeDOM)==null?void 0:y.style;let a,r;const c=(M=e==null?void 0:e.title)!=null&&M.show?(I=e==null?void 0:e.title)==null?void 0:I.height:0,d=c+((E=e==null?void 0:e.legend)==null?void 0:E.height),{top:h=0,bottom:u=0,left:f=0,right:g=0}=((T=e==null?void 0:e.legend)==null?void 0:T.padding)??{};if(!(!n||!o))switch(s.padding=`${h}px ${g}px ${u}px ${f}px`,t){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(o.paddingTop)+parseInt(o.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,o.top=`${c}px`,o.right="",o.bottom="",o.left="",o.width=`${a.width}px`,o.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${e.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width-10}px`,s.maxHeight=`${a.height}px`,o.paddingLeft="10px",o.top=`${c}px`,o.right="0px",o.bottom="",o.left="",o.width=`${e.legend.width}px`,o.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${e.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${e.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(o.paddingTop)+parseInt(o.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,o.top="",o.right="",o.bottom="0px",o.left="0px",o.width=`${a.width}px`,o.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${e.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${e.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",o.top=`${c}px`,o.right="",o.bottom="",o.left="0px",o.width=`${e.legend.width}px`,o.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${e.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const e=(n=this.options)==null?void 0:n.legend,t=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(t)for(let o=0;o<t.length;o++)e.position==="top"||e.position==="bottom"?(t[o].style.width=`${e.width-8}px`,t[o].style.margin="0 4px"):t[o].style.width="100%"},onMouseMove(e){e.stopPropagation(),e.preventDefault();const t=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,o=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=e.clientX-t.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=e.clientX-t.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=e.clientY-t.top,h<d+s?h=d+s:h>o-r&&(h=o-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=e.clientY-t.top,h<r+s?h=r+s:h>o-d&&(h=o-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(e){e.stopPropagation(),e.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const t=this.options,n=t.legend.position,o=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=t.title.show?t.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":o.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,t.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":o.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,t.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":o.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,t.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":o.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,t.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}o.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const e=this.options,t=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,o=(r=this.legendDOM)==null?void 0:r.style,s=(c=e==null?void 0:e.title)!=null&&c.show?(d=e==null?void 0:e.title)==null?void 0:d.height:0;!o||!t||(n&&(n.display="none"),o.display="none",o.width="0",o.height="0",t.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:e,decimalPoint:t},n){if(n==null)return"Null";let o;return e&&(o=e(+n)),(!e||typeof o!="string")&&(o=Y.labelSignFormat(+n,t)),o}},Rr=28,NC={width:70,height:60},VC={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=e.target.dataset.type;let n;if(t==="handle")n=e.target;else if(t==="handle-btn")n=e.target.parentElement;else if(t==="handle-btn-color")n=e.target.parentElement.parentElement;else return;const o=Object.values(this.seriesList);if(!o.length)return;const{colorState:s}=o[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=e=>{e.stopPropagation(),e.preventDefault();const{dragging:t,isStart:n}=this.legendDragInfo;if(t){let o=this.getSelectedValue(e);o=this.isSide?100-o:o;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&o>c||!n&&o<r)return;a[0][s]=o,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const e=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];e==null||e.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=e=>{const t=e.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:o,valueOpt:s}=n[0],l=o[0];let a=this.getSelectedValue(e);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(t))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(t)){const r=e.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const e=Object.values(this.seriesList);if(!e.length)return;const{colorState:t}=e[0];t[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(e){const{x:t,y:n,width:o,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?t:n,r=l?o:s;let c=l?e.clientX:e.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+We(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},resetLegend(){const e=this.containerDOM;if(e)for(;e.hasChildNodes();)e.removeChild(e.firstChild)},clearOverlay(){const e=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],t=e==null?void 0:e.getElementsByClassName("ev-chart-legend-overlay")[0];if(t){e.removeChild(t);const o=e.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(o&&o.length)for(const s of o)s.style.opacity=1}},createLegendOverlay(e,t){this.clearOverlay();const n=this.legendHandleSize,{min:o,max:s}=t;if(o===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(o+(s-o)*(e/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const u=Math.floor(n/2)+14;this.isSide?(h=`top:${100-e}%;left:${u}px;transform:translateY(-50%);`,d=`top:${100-e}%;transform:translateY(-50%);`):(h=`top:-${u}px;left:${e}%;transform:translateX(-50%);`,d=`left:${e}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const f=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(f){const g=f.children;if(g&&g.length)for(const p of g)p.style.opacity=.2}},createLegendHandle(e){const t=document.createElement("span");t.className=`ev-chart-legend-handle-btn-color ${e}`,t.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${e}`,n.dataset.type="handle-btn",n.appendChild(t);const o=document.createElement("div");return o.className=`ev-chart-legend-handle ${e}`,o.dataset.type="handle",o.appendChild(n),o},createLegendLabel(){const e=document.createElement("span");e.className="ev-chart-legend-label-text";const t=document.createElement("div");return t.className="ev-chart-legend-label",t},createLegend(){if(!Object.values(this.seriesList).length)return;const e=this.options.legend;this.isSide=!["top","bottom"].includes(e.position);const t=this.isSide?e.width:e.height;this.legendHandleSize=t>Rr?Rr:t;const n=this.legendHandleSize,o=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(o),this.containerDOM.appendChild(s)},setLegendStyle(e){const t=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:o,colorState:s}=e,{min:l,max:a,decimalPoint:r}=o,{start:c,end:d}=s[0],h=e.getColorForGradient(c),u=e.getColorForGradient(d);let f=`linear-gradient(to ${t}, `;f+=`${h}, ${u})`;const g=Math.floor(n/2)+14;let p=`width:${n}px;height:${n}px;`,m,x,b,y=`background:${f};`;this.isSide?(p+=`margin-top:-${n/2}px;`,m=`left:${g}px;transform:translateY(-50%);top:`,x=`top:${100-d}%;`,b=`top:${100-c}%;`,y+=`top:${100-d}%;height:${d-c}%;`):(p+=`margin-left:-${n/2}px;`,m=`top:-${g}px;transform:translateX(-50%);left:`,x=`left:${c}%;`,b=`left:${d}%;`,y+=`left:${c}%;width:${d-c}%;`);const M=(l+(a-l)*(c/100)).toFixed(r),I=(l+(a-l)*(d/100)).toFixed(r),E=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];E.style.cssText=y;const T=E.getElementsByClassName("ev-chart-legend-label");T[0].style.cssText=`${m}0%;`,T[1].style.cssText=`${m}100%;`,l!==void 0&&a!==void 0&&(T[0].innerText=this.isSide?I:M,T[1].innerText=this.isSide?M:I);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=p+x,V[1].style.cssText=p+b;const C=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");C[0].style.backgroundColor=this.isSide?u:h,C[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var x,b,y,M;const e=this.options,t=(x=e==null?void 0:e.legend)==null?void 0:x.position,{width:n,height:o}=NC,s=this.legendHandleSize,l=(b=e==null?void 0:e.title)!=null&&b.show?(y=e==null?void 0:e.title)==null?void 0:y.height:0,a=l+o,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((M=e==null?void 0:e.legend)==null?void 0:M.padding)??{},u=this.wrapperDOM.style;if(!u)return;let f,g,p,m;switch(t){case"top":u.padding=`${a}px 0 0 0`,m=this.chartDOM.getBoundingClientRect(),g=`padding:${s+7}px ${h}px ${c}px ${d}px;`,g+="width:100%",g+=`height${o}px;`,f=`width:${m.width}px;`,f+=`height:${o}px;`,f+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,m=this.chartDOM.getBoundingClientRect(),g=`padding:${r}px ${h}px ${c}px ${d}px;`,g+=`width:${n}px;`,g+="height:100%;",g+=`max-height:${m.height}px;`,f=`width:${n}px;`,f+=`height:${m.height}px;`,f+=`top:${l}px;right:0px;`;break;case"bottom":u.padding=`${l}px 0 ${o}px 0`,m=this.chartDOM.getBoundingClientRect(),g=`padding:${s+7}px ${h}px ${c}px ${d}px;`,g+="width:100%;",g+=`height:${o}px;`,f=`width:${m.width}px;`,f+=`height:${o}px;`,f+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,m=this.chartDOM.getBoundingClientRect(),g=`padding:${r}px ${h}px ${c}px ${d}px;`,g+="display:absolute;",g+="bottom:0px;",g+=`width:${n}px;`,g+="height:100%;",g+=`maxHeight:${m.height}px;`,f=`width:${n}px;`,f+=`height:${m.height}px;`,f+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(t)){const I=m.width/2;p=`left:${m.width/2-I/2}px;`,p+=`width:${I}px;`,p+=`height:${s}px;`,p+="padding:4px 0;",p+="margin:0 4px;"}else{const I=m.height/2;p=`top:${m.height/2-I/2}px;`,p+="left:5px;",p+=`width:${s}px;`,p+=`height:${I}px;`,p+="padding:0 4px;",p+="margin:4px 0;"}this.containerDOM.style.cssText=p,this.legendBoxDOM.style.cssText=g,this.legendDOM.style.cssText=f},updateLegendContainerSize(){Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const e=this.options,t=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,o=(a=e==null?void 0:e.title)!=null&&a.show?(r=e==null?void 0:e.title)==null?void 0:r.height:0;!n||!t||(n.display="none",n.width="0",n.height="0",t.padding=`${o}px 0 0 0`)}},PC={initScrollbar(){var e,t,n,o,s,l;(n=(t=(e=this.options.axesX)==null?void 0:e[0])==null?void 0:t.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(o=this.options.axesY)==null?void 0:o[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(e,t){var s,l,a,r,c,d;const n=this.scrollbar[t],o=Fe({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,Ir.scrollbar);Object.keys(o).forEach(h=>{n[h]=o[h]}),n.resetPosition&&(n.range=(a=(l=e==null?void 0:e[0])==null?void 0:l.range)!=null&&a.length?[...e[0].range]:null,this.resetScrollbarSavedPositions(t)),n.isInit||(n.type=(r=e==null?void 0:e[0])==null?void 0:r.type,n.range=(d=(c=e==null?void 0:e[0])==null?void 0:c.range)!=null&&d.length?[...e[0].range]:null,this.resetScrollbarSavedPositions(t),this.initScrollbarRange(t),this.createScrollbarLayout(t),this.createScrollbar(t),this.createScrollEvent(t),n.isInit=!0)},initScrollbarRange(e){var s,l;const t=this.scrollbar[e],n=t.type,o=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;if((s=t.range)!=null&&s.length&&o.length){const[a,r]=t.range;let c,d;if(ve(a)&&ve(r)){if(n==="step")c=0,d=o.length-1;else{const f=(l=this.minMax[e])==null?void 0:l[0];c=+f.min,d=+f.max}const h=r-a,u=d-c;h>=u?(t.range[0]=c,t.range[1]=d):(t.range[0]=+a<c?c:+a,t.range[1]=+r>d?d:+r,t.range[1]-t.range[0]<h&&(t.range[0]=t.range[1]-h,t.range[0]<c&&(t.range[0]=c)))}}},updateScrollbarInfo(e,t){var r,c,d,h,u,f,g,p,m,x,b,y,M,I,E,T;const{axesX:n,axesY:o}=this.options,s=e==="x"?n:o;if(!this.scrollbar[e].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,e);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||Gi((u=s==null?void 0:s[0])==null?void 0:u.range)){this.destroyScrollbar(e);return}const l=e==="x"?this.axesX:this.axesY,a=!je((f=s==null?void 0:s[0])==null?void 0:f.range,(g=l==null?void 0:l[0])==null?void 0:g.range);if(a||t){const V=e==="x"?(x=(m=(p=this.options.axesX)==null?void 0:p[0])==null?void 0:m.scrollbar)==null?void 0:x.resetPosition:(M=(y=(b=this.options.axesY)==null?void 0:b[0])==null?void 0:y.scrollbar)==null?void 0:M.resetPosition;a&&(this.scrollbar[e].range=(E=(I=s==null?void 0:s[0])==null?void 0:I.range)!=null&&E.length?[...s[0].range]:null),(V||t)&&this.resetScrollbarSavedPositions(e),this.initScrollbarRange(e)}this.scrollbar[e].use=!!((T=s==null?void 0:s[0].scrollbar)!=null&&T.use)},updateScrollbarPosition(){var e,t,n,o,s,l,a,r,c,d;if((e=this.scrollbar.x)!=null&&e.use&&((t=this.scrollbar.x)!=null&&t.isInit)){const h=!((s=(o=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:o.scrollbar)!=null&&s.resetPosition);this.setScrollbarPosition("x",h)}if((l=this.scrollbar.y)!=null&&l.use&&((a=this.scrollbar.y)!=null&&a.isInit)){const h=!((d=(c=(r=this.options.axesY)==null?void 0:r[0])==null?void 0:c.scrollbar)!=null&&d.resetPosition);this.setScrollbarPosition("y",h)}},createScrollbarLayout(e){const t=this.scrollbar[e];t.dom=document.createElement("div"),t.dom.className="ev-chart-scrollbar",t.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=e,t.dom.appendChild(n),this.wrapperDOM.appendChild(t.dom)},createScrollbar(e){const t=this.scrollbar[e],n=t.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),t.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-track",t.dataset.type="track",e.appendChild(t)},createScrollbarThumb(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-thumb",t.dataset.type="thumb",e.appendChild(t)},createScrollbarButton(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",t.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",t.appendChild(n);const o=document.createElement("div");o.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",o.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",o.appendChild(s),e.appendChild(t),e.appendChild(o)},setScrollbarPosition(e,t=!1){var V,C;const n=this.scrollbar[e];if(!n.use||!n.range)return;const o=n.dom,s=this.chartRect,l=this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(C=this.options.title)==null?void 0:C.height:0,c=e==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,u=n.showButton?d:0,f=h-u*2,g=this.getScrollbarThumbSize(e,f);if(t&&n.savedPositionRatio!==void 0){const S=Math.max(0,f-g.size);n.savedAtStart?g.position=0:n.savedAtEnd?g.position=S:g.position=Math.min(n.savedPositionRatio*f,S)}const p=Math.max(0,f-g.size);p>0&&(n.savedPositionRatio=g.position/f,n.savedAtStart=g.position<=0,n.savedAtEnd=g.position>=p);let m="display: block;",x,b,y,M,I=`width:${u}px;height:${u}px;`;c?(m=`top: ${s.y2+r+l.top}px;`,m+=`left: ${a.x1}px;`,m+=`width: ${h}px;`,m+=` height: ${d}px;`,x="top: 0;",x+=`left: ${u}px;`,x+=`width: ${f}px;`,x+="height: 100%;",b=`width: ${g.size}px;`,b+="height: 100%;",b+=`left: ${g.position+u}px`,I+="transform:rotate(90deg);top: 0;",y=`${I}right:0;`,M=`${I}left:0;`):(m=`top: ${a.y1+r}px;`,m+=`left: ${a.x2+10}px;`,m+=`width: ${d}px;`,m+=`height: ${h}px;`,x=`top: ${u}px;`,x+="left: 0;",x+="width: 100%;",x+=`height: ${f}px;`,b="width: 100%;",b+=`height: ${g.size}px;`,b+=`bottom: ${g.position+u}px`,I+="left:0;",y=`${I}top: 0;`,M=`${I}bottom: 0;`),o.style.cssText=m;const E=o.getElementsByClassName("ev-chart-scrollbar-track");E[0].style.cssText=x,E[0].style.backgroundColor=n.background;const T=o.getElementsByClassName("ev-chart-scrollbar-thumb");if(T[0].style.cssText=b,T[0].style.backgroundColor=n.thumbStyle.background,T[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const S=o.getElementsByClassName("ev-chart-scrollbar-button-up"),w=Math.floor(f-g.size),k=Math.floor(g.position)>w?.5:1;S[0].style.cssText=`background-color: ${n.background};${y}`,S[0].style.opacity=k,S[0].children[0].style.display="block";const B=o.getElementsByClassName("ev-chart-scrollbar-button-down");B[0].style.cssText=`background-color: ${n.background};${M}`,B[0].style.opacity=Math.floor(g.position)<0?.5:1,B[0].children[0].style.display="block"}},getScrollbarThumbSize(e,t){var u,f,g,p;const n=this.scrollbar[e],[o,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const m=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,x=s-o+1;r=m.length;const b=t/r;a=b*x,h=b*o}else{const m=e==="x"?this.axesX:this.axesY,x=(u=this.minMax[e])==null?void 0:u[0],b=+x.max-+x.min,y=+s-+o;l==="time"&&(c=(p=m==null?void 0:m[0])==null?void 0:p.getInterval({minValue:x.min,maxValue:x.max,maxSteps:(g=(f=this.labelRange[e])==null?void 0:f[0])==null?void 0:g.max})),r=Math.ceil(b/c)+1,d=+x.min;const M=t/r,I=y/c+1,E=+o-d;a=M*I,h=M*(E/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(e){const t=["track","thumb","button"],n=e.dataset.type;return t.includes(n)?e.parentElement:n==="button-icon"?e.parentElement.parentElement:n==="scrollbar"?e.getElementsByClassName("ev-chart-scrollbar-container")[0]:e},updateScrollbarRange(e,t){const n=this.scrollbar[e],{startValue:o,range:s,interval:l,steps:a}=n,r=o+l*a,c=e==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!ve(d)||!ve(h))&&(n.range=(c==null?void 0:c.range)||null);let u,f,g=!1;t?(u=d+l,f=h+l,g=f>=r):(u=d-l,f=h-l,g=u<o),g||(n.range=[u,f],this.resetScrollbarSavedPositions(e),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},resetScrollbarSavedPositions(e){const t=this.scrollbar[e];t&&(delete t.savedPositionRatio,delete t.savedAtStart,delete t.savedAtEnd)},createScrollEvent(){var t,n,o;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:u,y:f}=h[0].getBoundingClientRect(),g=c==="x",p=g?s.clientX:-s.clientY,m=g?u:-f;d=p>m}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),u=this.scrollbar[a];u.scrolling=!0,a==="x"?u.pointInThumb=s.clientX-c:u.pointInThumb=d+h-s.clientY;const f=u.dom;f.addEventListener("mousemove",this.onScrollbarMove),f.addEventListener("mouseup",this.onScrollbarUp)};const e=s=>{this.scrolling(s)};if(this.onScrollbarMove=xs(e,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,u,f,g,p,m,x,b;const l=((u=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:u.display)==="block",a=this.tooltipBodyDOM||((f=this.tooltipDOM)==null?void 0:f.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:y,scrollHeight:M,clientHeight:I}=a,E=y<=0,T=y+I>=M,V=s.deltaY<0,C=s.deltaY>0;if(!(E&&V||T&&C))return}s.preventDefault();const r=1;if((g=this.scrollbar.x)!=null&&g.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((p=this.scrollbar.x)!=null&&p.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((m=this.scrollbar.y)!=null&&m.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((x=this.scrollbar.x)!=null&&x.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(b=this.scrollbar.y)!=null&&b.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((t=this.scrollbar.x)!=null&&t.use||(n=this.scrollbar.y)!=null&&n.use)&&((o=this.overlayCanvas)==null||o.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(e){const t=this.getScrollbarContainerDOM(e.target),n=t.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:o,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=t.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:u,height:f}=c[0].getBoundingClientRect(),g=n==="x",p=g?d:h,m=g?u:f,x=m/o,b=a+(o-1)*r;let y=g?e.clientX:e.clientY;y<p?y=p:y>p+m&&(y=p+m);let M;if(g?M=y-p-l:M=p+m-y-l,M<=0)return;let I,E;const T=Math.round(Math.abs(M)/x)*r,[V,C]=s;if(M>0){const S=a+(T-+V);I=+V+S,E=I+(+C-+V)}I<a||E>b||(this.scrollbar[n].range=[I,E],this.resetScrollbarSavedPositions(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:I>1,updateByScrollbar:!0}))},stopScrolling(e){const n=this.getScrollbarContainerDOM(e.target).dataset.type,o=this.scrollbar[n];if(o.scrolling){o.scrolling=!1;const s=o.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(e){const t=this.scrollbar[e].dom;if(!t)return;const n=t==null?void 0:t.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(e){var n,o,s;const t=this.scrollbar[e].dom;t&&(t.remove(),this.scrollbar[e]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((o=this.scrollbar.y)!=null&&o.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function _C(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function Lr(e,t,n){let o,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;const g=!t&&t!==0&&typeof root.requestAnimationFrame=="function";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0,_C(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Math.max(+n.maxWait||0,t):l,f="trailing"in n?!!n.trailing:f);function p(w){const k=o,B=s;return o=s=void 0,d=w,a=e.apply(B,k),a}function m(w,k){return g?(window.cancelAnimationFrame(r),window.requestAnimationFrame(w)):setTimeout(w,k)}function x(w){if(g)return window.cancelAnimationFrame(w);clearTimeout(w)}function b(w){return d=w,r=m(I,t),h?p(w):a}function y(w){const k=w-c,B=w-d,D=t-k;return u?Math.min(D,l-B):D}function M(w){const k=w-c,B=w-d;return c===void 0||k>=t||k<0||u&&B>=l}function I(){const w=Date.now();if(M(w))return E(w);r=m(I,y(w))}function E(w){return r=void 0,f&&o?p(w):(o=s=void 0,a)}function T(){r!==void 0&&x(r),d=0,o=c=s=r=void 0}function V(){return r===void 0?a:E(Date.now())}function C(){return r!==void 0}function S(...w){const k=Date.now(),B=M(k);if(o=w,s=this,c=k,B){if(r===void 0)return b(c);if(u)return r=m(I,t),p(c)}return r===void 0&&(r=m(I,t)),a}return S.cancel=T,S.flush=V,S.pending=C,S}const AC="Expected a function";function zC(e,t,n){let o=!0,s=!0;if(typeof e!="function")throw new TypeError(AC);return Lr(e,t,{leading:o,maxWait:t,trailing:s})}const FC={createEventFunctions(){var e,t,n,o;this.onMouseMove=s=>{var f,g;if((f=this.dragInfo)!=null&&f.isMove||this.isMobile)return;const l={e:s},{indicator:a,tooltip:r,type:c}=this.options,d=this.getMousePosition(s),h=this.findHitItem(d);r!=null&&r.showAllValueInRange&&(h!=null&&h.items)&&this.addNotHitInfo(h);const u=this.overlayCtx;if(this.overlayClear(),Object.keys(h.items).length){if(r.use&&this.isInitTooltip)if(this.drawItemsHighlight(h,u),typeof(r==null?void 0:r.returnValue)=="function"){const m=[];Object.keys(h.items).forEach(x=>{m.push({sId:x,data:h.items[x].data,color:h.items[x].color,name:h.items[x].name,dataId:h.items[x].id,index:h.items[x].index})}),this.hideTooltipDOM(),r.returnValue(m,s)}else(g=r==null?void 0:r.formatter)!=null&&g.html?(this.drawCustomTooltip(h==null?void 0:h.items),this.setCustomTooltipLayoutPosition(h,s)):(this.setTooltipLayoutPosition(h,s),c==="scatter"?this.drawTooltipForScatter(h,this.tooltipCtx):c==="heatMap"?this.drawToolTipForHeatMap(h,this.tooltipCtx):this.drawTooltip(h,this.tooltipCtx));const p=Object.values(this.seriesList||{}).some(m=>m.type==="line");if(r.use&&(c==="line"||p)){const m=this.drawIndicatorForTooltip(h,a.color),x=m==null?void 0:m.labelValue,b=this.getTimeLabel(d);l.hoveredLabel={horizontal:this.options.horizontal,label:b,mousePosition:[s.clientX,s.clientY],dataLabel:x}}}else r.use&&this.isInitTooltip&&(typeof(r==null?void 0:r.returnValue)=="function"&&r.returnValue([],s),this.hideTooltipDOM());if(this.dragInfoBackup&&this.drawSelectionArea(this.dragInfoBackup),!l.hoveredLabel&&!this.isNotUseIndicator()){const p=Object.values(this.seriesList||{}).some(x=>x.type==="line");(c!=="line"&&!p||!r.use||!Object.keys(h.items).length)&&this.drawIndicator(d,a.color);const m=this.getTimeLabel(d);l.hoveredLabel={horizontal:this.options.horizontal,label:m,mousePosition:[s.clientX,s.clientY]}}else l.hoveredLabel||(l.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(c!=="pie"&&(l.curMouseTargetVal=this.getCurMouseTargetVal(d,h)),this.listeners["mouse-move"](l))},this.onMouseLeave=s=>{const{tooltip:l,dragSelection:a}=this.options;l.throttledMove&&this.onMouseMove.cancel(),(!a.use||!a.keepDisplay)&&this.overlayClear(),l.use&&this.isInitTooltip&&(typeof(l==null?void 0:l.returnValue)=="function"&&l.returnValue([],s),this.tooltipClear()),this.listeners["mouse-leave"]()},this.onDblClick=s=>{const l={e:s},a=this.getMousePosition(s),{type:r,selectItem:c,selectLabel:d,selectSeries:h}=this.options,u=(c==null?void 0:c.use)&&(c==null?void 0:c.useClick),f=(d==null?void 0:d.use)&&(d==null?void 0:d.useClick),g=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick);u?l.eventTarget="item":f?l.eventTarget="label":g&&(l.eventTarget="series");const p=()=>{var I,E;const b=this.findHitItem(a),y=b.hitId||Object.keys(b.items)[0],M=b.items[y];M&&(l.label=M.label,l.value=(I=M.data)==null?void 0:I.o,l.seriesId=y,l.dataIndex=M.index,l.acc=(E=M.data)==null?void 0:E.acc)},m=b=>{var V,C;const y=this.findHitItem(a),M=y.hitId||Object.keys(y.items)[0],I=y.items[M],{labelIndex:E}=this.getLabelInfoByPosition(a,b),{dataIndex:T}=this.regulateSelectedLabelInfo(E,b);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(T,b),I&&(l.label=I.label,l.seriesId=M,l.value=(V=I.data)==null?void 0:V.o,l.acc=(C=I.data)==null?void 0:C.acc,l.dataIndex=I.index)},x=()=>{var I,E,T;const b=this.findHitItem(a),y=b.hitId||Object.keys(b.items)[0],M=b.items[y];if(y!==null){const V=this.updateSelectedSeriesInfo(y,!0);M&&(l.label=M.label,l.value=(I=M.data)==null?void 0:I.o,l.seriesId=(E=V.seriesId)==null?void 0:E.at(0),l.acc=(T=M.data)==null?void 0:T.acc,l.dataIndex=M.index)}};switch(r){case"bar":{f?m(this.options.horizontal?"yAxis":"xAxis"):p();break}case"line":{u?p():f?m():g&&x();break}default:{p();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](l)},this.onClick=s=>{var b;if(this.isMouseMove){this.isMouseMove=!1;return}const l={e:s},a=this.getMousePosition(s),{type:r,selectItem:c,selectLabel:d,selectSeries:h}=this.options,u=(c==null?void 0:c.use)&&(c==null?void 0:c.useClick),f=(d==null?void 0:d.use)&&(d==null?void 0:d.useClick),g=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick),p=()=>{const y=this.getItemByPosition(a,!1);({label:l.label,value:l.value,sId:l.seriesId,maxIndex:l.dataIndex,acc:l.acc}=y),y!=null&&y.sId&&(l.selected={eventTarget:"item",seriesId:this.isDeselectItem(y)?null:y.sId,dataIndex:this.isDeselectItem(y)?null:y.maxIndex})},m=y=>{var E,T,V,C;const{labelIndex:M}=this.getLabelInfoByPosition(a,y),{dataIndex:I}=this.regulateSelectedLabelInfo(M,y);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,y),y&&(this.defaultSelectInfo.targetAxis=I!=null&&I.length?y:null),l.selected={eventTarget:"label",...Se(this.defaultSelectInfo)},l.label=(T=(E=this.defaultSelectInfo)==null?void 0:E.label)==null?void 0:T.at(0),l.dataIndex=(C=(V=this.defaultSelectInfo)==null?void 0:V.dataIndex)==null?void 0:C.at(0)},x=()=>{const y=this.findHitItem(a),M=y.hitId||Object.keys(y.items)[0],I=y.items[M];if(!pt(M)){const E=this.updateSelectedSeriesInfo(M,!1);this.defaultSelectInfo.seriesId=E.seriesId,l.selected={eventTarget:"series",...Se(this.defaultSelectInfo)},l.label=I.label,l.dataIndex=I.index}};switch(r){default:case"bar":{u?p():f&&m(this.options.horizontal?"yAxis":"xAxis");break}case"line":{u?p():f?m():g&&x();break}case"heatMap":{const y=!!this.options.horizontal;if(u&&f){const{useBothAxis:M}=d,I=this.getCurMouseLocation(a);if(I==="chartBackground")this.clearSelectedLabelInfo(),l.deselected={eventTarget:"label"},p();else if(I==="yAxis"||I==="xAxis"){if(this.clearSelectedItemInfo(),l.deselected={eventTarget:"item"},!M&&I!==(y?"yAxis":"xAxis"))return;m(I)}}else if(u)p();else if(f){const{useBothAxis:M}=d,I=this.getCurMouseLocation(a);if((I==="yAxis"||I==="xAxis")&&!M&&I!==(y?"yAxis":"xAxis"))return;I!=="canvas"&&m(M?I:null)}break}case"pie":{u&&p();break}case"scatter":{if(u&&p(),(b=this.options.dragSelection)!=null&&b.use&&this.isMobile){let y=this.setTouchInfo(s);this.overlayClear(),this.options.dragSelection.keepDisplay&&(s.layerX<y.range.x1||s.layerY<y.range.y1||s.layerX>y.range.x2||s.layerY>y.range.y2)?this.isTouchOverlay=!1:(y=this.setTouchBoxDimensions(y),this.isTouchOverlay=!0,this.drawSelectionArea(y)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),l.e=s,l.touchInfo=y,l.data=this.findSelectedItems(y),l.range=this.getSelectionRange(y),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](l)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(l))},this.onMouseDown=s=>{const{dragSelection:l,type:a}=this.options;l.use&&(a==="scatter"||a==="line"||a==="heatMap")&&(this.removeSelectionArea(),this.dragStart(s,a))},this.onWheel=s=>{var r,c,d;const l=((c=(r=this.tooltipDOM)==null?void 0:r.style)==null?void 0:c.display)==="block",a=(d=this.tooltipDOM)==null?void 0:d.querySelector(this.options.tooltip.htmlScrollTarget);(l||a&&a.scrollHeight>a.clientHeight)&&(s.preventDefault(),l&&(this.tooltipBodyDOM.scrollTop+=s.deltaY),a&&(a.scrollTop+=s.deltaY))},(t=(e=this.options)==null?void 0:e.tooltip)!=null&&t.useScrollbar&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(o=(n=this.options)==null?void 0:n.tooltip)!=null&&o.throttledMove&&(this.onMouseMove=zC(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick),this.overlayCanvas.addEventListener("mousedown",this.onMouseDown),this.dragTouchSelectionEvent=s=>this.dragTouchSelectionDestroy(s),window.addEventListener("click",this.dragTouchSelectionEvent)},dragStart(e,t){let[n,o]=this.getMousePosition(e);const s=this.chartRect,l=this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom};n<a.x1&&(n=a.x1),n>a.x2&&(n=a.x2),o<a.y1&&(o=a.y1),o>a.y2&&(o=a.y2),this.dragInfo={xcp:n,ycp:o,range:a};const r=d=>{d.preventDefault();const[h,u]=this.getMousePosition(d),f=this.dragInfo,{xcp:g,ycp:p,range:m}=f;let x,b;if(f.isMove=!0,this.isMouseMove=!0,h<m.x1?x=m.x1:h>m.x2?x=m.x2:x=h,u<m.y1?b=a.y1:u>m.y2?b=m.y2:b=u,t==="heatMap"){const y={xcp:g,xep:x,ycp:p,yep:b,range:m},{xsp:M,ysp:I,width:E,height:T}=this.getDragInfoForHeatMap(y);f.xsp=M,f.ysp=I,f.width=E,f.height=T}else f.xsp=Math.min(g,x),f.ysp=t==="scatter"?Math.min(p,b):m.y1,f.width=Math.ceil(Math.abs(x-g)),f.height=t==="scatter"?Math.ceil(Math.abs(b-p)):m.y2-m.y1;this.overlayClear(),this.drawSelectionArea(f)},c=d=>{var u,f;const h=this.dragInfo;if(h!=null&&h.isMove&&(h==null?void 0:h.width)>1&&(h==null?void 0:h.height)>1){const g={e:d,data:this.findSelectedItems(h),range:t==="heatMap"?this.getSelectionRangeForHeatMap(h):this.getSelectionRange(h)};if(this.dragInfoBackup=Fe({},h),typeof this.listeners["drag-select"]=="function"&&!((f=(u=this.options)==null?void 0:u.zoom)!=null&&f.use))this.listeners["drag-select"](g);else{const{xsp:p,range:m,width:x}=h,b=p-m.x1;g.range.dragSelectionInfo={dragXsp:b,dragXep:b+x,exceptAxesYChartWidth:m.x2-m.x1,exceptAxesXChartHeight:m.y2-m.y1,chartRange:m,chartTitle:this.options.title.text},this.options.zoom.getRangeInfo(g)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",c)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",c)},drawSelectionArea({xsp:e,ysp:t,width:n,height:o,range:s}){const l=this.overlayCtx,{fillColor:a,opacity:r}=this.options.dragSelection,c=this.chartRect,d=this.labelOffset,h={x1:c.x1+d.left,x2:c.x2-d.right,y1:c.y1+d.top,y2:c.y2-d.bottom};if(l.fillStyle=a,l.globalAlpha=r,je(h,s))l.fillRect(e,t,n,o);else{const u=s.x2-s.x1,f=s.y2-s.y1,g=h.x2-h.x1,p=h.y2-h.y1,m=(e-s.x1)/u,x=(t-s.y1)/f,b=h.x1+g*m,y=h.y1+p*x,M=n/u,I=o/f,E=g*M,T=p*I;l.fillRect(b,y,E,T)}l.globalAlpha=1},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear()},getMousePosition(e){const t=e.originalEvent||e,n=this.overlayCanvas.getBoundingClientRect();return[t.clientX-n.left,t.clientY-n.top,n.width,n.height]},getCurMouseTargetVal(e,t){const n=this.getCurMouseLocation(e),o={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=t;if(s!=null&&s.length){const[a,r]=s;l[a]&&(o.dataIdx=l[a].index,o.maxDataVal=r,o.originVal=t)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{o.labelIdx=d,o.labelVal=c[0].type==="time"?at(h).format(c[0].timeFormat):h,o.originVal=c[0].type==="time"?at(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(e,n),{labelVal:h,labelIdx:u}=this.getCurMouseLabelVal(c,e,d);a(c==="xAxis"?s:l,u,h)})(n)}return o},setTouchInfo(e){let[t,n]=this.getMousePosition(e);const o=this.chartRect,s=this.labelOffset,l={x1:o.x1+s.left,x2:o.x2-s.right,y1:o.y1+s.top,y2:o.y2-s.bottom};return t=Math.max(l.x1,Math.min(t,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:t,ycp:n,range:l}},setTouchBoxDimensions(e){var h;const t=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=t/2,{xcp:o,ycp:s,range:l}=e;let a=o-n,r=s-n,c=t,d=t;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},o<l.x1+n&&(a=l.x1,c=n-(l.x1-o),this.boxOverflow.x1=!0),o>l.x2-n&&(c=n-(o-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),e.xsp=a,e.ysp=r,e.width=c,e.height=d,e},dragTouchSelectionDestroy(e){var t;(t=this.options.dragSelection)!=null&&t.use&&e.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(e){var m,x;const t=Object.keys(this.seriesList),n={},o=!!this.options.horizontal,s=this.tooltipCtx;let l=null,a="",r=0,c="",d=null,h=null,u=1/0;const f=this.findClosestDataIndex(e,t);if(f===-1&&!this.isNotUseIndicator())return{items:n,hitId:l,maxTip:[a,c],maxHighlight:null};const g=t.every(b=>this.seriesList[b].type==="bar");for(let b=0;b<t.length;b++){const y=t[b],M=this.seriesList[y];if(M.findGraphData&&M.show){const I=M.findGraphData(e,o,f,!g);if(I!=null&&I.data){let E;if(I.data.o===null&&M.interpolation!=="zero"?M.isExistGrp||(E=o?I.data.x:I.data.y):isNaN(I.data.o)||(E=I.data.o),E!=null){const T=this.getFormattedTooltipLabel({dataId:M.id,seriesId:y,seriesName:M.name,itemData:I.data}),V=s?s.measureText(T).width:1;I.id=M.id,I.name=T,I.axis={x:M.xAxisIndex,y:M.yAxisIndex},I.label=o?(m=I.data)==null?void 0:m.y:(x=I.data)==null?void 0:x.x,n[y]=I;const C=this.getFormattedTooltipValue({dataId:M.id,seriesId:y,seriesName:T,value:E,itemData:I.data});if(I.data.formatted=C,r<V&&(a=T,r=V),c.length<=`${C}`.length&&(c=`${C}`),(d===null||d<=E)&&(d=E,h=y),I.hit&&I.data.xp!==void 0&&I.data.yp!==void 0){const S=(I.data.xp-e[0])**2+(I.data.yp-e[1])**2;S<u&&(u=S,l=y)}}}}}return l=l===null?Object.keys(n)[0]:l,{items:n,hitId:l,maxTip:[a,c],maxHighlight:d!==null?[h,d]:null}},findClosestDataIndex(e,t){var u;const[n,o]=e,s=!!this.options.horizontal,l=s?o:n,a=t.find(f=>{var p;const g=this.seriesList[f];return(g==null?void 0:g.show)&&((p=g==null?void 0:g.data)==null?void 0:p.length)>0});if(!a||!((u=this.seriesList[a])!=null&&u.data))return-1;const r=this.seriesList[a].data;let c=50;if(r.length>1){const f=[];for(let g=1;g<r.length;g++){const p=r[g-1],m=r[g];if(p&&m){let x,b;s?(x=p.h?p.yp+p.h/2:p.yp,b=m.h?m.yp+m.h/2:m.yp):(x=p.w?p.xp+p.w/2:p.xp,b=m.w?m.xp+m.w/2:m.xp),x!==null&&b!==null&&f.push(Math.abs(b-x))}}f.length>0&&(c=f.reduce((g,p)=>g+p,0)/f.length)}let d=1/0,h=-1;for(let f=0;f<r.length;f++)if(t.some(p=>{var x,b,y,M;const m=this.seriesList[p];return(m==null?void 0:m.show)&&((b=(x=m.data)==null?void 0:x[f])==null?void 0:b.o)!==null&&((M=(y=m.data)==null?void 0:y[f])==null?void 0:M.o)!==void 0})){const p=r[f];if(p){let m;if(s?m=p.h?p.yp+p.h/2:p.yp:m=p.w?p.xp+p.w/2:p.xp,m!==null){const x=Math.abs(l-m);x<d&&(d=x,h=f)}}}return d>=c?t.some(g=>{const p=this.seriesList[g];if(p!=null&&p.show){const m=p.passingValue,x=p.interpolation,b=p.hasPassingValueInData;return x==="linear"||x==="none"&&!!m&&b}return!1})?h:-1:h},getFormattedTooltipLabel({dataId:e,seriesId:t,seriesName:n,itemData:o}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:e,seriesId:t,seriesName:n,itemData:o})),r},getFormattedTooltipValue({dataId:e,seriesId:t,seriesName:n,value:o,itemData:s}){var h;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(h=r==null?void 0:r.formatter)==null?void 0:h.value;let d=o;return c&&(l.type==="pie"?d=c({value:o,name:n,percentage:s==null?void 0:s.percentage,seriesId:t,dataId:e}):l.type==="heatMap"?d=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:o>-1?o:"error",seriesId:t,dataId:e}):d=c({x:a?o:s==null?void 0:s.x,y:a?s==null?void 0:s.y:o,o:s==null?void 0:s.o,name:n,seriesId:t,dataId:e})),o&&(!c||typeof d!="string")&&(l.type==="heatMap"?d=o<0?"error":$t(o):d=$t(o)),d},addNotHitInfo(e){var c,d,h,u,f,g;const t=this.tooltipCtx,n=!!this.options.horizontal,o=Object.keys(e.items)[0],s=n?(h=(d=(c=e.items)==null?void 0:c[o])==null?void 0:d.data)==null?void 0:h.y:(g=(f=(u=e.items)==null?void 0:u[o])==null?void 0:f.data)==null?void 0:g.x;let l="",a="";const r=Object.keys(this.seriesList);for(let p=0;p<r.length;p++){const m=r[p],x=this.seriesList[m];if(x!=null&&x.show){const b=x.data.find(C=>n?(C==null?void 0:C.y)===s:(C==null?void 0:C.x)===s),y=this.getFormattedTooltipLabel({dataId:x.id,seriesId:m,seriesName:x.name,itemData:b}),M=this.getFormattedTooltipValue({dataId:x.id,seriesId:m,seriesName:y,value:b==null?void 0:b.o,itemData:b});if(b&&b.o!==null&&b.o!==void 0&&!e.items[m]){const C={};C.color=x.color,C.hit=!1,C.name=y,C.axis={x:x.xAxisIndex,y:x.yAxisIndex},C.index=n?x.yAxisIndex:x.xAxisIndex,C.data=b,C.data.formatted=M,e.items[m]=C}const I=t?t.measureText(l).width:1,E=t?t.measureText(y).width:1;I<E&&(l=y);const T=t?t.measureText(a).width:1,V=t?t.measureText(`${M}`).width:1;T<V&&(a=`${M}`)}}e.maxTip=[l,a]},selectItemByData(e,t){this.defaultSelectItemInfo=e;let n;t==="pie"?n={type:"pie",sId:e.seriesID}:n=isNaN(e==null?void 0:e.dataIndex)?null:this.getItem(e,!1),this.render(n)},selectLabelByData(e,t){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(e,t),this.render()},selectSeriesByData(e){this.defaultSelectInfo.seriesId=e,this.render()},getSelectedLabelInfoWithLabelData(e,t){const{selectLabel:n,type:o,horizontal:s}=this.options,l=Se(this.defaultSelectInfo);switch(l.dataIndex=e,o){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=t==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:u})=>l.label.includes(c==="y"?u:h));break}}return l},regulateSelectedLabelInfo(e,t){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},o=t===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===t?{...this.defaultSelectInfo,targetAxis:t}:{dataIndex:[],targetAxis:t},s=Se(o);if(o.dataIndex.includes(e)){const r=o.dataIndex.indexOf(e);s.dataIndex.splice(r,1)}else e>-1&&(s.dataIndex.push(e),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(e,t){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},o=this.defaultSelectInfo??{seriesId:[]};typeof o.seriesId=="string"&&(o.seriesId=[o.seriesId]);const s=Se(o);if(o.seriesId.includes(e)){if(!t){const a=o.seriesId.indexOf(e);s.seriesId.splice(a,1)}}else e&&(s.seriesId.push(e),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(e,t){var d;if(!(e!=null&&e.items)||!Object.keys(e.items).length)return null;const n=this.overlayCtx,{horizontal:o}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(e.items)[0],a=e.items[l];if(!(a!=null&&a.data))return null;const r=o?a.data.y:a.data.x;let c;if(o){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),o?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(e){const t=[],n=Object.keys(this.seriesList);for(let o=0;o<n.length;o++){const s=n[o],l=this.seriesList[s],a=l.findItems;if(a){const r=a.call(l,e);r&&r.length&&t.push({seriesName:l.name,seriesId:s,items:r})}}return t},getSelectionRange({xsp:e,ysp:t,width:n,height:o,range:s}){var M,I,E,T;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=e+n,c=t+o,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,u=this.getRatioInRange(s.x1,s.x2,e),f=this.getRatioInRange(s.x1,s.x2,r),g=this.getRatioInRange(s.y1,s.y2,c),p=this.getRatioInRange(s.y1,s.y2,t),m=this.isMobile&&((M=this.boxOverflow)!=null&&M.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),x=this.isMobile&&((I=this.boxOverflow)!=null&&I.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*f,l.graphMax),b=this.isMobile&&((E=this.boxOverflow)!=null&&E.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-g),a.graphMin),y=this.isMobile&&((T=this.boxOverflow)!=null&&T.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-p),a.graphMax);return{xMin:+m.toFixed(3),xMax:+x.toFixed(3),yMin:+b.toFixed(3),yMax:+y.toFixed(3)}},getRatioInRange(e,t,n){const o=t-e;return(n-e)/o},getDragInfoForHeatMap(e){const t=Object.keys(this.seriesList)[0];return this.seriesList[t].findBlockRange(e)},getSelectionRangeForHeatMap(e){const t=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!t||!n)return null;const o=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[o].findSelectionRange(e)??{};return{xMin:s??t.graphMin,xMax:l??t.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(e){var t,n;return this.options.selectItem.useDeselectItem&&(e==null?void 0:e.maxIndex)===((t=this.defaultSelectItemInfo)==null?void 0:t.dataIndex)&&(e==null?void 0:e.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(e==null?void 0:e.maxIndex)},getCurMouseLocation(e){const[t,n]=e,o={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=o[this.axesX[0].units.rectStart],l=o[this.axesX[0].units.rectEnd],a=o[this.axesY[0].units.rectStart],r=o[this.axesY[0].units.rectEnd];return gt(t,this.chartRect.x1,o.x1)&&gt(n,a,r)?"yAxis":gt(t,s,l)&&gt(n,o.y2,this.chartRect.y2)?"xAxis":gt(t,o.x1,o.x2)&&gt(n,o.y1,o.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},Ps=8,ai=50,io=17,HC=8,WC={createTooltipDOM(){var e,t;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(t=(e=this.options.tooltip)==null?void 0:e.formatter)!=null&&t.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=Lr(()=>{this.tooltipDOM.style.display="none"},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none"},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},getFontStyle(e){var s,l;const t=(s=this.options)==null?void 0:s.tooltip,n=((l=t==null?void 0:t.fontSize)==null?void 0:l[e])??14,o=(t==null?void 0:t.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${o}`},getTextHeight(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:e=0,right:t=20,bottom:n=3,left:o=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t:e,l:o,b:n,r:t}},setTooltipLayoutPosition(e,t){var A,z,$,U,H,X,j;const n=this.tooltipCtx,o=t.pageX,s=t.pageY,l=e.items,[a,r]=e.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),u=this.options.tooltip,f=this.getColorMargin(),g=e.hitId,p=l[g].data,m=l[g].axis,x=(A=u.formatter)==null?void 0:A.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(x?this.tooltipHeaderDOM.textContent=x({x:p.x,y:p.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[m.y].getLabelFormat(p.y):this.axesX[m.x].getLabelFormat(p.x)),u.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${u.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const y=!!this.options.horizontal?($=(z=l[e.hitId])==null?void 0:z.data)==null?void 0:$.y:(H=(U=l[e.hitId])==null?void 0:U.data)==null?void 0:H.x,M=(y==null?void 0:y.length)>a.length?y:a,I=Math.round(n.measureText(M).width),E=Math.round(n.measureText(r).width),T=I+E+h.l+h.r+f+ai+io,V=T>u.maxWidth?u.maxWidth:T;let C=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const K=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+ai+io);Object.values(l).map(Q=>Q.name).forEach(Q=>{if(n.measureText(Q).width>K){let J="";for(let te=0;te<Q.length;te++){const G=Q[te],oe=`${J}${G}`;n.measureText(oe).width>K?(J=G,C+=1):J=oe}}C+=1}),n.restore()}const S=h.t+C*this.getTextHeight()+d*Ps+h.b;let w;u.useScrollbar&&S>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",w=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",w=S),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=S*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${S}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${w+6}px`,this.tooltipDOM.style.display="block";const k=document.body.clientWidth,B=document.body.clientHeight,D=20,O=((X=this.tooltipDOM)==null?void 0:X.offsetHeight)||((j=this.tooltipHeaderDOM)==null?void 0:j.offsetHeight)+w+HC,R=k-V-D,v=B-O-D,N=o+D,L=s+D,P=o-V-D,_=s-O-D;this.tooltipDOM.style.left=N>R?`${P}px`:`${N}px`,this.tooltipDOM.style.top=L>v?`${_}px`:`${L}px`},drawSeriesColorShape(e,t,n){var a,r;const o=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(t==="circle"){e.beginPath();const c=o/2;e.arc(s,l-c/2,c,0,2*Math.PI),e.fill()}else{const c=o;e.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(e,t){const n=t,o=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(o)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let u=2,f=2;u+=Y.aliasPixel(u),f+=Y.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=io),u+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const g=[];l.forEach(m=>{g.push({id:m,data:o[m].data,color:o[m].color,name:o[m].name,dataId:o[m].id})}),c.sortByValue&&g.sort((m,x)=>{let b=m.data.o,y=x.data.o;return b==null&&(b=r?m.data.x:m.data.y),y==null&&(y=r?x.data.x:x.data.y),y-b}),this.setTooltipDOMStyle(c);let p=1;for(let m=0;m<g.length;m++){const x=g[m].data,b=g[m].color,y=g[m].name,M=x.formatted;let I=u+4,E=f+p*d;I+=Y.aliasPixel(I),E+=Y.aliasPixel(E),n.beginPath(),typeof b!="string"?n.fillStyle=ie.createGradient(n,r,{x:I-4,y:E,w:12,h:-12},b):n.fillStyle=b;const T={id:g[m].id,name:g[m].name,value:M,dataId:g[m].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:I,y:E}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(T):c.fontColor.label??c.fontColor;const V=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ai,C=I+h,S=E;if(V>n.measureText(y).width)n.fillText(y,C,S);else if(c.textOverflow==="wrap"){let w="",k=S;for(let B=0;B<y.length;B++){const D=y[B],O=`${w}${D}`;n.measureText(O).width>V?(n.fillText(w,C,k),w=D,p+=1,k+=d):w=O}n.fillText(w,C,k)}else{const w=Y.truncateLabelWithEllipsis(y,V,n);n.fillText(w,C,S)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(T):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(M,this.tooltipDOM.offsetWidth-a.r,E),n.restore(),n.closePath(),f+=Ps,p+=1}n.restore()},drawToolTipForHeatMap(e,t){const n=t,o=e.items,s=e.hitId,l=o[s].data,a=o[s].axis,r=o[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],f=this.getTextHeight(),g=this.getColorMargin();let p=!1,m=l.formatted;const{colorState:x,isGradient:b}=u;if(b){const{min:E,max:T}=u.valueOpt,V=We(l.o-E,T-E),{start:C,end:S}=x[0];p=C<=V&&V<=S||l.o===-1}else{const E=x.find(({id:T})=>T===l.cId);p=E==null?void 0:E.show,m=(E==null?void 0:E.label)??m}if(!p){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=io);const y=c.l+2,M=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=ie.createGradient(n,d,{x:y,y:M,w:12,h:-12},r):n.fillStyle=r;const I={id:e.hitId,name:l.y,value:m,dataId:o[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:y,y:M}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(I):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),y+g,M),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(I):h.fontColor.value??h.fontColor,n.fillText(m,this.tooltipDOM.offsetWidth-c.r,M),n.closePath()},drawTooltipForScatter(e,t){const n=t,o=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(o)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,u=2;h+=Y.aliasPixel(h),u+=Y.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=io),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(p=>{f.push({data:o[p].data,color:o[p].color,name:o[p].name})}),r.sortByValue&&f.sort((p,m)=>{let x=p.data.o,b=m.data.o;return x==null&&(x=p.data.y),b==null&&(b=m.data.y),b-x}),this.setTooltipDOMStyle(r);let g=1;for(let p=0;p<f.length;p++){const m=f[p].data,x=f[p].color,b=f[p].name,y=m.formatted;let M=h+4,I=u+g*c;M+=Y.aliasPixel(M),I+=Y.aliasPixel(I),n.beginPath(),typeof x!="string"?n.fillStyle=ie.createGradient(n,!1,{x:M-4,y:I,w:12,h:-12},x):n.fillStyle=x;const E={id:e.hitId,name:f[p].name,value:y,dataId:f[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:M,y:I}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(E):r.fontColor.label??r.fontColor;const T=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ai,V=M+d,C=I;if(T>n.measureText(b).width)n.fillText(b,V,C);else if(r.textOverflow==="wrap"){let S="",w=C;for(let k=0;k<b.length;k++){const B=b[k],D=`${S}${B}`;n.measureText(D).width>T?(n.fillText(S,V,w),S=B,g+=1,w+=c):S=D}n.fillText(S,V,w)}else{const S=Y.truncateLabelWithEllipsis(b,T,n);n.fillText(S,V,C)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(E):r.fontColor.value??r.fontColor,n.fillText(y,this.tooltipDOM.offsetWidth-a.r,I),n.restore(),n.closePath(),u+=Ps,g+=1}n.restore()},setCustomTooltipLayoutPosition(e,t){var b,y;const n=t.pageX,o=t.pageY,s=(b=this.tooltipDOM.getElementsByClassName("ev-chart-tooltip-custom"))==null?void 0:b[0];if(!s&&!this.tooltipDOM)return;this.tooltipDOM.style.display="block";const l=s.offsetWidth,a=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${a+6}px`;const r=document.body.clientWidth,c=document.body.clientHeight,d=(y=this.tooltipDOM)==null?void 0:y.getBoundingClientRect(),h=20,u=r-l-h,f=c-(d==null?void 0:d.height)-h,g=n+h,p=o+h,m=n-l-h,x=o-(d==null?void 0:d.height)-h;this.tooltipDOM.style.left=g>u?`${m}px`:`${g}px`,this.tooltipDOM.style.top=p>f?`${x}px`:`${p}px`},drawCustomTooltip(e){var n,o,s,l;const t=(n=this.options)==null?void 0:n.tooltip;if((o=t.formatter)!=null&&o.html){this.tooltipDOM.innerHTML="";const a=[];Object.keys(e).forEach(c=>{a.push({sId:c,data:e[c].data,color:e[c].color,name:e[c].name,dataId:e[c].id,index:e[c].index})});const r=Y.htmlToElement((s=t==null?void 0:t.formatter)==null?void 0:s.html(a));r&&this.tooltipDOM.appendChild(r),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((l=t.fontColor)==null?void 0:l.title)??t.fontColor}},setTooltipDOMStyle(e){var t;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((t=e.fontColor)==null?void 0:t.title)??e.fontColor,this.tooltipHeaderDOM.style.fontSize=`${e.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),e.useShadow){const n=`rgba(0, 0, 0, ${e.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(e,t){Object.keys(e.items).forEach(n=>{var s;const o=this.seriesList[n];o.itemHighlight(e.items[n],t,e.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),Y.isDoughnutHole(o.type)&&this.drawDoughnutHole(t)})},drawIndicator(e,t){var d;const n=this.overlayCtx,[o,s]=e,l={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},a=15,r=15,c=this.options;o>=l.x1-a&&o<=l.x2+a&&s>=l.y1-r&&s<=l.y2+r&&(n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=c.indicator)!=null&&d.segments&&n.setLineDash(c.indicator.segments),c.horizontal?(n.moveTo(l.x1,s+.5),n.lineTo(l.x2,s+.5)):(n.moveTo(o+.5,l.y1),n.lineTo(o+.5,l.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(e){var h,u;const t=this.options;if(t.syncHover===!1||!t.horizontal&&!t.axesX.every(({type:f})=>f==="time")||t.horizontal&&!t.axesY.every(({type:f})=>f==="time"))return null;const n=+((h=this.data.labels)==null?void 0:h[0]),o=+((u=this.data.labels)==null?void 0:u[this.data.labels.length-1]);if(n==null||o==null)return null;const[s,l]=e,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t.horizontal){const f=a.y2-a.y1,p=(l-a.y1)*(o-n)/f+n;return Math.round(p)}const r=a.x2-a.x1,d=(s-a.x1)*(o-n)/r+n;return Math.round(d)},drawSyncedIndicator({horizontal:e,label:t,mousePosition:n,dataLabel:o}){var p,m;if(!this._canDrawSyncedIndicator(e,n))return;if(o){this.drawSyncedIndicatorForTooltip({dataLabel:o,mousePosition:n});return}const s=+((p=this.data.labels)==null?void 0:p[0]),l=+((m=this.data.labels)==null?void 0:m[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:u}=this.chartDOM.getBoundingClientRect();if(gt(a,h,u)&&gt(r,d,c))return;this.overlayClear();const g={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e){const b=(g.y2-g.y1)*(t-s)/(l-s)+g.y1;this.drawIndicator([g.x2,b],this.options.indicator.color)}else{const b=(g.x2-g.x1)*(t-s)/(l-s)+g.x1;this.drawIndicator([b,g.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(e,t){return!t||!!e!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(e)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(e){var n,o;return this.options.syncHover===!1||!((o=(n=this.data)==null?void 0:n.labels)!=null&&o.length)?!1:e?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,o;const e=+((n=this.data.labels)==null?void 0:n[0]),t=+((o=this.data.labels)==null?void 0:o[this.data.labels.length-1]);return e!=null&&t!=null},drawSyncedIndicatorForTooltip({dataLabel:e,mousePosition:t}){var u,f,g,p,m,x,b,y,M,I,E,T,V;if(!((u=this.data)!=null&&u.labels)||!e)return;const n=this.data.labels.findIndex(C=>(C==null?void 0:C.valueOf())===(e==null?void 0:e.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:o}=this.options,s=this.chartDOM.getBoundingClientRect(),[l,a]=t;if(gt(l,s.left,s.right)&&gt(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(o){const C=c.y2-c.y1,S=(f=this.options.axesY)==null?void 0:f.some(B=>B.categoryMode),w=(g=this.options.axesY)==null?void 0:g.some(B=>B.type==="time");let k;if(S)k=c.y1+C*(n+.5)/d;else if(w){const B=(m=(p=this.axesSteps)==null?void 0:p.y)==null?void 0:m[0],D=(B==null?void 0:B.graphMin)??+((x=this.data.labels)==null?void 0:x[0]),O=(B==null?void 0:B.graphMax)??+((b=this.data.labels)==null?void 0:b[this.data.labels.length-1]);k=c.y1+C*(+e-D)/(O-D)}else k=c.y1+C*n/(d-1);h=[c.x2,k]}else{const C=c.x2-c.x1,S=(y=this.options.axesX)==null?void 0:y.some(B=>B.categoryMode),w=(M=this.options.axesX)==null?void 0:M.some(B=>B.type==="time");let k;if(S)k=c.x1+C*(n+.5)/d;else if(w){const B=(E=(I=this.axesSteps)==null?void 0:I.x)==null?void 0:E[0],D=(B==null?void 0:B.graphMin)??+((T=this.data.labels)==null?void 0:T[0]),O=(B==null?void 0:B.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);k=c.x1+C*(+e-D)/(O-D)}else k=c.x1+C*n/(d-1);h=[k,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none"},alignSeriesList(e){const t=this.data.groups,n=this.seriesList,o=[];return t.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&e.includes(l)&&o.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&e.includes(s)&&o.push(s)}),o},tooltipDestroy(){this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.isInitTooltip=!1}},$C={pieDataSet:[],drawPie(e){var I;const t=this.bufferCtx,n=this.chartRect,o=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,f,g;const p=n.width/2,m=n.height/2,x=p-(l.left+l.right),b=m-(l.bottom+l.top);if(typeof x=="number"&&x<0||typeof b=="number"&&b<0)return;const y=Math.min(x,b)*s.doughnutHoleSize,M=Math.min(x,b);for(let E=0;E<o.length;E++){const T=o[E];if(!T)return;let V=M-(M-y)/o.length*E;if((I=s==null?void 0:s.pieStroke)!=null&&I.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(T.or=V,E<o.length-1?T.ir=M-(M-y)/o.length*(E+1):T.ir=1,T.total){for(let C=0;C<T.data.length;C++)if(r=T.data[C],c=r.value,g=c/T.total*100,d=2*Math.PI*(c/T.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const S={...s.pieStroke};T.data.length===1&&s.pieStroke.use&&(S.use=!1,t.lineWidth=s.pieStroke.lineWidth,t.strokeStyle=s.pieStroke.color,t.arc(p,m,V,0,2*Math.PI),t.stroke());const{selectInfo:w,legendHitInfo:k,unSelectedOpacity:B}=e;f.isSelect=(w==null?void 0:w.sId)===r.id,f.isDownplay=k&&k.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=p,f.centerY=m,f.radius=V,f.doughnutHoleSize=V*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:g},f.draw(t,S,B),h+=d}}}},drawSunburst(e){var m;const t=this.bufferCtx,{width:n,height:o}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=o/2,u=d-(a.left+a.right),f=h-(a.bottom+a.top);if(typeof u=="number"&&u<0||typeof f=="number"&&f<0)return;const g=Math.min(u,f)*l.doughnutHoleSize,p=Math.min(u,f);for(let x=0;x<s.length;x++){const b=s[x];if(!b)return;let y=p-(p-g)/s.length*x;if((m=l==null?void 0:l.pieStroke)!=null&&m.use&&(y-=l.pieStroke.lineWidth),y<0)return;b.or=y,x<s.length-1?b.ir=p-(p-g)/s.length*(x+1):b.ir=1;for(let M=0;M<b.data.length;M++)if(r=b.data[M],r.id==="dummy")t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.lineWidth=2,t.strokeStyle="#fff",t.moveTo(d,h),t.arc(d,h,y,r.sa,r.ea),t.stroke(),t.fill(),t.closePath(),t.restore();else if(c=this.seriesList[r.id],r.value){const I={...l.pieStroke};b.data.length===1&&l.pieStroke.use&&(I.use=!1,t.lineWidth=l.pieStroke.lineWidth,t.strokeStyle=l.pieStroke.color,t.arc(d,h,y,0,2*Math.PI),t.stroke());const{selectInfo:E,legendHitInfo:T,unSelectedOpacity:V}=e;c.isSelect=(E==null?void 0:E.sId)===r.id,c.isDownplay=T&&T.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=y,c.doughnutHoleSize=y*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(t,I,V)}}},drawDoughnutHole(e=this.bufferCtx){var h;const t=this.options,{width:n,height:o}=this.chartRect,s=this.options.padding,l=n/2,a=o/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*t.doughnutHoleSize;e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.fillOpacity=0,e.arc(l,a,d,0,2*Math.PI),e.fill(),e.strokeStyle="#fff",e.stroke(),e.closePath(),e.restore(),(h=t==null?void 0:t.pieStroke)!=null&&h.use&&(e.beginPath(),e.strokeStyle=t.pieStroke.color,e.lineWidth=t.pieStroke.lineWidth,e.arc(l,a,d,0,Math.PI*2),e.stroke(),e.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},XC={drawTips(e){var h,u,f,g,p,m;const t=this.options;let n=null;const o=!!t.horizontal,s=t.maxTip,l=t.selectItem,a=t.selectLabel;let r,c;typeof((h=t.tooltip)==null?void 0:h.formatter)=="function"?n=(u=t.tooltip)==null?void 0:u.formatter:typeof((g=(f=t.tooltip)==null?void 0:f.formatter)==null?void 0:g.value)=="function"&&(n=(m=(p=t.tooltip)==null?void 0:p.formatter)==null?void 0:m.value),a.use&&a.showTip&&(c=t.type==="heatMap"?this.drawLabelTipForHeatMap():this.drawTipForSelectedLabel());const d=x=>{e.forEach(b=>{if(b){const y=this.seriesList[b==null?void 0:b.sId];if(!(y!=null&&y.show))return;const M=this.calculateTipInfo(y,"sel",b);if(M){let I=!1;if(s.use&&(r==null?void 0:r.dp)===M.dp&&(I=!0),x.showTextTip||x.showTip){if(x.tipText==="label"){const E=o?t.axesY[0]:t.axesX[0],T=M.label;M.text=E.type==="time"?at(T).format(E.timeFormat):T}else M.text=$t(M.value);this.drawTextTip({opt:x,tipType:"sel",seriesOpt:y,isSamePos:I,...M})}x.showIndicator&&this.drawFixedIndicator({opt:x,seriesOpt:y,...M})}b&&(b!=null&&b.label)&&(b==null?void 0:b.label)===0&&(this.lastHitInfo=b)}})};if(e&&!c&&(l.use?d(l):a.use&&t.type==="line"&&d(a)),s.use&&!c){const x=this.minMax[o?"x":"y"][0].maxSID,b=this.seriesList[x];r=this.calculateTipInfo(b,"max",null),s.use&&r&&(n?r.text=n({seriesId:b.sId,x:o?r.value:void 0,y:o?void 0:r.value}):r.text=$t(r.value),this.drawTextTip({opt:s,tipType:"max",seriesOpt:b,...r}),s.showIndicator&&this.drawFixedIndicator({opt:s,seriesOpt:b,...r}))}},calculateTipInfo(e,t,n){if(!e)return!1;const o=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[e.xAxisIndex],u=this.axesSteps.y[e.yAxisIndex],f=r.x1,g=r.x2,p=r.y2,{type:m,size:x}=e,{maxDomain:b,maxDomainIndex:y}=e.minMax;if(b===null||y<0)return!1;let M=m==="bar"?y:b;t==="sel"&&(n&&n.label!==null?(s.pos=m==="bar"?n.maxIndex:n.label,M=s.pos):s.pos!==null&&(M=s.pos));let I=o?e.minMax.maxX:e.minMax.maxY,E;if(t==="sel"){if(n&&n.value!==null)I=n.useStack?n.acc:n.value,E=n.label,s.value=I,s.label=E;else if(s.value!==null)I=s.value,E=s.label;else if(s.pos!==null){const k=m==="bar"?this.getItemByLabelIndex(s.pos):this.getItemByLabel(s.pos);I=k.useStack?k.acc:k.value,E=k.label,s.value=I,s.label=E}}let T,V,C;if(m==="bar"){const k=o?this.scrollbar.y:this.scrollbar.x;if(k!=null&&k.use){const[B,D]=(k==null?void 0:k.range)??[];if(M>=B&&M<=D)M-=B??0;else return!1}o?(V=Math.round(x.h/2),T=p-x.cat*M-x.cPad,C=T-(x.bar*x.ix-(x.h+x.bPad))-V):(V=Math.round(x.w/2),T=f+x.cat*M+x.cPad,C=T+(x.bar*x.ix-(x.w+x.bPad))+V)}else m==="line"?C=ie.calculateX(M,h.graphMin,h.graphMax,d-x.comboOffset,f+x.comboOffset/2):m==="scatter"&&(C=ie.calculateX(M,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:g,ysp:p},...{dp:C,value:I,label:E,type:m}}},drawFixedIndicator(e){const t=!!this.options.horizontal,n=this.bufferCtx,{graphX:o,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:f,seriesOpt:g}=e;let p=0;h==="line"?p+=3:h==="scatter"&&(p+=(g==null?void 0:g.pointSize)??0);let m;if(f.fixedPosTop)t?m=ie.calculateX(o.graphMax,o.graphMin,o.graphMax,l,r):(m=ie.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),m-=p);else if(t){const x=Math.min(Math.max(u,o.graphMin),o.graphMax);m=ie.calculateX(x,o.graphMin,o.graphMax,l,r)}else{const x=Math.min(Math.max(u,s.graphMin),s.graphMax);m=ie.calculateY(x,s.graphMin,s.graphMax,a,c),m-=p}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=f.indicatorColor,n.lineWidth=2,t?(n.moveTo(r,d),n.lineTo(m,d)):(n.moveTo(d,c),n.lineTo(d,m)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(){var r,c;const e=this.options,t=!!e.horizontal,n=e.selectLabel,{dataIndex:o,data:s,label:l}=this.defaultSelectInfo;let a=!1;if(o.length){a=!0;const d=this.chartRect,h=this.labelOffset,u={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom},f=t?this.axesY[0]:this.axesX[0],g=t?this.axesX[0]:this.axesY[0],p=t?this.axesSteps.x[0]:this.axesSteps.y[0],m=t?ie.calculateX:ie.calculateY,x=t?ie.calculateY:ie.calculateX,b=t?this.scrollbar.y:this.scrollbar.x,y=d.chartWidth-(h.left+h.right),M=d.chartHeight-(h.top+h.bottom),I=t?y:M,E=u[g.units.rectStart];let T=this.options.type==="bar"?4:6;T*=t?1:-1;const V=Object.keys(this.seriesList??{}),C=V.filter(z=>this.seriesList[z].show),S=V.some(z=>this.seriesList[z].isExistGrp&&!this.seriesList[z].isOverlapping),w=((r=this.data.groups)==null?void 0:r[0])??[];let k,B,D,O,R,v,N,L,P,_=0,A=(c=f.labels)==null?void 0:c.length;if(f.labels){let z=f.labels.length;if(b!=null&&b.use){const{range:$,interval:U,type:H}=b,[X,j]=$??[];ve(X)&&ve(j)&&(z=Math.floor((+j-+X)/U)+1,_=H==="step"?X:f.labels.findIndex(K=>K===+X),A=H==="step"?j:f.labels.findIndex(K=>K===+j))}O=u[f.units.rectStart],R=u[f.units.rectEnd],v=(R-O)/z}else N=this.axesSteps.x[0],L=V.find(z=>{var $;return(($=this.seriesList[z])==null?void 0:$.type)==="line"}),P=this.seriesList[L].size;s.forEach((z,$)=>{var U;if(D=p.graphMax,!n.fixedPosTop){if(S){const H=C==null?void 0:C.reduce((K,q)=>{var Q,J;return w.includes(q)&&(((Q=z[q])==null?void 0:Q.value)??z[q])>0?K+(((J=z[q])==null?void 0:J.value)??z[q]):K},0),X=((U=C==null?void 0:C.filter(K=>!w.includes(K)))==null?void 0:U.map(K=>{var q;return((q=z[K])==null?void 0:q.value)??z[K]}))??[],j=(X==null?void 0:X.length)>0?X.reduce((K,q)=>Math.max(K,q??-1/0),-1/0):-1/0;D=H>0?Math.max(j,H):Math.max(j,0)}else if(C.length){const H=C.map(j=>{var K;return((K=z[j])==null?void 0:K.value)??z[j]}),X=H.length>0?H.reduce((j,K)=>Math.max(j,K??-1/0),-1/0):-1/0;D=X>0||this.options.type!=="bar"?X:0}}if(f.labels){if(o[$]<_||o[$]>A)return;const H=o[$]-_;k=Math.round(O+v*H)+v/2}else k=x(l[$],N.graphMin,N.graphMax,y-P.comboOffset,u.x1+P.comboOffset/2);B=m(D,p.graphMin,p.graphMax,I,E)+T,this.showTip({context:this.bufferCtx,x:t?B:k,y:t?k:B,opt:n,isSamePos:!1})})}return a},drawLabelTipForHeatMap(){const e=this.options,t=!!e.horizontal,n=e.selectLabel,{dataIndex:o}=this.defaultSelectInfo;let s=!1;if(o){s=!0;const l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=t?this.axesY[0]:this.axesX[0],d=r[c.units.rectStart],u=(r[c.units.rectEnd]-d)/c.labels.length,f=t?this.axesX[0]:this.axesY[0],g=6*(t?1:-1),p=r[f.units.rectEnd]+g;o==null||o.forEach(m=>{const b=Math.round(d+u*m)+u/2;this.showTip({context:this.bufferCtx,x:t?p:b,y:t?b:p,opt:n,isSamePos:!1})})}return s},drawTextTip(e){const t=!!this.options.horizontal,n=this.bufferCtx,{graphX:o,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=e,{dp:h,value:u,text:f,opt:g,type:p,tipType:m,isSamePos:x,seriesOpt:b}=e,y=4,M=4,{fontSize:I,fontFamily:E,fontWeight:T,height:V}=g.tipStyle,C=`normal normal ${T} ${I}px ${E}`;let S=1;p==="line"?S+=6:p==="scatter"?S+=b==null?void 0:b.pointSize:p==="bar"&&(S+=4);let w,k=h;if(g.fixedPosTop)t?(w=ie.calculateX(o.graphMax,o.graphMin,o.graphMax,l,r),w+=S):(w=ie.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),w-=S);else if(t){const O=Math.min(Math.max(u,o.graphMin),o.graphMax);w=ie.calculateX(O,o.graphMin,o.graphMax,l,r),w=u<0?w-S:w+S}else{const O=p==="bar"&&u<0?0:u,R=Math.min(Math.max(O,s.graphMin),s.graphMax);w=ie.calculateY(R,s.graphMin,s.graphMax,a,d),w=O<0?w+S:w-S}let B="center";n.save(),n.font=C;const D=Math.round(Math.max(n.measureText(f).width+12,40));t||(h+D/2>c-10?(B="right",k-=D/2-y*2):h-D/2<r+10&&(B="left",k+=D/2-y*2)),n.restore(),(g.showTextTip||m==="max")&&this.showTextTip({context:n,type:B,width:D,height:V,x:t?w+D/2:k,y:t?k+V/2:w,opt:g,arrowSize:y,borderRadius:M,text:f,textStyle:C,isNegative:u<0}),g.showTip&&m==="sel"&&this.showTip({context:n,x:t?w:h,y:t?h:w,opt:g,isSamePos:x})},showTextTip(e){const t=!!this.options.horizontal,{type:n,width:o,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:f}=e,g=e.context;let p=l-o/2,m=l+o/2;const x=a-s,b=a;f&&t&&(p=l-o/2-o,m=l-o/2),g.save(),g.font=u,g.fillStyle=h.tipBackground??h.tipStyle.background,g.shadowBlur=0,g.beginPath(),g.moveTo(p+c,x),g.quadraticCurveTo(p,x,p,x+c),g.lineTo(p,b-c),g.quadraticCurveTo(p,b,p+c,b),g.lineTo(m-c,b),g.quadraticCurveTo(m,b,m,b-c),g.lineTo(m,x+c),g.quadraticCurveTo(m,x,m-c,x),g.lineTo(p+c,x),g.closePath(),g.fill(),g.beginPath(),t?(f?(g.moveTo(m,b),g.lineTo(m,x+c+r/2),g.lineTo(m+r,b-s/2),g.lineTo(m,b-c-r/2)):(g.moveTo(p,x),g.lineTo(p,x+c+r/2),g.lineTo(p-r,b-s/2),g.lineTo(p,b-c-r/2)),g.closePath(),g.fill()):(f?n==="left"?(g.lineTo(p+c+r,b+r),g.lineTo(p+c+r*2,b)):n==="right"?(g.lineTo(m-r*2-c,b),g.lineTo(m-r-c,b+r)):(g.lineTo(l-r,b),g.lineTo(l,b+r),g.lineTo(l+r,b)):f||(n==="left"?(g.moveTo(p,x),g.lineTo(p+c+r,b+r),g.lineTo(p+c+r*2,b)):n==="right"?(g.moveTo(m,x),g.lineTo(m-r*2-c,b),g.lineTo(m-r-c,b+r)):(g.lineTo(l-r,b),g.lineTo(l,b+r),g.lineTo(l+r,b))),g.closePath(),g.fill()),g.restore(),g.save(),g.font=u,g.fillStyle=h.tipTextColor??h.tipStyle.textColor,g.textBaseline="middle",g.textAlign="center",g.fillText(`${d}`,p+o/2,x+s/2),g.restore()},showTip(e){const t=!!this.options.horizontal,{x:n,y:o,opt:s,isSamePos:l}=e,a=e.context,c=o-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),t?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}};let Nr=class{constructor(t,n,o,s,l,a,r){Object.keys(Or).forEach(c=>Object.assign(this,Or[c])),o.brush||(Object.assign(this,WC),Object.assign(this,FC),Object.assign(this,XC),Object.assign(this,LC),Object.assign(this,$C),Object.assign(this,RC),Object.assign(this,PC)),o.type==="heatMap"&&o.legend.type==="gradient"&&Object.assign(this,VC),this.isMobile=yh(),this.brushSeries=r,this.target=t,this.data=n,this.options=o,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=o.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=o.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM),this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d"),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d"),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),o.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d"),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null}init(){var u,f,g,p,m;const{series:t,data:n,labels:o,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(t,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,o),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((f=(u=a==null?void 0:a[0])==null?void 0:u.scrollbar)!=null&&f.use||(p=(g=r==null?void 0:r[0])==null?void 0:g.scrollbar)!=null&&p.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(m=this.createEventFunctions)==null||m.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(t=>t.show).length}initRect(){const t=this.options;t.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),t.legend.show&&!t.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):t.legend.show&&t.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:t,label:n,mousePosition:o}){this.drawSyncedIndicator({horizontal:t,label:n,mousePosition:o})}adjustXAndYAxisWidth(){var o,s,l,a;const t=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:f,steps:g=0,minIndex:p,maxIndex:m,indexInterval:x}=r??{};let b=[];if((d==null?void 0:d.type)==="step"&&p!==void 0&&m!==void 0&&x!==void 0){const{labels:y}=this.data,M=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[];b=[];for(let I=p;I<=m;I+=x)M[I]!==void 0&&b.push(M[I])}else if(h)b=Array.from({length:g},(y,M)=>u+M*h),b.push(f);else{const{labels:y}=this.data;b=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[]}return b},n={x:(s=(o=this.axesRange)==null?void 0:o.x)==null?void 0:s.map((r,c)=>{var p,m,x;const d=this.axesX[c],h=(p=this.axesSteps)==null?void 0:p.x[c],u=t(h,"x",d),f=ve((m=d==null?void 0:d.labelStyle)==null?void 0:m.fixWidth)?d.labelStyle.fixWidth:0,g=((x=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:x.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(g,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var p,m,x;const d=this.axesY[c],h=(p=this.axesSteps)==null?void 0:p.y[c],u=t(h,"y",d),f=ve((m=d==null?void 0:d.labelStyle)==null?void 0:m.fixWidth)?d.labelStyle.fixWidth:0,g=((x=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:x.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(g,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}emitAxesScaleChange(){var c;if(typeof((c=this.listeners)==null?void 0:c["axes-scale-change"])!="function")return;const t=this._lastEmittedAxesRange,n=this.labelRange,o=(d,h)=>(d==null?void 0:d.min)===(h==null?void 0:h.min)&&(d==null?void 0:d.max)===(h==null?void 0:h.max),s=({min:d,max:h})=>({minSteps:d,maxSteps:h}),l=n.x.every((d,h)=>{var f;return!!!((f=this.options.axesX[h])!=null&&f.scaleChange)||!!t&&o(d,t.x[h])}),a=n.y.every((d,h)=>{var f;return!!!((f=this.options.axesY[h])!=null&&f.scaleChange)||!!t&&o(d,t.y[h])});if(l&&a)return;this._lastEmittedAxesRange=n;const r={x:n.x.map(s),y:n.y.map(s)};this.listeners["axes-scale-change"](r)}drawChart(t){var n,o,s,l,a,r;this.initScale(),this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange(),((o=(n=this.scrollbar)==null?void 0:n.x)!=null&&o.use||(l=(s=this.scrollbar)==null?void 0:s.y)!=null&&l.use)&&this.updateScrollbarPosition(),this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),this.emitAxesScaleChange(),this.drawAxis(t),this.drawSeries(t),this.drawTip(),this.bufferCanvas&&((a=this.bufferCanvas)==null?void 0:a.width)>1&&((r=this.bufferCanvas)==null?void 0:r.height)>1&&this.displayCtx.drawImage(this.bufferCanvas,0,0)}collectDuplicatePoints(t,n){var s,l,a;const o=!!this.options.seriesReverse;for(let r=o?n.length-1:0;o?r>=0:r<n.length;o?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let u=0;u<h.length;u++){const f=((a=h[u])==null?void 0:a.data)||[];for(let g=0;g<f.length;g++){const p=f[g];t.set(`${p.x}${p.y}`,c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let u=0;u<h.length;u++){const f=h[u];t.set(`${f.x}${f.y}`,c.sId)}}}}drawSeries(t){var p;const{maxTip:n,selectLabel:o,selectItem:s,selectSeries:l,brush:a,displayOverflow:r,unSelectedOpacity:c}=this.options,d={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:n.background,color:n.color},selectLabel:{option:o,selected:this.defaultSelectInfo},selectSeries:{option:l,selected:this.defaultSelectInfo},selectItem:{option:s,selected:this.defaultSelectItemInfo},overlayCtx:this.overlayCtx,isBrush:!!a,displayOverflow:r,unSelectedOpacity:c};let h=0,u=0;this.seriesInfo.charts.bar.forEach(m=>{this.seriesList[m].show&&u++});const f=new Map,g=Object.keys(this.seriesInfo.charts);for(let m=0;m<g.length;m++){const x=g[m],b=this.seriesInfo.charts[x];x==="scatter"&&this.options.coordinateDedupe&&this.collectDuplicatePoints(f,b);for(let y=0;y<b.length;y++){let M=this.seriesList[b[y]];switch(x){case"line":{const I=t==null?void 0:t.legend;M.draw({legendHitInfo:I,...d});break}case"heatMap":{const I=t==null?void 0:t.legend;M.draw({legendHitInfo:I,...d});break}case"bar":{const I=t==null?void 0:t.legend,{thickness:E,cPadRatio:T,borderRadius:V}=this.options;M.draw({thickness:E,cPadRatio:T,borderRadius:V,showSeriesCount:u,showIndex:h,legendHitInfo:I,...d}),M.show&&h++;break}case"pie":{const I=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},E=t==null?void 0:t.legend;this.options.sunburst?this.drawSunburst({selectInfo:I,legendHitInfo:E,unSelectedOpacity:d.unSelectedOpacity}):this.drawPie({selectInfo:I,legendHitInfo:E,unSelectedOpacity:d.unSelectedOpacity}),this.options.doughnutHoleSize>0&&this.drawDoughnutHole();break}case"scatter":{const I=t==null?void 0:t.legend;let E;if(s.use&&s.useSeriesOpacity){const T=this.lastHitInfo,V=this.defaultSelectItemInfo;T!=null&&T.maxIndex||(T==null?void 0:T.maxIndex)===0?E={seriesID:T.sId,dataIndex:T.maxIndex}:V!=null&&V.dataIndex||(V==null?void 0:V.dataIndex)===0?E={...V}:E=null}this.options.seriesReverse&&(M=this.seriesList[b.at(-1-y)]),M.draw({legendHitInfo:I,selectInfo:E,duple:f,coordinateDedupe:this.options.coordinateDedupe,...d});break}}}}}drawTip(){var n;let t;this.lastHitInfo?t=this.lastHitInfo:this.defaultSelectItemInfo?t=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?t=this.getItem(this.defaultSelectInfo,!1):t=null,(n=this.drawTips)==null||n.call(this,t)}createAxes(t,n=[]){const o=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new TC(t,r,o,a);case"time":return r.categoryMode?new OC(t,r,o,l,a):new vC(t,r,o,a);case"log":return new BC(t,r,o);case"step":return new DC(t,r,o,l,a);default:return!1}})}getAxesRange(){const t=this.axesX.map((o,s)=>o.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((o,s)=>o.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:t,y:n}}drawAxis(t){this.axesX.forEach((n,o)=>{n.draw(this.chartRect,this.labelOffset,this.axesSteps.x[o],t,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((n,o)=>{n.draw(this.chartRect,this.labelOffset,this.axesSteps.y[o],t,this.defaultSelectInfo)})}calculateSteps(){const t=this.axesX.map((o,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return o.calculateSteps(l)}),n=this.axesY.map((o,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return o.calculateSteps(l)});return{x:t,y:n}}getAxesLabelRange(){const t=this.axesX.map((o,s)=>{const l=this.axesRange.x[s].size;return o.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((o,s)=>{const l=this.axesRange.y[s].size;return o.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:t,y:n}}initScale(){const t=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;this.pixelRatio=t/n,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.scale(this.pixelRatio,this.pixelRatio),this.overlayCtx&&this.overlayCtx.scale(this.pixelRatio,this.pixelRatio)}getChartDOMRect(){var s;const t=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(t==null?void 0:t.width)||10,o=(t==null?void 0:t.height)||10;return this.setWidth(n),this.setHeight(o),{width:n,height:o}}getChartRect(){var E,T,V,C;const{width:t,height:n}=this.getChartDOMRect(),o=this.options.padding,s=(T=(E=this.options.axesX)==null?void 0:E[0])==null?void 0:T.title,l=(C=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:C.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let u=0;d!=null&&d.use&&(u=d==null?void 0:d.height);let f=0;h!=null&&h.use&&(f=h==null?void 0:h.width);const g=o.left+o.right+f,p=o.top+o.bottom+r+c+u,m=t>g?t-g:t,x=n>p?n-p:n,b=o.left,y=Math.max(t-o.right-f,b+2),M=o.top+c,I=Math.max(n-o.bottom-r-u,M+2);return{x1:b,x2:y,y1:M,y2:I,chartWidth:m,chartHeight:x,width:t,height:n}}setWidth(t){this.displayCanvas&&(this.displayCanvas.width=t*this.pixelRatio,this.displayCanvas.style.width=`${t}px`,this.bufferCanvas.width=t*this.pixelRatio,this.bufferCanvas.style.width=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.width=t*this.pixelRatio,this.overlayCanvas.style.width=`${t}px`))}setHeight(t){this.displayCanvas&&(this.displayCanvas.height=t*this.pixelRatio,this.displayCanvas.style.height=`${t}px`,this.bufferCanvas.height=t*this.pixelRatio,this.bufferCanvas.style.height=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.height=t*this.pixelRatio,this.overlayCanvas.style.height=`${t}px`))}getLabelOffset(t=null){const n=this.axesX,o=this.axesY,s=t??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),o.forEach((d,h)=>{var u;(u=d.labelStyle)!=null&&u.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(t,n){var c,d,h,u,f,g,p,m,x,b;const o=n||t,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((g=(f=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:f.scrollbar)==null?void 0:g.use)??!1,a=((m=(p=this.scrollbar)==null?void 0:p.x)==null?void 0:m.use)??!1,r=((b=(x=this.scrollbar)==null?void 0:x.y)==null?void 0:b.use)??!1;(s!==a||s||o&&s)&&this.updateScrollbarInfo("x",t),(l!==r||l||o&&l)&&this.updateScrollbarInfo("y",t)}update(t){var x,b,y,M,I,E;const n=this.options,o=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:u,lightUpdate:f,updateByScrollbar:g}=t;if(!this.isInit)return;if(this.updateScrollbar(h,g),this.resetProps(),this.updateSeries=r,r&&(this.seriesInfo=null,this.seriesList=null,this.lastTip=null,this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.seriesList={},this.lastTip={pos:null,value:null},this.createSeriesSet(a,n.type,n.horizontal,l),this.legendDOM&&!n.legend.external&&this.updateLegend()),c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!f)if(l.length&&this.addGroupInfo(l),(x=this.options.realTimeScatter)!=null&&x.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(o)):this.createDataSet(o,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const T=!!((y=(b=n.legend)==null?void 0:b.table)!=null&&y.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():T&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();u&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(I=(M=n.tooltip)==null?void 0:M.formatter)!=null&&I.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let p=t==null?void 0:t.hitInfo;!(p!=null&&p.legend)&&((E=this.legendHover)!=null&&E.sId)&&(p={...p||{},legend:this.legendHover}),this.render(p),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.displayCanvas&&this.displayCtx.clearRect(0,0,this.displayCanvas.width/this.clearRectRatio,this.displayCanvas.height/this.clearRectRatio),this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(t){var n,o,s,l,a,r,c;this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.initRect(),((s=(o=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:o.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),t&&t(!0)}render(t){this.isInit&&(this.clear(),this.chartRect=this.getChartRect(),this.drawChart(t))}_getLegendSeries(){var n;const t=(n=this.data.groups)==null?void 0:n.at(0);return t?t.filter(o=>{var s;return(s=this.seriesList[o])==null?void 0:s.showLegend}).map(o=>[o,this.seriesList[o]]):Object.entries(this.seriesList).filter(([,o])=>o.showLegend)}_seriesToLegendItem(t){const n=typeof t.color!="string"?t.color[t.color.length-1][1]:t.color;return{sId:t.sId,name:t.name,color:n,type:t.type,show:t.show,fill:t.fill,fillColor:t.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,t])=>this._seriesToLegendItem(t))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(t){var d;const n=this.seriesList[t];if(!n)return;const o=this.options.legend,s=this._getLegendSeries();if(o.clickMode==="active")s.every(([,f])=>f.show)?(s.forEach(([,f])=>{f.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,f])=>!f.show)&&(s.forEach(([,f])=>{f.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,u=[...this.brushSeries.list];u[h]=this.seriesList,this.brushSeries.list=u,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(t){const n={sId:t,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){if(!this.isInit)return;const t=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),this.overlayCanvas.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent)),this.isInitTooltip&&this.tooltipDestroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null;t.hasChildNodes();)t.removeChild(t.firstChild)}hideTooltip(){var t;this.options.tooltip.use&&((t=this.tooltipDOM)!=null&&t.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:t,selectLabel:n,selectSeries:o}=this.options;if(n.use){let a=null;t==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}o.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};const UC={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},YC={class:"ev-chart-toolbar"},jC={class:"ev-chart-toolbar__icon"};function GC(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon");return i.openBlock(),i.createElementBlock("div",YC,[i.createElementVNode("div",jC,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.$props.toolbar.items,(r,c)=>(i.openBlock(),i.createBlock(a,{key:`${c}-${r.icon}`,class:i.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>e.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const Vr=le(UC,[["render",GC],["__scopeId","data-v-dfbffbab"]]);class ZC{constructor(t,n,o,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=t.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=o.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(t.dom):t.dom}setEvChartZoomOptions(t){this.evChartZoomOptions=t}setIcon(t){if(!t)return;const n=t.querySelector(".dragZoom");this.resetIcon=t.querySelector(".reset"),this.previousIcon=t.querySelector(".previous"),this.latestIcon=t.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(t){return t.forEach(n=>{const o=document.createElement("canvas");o.setAttribute("style","display: block;"),o.setAttribute("class","animation-canvas"),o.style.position="absolute",n.appendChild(o)}),t}setEventListener(t){const n=t?"addEventListener":"removeEventListener";this.isUseZoomMode=t,this.evChartDomContainers.forEach(o=>{o[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(t){t.preventDefault();const[n,o]=this.zoomAreaMemory.current[0];if(n===o)return;let s,l;if(t.deltaY>0){if(!n)return;s=n-1,l=o-1}else{if(o===this.cloneLabelsLastIdx)return;s=n+1,l=o+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(t){if(!this.zoomAreaMemory[t].length)return;const[n,o]=this.zoomAreaMemory[t].pop();this.isUseToolbar=!0,this.executeZoom(n,o),this.setZoomAreaMemory(n,o,t==="previous"?"latest":"previous")}dragZoom({data:t,range:{dragSelectionInfo:n}}){const{dragXsp:o,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var u;return(((u=h==null?void 0:h.title)==null?void 0:u.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=t[0].items,u=h[0].x,f=h[h.length-1].x,g=c[d].labels,p=this.evChartCloneData[d].labels,[m,x]=this.zoomAreaMemory.current[0];let b=p.findIndex(T=>+T.$d==+u.$d),y=p.findLastIndex(T=>+T.$d==+f.$d);const M=T=>l/(g.length-1)*(T-m);let I=M(b);if(b===y&&(I-o>=s-I?b-=1:y+=1),b===m&&y===x)return;b-y===-1&&(I=M(b));const E=M(y);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,b,y,I,E):(this.executeZoom(b,y),this.setZoomAreaMemory(b,y))}}dragZoomAnimation(t,n,o,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=t,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(u=>{const f=u.querySelector(".animation-canvas");return[u.children[0],f]});for(let u=0;u<h.length;u++){const[f,g]=h[u],p=g.getContext("2d");g.style.top=`${a.y1}px`,g.style.left=`${a.x1}px`,g.width=r*d,g.style.width=`${r}px`,g.height=c*d,g.style.height=`${c}px`,g.style.display==="none"&&(g.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(f,p,t,s,l).then(m=>{g.style.display="none",m&&u===h.length-1&&(this.isAnimationFinish=m,this.executeZoom(n,o),this.setZoomAreaMemory(n,o))})}}executeZoom(t,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let o=0;o<this.evChartCloneData.length;o++){const{data:s,labels:l,series:a}=this.evChartCloneData[o],r=this.evChartProps.data[o],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((u,f)=>t<=f&&n>=f)}r.labels=l.filter((d,h)=>t<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=t,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(t),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(t,n){this.brushIdx.end=-1;for(let o=0;o<n.value.length;o++){const s=t.data[n.value[o]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(t,n,o,s){const l=t.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=t.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(o),this.setBrushIdx(t,n)}setZoomAreaMemory(t,n,o){if(t<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;o?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[o].push(r)):(t!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([t,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(t,n,o,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=o;let d=0,h=s,u=l-s,f=l,g=1;const p=.0015;let m=.5;const x=.1,b=.05,y=50,M=Math.ceil(y*(s/r)),I=Math.ceil(y*((r-l)/r)),E=T=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(t.style.opacity="initial",T(!0)):(m>=x&&(t.style.opacity=m,m-=b),n.globalAlpha=g,n.drawImage(t,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(t,a.x1+s,a.y1,l-s,c,h,0,u,c),n.drawImage(t,a.x1+l,a.y1,r,c,f,0,r,c),g-=p,d-=M,h-=M,u+=M+I,f+=I,requestAnimationFrame(()=>E(T))));return new Promise(T=>E(T))}setIconStyle(t){const n=(o,s)=>{s?this.iconStyle(o,"enable"):this.iconStyle(o,"disable")};if(t&&this.dragZoomIcon.classList.contains("active")){const{previous:o,latest:s}=this.zoomAreaMemory;n(this.previousIcon,o.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(t,n){if(!t)return;const[o,s]=n==="enable"?[1,"initial"]:[.5,"none"];t.style.opacity=o,t.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[t,n]=this.zoomAreaMemory.current[0],o=this.cloneLabelsLastIdx;(t!==0||n!==o)&&(this.isUseToolbar=!0,this.executeZoom(0,o),this.setZoomAreaMemory(0,o))}}const qC={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!1,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0},indicator:{use:!0,color:"#EE7F44",segments:null},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"}},KC={series:{},groups:[],labels:[],data:{}},JC=()=>{let e=null,t=0;const n=200;return{clickEventCallback:l=>{t++,t===1&&(e=setTimeout(()=>{t===1&&l(),t=0},n))},dblClickEventCallback:l=>{e&&(clearTimeout(e),e=null),l(),t=0}}},Pr=(e,t)=>{const{props:n,emit:o}=i.getCurrentInstance(),s=f=>{const g=Fe({},f,qC);return(f.type==="scatter"||f.type==="heatMap")&&!(f!=null&&f.tooltip)&&(g.tooltip.use=!1),f.type==="pie"&&!(f!=null&&f.padding)&&(g.padding={top:2,right:2,left:2,bottom:4}),g},l=f=>Fe(f,KC),a=Se(n.selectedItem),r=Se(n.selectedLabel??(e==null?void 0:e.value)),c=Se(n.selectedSeries),{clickEventCallback:d,dblClickEventCallback:h}=JC();return{eventListeners:{click:async f=>{await i.nextTick(),d(()=>{const{seriesId:g,dataIndex:p,eventTarget:m,targetAxis:x}=(f==null?void 0:f.selected)??{},{eventTarget:b}=(f==null?void 0:f.deselected)??{};switch(m){case"item":{g!==null?(o("update:selectedItem",{seriesID:g,dataIndex:p}),b==="label"&&o("update:selectedLabel",{dataIndex:[]})):o("update:selectedItem",null);break}case"label":{e!=null&&e.value?e.value.dataIndex=p:(o("update:selectedLabel",{dataIndex:p,targetAxis:x}),b==="item"&&o("update:selectedItem",null));break}case"series":{o("update:selectedSeries",{seriesId:g});break}}o("click",f)})},"dbl-click":async f=>{await i.nextTick(),h(()=>{const{eventTarget:g}=f;switch(g){case"series":{o("update:selectedSeries",{seriesId:f.seriesId?[f.seriesId]:[]});break}}o("dbl-click",f)})},"drag-select":async f=>{await i.nextTick(),o("drag-select",f)},"mouse-move":async f=>{t!=null&&t.value&&(t.value=f.hoveredLabel),await i.nextTick(),o("mouse-move",f)},"mouse-leave":()=>{t!=null&&t.value&&(t.value.label=null)},"click-legend":async f=>{await i.nextTick(),o("click-legend",f)},"update:legendData":async f=>{await i.nextTick(),o("update:legendData",f)},"axes-scale-change":f=>{o("axes-scale-change",f)}},selectItemInfo:a,selectLabelInfo:r,selectSeriesInfo:c,getNormalizedData:l,getNormalizedOptions:s}},_r=e=>{const t=i.ref(),n=i.computed(()=>{const o=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:o(Zl(e.width)),height:o(Zl(e.height))}});return{wrapper:t,wrapperStyle:n}},Ar=(e,{wrapper:t,evChartGroupRef:n},o,s)=>{const{props:l,emit:a}=i.getCurrentInstance(),r=i.ref(!1),c=i.ref(!1),d=i.ref(!0),h=i.ref(),u=i.reactive({zoom:e.zoom}),f=i.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let g=null;const p=i.reactive({dom:[],props:{data:[],options:[]}}),m=i.reactive({data:null,options:null}),x=i.ref([]),b=S=>{S.data.length&&S.range&&c.value&&g.dragZoom(S)},y=()=>{p.props.options.forEach((S,w)=>{if(S.zoom={...S.zoom,use:c.value,getRangeInfo:b},c.value)S.dragSelection={...S.dragSelection,use:!0,keepDisplay:!1};else{const{use:k,keepDisplay:B}=m.options[w].dragSelection??{};S.dragSelection={use:!!k,keepDisplay:!!B}}})},M=()=>{if(n!=null&&n.value?(p.dom=n.value.querySelectorAll(".ev-chart-container"),p.dom.length&&s.value.forEach(({data:S,options:w},k)=>{S.chartIdx=k,p.props.data.push(S),p.props.options.push(w),x.value.push(k)})):(p.dom=[t.value.querySelector(".ev-chart-container")],p.props.data.push(l.data),p.props.options.push(l.options)),p.props.data.length){m.data=Se(p.props.data),m.options=Se(p.props.options);const S={updateZoomStartIdx:w=>a("update:zoomStartIdx",w),updateZoomEndIdx:w=>a("update:zoomEndIdx",w)};g=new ZC(p,m,u,h.value,r,f,S)}},I=S=>{m.data[0].labels.length<=1||(c.value=!c.value,S?S.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),y(),g.setIconStyle(c.value),g.setEventListener(c.value))},E=(S,w)=>{if(g.isAnimationFinish)switch(w){case"dragZoom":I(S.target);break;case"reset":g.initZoom();break;case"previous":case"latest":g.clickMoveZoomArea(w);break}};i.onUpdated(()=>{g&&h.value&&g.setIcon(h.value)});const T=S=>{!je(S.zoom,u.zoom)&&(u.zoom=S.zoom,g?(!u.zoom.toolbar.show&&c.value&&I(),g.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&M())},V=S=>{d.value?(r.value||(m.data=n?Se(S):[Se(S)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,y()),g&&g.updateEvChartCloneData(m,x,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},C=(S,w)=>{if(g.isUseToolbar){g.isUseToolbar=!1;return}c.value&&(g.executeZoom(S,w),g.setZoomAreaMemory(S,w))};return i.watch(()=>[f.start,f.end],([S,w],[k])=>{if(o!=null&&o.value)if(typeof o.value.dataIndex=="number")S>=(k??0)?o.value.dataIndex-=S-(k??0):o.value.dataIndex+=k-S;else for(let B=0;B<o.value.dataIndex.length;B++)S>=(k??0)?o.value.dataIndex[B]-=S-(k??0):o.value.dataIndex[B]+=k-S;(f.isUseButton||f.isUseScroll)&&g.executeZoom(S,w)}),i.watch(()=>[f.isUseButton,f.isUseScroll],([S,w],[k,B])=>{k&&!S?g.setZoomAreaMemory(f.start,f.end):B&&!w&&(g.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:p,evChartToolbarRef:h,evChartClone:m,brushIdx:f,createEvChartZoom:M,setOptionsForUseZoom:T,setDataForUseZoom:V,controlZoomIdx:C,onClickToolbar:E}},QC={name:"EvChart",components:{EvChartToolbar:Vr},directives:{resize:wn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change"],setup(e,{emit:t}){let n=null;const o=i.ref(!1),s=i.inject("isChartGroup",!1),l=i.inject("brushSeries",{list:[],chartIdx:null}),a=i.inject("groupSelectedLabel",null),r=i.inject("groupHoveredLabel",null),c=i.inject("brushIdx",{start:0,end:-1}),d=i.inject("evChartPropsInGroup",[]),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:m}=Pr(a,r),x=p(e.data),b=m(e.options),y=i.computed(()=>e.selectedLabel),M=i.computed(()=>e.selectedItem),{wrapper:I,wrapperStyle:E}=_r(b),{evChartZoomOptions:T,evChartToolbarRef:V,createEvChartZoom:C,setOptionsForUseZoom:S,setDataForUseZoom:w,controlZoomIdx:k,onClickToolbar:B}=s?{}:Ar(b,{wrapper:I,evChartGroupRef:null},e.selectedLabel?y:M,d),D=()=>{var z;let _;b.selectLabel.use?_=f:b.selectSeries.use&&(_=g);const A=(z=e.options.realTimeScatter)!=null&&z.use?{...e.data,groups:[],labels:[]}:x;n=new Nr(I.value,A,b,h,u,_,l)},O=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&C(),b.legend.show&&b.legend.external&&n.emitLegendData())};i.watch(()=>e.options,_=>{var H,X;const A=m(_),z=((X=(H=n.options)==null?void 0:H.legend)==null?void 0:X.show)??!1,$=!je(A.legend.table,n.options.legend.table),U=A.tooltip.use&&!je(A.tooltip,n.options.tooltip);n.options=Se(A),n.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:$,updateTooltip:U}),A.legend.show&&A.legend.external&&!z&&n.emitLegendData(),s||S(A)},{deep:!0,flush:"post"}),i.watch(()=>e.data,_=>{var U,H;const A=(U=e.options.realTimeScatter)!=null&&U.use?{..._,groups:[],labels:[]}:p(_),z=!je(A.series,n.data.series)||!je(A.groups,n.data.groups)||e.options.type==="heatMap",$=!je(A,n.data);n.data=(H=e.options.realTimeScatter)!=null&&H.use?A:Se(A),n.update({updateSeries:z,updateSelTip:{update:!0,keepDomain:!1},updateData:$}),!s&&$&&w(A)},{deep:!0,flush:"post"}),s&&!(a!=null&&a.value)&&i.watch(()=>c.start,(_,A)=>{if(y!=null&&y.value)for(let z=0;z<y.value.dataIndex.length;z++)_>=(A??0)?y.value.dataIndex[z]-=_-(A??0):y.value.dataIndex[z]+=A-_;else M!=null&&M.value&&(_>=(A??0)?M.value.dataIndex-=_-(A??0):M.value.dataIndex+=A-_)}),i.watch(()=>M.value,_=>{const A=e.options.type;n.selectItemByData(_,A)},{deep:!0,flush:"post"}),i.watch(()=>(a==null?void 0:a.value)??y.value,_=>{_!=null&&_.dataIndex&&n.selectLabelByData(_.dataIndex,_==null?void 0:_.targetAxis)},{deep:!0,flush:"post"}),i.watch(()=>e.selectedSeries,_=>{var A;(A=b.selectSeries)!=null&&A.use?_.seriesId&&n.selectSeriesByData(_.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||i.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([_,A])=>{k(_,A)}),i.watch(()=>e.realTimeScatterReset,_=>{_&&(Object.keys(n.dataSet??{}).forEach(A=>{n.dataSet[A]&&(n.dataSet[A].dataGroup=[])}),t("update:realTimeScatterReset",!1))}),i.watch(()=>{var _;return(_=e.options.realTimeScatter)==null?void 0:_.use},_=>{n.options.realTimeScatter.use=_??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),i.watch(()=>r==null?void 0:r.value,_=>{_&&e.options.syncHover!==!1&&(_.label==null?n.overlayClear():n.drawSyncedIndicator(_))},{deep:!0,flush:"post"}),i.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await D(),await O(),o.value=!0}),i.onBeforeUnmount(()=>{var _;n&&"destroy"in n&&n.destroy(),(_=d==null?void 0:d.value)!=null&&_.length&&(d.value.length=0),o.value=!1}),i.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const R=_=>{n==null||n.toggleSeries(_)},v=_=>{n==null||n.highlightSeries(_)},N=()=>{n==null||n.unhighlightSeries()},L=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},P=jo(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return i.onActivated(()=>{o.value&&P()}),{wrapper:I,wrapperStyle:E,onResize:P,redraw:L,toggleSeries:R,highlightSeries:v,unhighlightSeries:N,evChartToolbarRef:V,injectIsChartGroup:s,onClickToolbar:B,normalizedOptions:b,zoomOptions:i.toRef(T??{zoom:{}},"zoom")}}},eS={key:0,ref:"evChartToolbarRef"};function tS(e,t,n,o,s,l){var c;const a=i.resolveComponent("ev-chart-toolbar"),r=i.resolveDirective("resize");return i.openBlock(),i.createElementBlock(i.Fragment,null,[(c=o.zoomOptions.toolbar)!=null&&c.show&&!o.injectIsChartGroup?(i.openBlock(),i.createElementBlock("div",eS,[i.createVNode(a,{toolbar:o.zoomOptions.toolbar,onOnClickToolbar:o.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",{ref:"wrapper",style:i.normalizeStyle(o.wrapperStyle),class:"ev-chart"},null,4),[[r,o.onResize]])],64)}const so=le(QC,[["render",tS]]);so.install=e=>{e.component(so.name,so)};const nS={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},oS=()=>{const e=i.ref(!1),t=i.ref(),n=i.ref([]),o=i.reactive({list:[],chartIdx:null});return{getNormalizedOptions:l=>Fe({},l,nS),isExecuteZoom:e,brushSeries:o,evChartGroupRef:t,evChartPropsInGroup:n}},iS={name:"EvChartGroup",components:{evChartToolbar:Vr},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(e,{emit:t}){const{getNormalizedOptions:n,isExecuteZoom:o,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a}=oS(),r=n(e.options);i.provide("isExecuteZoom",o),i.provide("isChartGroup",!0),i.provide("brushSeries",s),i.provide("evChartPropsInGroup",a);const c=i.computed({get:()=>e.groupSelectedLabel,set:I=>t("update:groupSelectedLabel",I)});i.provide("groupSelectedLabel",c);const d=i.ref(null);i.provide("groupHoveredLabel",d),i.watch(()=>e.options.syncHover,I=>{I?d.value={label:"",horizontal:!1}:d.value=null},{immediate:!0});const{evChartZoomOptions:h,evChartInfo:u,evChartToolbarRef:f,evChartClone:g,brushIdx:p,createEvChartZoom:m,setOptionsForUseZoom:x,setDataForUseZoom:b,controlZoomIdx:y,onClickToolbar:M}=Ar(r,{wrapper:null,evChartGroupRef:l},c,a);return i.provide("evChartClone",g),i.provide("evChartInfo",u),i.provide("brushIdx",p),i.onMounted(()=>{m()}),i.watch(()=>u.props.data,I=>{b(I)},{deep:!0}),i.watch(()=>e.options,I=>{const E=n(I);x(E)},{deep:!0}),i.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([I,E])=>{p.isUseButton||p.isUseScroll||y(I,E)}),{evChartGroupRef:l,evChartToolbarRef:f,zoomOptions:i.toRef(h,"zoom"),onClickToolbar:M}}},sS={key:0,ref:"evChartToolbarRef"},lS={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function aS(e,t,n,o,s,l){const a=i.resolveComponent("ev-chart-toolbar");return i.openBlock(),i.createElementBlock(i.Fragment,null,[o.zoomOptions.toolbar.show?(i.openBlock(),i.createElementBlock("div",sS,[i.createVNode(a,{toolbar:o.zoomOptions.toolbar,onOnClickToolbar:o.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):i.createCommentVNode("",!0),i.createElementVNode("div",lS,[i.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const lo=le(iS,[["render",aS],["__scopeId","data-v-b1c0c322"]]);lo.install=e=>{e.component(lo.name,lo)};const Ee={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Re={LEFT:"leftX",RIGHT:"rightX"};let rS=class{constructor(t,n,o,s,l){this.evChart=t,this.evChartBrushOptions=o,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,o.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(t){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const o=this.evChartBrushRef.value.querySelector(".brush-canvas");if(o)this.drawBrushRect({brushCanvas:o,isResize:t});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:t,isResize:n,isDebounce:o,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,t);if(!(n&&this.isEqualWidth)&&c>=0){const u=this.setBrushXAndWidth(h,l,o,s);h&&u&&this.drawBrush(h,u,d,t)}}setCanvasWidthHeight(t,n){const s=t.x2-t.x1+6,l=t.y2-t.y1,a=(t.x2-t.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(t,n=0,o,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=t;!o&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case Ee.BUTTON.INCREASE:case Ee.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Re.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===Re.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case Ee.GRAB.UP:case Ee.GRAB.DOWN:this.brushRectX<=0&&s===Ee.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===Ee.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}return{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(t,n,o,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=t,{brushRectX:h,brushRectWidth:u}=n,{height:f,selection:{fillColor:g,opacity:p}}=this.evChartBrushOptions.value,m=f-o.y1,x=h,b=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${o.y1}px`,s.style.left=`${o.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const y=s.getContext("2d");y.clearRect(0,0,r*d,a*d),y.fillStyle=g,y.globalAlpha=p,y.fillRect(h,0,u,m),y.fillRect(x,0,l,m),y.fillRect(b-l,0,l,m),this.brushPosInfo={leftX:x/d,rightX:b/d,buttonWidth:l,axesXInterval:c,...t,...n}}addEvent(){let t;this.onMouseDown=s=>{s.preventDefault(),t.isInsideButton?this.clickBrushInsideX=-1:t.isInsideBrush?this.clickBrushInsideX=s.offsetX:t.isOutsideBrush&&this.teleportBrush(s)};const n=s=>{this.clickBrushInsideX?this.mouseDownAndMove(s):(t=this.getMousePosition(s),this.changeCursor(t))};this.onMouseMove=xs(n,5),this.onWheel=s=>{s.preventDefault();const l=s.deltaY>0?Ee.WHEEL.DOWN:Ee.WHEEL.UP;this.updateBrushIdx(l),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:l}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()},this.onMouseLeave=()=>{this.clickBrushInsideX&&this.initEventState()};const o=()=>{this.initEventState()};this.onWheelDebounce=jo(o,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),o=n(Re.RIGHT)>n(Re.LEFT)?Re.LEFT:Re.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Re.LEFT)||s(Re.RIGHT),r=s(Re.LEFT)&&l(Re.RIGHT),c=t.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[o]&&t.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[o];return this.curBrushButtonType=c&&o,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),this.brushCanvas=null),this.evChartBrushContainer){const t=this.evChartBrushContainer;for(;t.hasChildNodes();)t.removeChild(t.firstChild)}}setEventListener(t){this.brushCanvas[t]("mousemove",this.onMouseMove),this.brushCanvas[t]("mousedown",this.onMouseDown),this.brushCanvas[t]("mouseup",this.onMouseUp),this.brushCanvas[t]("mouseleave",this.onMouseLeave),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[t]("wheel",this.onWheel),this.brushCanvas[t]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const t=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");t&&this.evChartBrushRef.value.removeChild(t)}}removeBrushCanvas(){if(this.evChartBrushContainer){const t=this.evChartBrushContainer.querySelector(".brush-canvas");t&&this.evChartBrushContainer.removeChild(t)}}teleportBrush(t){const n=this.debounceBrushIdx??this.brushIdx,o=(n.end-n.start)/2;let s,l,a;o>.5?(n.end-n.start)%2===0?(a=Math.round(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(o),l=Math.floor(o)):(a=Math.ceil(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(o),l=Math.floor(o)):(a=Math.floor(t.offsetX/this.brushPosInfo.axesXInterval),t.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(o),l=Math.ceil(o)):(s=Math.ceil(o),l=Math.floor(o),o<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(t){t.isOutsideBrush?this.brushCanvas.style.cursor="pointer":t.isInsideBrush&&(t.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(t){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let o;t.offsetX>this.beforeMouseXPos?this.clickBrushInsideX>0?this.clickBrushInsideX<t.offsetX-n&&(o=Ee.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(o=this.curBrushButtonType===Re.LEFT?Ee.BUTTON.DECREASE:Ee.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.clickBrushInsideX>0?this.clickBrushInsideX>t.offsetX+n&&(o=Ee.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(o=this.curBrushButtonType===Re.LEFT?Ee.BUTTON.INCREASE:Ee.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:o,offsetX:t.offsetX}):this.updateBrushIdx(o),this.beforeMouseXPos=t.offsetX}updateBrushIdx(t){const n=this.debounceBrushIdx??this.brushIdx;switch(t){case Ee.WHEEL.UP:case Ee.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case Ee.WHEEL.DOWN:case Ee.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case Ee.BUTTON.INCREASE:if(this.curBrushButtonType===Re.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case Ee.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Re.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const t=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===Re.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Re.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:o}=t();this.brushIdx.start===n&&this.brushIdx.end===o&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=o??this.debounceBrushIdx.end}initEventState(){new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1)})}};const cS={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},dS=()=>({getNormalizedBrushOptions:t=>Fe({},t,cS)}),hS={name:"EvChartBrush",directives:{resize:wn},props:{options:{type:Object,default:()=>({})}},setup(e){let t=null,n=null;const o=i.ref(!1),s=i.inject("evChartClone",{data:[]}),l=i.inject("evChartInfo",{props:{options:[]}}),a=i.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=i.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=dS(),d=i.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:m}=Pr(),x=i.computed(()=>p((s.data??[])[d.value.chartIdx])),b=i.computed(()=>{var k,B;const S=l.props.options[d.value.chartIdx],w={...S,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(k=S==null?void 0:S.axesX)==null?void 0:k[0],title:{use:!1}}],axesY:[{...(B=S==null?void 0:S.axesY)==null?void 0:B[0],title:{use:!1}}]};return m(w)}),{wrapper:y,wrapperStyle:M}=_r(b.value);i.watch(()=>r.list,()=>{y.value&&r.chartIdx===d.value.chartIdx&&(t.seriesList=r.list[d.value.chartIdx],t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),i.watch(b,(S,w)=>{var k;S.brush.chartIdx<=((k=s.data)==null?void 0:k.length)-1?n&&!je(w.brush,S.brush)?n.removeBrushWrapper():t&&!je(S,w)&&(t.options=Se(S),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Se(x.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),i.watch(()=>s.data,S=>{if(t){const w=S[d.value.chartIdx];if(w){const k=!je(w.series,t.data.series),B=r.list[d.value.chartIdx];typeof B=="object"&&Object.keys(B).length&&Object.keys(w.series).forEach(D=>{var O;"show"in w.series[D]||(w.series[D].show=((O=B[D])==null?void 0:O.show)??!0)}),t.data=Se(w),t.update({updateSeries:k,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const I=()=>{let S;b.value.selectLabel.use?S=f:b.value.selectSeries.use&&(S=g),t=new Nr(y.value,x.value,b.value,h,u,S)},E=()=>{n=new rS(t,x,d,a,y)},T=()=>{t&&t.init()},V=S=>{n&&n.init(S)};i.watch(()=>[a.start,a.end],()=>{var S;y.value&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1&&V()}),i.onMounted(async()=>{d.value.show&&(await I(),await T(),E(),V()),o.value=!0}),i.onUpdated(async()=>{var S;if(d.value.show&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1){const w=r.list[d.value.chartIdx];typeof w=="object"&&Object.keys(w).length&&Object.keys(x.value.series).forEach(k=>{var B;"show"in x.value.series[k]||(x.value.series[k].show=((B=w[k])==null?void 0:B.show)??!0)}),await I(),await T(),E(),V()}}),i.onBeforeUnmount(()=>{t&&"destroy"in t&&t.destroy(),n&&n.destroy(),o.value=!1}),i.onDeactivated(()=>{t&&"hideTooltip"in t&&t.hideTooltip()});const C=jo(()=>{t&&"resize"in t&&new Promise(w=>t.resize(w)).then(w=>{w&&V(w)})},0);return i.onActivated(()=>{o.value&&C()}),{evChartBrushOptions:d,evChartBrushRef:y,evChartBrushStyle:M,onResize:C}}};function uS(e,t,n,o,s,l){const a=i.resolveDirective("resize");return o.evChartBrushOptions.show?i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:i.normalizeStyle(o.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,o.onResize]]):i.createCommentVNode("",!0)}const ao=le(hS,[["render",uS]]);ao.install=e=>{e.component(ao.name,ao)};const fS={name:"TreeGridNode",components:{GridOptionButton:Ls},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(e,{emit:t}){const n=(y,M)=>{t("check-tree-data",y,M)},o=y=>{t("expand-tree-data",y)},s=(y,M)=>{t("click-tree-data",y,M)},l=(y,M)=>{t("dbl-click-tree-data",y,M)},a=y=>{t("context-menu",y)},r=y=>{const M=e.expandIcon?e.expandIcon:"",I=e.expandIcon?e.collapseIcon:"";return y.expand?I:M},c=i.computed(()=>e.nodeData||{}),d=i.computed(()=>e.parentIcon||"tree-parent-icon"),h=i.computed(()=>e.childIcon||"tree-child-icon"),u=i.computed(()=>d.value!=="none"||h.value!=="none"),f=i.computed(()=>{const y=e.orderedColumns||[],M=y.findIndex(E=>E.expandColumn&&!E.hide&&!E.hiddenDisplay);if(M!==-1)return M;const I=y.findIndex(E=>!E.hide&&!E.hiddenDisplay);return I!==-1?I:0}),g=y=>({row:!0,"tree-row":!0,[`tree-row--level-${y==null?void 0:y.level}`]:!0,highlight:(y==null?void 0:y.index)===e.highlightIndex,selected:y.selected,"non-border":!!e.borderStyle&&e.borderStyle!=="rows"}),p=i.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!e.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:p,expandColumnIdx:f,onCheck:n,onExpand:o,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:g,getColumnClass:(y,M)=>({cell:!0,"tree-td":M===0,[y.type]:y.type,[y.align]:y.align,[y.field]:y.field,"non-border":!!e.borderStyle}),getColumnStyle:(y,M)=>({width:`${y.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),getDepthStyle:y=>({"margin-left":`${y*13}px`})}}},mS=["data-index"],gS=["data-name","data-index"],pS={class:"td-content__wrapper"},yS=["title"],xS={class:"td-content"};function bS(e,t,n,o,s,l){var d;const a=i.resolveComponent("ev-checkbox"),r=i.resolveComponent("ev-icon"),c=i.resolveComponent("grid-option-button");return i.openBlock(),i.createElementBlock("tr",{"data-index":o.node.index,class:i.normalizeClass(o.getRowClass(o.node)),onClick:t[7]||(t[7]=h=>o.onClick(h,o.node)),onDblclick:t[8]||(t[8]=h=>o.onDblClick(h,o.node))},[n.useCheckbox.use?(i.openBlock(),i.createElementBlock("td",{key:0,class:i.normalizeClass(o.checkboxClass),style:i.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(a,{modelValue:o.node.checked,"onUpdate:modelValue":t[0]||(t[0]=h=>o.node.checked=h),disabled:o.node.uncheckable,indeterminate:o.node.indeterminate,class:"row-checkbox-input",onChange:t[1]||(t[1]=h=>o.onCheck(h,o.node))},null,8,["modelValue","disabled","indeterminate"])],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.orderedColumns,(h,u)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(i.openBlock(),i.createElementBlock("td",{key:0,"data-name":h.field,"data-index":o.node.index,class:i.normalizeClass(o.getColumnClass(h,u)),style:i.normalizeStyle(o.getColumnStyle(h,u))},[i.createElementVNode("div",pS,[u===o.expandColumnIdx?(i.openBlock(),i.createElementBlock("span",{key:0,style:i.normalizeStyle(o.getDepthStyle(o.node.level))},null,4)):i.createCommentVNode("",!0),u===o.expandColumnIdx?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass({expand:o.node.expand,"ev-tree-toggle":!0})},[o.node.hasChild?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o.expandIconClasses(o.node)?(i.openBlock(),i.createBlock(r,{key:0,icon:o.expandIconClasses(o.node),style:{display:"block"},onClick:t[2]||(t[2]=f=>o.onExpand(o.node))},null,8,["icon"])):(i.openBlock(),i.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:t[3]||(t[3]=i.withModifiers(f=>o.onExpand(o.node),["stop"]))},[...t[9]||(t[9]=[i.createElementVNode("i",null,null,-1)])]))],64)):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),u===o.expandColumnIdx&&o.isDataIcon?(i.openBlock(),i.createElementBlock("span",{key:2,title:o.node[h.field],class:i.normalizeClass({expand:o.node.expand,"ev-tree-toggle":!0})},[i.createElementVNode("span",{class:i.normalizeClass(o.node.hasChild?o.parentIconMV:o.childIconMV)},[...t[10]||(t[10]=[i.createElementVNode("i",null,null,-1)])],2)],10,yS)):i.createCommentVNode("",!0),i.createElementVNode("div",xS,[e.$slots[h.field+"Node"]?i.renderSlot(e.$slots,h.field+"Node",{key:0,item:{data:o.node.data}},void 0,!0):i.createCommentVNode("",!0)])])],14,gS)):i.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(i.openBlock(),i.createElementBlock("td",{key:1,class:i.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:i.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[e.$slots.contextmenuIconNode?(i.openBlock(),i.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[t[4]||(t[4]=h=>o.onContextMenu(h)),t[5]||(t[5]=i.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[i.renderSlot(e.$slots,"contextmenuIconNode",{},void 0,!0)])):(i.openBlock(),i.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[t[6]||(t[6]=h=>o.onContextMenu(h)),i.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):i.createCommentVNode("",!0)],42,mS)}const CS=le(fS,[["render",bS],["__scopeId","data-v-faab3696"]]),SS={name:"EvTreeGridToolbar"},wS={class:"tree-grid-toolbar"};function kS(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",wS,[i.renderSlot(e.$slots,"toolbarWrapper")])}const MS=le(SS,[["render",kS]]),ES=e=>{const{props:t}=i.getCurrentInstance(),{checkInfo:n}=e;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=g=>g.charAt(0).toUpperCase()+g.slice(1),u="Renderer";let f="";if(d.indexOf("_")!==-1){const g=d.split("_");for(let p=0;p<g.length;p++)f+=h(g[p])}else f=h(d);return f+u},getConvertValue:(d,h)=>{let u=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(u=$t(h),u=u===!1?h:u):d.type==="float"&&(u=u.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),u},getColumnIndex:d=>t.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const u=h.toString().indexOf("px")>=0,f=h.toString().indexOf("%")>=0;return!u&&!f&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(u=>u.checked);const h=d.filter(u=>u.uncheckable);if(h.length){const u=d.filter(g=>g.checked),f=d.every(g=>h.includes(g));n.isHeaderChecked=!f&&h.length+u.length===d.length,n.isHeaderUncheckable=f}n.isHeaderIndeterminate=!!d.length&&d.some(u=>u.checked||u.indeterminate)&&!n.isHeaderChecked}}},ri=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(o=>{const s=n.find(l=>l.index===o.index)??{};return{...o,...s}})},IS=e=>{const{scrollInfo:t,stores:n,elementInfo:o,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=e,d=f=>{let g=n.showTreeStore;l.isClientPaging&&(g=r());const p=o.body;if(p){const m=s.rowHeight,x=p.clientHeight>m?Math.ceil(p.clientHeight/m):g.length,b=g.length*m;let y=Math.floor(p.scrollTop/m);y>g.length-1&&(y=0);const M=y+x+1,I=Math.max(y,0),E=M,T=o.table;n.viewStore=g.slice(I,E),t.hasVerticalScrollBar=x<g.length||p.clientHeight<T.clientHeight,t.vScrollTopHeight=I*m,t.vScrollBottomHeight=b-n.viewStore.length*m-t.vScrollTopHeight,f&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(E/l.perPage)+1,l.startIndex=E,c({onScrollEnd:!0}))}},h=()=>{const f=o.header,g=o.body,p=o.table;f.scrollLeft=g.scrollLeft,a.value=g.scrollLeft,t.hasHorizontalScrollBar=g.clientWidth<p.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const f=o.body,g=f.scrollTop,p=f.scrollLeft,m=t.lastScroll.top,x=t.lastScroll.left,b=p!==x;g!==m&&f.clientHeight&&d(!0),b&&h(),t.lastScroll.top=g,t.lastScroll.left=p}}},vS=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{resizeInfo:o,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=e,u=()=>{a.viewStore=a.showTreeStore;const m=a.viewStore;let x=o.columnWidth;o.columnWidth>0&&(x=o.columnWidth),x=o.columnWidth;let b=0;if(o.adjust&&s.body){const y=s.body;let M=y.offsetWidth;const I=y.offsetHeight,E=a.orderedColumns.reduce((T,V)=>(V.hide||V.hiddenDisplay||(V.width?T.totalWidth+=V.width:T.emptyCount++),T),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(o.rowHeight*m.length>I-o.scrollWidth&&(M-=o.scrollWidth),l.useCheckbox.use&&(M-=o.minWidth),x=M-E.totalWidth,x>0){const T=E.emptyCount===0?0:Math.floor(x/E.emptyCount);b=x-T*E.emptyCount,x=E.emptyCount!==0?T:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(a.orderedColumns.forEach(y=>{const M=r(y)?o.rendererMinWidth:o.minWidth;y.width&&y.width<M&&(y.width=M),!y.width&&!y.hide&&(y.width=x)}),b&&a.orderedColumns.length){let y=a.orderedColumns.length-1,M=a.orderedColumns[y];for(;y>0&&M&&(M.hide||M.hiddenDisplay);)y-=1,M=a.orderedColumns[y];M&&(M.width+=b)}o.isResize=!o.isResize},f=()=>{i.nextTick(()=>{var m,x;o.adjust&&a.orderedColumns.forEach(b=>{var M;const y=b;return!((M=t.columns[b.index])!=null&&M.width)&&!y.resized&&(y.width=0),y},void 0),u(),(m=s.body)!=null&&m.clientHeight&&c(),(x=s.body)!=null&&x.clientWidth&&d()})};return{calculatedColumn:u,onResize:f,onShow:m=>{m&&f()},onColumnResize:(m,x)=>{const b=s.header,y=s.body,M=b.getBoundingClientRect().left,I=b.querySelector(`li[data-index="${m}"]`),E=r(a.orderedColumns[m])?o.rendererMinWidth:o.minWidth,T=I.getBoundingClientRect(),V=y.getBoundingClientRect().right-M,C=s.resizeLine,S=T.left-M+E,w=T.right-M,k=x.clientX,B=T.left-M;y.style.overflow="auto",C.style.left=`${w}px`,o.showResizeLine=!0;const D=R=>{const v=R.clientX-k,N=w+v;let L=Math.max(S,N);L=Math.min(V,L),C.style.left=`${L}px`},O=()=>{const v=parseInt(C.style.left,10)-B;a.orderedColumns[m]&&(a.orderedColumns[m].width=v,a.orderedColumns[m].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),f();const N=ri(a);n("resize-column",{column:a.orderedColumns[m],columns:N}),n("change-column-info",{type:"resize",columns:N})};document.addEventListener("mousemove",D),document.addEventListener("mouseup",O,{once:!0})}}},TS=e=>{const{emit:t}=i.getCurrentInstance(),n=e,o=(r,c)=>{var u;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((u=r.target.closest("td"))==null?void 0:u.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(u=>u.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),t("update:selected",n.selectedRow),t("click-row",o(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),t("dblclick-row",o(r,c))}}},BS=e=>{const{checkInfo:t,stores:n,checkHeader:o,pageInfo:s,getPagingData:l}=e,{emit:a}=i.getCurrentInstance(),r=()=>t.useCheckbox.mode==="each",c=g=>{const p=n.treeStore.findIndex(m=>m.index===g.index);p!==-1&&(n.treeStore[p].checked=g.checked)},d=g=>{r()||g.hasChild&&g.children.forEach(p=>{const m=p;g.checked&&!m.checked&&!m.uncheckable&&t.checkedRows.push(m),g.checked||(t.checkedRows=t.checkedRows.filter(x=>x.index!==m.index)),m.checked=g.checked&&!m.uncheckable,m.hasChild&&d(m)})},h=g=>{if(r())return;const p=g.parent;if(p){const m=p.children.every(b=>b.checked);p.checked=m&&!p.uncheckable;const x=p.children.filter(b=>b.uncheckable);if(x.length){const b=p.children.filter(y=>y.checked);x.length+b.length===p.children.length&&(p.checked=!0)}p.indeterminate=!m&&p.children.some(b=>b.checked||b.indeterminate),p.checked?t.checkedRows.push(p):t.checkedRows=t.checkedRows.filter(b=>b.index!==p.index),p.parent&&h(p)}};return{onCheck:(g,p)=>{let m=n.store;s.isClientPaging&&(m=l());const x=()=>t.useCheckbox.mode==="single",b=()=>{t.isHeaderChecked&&(t.isHeaderChecked=!1)},y=()=>{x()&&t.checkedRows.length>0&&(t.prevCheckedRow.checked=!1,c(t.prevCheckedRow))},M=E=>{if(x()){t.checkedRows=[E];return}d(E),h(E),t.checkedRows.push(E),E.indeterminate=!1},I=E=>{if(x()){t.checkedRows=[];return}t.checkedRows=t.checkedRows.filter(T=>T.index!==E.index)};y(),p.checked?(M(p),o(m)):(b(),I(p),d(p),h(p)),t.prevCheckedRow=p,a("update:checked",t.checkedRows),a("check-row",g,p.index,p)},onCheckAll:g=>{var x;const p=t.isHeaderChecked;let m=(x=n.store)==null?void 0:x.filter(b=>b.isFilter);s.isClientPaging&&(m=l()),m.forEach(b=>{b.checked=p&&!b.uncheckable,b.checked?t.checkedRows.find(y=>y.index===b.index)||t.checkedRows.push(b):t.checkedRows=t.checkedRows.filter(y=>y.index!==b.index),b.indeterminate=!1}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",g,t.checkedRows)}}},DS=e=>{const{emit:t}=i.getCurrentInstance(),{contextInfo:n,stores:o,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=e,d=(g=!0)=>{const p=[];if(g&&n.customContextMenu.length){const m=s.selectedRow,x=n.customContextMenu.map(b=>{const y=b;return y.validate&&(y.disabled=!y.validate(y.itemId,m)),y.selectedRow=m??[],y});p.push(...x)}n.contextMenuItems=p};return{setContextMenu:d,onContextMenu:g=>{var x,b;const m=(b=(x=g.target.closest(".row"))==null?void 0:x.dataset)==null?void 0:b.index;if(m){const y=o.viewStore.findIndex(I=>I.index===Number(m)),M=o.viewStore[y];s.selectedRow=[M],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(g,p)=>{var m,x,b,y,M,I;if(g.target.className.includes("column-name")){const E=!!p.sortable;n.columnMenuItems=[{text:((m=n.columnMenuTextInfo)==null?void 0:m.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||o.orderedColumns.length===1||!!p.fixed,hidden:((x=n.hiddenColumnMenuItem)==null?void 0:x.hide)||!l.value,click:()=>{r(p.field),t("change-column-status",{columns:o.updatedColumns}),t("change-column-info",{type:"display",columns:o.updatedColumns})}},{text:((b=n.columnMenuTextInfo)==null?void 0:b.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!E,hidden:(y=n.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>c(p,"asc")},{text:((M=n.columnMenuTextInfo)==null?void 0:M.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!E,hidden:(I=n.hiddenColumnMenuItem)==null?void 0:I.descending,click:()=>c(p,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:g=>{const{useDefaultColumnSetting:p,columnSettingTextInfo:m}=a,x={text:(m==null?void 0:m.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),p&&n.gridSettingContextMenuItems.push(x),n.gridSettingMenu.show(g)}}},OS=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,onResize:o}=e,s=()=>{let r=0;const c=[];function d(u){const f={};return Object.keys(u).forEach(g=>{g!=="children"&&(f[g]=u[g])}),f}function h(u){const{node:f,level:g,isShow:p,parent:m,uncheckable:x}=u;f!==null&&typeof f=="object"&&(f.index=r++,f.level=g,Object.hasOwnProperty.call(f,"checked")||(f.checked=!1),Object.hasOwnProperty.call(f,"selected")||(f.selected=!1),Object.hasOwnProperty.call(f,"show")||(f.show=p),Object.hasOwnProperty.call(f,"expand")||(f.expand=!0),Object.hasOwnProperty.call(f,"isFilter")||(f.isFilter=!1),Object.hasOwnProperty.call(f,"uncheckable")||(f.uncheckable=x),Object.hasOwnProperty.call(f,"indeterminate")||(f.indeterminate=!1),Object.hasOwnProperty.call(f,"data")||(f.data=d(f)),c.push(f),Object.hasOwnProperty.call(f,"parent")||(f.parent=m),f.children&&(f.hasChild=!0,f.children.forEach(b=>h({node:b,level:g+1,isShow:f.show&&f.expand,parent:f,uncheckable:f.uncheckable}))))}return n.treeRows.forEach(u=>{h({node:u,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const u=h;u.show=d&&c?u.isFilter:c,u.hasChild&&l(u.children,u.show&&u.expand,u.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),t("toggle-row",{row:d,isExpand:c}),o()}}},RS=e=>{const{stores:t,filterInfo:n,pageInfo:o,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=e,d=g=>{if(!(g!=null&&g.parent))return;const{parent:p}=g;p.show=!0,p.isFilter=!0,d(p)},h=g=>{if(!(g!=null&&g.children))return;const{children:p}=g;p.forEach(m=>{const x=m;x.parent.show&&x.parent.expand?x.show=!0:x.show=!1,x.isFilter=!0,x.hasChild&&h(x)})};let u=null;return{onSearch:g=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=g;const p=t.treeStore;p.forEach(m=>{m.show=!1,m.isFilter=!1}),g?(p.filter(x=>{let b=!1;for(let y=0;y<t.orderedColumns.length;y++){const M=t.orderedColumns[y]||{};let I=x[M.field]??null;if(M.type=M.type||"string",I!==null&&!M.hide&&((M==null?void 0:M.searchable)===void 0||M!=null&&M.searchable)&&(I=s(M,I).toString(),b=I.toLowerCase().includes(g.toString().toLowerCase()),b))break}return b}).forEach(x=>{x.show=!0,x.parent&&!x.parent.expand&&(x.show=!1),x.isFilter=!0,d(x),h(x)}),n.isSearch=!0):(p.forEach(m=>{m.show=!0,m.isFilter=!1}),p.forEach(m=>{d(m),h(m)})),!g&&o.isClientPaging&&o.prevPage&&(o.currentPage=1,t.pagingStore=r()),c({onSearch:!0}),a(t.store),l()},500)}}},LS=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,pageInfo:o,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(o.currentPage-1)*o.perPage,f=parseInt(u,10)+parseInt(o.perPage,10);return n.showTreeStore.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:o.currentPage,prevPage:o.prevPage,startIndex:o.startIndex,total:o.pageTotal,perPage:o.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(f=>!f.hide&&((f==null?void 0:f.searchable)===void 0||(f==null?void 0:f.searchable))).map(f=>f.field)}}),o.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(o.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(o.isClientPaging)if(o.prevPage=u,n.showTreeStore.length<=o.perPage)n.pagingStore=n.showTreeStore;else{const f=(o.currentPage-1)*o.perPage,g=parseInt(f,10)+parseInt(o.perPage,10);n.pagingStore=n.showTreeStore.slice(f,g),a.body.scrollTop=0,o.startIndex=f}d({onChangePage:!0})}}},NS=({sortInfo:e,stores:t})=>{const{emit:n}=i.getCurrentInstance(),o=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=o(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,f="init")=>{t.orderedColumns.forEach(g=>{g.index===(u==null?void 0:u.index)&&f?g.sortOption={sortType:f}:g.sortOption={sortType:"init"}})},a=()=>{const u=t.originColumns.filter(f=>f.hiddenDisplay||f.hide);u.length&&u.forEach(f=>{f.sortOption={sortType:"init"}})},r=new s;return{onSort:(u,f)=>{if(u.sortable===void 0?!0:u.sortable){e.sortColumn=u,e.sortField!==(u==null?void 0:u.field)&&(r.orders=o(),e.sortField=u==null?void 0:u.field),f&&(r.orders=o(),f==="desc"&&(e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder))),e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder),a(),l(u,e.sortOrder);const p=ri(t);n("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:p}),n("change-column-info",{type:"sort",columns:p})}},setSortInfo:(u,f=!0)=>{const g=u==null?void 0:u.findIndex(x=>{var b;return(x==null?void 0:x.sortable)&&((b=x==null?void 0:x.sortOption)==null?void 0:b.sortType)&&x.sortOption.sortType!=="init"}),p=u[g];g>-1&&(p.index=g);const{sortType:m}=(p==null?void 0:p.sortOption)||{};e.sortColumn=p,e.sortField=p==null?void 0:p.field,e.isSorting=!!m,e.sortOrder=m,l(p,m),f&&n("change-column-info",{type:"sort",columns:ri(t)})},initSortInfo:u=>{e.isSorting=!1,e.sortOrder="init",u.forEach(f=>{var g;(g=f==null?void 0:f.sortOption)!=null&&g.sortType&&f.sortOption.sortType!=="init"&&(f.sortOption.sortType="init")})}}},VS={name:"EvTreeGrid",components:{TreeGridNode:CS,Toolbar:MS,GridPagination:mr,GridSummary:Cr,ColumnSetting:Sr,GridSortButton:wr,GridOptionButton:Ls},directives:{observeVisibility:Xi,resize:wn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var ci,di,hi,ui,fi,mi,gi,qt,gn;const t=i.ref(null),n=i.computed(()=>{var W,ne;return((ne=(W=e.option)==null?void 0:W.useGridSetting)==null?void 0:ne.use)||!1}),o=i.computed(()=>{var W;return((W=e.option)==null?void 0:W.useSummary)||!1}),s=i.computed(()=>e.option.emptyText??"No records"),l=i.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=i.reactive({isSearch:!1,searchWord:""}),r=i.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:i.computed(()=>{var W,ne;return((ne=(W=e.option)==null?void 0:W.useGridSetting)==null?void 0:ne.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((di=(ci=e.option)==null?void 0:ci.useGridSetting)==null?void 0:di.columnMenuText)??"Column List",search:((ui=(hi=e.option)==null?void 0:hi.useGridSetting)==null?void 0:ui.searchText)??"Search",empty:((mi=(fi=e.option)==null?void 0:fi.useGridSetting)==null?void 0:mi.emptyText)??"No records",ok:((qt=(gi=e.option)==null?void 0:gi.useGridSetting)==null?void 0:qt.okBtnText)??"OK"}}),c=i.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:i.computed(()=>c.treeStore.filter(W=>W.show)),searchStore:i.computed(()=>c.treeStore.filter(W=>W.isFilter)),store:i.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:i.computed(()=>e.columns.map((W,ne)=>{var he;return{index:ne,hiddenDisplay:!1,...W,width:isFinite(W.width)?W.width:void 0,sortOption:{sortType:((he=W==null?void 0:W.sortOption)==null?void 0:he.sortType)||"init"}}})),orderedColumns:i.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:i.computed(()=>ri(c))}),d=i.reactive({usePage:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.use)||!1}),useClient:((gn=e.option.page)==null?void 0:gn.useClient)||!1,isInfinite:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.total)||0}),perPage:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.perPage)||20}),visiblePage:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.visiblePage)||8}),order:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.order)||"center"}),showPageInfo:i.computed(()=>{var W;return((W=e.option.page)==null?void 0:W.showPageInfo)||!1}),isClientPaging:i.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=i.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:i.computed(()=>e.option.useCheckbox||{})}),{isRenderer:u,getComponentName:f,getConvertValue:g,getColumnIndex:p,setPixelUnit:m,checkHeader:x}=ES({checkInfo:h}),b=i.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),y=i.reactive({selectedRow:e.selected,useSelect:i.computed(()=>{var W,ne;return((ne=(W=e.option)==null?void 0:W.useSelection)==null?void 0:ne.use)??!0}),limitCount:i.computed(()=>{var ne,he;let W=(he=(ne=e.option)==null?void 0:ne.useSelection)==null?void 0:he.limitCount;return W=W&&W>=2?W:0,W}),multiple:i.computed(()=>{var W,ne;return((ne=(W=e.option)==null?void 0:W.useSelection)==null?void 0:ne.multiple)??!1})}),M=i.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),I=i.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:i.computed(()=>{var W,ne;return((ne=(W=e.option)==null?void 0:W.useGridSetting)==null?void 0:ne.customContextMenu)||[]}),isShowMenuOnClick:!1}),E=i.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:i.computed(()=>e.option.rowHeight||35),gridWidth:i.computed(()=>e.width?m(e.width):"100%"),gridHeight:i.computed(()=>e.height?m(e.height):"100%"),isResize:!1}),T=i.reactive({showHeader:i.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:i.computed(()=>{var W;return((W=e.option.style)==null?void 0:W.stripe)||!1}),borderStyle:i.computed(()=>{var W;return((W=e.option.style)==null?void 0:W.border)||""}),highlightIdx:i.computed(()=>{var W;return((W=e.option.style)==null?void 0:W.highlight)??-1})}),V=()=>{y.selectedRow.length=0,c.store.forEach(W=>{W.selected=!1})},C=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(W=>{W.checked=!1,W.indeterminate=!1})},{getPagingData:S,updatePagingInfo:w,changePage:k}=LS({stores:c,pageInfo:d,sortInfo:M,filterInfo:a,elementInfo:l,clearCheckInfo:C}),B=i.ref(0),{updateVScroll:D,updateHScroll:O,onScroll:R}=IS({scrollInfo:b,stores:c,elementInfo:l,resizeInfo:E,pageInfo:d,summaryScroll:B,getPagingData:S,updatePagingInfo:w}),{onRowClick:v,onRowDblClick:N}=TS(y),{onCheck:L,onCheckAll:P}=BS({checkInfo:h,stores:c,checkHeader:x,pageInfo:d,getPagingData:S}),{calculatedColumn:_,onResize:A,onShow:z,onColumnResize:$}=vS({resizeInfo:E,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:D,updateHScroll:O,contextInfo:I}),{setTreeNodeStore:U,handleExpand:H}=OS({stores:c,onResize:A}),{onSort:X,initSortInfo:j,setSortInfo:K}=NS({sortInfo:M,stores:c}),{onSearch:q}=RS({stores:c,filterInfo:a,pageInfo:d,getConvertValue:g,onResize:A,checkHeader:x,getPagingData:S,updatePagingInfo:w}),{setPositionColumnSetting:Q,initColumnSettingInfo:J,onApplyColumn:te,setColumnHidden:G}=kr({stores:c,columnSettingInfo:r,contextInfo:I,onSearch:q,onResize:A}),{setContextMenu:oe,onContextMenu:Z,onColumnContextMenu:ae,onGridSettingContextMenu:me}=DS({contextInfo:I,stores:c,selectInfo:y,useGridSetting:n,columnSettingInfo:r,setColumnHidden:G,onSort:X}),re=W=>{I.gridSettingContextMenuItems.length=0,I.customGridSettingContextMenu.length?me(W):r.isShowColumnSetting=!0},ue=W=>{var ne,he,xe,Me,Pe,Xe;W.type==="wheel"&&((ne=I.menu)==null||ne.hide(W)),W.type==="scroll"&&!((he=W.target.classList)!=null&&he.contains("table-body"))&&!((Me=(xe=W.target.offsetParent)==null?void 0:xe.classList)!=null&&Me.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,I.isShowMenuOnClick=!1,(Pe=I.columnMenu)==null||Pe.hide(W),(Xe=I.gridSettingMenu)==null||Xe.hide())};i.onMounted(()=>{var W;if(c.treeStore=U(),c.originStore=Se(c.treeStore),(W=e.option)!=null&&W.useSort)K(e.columns,!1);else{const ne=I.hiddenColumnMenuItem;ne.ascending=!0,ne.descending=!0}document.addEventListener("wheel",ue,{capture:!1}),document.addEventListener("scroll",ue,{capture:!0})}),i.onUnmounted(()=>{document.removeEventListener("wheel",ue,{capture:!1}),document.removeEventListener("scroll",ue,{capture:!0})}),i.onActivated(()=>{A()}),i.watch(()=>{var W;return(W=e.option)==null?void 0:W.useSort},W=>{const ne=e.option.hiddenColumnMenuItem,he=I.hiddenColumnMenuItem;W?(he.ascending=(ne==null?void 0:ne.ascending)??!1,he.descending=(ne==null?void 0:ne.descending)??!1,K(e.columns,!1)):(he.ascending=!0,he.descending=!0,j(e.columns))}),i.watch(()=>r.isShowColumnSetting,W=>{var ne;if(!W){(ne=I.gridSettingMenu)==null||ne.hide();return}Q(t.value)}),i.watch(()=>e.columns,()=>{J()},{deep:!0,immediate:!0}),i.watch(()=>e.checked,W=>{h.checkedRows=W}),i.watch(()=>h.checkedRows,W=>{h.isHeaderChecked=!1;let ne=c.store;d.isClientPaging&&(ne=S()),ne.length&&(ne.forEach(he=>{he.checked=!!W.find(xe=>xe.index===he.index)}),x(ne)),D()}),i.watch(()=>e.selected,W=>{y.useSelect&&(y.selectedRow=W)}),i.watch(()=>y.selectedRow,W=>{y.useSelect&&(c.store.forEach(ne=>{ne.selected=!!W.find(he=>he.index===ne.index)}),D())},{deep:!0}),i.watch(()=>T.highlightIdx,async W=>{await i.nextTick();const ne=xe=>{if(!(xe!=null&&xe.children))return;const{children:Me}=xe;Me.forEach(Pe=>{const Xe=Pe;Xe.parent.show&&Xe.parent.expand?Xe.show=!0:Xe.show=!1,Xe.isFilter=!0,Xe.hasChild&&ne(Xe)})},he=xe=>{if(!(xe!=null&&xe.parent)){ne(xe);return}const{parent:Me}=xe;Me.show=!0,Me.isFilter=!0,Me.expand=!0,ne(Me),he(Me)};if(W>=0){const xe=c.store.find(Pe=>Pe.index===W);if(!xe)return;xe.show=!0,xe.isFilter=!0,he(xe);const Me=c.showTreeStore.map(Pe=>Pe.index).indexOf(xe.index);if(d.usePage&&!d.isInfinite){const Pe=Math.ceil(Me/d.perPage);if(d.highlightPage=Me===d.perPage?Pe+1:Pe||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=E.rowHeight*Me}}),i.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),i.watch(()=>y.useSelect,()=>{V()}),i.watch(()=>y.multiple,()=>{V()}),i.watch(()=>e.rows,W=>{c.treeRows=W,c.treeStore=U(),A()},{deep:!0}),i.watch(()=>c.treeStore.length,()=>{x(c.store)}),i.watch(()=>[e.width,e.height,e.option.columnWidth],()=>{e.option.columnWidth!=null&&(E.columnWidth=e.option.columnWidth),c.orderedColumns.map(W=>{var he;const ne=W;return!((he=e.columns[W.index])!=null&&he.width)&&!ne.resized&&(ne.width=0),ne}),A()}),i.watch(()=>e.option.searchValue,W=>{i.nextTick(()=>{W!==void 0&&(q((W==null?void 0:W.value)??W),d.isClientPaging&&(C(),V()))})},{immediate:!0}),i.watch(()=>{var W;return(W=e.option.page)==null?void 0:W.currentPage},W=>{var he;const ne=W||1;d.currentPage=(he=e.option.page)!=null&&he.isInfinite?1:ne},{immediate:!0}),i.watch(()=>d.currentPage,(W,ne)=>{i.nextTick(()=>{if(k(ne),d.isClientPaging&&W!==ne&&(C(),V()),D(),W===d.highlightPage&&d.isHighlight){const he=c.pagingStore.map(xe=>xe.index).indexOf(T.highlightIdx);l.body.scrollTop=E.rowHeight*he,d.isHighlight=!d.isHighlight}})});const ke=()=>({"column-sort__icon":!0,"column-sort__icon--asc":M.sortOrder==="asc","column-sort__icon--desc":M.sortOrder==="desc"}),rt=i.computed(()=>({width:E.gridWidth,height:E.gridHeight})),ct=i.computed(()=>({"table-body":!0,stripe:T.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!T.borderStyle})),yt=i.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:E.adjust,"non-header":!T.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),ho=i.computed(()=>({"table-header":!0,"non-border":!!T.borderStyle})),uo=i.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!T.borderStyle})),fo=i.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Zt=W=>({column:!0,render:u(W),"non-border":!!T.borderStyle,[W.field]:W.field}),_s=(W,ne)=>{const he=u(W);return{width:`${W.width}px`,"min-width":he?`${E.rendererMinWidth}px;`:`${E.minWidth}px`,"margin-right":c.orderedColumns.length-1===ne&&b.hasVerticalScrollBar&&b.hasHorizontalScrollBar?`${E.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===ne?"none":"1px solid #CFCFCF"}},As=W=>`${W}Node`;return{summaryScroll:B,gridStyle:rt,gridClass:yt,headerClass:ho,headerCheckboxClass:uo,isHeaderCheckbox:fo,bodyStyle:ct,useSummary:o,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...i.toRefs(T),...i.toRefs(l),...i.toRefs(c),...i.toRefs(a),...i.toRefs(b),...i.toRefs(E),...i.toRefs(y),...i.toRefs(h),...i.toRefs(M),...i.toRefs(I),...i.toRefs(d),...i.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:g,getColumnIndex:p,setPixelUnit:m,updateVScroll:D,updateHScroll:O,onScroll:R,calculatedColumn:_,onResize:A,onShow:z,onColumnResize:$,onRowClick:v,onRowDblClick:N,onCheck:L,onCheckAll:P,setContextMenu:oe,onContextMenu:Z,onSearch:q,handleExpand:H,getColumnClass:Zt,getColumnStyle:_s,getSlotName:As,setGridSetting:re,onApplyColumn:te,onColumnContextMenu:ae,onSort:X,sortIconClass:ke}}},PS={class:"column-list"},_S=["data-index"],AS=["title","onClick"],zS=["onClick"],FS=["onMousedown"],HS={ref:"table"},WS=["title"],$S={key:0},XS={class:"is-empty"},US={ref:"resizeLine",class:"table-resize-line"};function YS(e,t,n,o,s,l){var b;const a=i.resolveComponent("grid-option-button"),r=i.resolveComponent("toolbar"),c=i.resolveComponent("ev-checkbox"),d=i.resolveComponent("grid-sort-button"),h=i.resolveComponent("tree-grid-node"),u=i.resolveComponent("ev-context-menu"),f=i.resolveComponent("grid-summary"),g=i.resolveComponent("grid-pagination"),p=i.resolveComponent("column-setting"),m=i.resolveDirective("resize"),x=i.resolveDirective("observe-visibility");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.$slots.toolbar||o.useGridSetting?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:i.normalizeStyle(`width: ${e.gridWidth};`)},[i.createVNode(r,null,{toolbarWrapper:i.withCtx(()=>[o.useGridSetting?(i.openBlock(),i.createBlock(a,{key:0,class:"grid-setting__icon",onClick:o.setGridSetting},null,8,["onClick"])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"toolbar",{item:{onSearch:o.onSearch}},void 0,!0)]),_:3})],4)):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"grid-wrapper",style:i.normalizeStyle(o.gridStyle)},[i.createElementVNode("div",{ref:"grid",class:i.normalizeClass(o.gridClass)},[i.withDirectives(i.createElementVNode("div",{ref:"header",class:i.normalizeClass(o.headerClass)},[i.createElementVNode("ul",PS,[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(o.headerCheckboxClass),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[o.isHeaderCheckbox?(i.openBlock(),i.createBlock(c,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[0]||(t[0]=y=>e.isHeaderChecked=y),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:o.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(y,M)=>{var I,E;return i.openBlock(),i.createElementBlock(i.Fragment,{key:M},[!y.hide&&!y.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":M,class:i.normalizeClass(o.getColumnClass(y)),style:i.normalizeStyle(o.getColumnStyle(y,M))},[y.customHeader&&e.$slots.customHeader?i.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:y.caption,class:i.normalizeClass(["column-name",{"column-name--click":o.useGridSetting}]),onClick:[T=>o.onColumnContextMenu(T,y),t[1]||(t[1]=i.withModifiers((...T)=>e.columnMenu.show&&e.columnMenu.show(...T),["prevent"]))]},[i.createTextVNode(i.toDisplayString(y.caption)+" ",1),i.createElementVNode("span",{onClick:i.withModifiers(T=>o.onSort(y),["stop"])},[e.$slots.sortIcon?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(I=e.$props.option)!=null&&I.useSort&&(y!=null&&y.sortable)?(i.openBlock(),i.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):i.createCommentVNode("",!0),e.sortField===y.field?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(o.sortIconClass(y)),style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[(E=e.$props.option)!=null&&E.useSort&&(y!=null&&y.sortable)?(i.openBlock(),i.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):i.createCommentVNode("",!0),e.sortField===y.field?(i.openBlock(),i.createBlock(d,{key:1,class:i.normalizeClass(o.sortIconClass(y)),icon:e.sortOrder,style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?y.hidden:!0})},null,8,["class","icon","style"])):i.createCommentVNode("",!0)],64))],8,zS)],10,AS)),i.createElementVNode("span",{class:"column-resize",onMousedown:i.withModifiers(T=>o.onColumnResize(M,T),["stop","left"])},null,40,FS)],14,_S)):i.createCommentVNode("",!0)],64)}),128)),(b=e.$props.option.customContextMenu)!=null&&b.length?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({column:!0,"non-border":!!e.borderStyle}),style:i.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):i.createCommentVNode("",!0)])],2),[[i.vShow,e.showHeader]]),i.createElementVNode("div",{ref:"body",class:i.normalizeClass(o.bodyStyle),onScroll:t[2]||(t[2]=(...y)=>o.onScroll&&o.onScroll(...y)),onContextmenu:[t[3]||(t[3]=y=>o.onContextMenu(y)),t[4]||(t[4]=i.withModifiers((...y)=>e.menu.show&&e.menu.show(...y),["prevent"]))]},[i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),i.createElementVNode("table",HS,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(y,M)=>(i.openBlock(),i.createBlock(h,{key:M,"selected-data":e.selectedRow,"node-data":y,"use-checkbox":e.useCheckbox,"ordered-columns":e.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":e.customContextMenu,"menu-ref":e.menu,"is-resize":e.isResize,"row-height":e.rowHeight,"min-width":e.minWidth,"highlight-index":e.highlightIdx,"border-style":e.borderStyle,onCheckTreeData:o.onCheck,onExpandTreeData:o.handleExpand,onClickTreeData:o.onRowClick,onDblClickTreeData:o.onRowDblClick,onContextMenu:o.onContextMenu},i.createSlots({_:2},[i.renderList(e.orderedColumns,(I,E)=>({name:o.getSlotName(I.field),fn:i.withCtx(({item:T})=>[e.$slots[I.field]?i.renderSlot(e.$slots,I.field,{key:0,item:{data:T.data,fieldName:I.field}},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:o.getConvertValue(I,y[I.field])},i.toDisplayString(o.getConvertValue(I,y[I.field])),9,WS))])})),e.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:i.withCtx(()=>[i.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),e.viewStore.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("tr",$S,[i.createElementVNode("td",XS,i.toDisplayString(o.emptyText),1)]))])],512),i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),i.createVNode(u,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),i.createVNode(u,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),i.createVNode(u,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),i.withDirectives(i.createElementVNode("div",US,null,512),[[i.vShow,e.showResizeLine]])],2)],4)),[[m,o.onResize],[x,{callback:o.onShow,once:!0}]]),o.useSummary?(i.openBlock(),i.createBlock(f,{key:1,"is-tree":!0,"ordered-columns":e.orderedColumns,stores:o.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:e.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":o.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):i.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(i.openBlock(),i.createBlock(g,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[5]||(t[5]=y=>e.currentPage=y),total:e.showTreeStore.length,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):i.createCommentVNode("",!0),i.createVNode(p,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[6]||(t[6]=y=>e.isShowColumnSetting=y),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[7]||(t[7]=y=>e.isShowMenuOnClick=y),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:o.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const ro=le(VS,[["render",YS],["__scopeId","data-v-9ed705b7"]]);ro.install=e=>{e.component(ro.name,ro)};const jS={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},GS=["aria-current"];function ZS(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("span",i.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},e.$attrs,{"aria-current":n.page.isCurrent,onClick:t[0]||(t[0]=i.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[i.renderSlot(e.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(n.page.number),1)])],16,GS)}const qS={name:"EvPagination",components:{EvIcon:hn,pageButton:le(jS,[["render",ZS]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.computed(()=>e.visiblePage>7?e.visiblePage:7),o=i.computed(()=>e.modelValue),s=i.computed(()=>e.total===0?1:Math.ceil(e.total/e.perPage)),l=i.computed(()=>o.value>1),a=i.computed(()=>o.value<s.value),r=i.computed(()=>Math.max(o.value-e.pagePerJump,1)),c=i.computed(()=>Math.min(o.value+e.pagePerJump,s.value)),d=i.computed(()=>{const m=o.value*e.perPage-e.perPage+1;return m>=0?m:0}),h=(m,x)=>{o.value===m||m<1||m>s.value||(t("update:modelValue",m),t("change",m),x&&x.target&&i.nextTick(()=>x.target.focus()))},u=(m,x={})=>({number:m,isCurrent:x.isCurrent??o.value===m,click:b=>h(m,b),input:(b,y)=>h(+y,b),disabled:x.disabled||!1,class:x.class||""}),f=(m,x)=>{const b=[],y=m>0?m:1;for(let M=y;M<=x;M++)b.push(u(M));return b},g=i.computed(()=>{const m=parseInt(n.value,10);if(m===0)return[];const x=Math.min(Math.max(0,m)||s.value,s.value);if(s.value<=x)return f(1,s.value);const b=x%2===0?1:0,y=Math.floor(x/2),M=s.value-y+1+b;if(o.value>y&&o.value<M){const E=s.value,T=o.value-y+2,V=o.value+y-2-b,C=T-1===2?2:-1,S=V+1===E-1?V+1:-1;return[u(1),u(C),...f(T,V),u(S),u(s.value)]}else if(o.value===y){const I=o.value+y-1-b;return[...f(1,I),u(-1),u(s.value)]}else if(o.value===M){const I=o.value-y+1;return[u(1),u(-1),...f(I,s.value)]}return[...f(1,y),u(-1),...f(M,s.value)]}),p=i.computed(()=>({"justify-content":e.order,flex:"3 1 0%"}));return i.watch(()=>s.value,m=>{o.value>m&&h(m)}),i.watch(()=>o.value,(m,x)=>{s.value<m&&h(x)}),{pageCount:s,pagesInRange:g,hasPrev:l,hasNext:a,listClasses:p,firstData:d,current:o,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},KS={class:"pagination"},JS={key:0,class:"pagination-info"},QS={key:0,class:"pagination-ellipsis"},ew=["onClick"];function tw(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("page-button");return i.openBlock(),i.createElementBlock("nav",KS,[n.showPageInfo?(i.openBlock(),i.createElementBlock("small",JS,[n.perPage===1?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(o.firstData)+" / "+i.toDisplayString(n.total),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(o.firstData)+" - "+i.toDisplayString(Math.min(o.current*n.perPage,n.total))+" / "+i.toDisplayString(n.total),1)],64))])):i.createCommentVNode("",!0),i.createElementVNode("ul",{class:"pagination-list",style:i.normalizeStyle(o.listClasses)},[e.$props.pagePerJump?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(["step-button",{"is-disabled":!o.hasPrev}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasPrev,page:o.getPage(o.prevJumpPage,{isCurrent:!1})},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):i.createCommentVNode("",!0),i.createElementVNode("li",{class:i.normalizeClass(["step-button",{"is-disabled":!o.hasPrev}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasPrev,page:o.getPage(o.current-1)},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.pagesInRange,(c,d)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:d},[c.number===-1?(i.openBlock(),i.createElementBlock("li",QS,[...t[0]||(t[0]=[i.createElementVNode("span",null,"…",-1)])])):(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[i.createVNode(r,{page:c},null,8,["page"])],10,ew))],64))),128)),i.createElementVNode("li",{class:i.normalizeClass(["step-button",{"is-disabled":!o.hasNext}])},[i.createVNode(r,{class:"pagination-next",disabled:!o.hasNext,page:o.getPage(o.current+1)},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),e.$props.pagePerJump?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass(["step-button",{"is-disabled":!o.hasNext}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasNext,page:o.getPage(o.nextJumpPage,{isCurrent:!1})},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):i.createCommentVNode("",!0)],4)])}const co=le(qS,[["render",tw]]);co.install=e=>{e.component(co.name,co)};const nw="3.5.4",ow=[kn,Mn,sn,En,ln,an,In,vn,Bn,Dn,On,Nn,Wn,hn,Un,Yn,jn,Gn,Zn,qn,Kn,Jn,Qn,eo,no,so,lo,ao,Jo,ei,ti,ro,co],iw={version:nw,install:e=>{e&&ow.forEach(t=>{e.use(t)})}};se.EvButton=sn,se.EvButtonGroup=En,se.EvCalendar=Un,se.EvChart=so,se.EvChartBrush=ao,se.EvChartGroup=lo,se.EvCheckbox=ln,se.EvCheckboxGroup=an,se.EvContextMenu=Gn,se.EvDatePicker=Yn,se.EvGrid=no,se.EvIcon=hn,se.EvInputNumber=Nn,se.EvLoading=qn,se.EvMenu=Jn,se.EvMessage=Jo,se.EvMessageBox=ti,se.EvNotification=ei,se.EvPagination=co,se.EvProgress=Kn,se.EvRadio=In,se.EvRadioGroup=vn,se.EvScheduler=jn,se.EvSelect=Bn,se.EvSlider=Wn,se.EvTabPanel=Mn,se.EvTabs=kn,se.EvTextField=On,se.EvTimePicker=eo,se.EvToggle=Dn,se.EvTree=Qn,se.EvTreeGrid=ro,se.EvWindow=Zn,se.default=iw,Object.defineProperties(se,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
17
+ 15.998 11.998C15.998 11.1696 16.6696 10.498 17.498 10.498Z`,fill:"#ADB5BD"},null,-1)])])}const Rs=le(M0,[["render",E0]]),Mt=0,mn=1,de=2,to=3,Ns=4,v0=()=>{const{props:e}=i.getCurrentInstance();return{isRenderer:(a={})=>{var r;return!!((r=a==null?void 0:a.render)!=null&&r.use)},getComponentName:(a="")=>{const r=h=>h.charAt(0).toUpperCase()+h.slice(1),c="Renderer";let d="";if(a.indexOf("_")!==-1){const h=a.split("_");for(let f=0;f<h.length;f++)d+=r(h[f])}else d=r(a);return d+c},getConvertValue:(a,r)=>{let c=a.type==="number"||a.type==="float"?Number(r):r;return a.type==="number"?(c=$t(r),c=c===!1?r:c):a.type==="float"&&(c=c.toFixed(a.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),c},getColumnIndex:a=>e.columns.findIndex(r=>r.field===a),setPixelUnit:a=>{let r=a;const c=r.toString().indexOf("px")>=0,d=r.toString().indexOf("%")>=0;return!c&&!d&&(r=`${r}px`),r}}},ii=e=>{var o;const t=((o=e.movedColumns)!=null&&o.length?e.movedColumns:e.originColumns)??[],n=new Map((e.filteredColumns??[]).map(s=>[s.index,s]));return t.map(s=>{const l=n.get(s.index)??{};return{...s,...l}})},T0=e=>{const{scrollInfo:t,stores:n,elementInfo:o,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=e,h=p=>{var y,M;const g=o.body,x=s.rowHeight,b=d.detailRowHeight??0;if(g){let E=n.store;l.isClientPaging&&(E=r());const I=((y=d.expandedRows)==null?void 0:y.length)??0,T=((M=d.expandedRows)==null?void 0:M.map(v=>E.findIndex(N=>N[de]===v)))??[],V=E.length*x+I*b;let C=0,S=0;if(I)for(C=0;S+x<g.scrollTop;C++)T.includes(C)&&(S+=b),S+=x;else C=Math.floor(g.scrollTop/x),S=Math.max(C,0)*x;C>E.length-1&&(C=0);let w=0,k=0;if(I)for(let v=C;k<=g.clientHeight;v++)T.includes(v)&&(k+=b),k+=x,w+=1;else w=g.clientHeight>x?Math.ceil(g.clientHeight/x):E.length,k=w*x;const B=C+w+1,D=Math.max(C,0),O=B,L=o.table;n.viewStore=E.slice(D,O),t.hasVerticalScrollBar=w<E.length||g.clientHeight<L.clientHeight,t.vScrollTopHeight=S,t.vScrollBottomHeight=V-k-t.vScrollTopHeight,p&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(O/l.perPage)+1,l.startIndex=O,c({onScrollEnd:!0}))}},f=p=>{if(d.useRowDetail&&!d.detailRowHeight){let g=n.store;l.isClientPaging&&(g=r()),n.viewStore=[...g],t.vScrollTopHeight=0,t.vScrollBottomHeight=0}else h(p)},u=()=>{const p=o.header,g=o.body,x=o.table;p.scrollLeft=g.scrollLeft,a.value=g.scrollLeft,t.hasHorizontalScrollBar=g.clientWidth<x.clientWidth};return{updateVScroll:f,updateHScroll:u,onScroll:()=>{const p=o.body,g=p.scrollTop,x=p.scrollLeft,b=t.lastScroll.top,y=t.lastScroll.left,M=x!==y;g!==b&&(p!=null&&p.clientHeight)&&f(!0),M&&u(),t.lastScroll.top=g,t.lastScroll.left=x}}},B0=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{resizeInfo:o,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:f}=e,u=()=>{var y;let x=o.columnWidth,b=0;if(o.adjust){const M=s.body;let E=M.offsetWidth;const I=M.offsetHeight,T=((y=M.querySelector("tr"))==null?void 0:y.offsetHeight)||o.rowHeight,V=E-M.clientWidth,C=r.orderedColumns.reduce((S,w)=>(w.hide||w.hiddenDisplay||(w.width?S.totalWidth+=w.width:S.emptyCount++),S),{totalWidth:f.customContextMenu.length?30:0,emptyCount:0});if(T*t.rows.length>I&&(E-=V),l.useCheckbox.use&&(E-=o.minWidth),a.useRowDetail&&(E-=o.minWidth),x=E-C.totalWidth,x>0){const S=C.emptyCount===0?0:Math.floor(x/C.emptyCount);b=x-S*C.emptyCount,x=C.emptyCount!==0?S:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(r.orderedColumns.forEach(M=>{const E=c(M)?o.rendererMinWidth:o.minWidth;M.width&&M.width<E&&(M.width=E),!M.width&&!M.hide&&(M.width=x)}),b&&r.orderedColumns.length){let M=r.orderedColumns.length-1,E=r.orderedColumns[M];for(;M>0&&E&&(E.hide||E.hiddenDisplay);)M-=1,E=r.orderedColumns[M];E&&(E.width+=b)}},m=()=>{const x=new Map(t.columns.map(b=>[b.field,b.width]));i.nextTick(()=>{var b,y;o.adjust&&r.orderedColumns.forEach(M=>{const E=M;return E.resized||(E.width=x.get(E.field)??0),E},void 0),u(),(b=s.body)!=null&&b.clientHeight&&d(),(y=s.body)!=null&&y.clientWidth&&h()})};return{calculatedColumn:u,onResize:m,onShow:x=>{x&&m()},onColumnResize:(x,b)=>{b.preventDefault();const y=s.header,M=s.body,E=y.getBoundingClientRect().left,I=y.querySelector(`li[data-index="${x}"]`),T=c(r.orderedColumns[x])?o.rendererMinWidth:o.minWidth,V=I.getBoundingClientRect(),C=s.resizeLine,S=V.left-E+T,w=V.right-E,k=b.clientX,B=V.left-E;M.style.overflow="auto",C.style.left=`${w}px`,o.showResizeLine=!0;const D=L=>{const v=L.clientX-k,N=w+v,R=Math.max(S,N);C.style.left=`${R}px`},O=()=>{const v=parseInt(C.style.left,10)-B;r.orderedColumns[x]&&(r.orderedColumns[x].width=v,r.orderedColumns[x].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),m();const N=ii(r);n("resize-column",{column:r.orderedColumns[x],columns:N}),n("change-column-info",{type:"resize",columns:N})};document.addEventListener("mousemove",D),document.addEventListener("mouseup",O,{once:!0})}}},D0=e=>{const{emit:t}=i.getCurrentInstance(),{selectInfo:n,stores:o}=e,s=(d,h)=>{var m;const f=(m=d.target.tagName)==null?void 0:m.toLowerCase();let u={};return f==="td"?u=d.target.dataset:u=d.target.parentNode.dataset,{event:d,rowData:h[de],rowIndex:h[Mt],cellName:u.name,cellIndex:u.index}};let l=null,a=-1;return{onRowClick:(d,h,f)=>{var p,g,x;if((p=d.target.parentElement.classList)!=null&&p.contains("row-checkbox-input"))return!1;const u=!!((x=(g=d.target.closest("td"))==null?void 0:g.classList)!=null&&x.contains("row-contextmenu")),m=(b,y,M)=>{if(b==="shift"){const E=h[Mt];if(a>-1)for(let I=Math.min(E,a);I<=Math.max(E,a);I++)if(!y)o.originStore[I][to]=!0,a!==I&&n.selectedRow.push(o.originStore[I][de]);else{o.originStore[I][to]=!1;const T=n.selectedRow.indexOf(o.originStore[I][de]);T>-1&&n.selectedRow.splice(T,1)}}else b==="ctrl"&&(y?n.selectedRow.splice(n.selectedRow.indexOf(h[de]),1):n.selectedRow.push(M))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const b=h[de],y=h[to];h[to]=!h[to];let M="";d.shiftKey?M="shift":d.ctrlKey&&(M="ctrl"),n.multiple&&M?m(M,y,b):f||u?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(b)||(n.selectedRow=[b])):y?n.selectedRow=[]:n.selectedRow=[b],a=h[Mt],t("update:selected",n.selectedRow),t("click-row",s(d,h))}},100),!0},onRowDblClick:(d,h)=>{l&&clearTimeout(l),t("dblclick-row",s(d,h))}}},O0=e=>{const{checkInfo:t,stores:n,pageInfo:o,getPagingData:s}=e,{props:l,emit:a}=i.getCurrentInstance(),r=h=>{const f=n.originStore.findIndex(u=>u[de]===h[de]);f!==-1&&(n.originStore[f][mn]=h[mn])};return{onCheck:(h,f)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),f[mn]){t.useCheckbox.mode==="single"?t.checkedRows=[f[de]]:t.checkedRows.push(f[de]);let u=n.store;o.isClientPaging&&(u=s());const m=u.filter(p=>!l.uncheckable.includes(p[de])).filter(p=>!l.disabledRows.includes(p[de])).every(p=>p[mn]);u.length&&m&&(t.isHeaderChecked=!0),t.isHeaderIndeterminate=u.length&&!m}else t.useCheckbox.mode==="single"?t.checkedRows=[]:t.checkedRows.splice(t.checkedRows.indexOf(f[de]),1),t.isHeaderChecked=!1,t.isHeaderIndeterminate=!!(n.store.length&&t.checkedRows.length);t.prevCheckedRow=f.slice(),a("update:checked",t.checkedRows),a("check-row",h,f[Mt],f[de])},onCheckAll:h=>{const f=t.isHeaderChecked;let u=n.store;o.isClientPaging&&(u=s()),u.forEach(m=>{const p=l.uncheckable.includes(m[de])||l.disabledRows.includes(m[de]);f?!t.checkedRows.includes(m[de])&&!p&&t.checkedRows.push(m[de]):t.checkedRows.splice(t.checkedRows.indexOf(m[de]),1),p||(m[mn]=f)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},L0=e=>{const{expandedInfo:t}=e,{emit:n}=i.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[de],r=t.expandedRows.indexOf(a);r===-1?t.expandedRows.push(a):t.expandedRows.splice(r,1),l[Ns]=!l[Ns],n("update:expanded",t.expandedRows),n("expand-row",s,l[de],l[Ns],l[Mt])}}},R0=e=>{const{sortInfo:t,stores:n,updatePagingInfo:o}=e,{emit:s}=i.getCurrentInstance(),l=(g=!0)=>g?["asc","desc","init"]:["asc","desc"];function a(){this.orders=l(),this.dequeue=()=>this.orders.shift(),this.enqueue=g=>this.orders.push(g)}const r=(g,x="init")=>{n.orderedColumns.forEach(b=>{b.index===(g==null?void 0:g.index)&&x?b.sortOption={sortType:x}:b.sortOption={sortType:"init"}})},c=()=>{const g=n.originColumns.filter(x=>x.hiddenDisplay||x.hide);g.length&&g.forEach(x=>{x.sortOption={sortType:"init"}})},d=new a,h=(g,x=!0)=>{const{sortType:b}=(g==null?void 0:g.sortOption)||{};t.sortColumn=g,t.sortField=g==null?void 0:g.field,t.sortOrder=b,t.isSorting=!!b,x&&(r(g,b),s("change-column-info",{type:"sort",columns:ii(n)}))},f=(g,x)=>{if(g.sortable===void 0?!0:g.sortable){t.sortColumn=g,t.sortField!==(g==null?void 0:g.field)&&(d.orders=l(),t.sortField=g==null?void 0:g.field),x&&(d.orders=l(),x==="desc"&&(t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder))),t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder),t.isSorting=!0,o({onSort:!0}),c(),r(g,t.sortOrder);const y=ii(n);s("sort-column",{field:t.sortField,order:t.sortOrder,column:t.sortColumn,columns:y}),s("change-column-info",{type:"sort",columns:y})}},u=()=>{var w;const{field:g,index:x}=t.sortColumn||{},b=((w=t.sortFunction)==null?void 0:w[g])??null,y=(k,B)=>k>B?-1:1,M=(k,B)=>k<B?-1:1,E=(k,B)=>(k===null)-(B===null)||Number(B)-Number(k),I=(k,B)=>(k===null)-(B===null)||Number(k)-Number(B);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((k,B)=>typeof k[Mt]=="number"?M(k[Mt],B[Mt]):0);return}const T=t.sortColumn.type||"string",V=t.sortOrder==="desc"?y:M,C=t.sortOrder==="desc"?E:I,S=(k,B)=>{var L,v;let D=k[de][x],O=B[de][x];return k[de][x]&&typeof k[de][x]=="object"&&(D=k[de][x][(L=n.originColumns[x])==null?void 0:L.field],O=B[de][x][(v=n.originColumns[x])==null?void 0:v.field]),{aCol:D,bCol:O}};if(b){n.store.sort((k,B)=>{const D=k[de][x],O=B[de][x],L=b(D,O);return t.sortOrder==="desc"?-L:L});return}switch(T){case"string":n.store.sort((k,B)=>{let{aCol:D,bCol:O}=S(k,B);if((!D||typeof D=="string")&&(!O||typeof O=="string")){D=D||"",O=O||"";const L=D.toLowerCase(),v=O.toLowerCase();if(D!==O&&L===v){const N=Array.from(D).findIndex((R,P)=>R!==O[P]);return V(D[N],O[N])}return V(L,v)}return 0});break;case"stringNumber":n.store.sort((k,B)=>{let{aCol:D,bCol:O}=S(k,B);return!D||typeof D=="string"||typeof D=="number"?(D=D===""?null:D,O=O===""?null:O,C(D??null,O??null)):0});break;default:n.store.sort((k,B)=>{const{aCol:D,bCol:O}=S(k,B);return!D||typeof D=="number"||typeof D=="boolean"?C(D??null,O??null):0});break}},m=()=>{var g;return(g=n.orderedColumns)==null?void 0:g.find(x=>(x==null?void 0:x.sortOption)&&l(!1).includes(x.sortOption.sortType))};return{onSort:f,getSortTarget:m,setSort:u,setSortInfo:h,hasSortTarget:()=>!!m()}},N0=e=>{const{props:t}=i.getCurrentInstance(),{columnSettingInfo:n,filterInfo:o,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:f}=e,u=I=>{let T=0;I.forEach(V=>{const C=l.checkedRows.includes(V[de]);V[mn]=C,T+=C?1:0}),I.length&&(l.isHeaderChecked=I.length===T,l.isHeaderIndeterminate=I.length!==T&&T>0,l.isHeaderUncheckable=I.every(V=>t.uncheckable.includes(V[de])||t.disabledRows.includes(V[de])))},m=(I,T,V)=>{if(typeof I!="string"||T===null)return!1;const C=T==null?void 0:T.toLowerCase(),S=I==null?void 0:I.toLowerCase();let w=C.includes(S);return V&&(V==="start"?w=C.startsWith(S):V==="end"&&(w=C.endsWith(S))),w},p=(I,T)=>{const V=T.comparison,C=T.value;let S=I[de][T.index];(S||S===0)&&(S=`${I[de][T.index]}`);let w;return V==="="?w=(C==null?void 0:C.toLowerCase())===(S==null?void 0:S.toLowerCase()):V==="!="?w=(C==null?void 0:C.toLowerCase())!==(S==null?void 0:S.toLowerCase()):V==="%s%"?w=m(C,S):V==="notLike"?w=!m(C,S):V==="s%"?w=m(C,S,"start"):V==="%s"?w=m(C,S,"end"):V==="isEmpty"?w=S==null||S==="":V==="isNotEmpty"&&(w=!!S),w},g=(I,T,V)=>{const C=T.comparison,S=Number(T.value.replace(/,/g,""));let w=Number(I[de][T.index]),k;return V==="float"&&(w=Number(w.toFixed(3))),C==="="?k=w===S:C===">"?k=w>S:C==="<"?k=w<S:C==="<="?k=w<=S:C===">="?k=w>=S:C==="!="?k=w!==S:C==="isEmpty"?k=w==null||isNaN(w):C==="isNotEmpty"&&(k=!!w||w===0),k},x=(I,T)=>{const V=T.comparison,C=T.value,S=`${I[de][T.index]}`;let w;return V==="="&&(w=S===C),w},b=(I,T,V)=>{let C=T==="string"||T==="stringNumber"?p:g;return T==="boolean"&&(C=x),I.filter(S=>C(S,V,T))||[]},y=()=>{const I=o.filteringItemsByColumn,T=Object.keys(I),V=s.originStore;let C=[],S=!1,w=[];T.forEach((k,B)=>{const D=I[k],O=f(k),L=t.columns[O].type,v=o.columnOperator==="or",N=B>0&&o.columnOperator==="and";D.forEach((R,P)=>{!C.length&&!S?C=b(V,L,{...R,index:O}):N&&R.operator==="or"?P>0?C.push(...b(w,L,{...R,index:O})):C=b(w,L,{...R,index:O}):P===0&&v||P!==0&&R.operator==="or"?C.push(...b(V,L,{...R,index:O})):C=b(C,L,{...R,index:O}),S=!0}),w=JSON.parse(JSON.stringify(C))}),S?s.filterStore=Up(C,JSON.stringify):s.filterStore=V};let M=null;return{onSearch:I=>{M&&clearTimeout(M),M=setTimeout(()=>{o.isSearch=!1,o.searchWord=I,I&&(s.searchStore=s.store.filter(T=>{let V=!1;const C=n.isFilteringColumn?T[de].filter((S,w)=>n.visibleColumnIdx.includes(w)):T[de];for(let S=0;S<s.orderedColumns.length;S++){const w=s.orderedColumns[S]||{};let k=C[w.index]??null;if(w.type=w.type||"string",k!==null&&(k instanceof Array?k=JSON.stringify(k):typeof k=="object"&&(k=k[w.field]),!w.hide&&((w==null?void 0:w.searchable)===void 0||w!=null&&w.searchable)&&(k=r(w,k).toString(),V=k.toLowerCase().includes(I.toString().toLowerCase()),V)))break}return V}),o.isSearch=!0),u(s.store),!I&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:y,setHeaderCheckboxByFilter:u}},V0=e=>{const{contextInfo:t,stores:n,selectInfo:o,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=e;let d=null;const{emit:h}=i.getCurrentInstance(),f=g=>{d&&clearTimeout(d);const x=[];d=setTimeout(()=>{if(t.customContextMenu.length){const b=t.customContextMenu.map(y=>{const M=y;return M.validate&&(M.disabled=!M.validate(M.itemId,o.selectedRow)),M.selectedRow=o.selectedRow??[],M.contextmenuInfo=o.contextmenuInfo??[],M});x.push(...b)}t.contextMenuItems=x,t.menu.show(g)},200)};return{setContextMenu:f,onContextMenu:g=>{var M,E,I;g.preventDefault();const b=(E=(M=g.target.closest(".row"))==null?void 0:M.dataset)==null?void 0:E.index;let y=null;b&&(y=(I=n.viewStore.find(T=>T[Mt]===+b))==null?void 0:I[de]),y&&(o.contextmenuInfo=[y],f(g))},onColumnContextMenu:(g,x)=>{var b,y,M,E,I,T,V,C;if(g.target.className==="column-name"){const S=x.sortable===void 0?!0:x.sortable,w=l.isFiltering&&x.filterable===void 0?!0:x.filterable,k=[{text:((b=t.columnMenuTextInfo)==null?void 0:b.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!S,hidden:(y=t.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>s(x,"asc")},{text:((M=t.columnMenuTextInfo)==null?void 0:M.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!S,hidden:(E=t.hiddenColumnMenuItem)==null?void 0:E.descending,click:()=>s(x,"desc")},{text:((I=t.columnMenuTextInfo)==null?void 0:I.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const B=document.documentElement.clientWidth,D=t.columnMenu.menuStyle.clientX,O=t.columnMenu.menuStyle.pageX,L=350;B<D+L&&(t.columnMenu.menuStyle.left=`${O-L}px`),l.filterSettingPosition={top:t.columnMenu.menuStyle.top,left:t.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=x,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!w,hidden:((T=t.hiddenColumnMenuItem)==null?void 0:T.filter)||!l.isFiltering},{text:((V=t.columnMenuTextInfo)==null?void 0:V.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||x.fixed,hidden:((C=t.hiddenColumnMenuItem)==null?void 0:C.hide)||!a.value,click:()=>{c(x.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(t.columnMenuItems=[],!S&&!w&&!a.value)return;t.columnMenuItems=k.filter(B=>!B.hidden)}},onGridSettingContextMenu:g=>{const{useDefaultColumnSetting:x,columnSettingTextInfo:b}=r,y={text:(b==null?void 0:b.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,t.isShowMenuOnClick=!0}};t.customGridSettingContextMenu.length&&(t.gridSettingContextMenuItems=[...t.customGridSettingContextMenu]),x&&t.gridSettingContextMenuItems.push(y),t.gridSettingMenu.show(g)}}},P0=e=>{const{props:t}=i.getCurrentInstance(),{selectInfo:n,checkInfo:o,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:f,setFilter:u}=e;return{setStore:({rows:p,isMakeIndex:g=!0,isInit:x=!1})=>{var y,M,E;const b=s.orderedColumns.find(I=>(I==null?void 0:I.sortOption)&&["asc","desc"].includes(I.sortOption.sortType));if(g){const I=[];let T=!1;p.forEach((V,C)=>{const S=t.checked.includes(V),w=t.uncheckable.includes(V)||t.disabledRows.includes(V);let k=!1;n.useSelect&&(k=t.selected.includes(V)),!S&&!w&&(T=!0);let B=!1;c.useRowDetail&&(B=t.expanded.includes(V));const D=t.disabledRows.includes(V);I.push([C,S,V,k,B,w,D])}),p.length!==t.checked.length&&(p.length===((y=t.uncheckable)==null?void 0:y.length)||p.length===((M=t.disabledRows)==null?void 0:M.length))&&(T=!0),o.isHeaderChecked=p.length>0?!T:!1,o.isHeaderIndeterminate=T&&!!o.checkedRows.length,o.isHeaderUncheckable=p.every(V=>t.uncheckable.includes(V)||t.disabledRows.includes(V)),s.originStore=I}r.isFiltering&&u(),b&&x&&h(b,!1),l.sortField&&d(),(E=a.body)!=null&&E.clientHeight&&f()}}},_0=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,pageInfo:o,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const f=(o.currentPage-1)*o.perPage,u=parseInt(f,10)+parseInt(o.perPage,10);return n.store.slice(f,u)},d=f=>{t("page-change",{eventName:f,pageInfo:{currentPage:o.currentPage,prevPage:o.prevPage,startIndex:o.startIndex,total:o.pageTotal,perPage:o.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(u=>!u.hide&&((u==null?void 0:u.searchable)===void 0||(u==null?void 0:u.searchable))).map(u=>u.field)}}),o.isInfinite&&(f!=null&&f.onSearch||f!=null&&f.onSort)&&(o.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:f=>{if(o.isClientPaging)if(o.prevPage=f,n.store.length<=o.perPage)n.pagingStore=n.store;else{const u=(o.currentPage-1)*o.perPage,m=parseInt(u,10)+parseInt(o.perPage,10);n.pagingStore=n.store.slice(u,m),a.body.scrollTop=0,o.startIndex=u}d({onChangePage:!0})}}},wr=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{stores:o,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=e,c=g=>{var x,b,y;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const M=l.gridSettingContextMenuItems.length-1,E=(y=(b=(x=l.gridSettingMenu)==null?void 0:x.rootMenuList)==null?void 0:b.$el)==null?void 0:y.children[0].children[M].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=E.width,s.columnSettingPosition.top=E.top,s.columnSettingPosition.left=E.right}else{const M=g==null?void 0:g.getBoundingClientRect(),E=M==null?void 0:M.height;s.columnSettingPosition.top=(M==null?void 0:M.top)+E,s.columnSettingPosition.left=M==null?void 0:M.right}},d=()=>{o.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(o.movedColumns)&&o.movedColumns.length?o.movedColumns:o.originColumns||[],f=(g,x)=>{var y;if(!g)return;g.hiddenDisplay=x;const b=(y=o.originColumns)==null?void 0:y.find(M=>M.index===g.index);if(b&&b!==g&&(b.hiddenDisplay=x),Array.isArray(o.movedColumns)){const M=o.movedColumns.find(E=>E.index===g.index);M&&M!==g&&(M.hiddenDisplay=x)}},u=()=>{s.visibleColumnIdx=o.filteredColumns.map(b=>b.index);const g=o.originColumns.filter(b=>!b.hide||b.hiddenDisplay).map(b=>b.index),x=s.visibleColumnIdx;s.isFilteringColumn=x.length!==g.length,t.option.searchValue&&a(t.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:g=>{const x=o.orderedColumns.filter(E=>!E.hide&&!E.hiddenDisplay);if(g.length===x.length&&x.every(E=>g.includes(E.field)))return;const y=h(),M=new Set(g);o.filteredColumns=y.filter(E=>{const I=M.has(E.field)||!E.caption;return f(E,!I),I}),s.hiddenColumn="",u(),n("change-column-status",{columns:o.updatedColumns}),n("change-column-info",{type:"display",columns:o.updatedColumns})},setColumnHidden:g=>{const x=o.orderedColumns.filter(y=>!y.hide&&!y.hiddenDisplay);if(x.length===1)return;o.filteredColumns=x.filter(y=>{const M=y.field===g;return f(y,M),!M}),h().forEach(y=>{y.field===g&&f(y,!0)}),s.hiddenColumn=g,u()}}},A0=({stores:e})=>{const{emit:t}=i.getCurrentInstance(),n=r=>{var f;const c=(f=e.movedColumns)!=null&&f.length?[...e.movedColumns]:[...e.originColumns],d=[...r],h=new Set(d.map(u=>u.index));e.movedColumns=c.map(u=>h.has(u.index)?d.shift():u)},o=(r,c)=>{const d=parseInt(r,10),h=parseInt(c,10);if(!Number.isInteger(d)||!Number.isInteger(h))return;const f=[...e.orderedColumns],u=f[d];f.splice(d,1),f.splice(h,0,u),e.filteredColumns.length&&(e.filteredColumns=f),n(f)};return{onDragStart:r=>{r.dataTransfer.setData("text/plain",r.currentTarget.dataset.index)},onDragOver:r=>{r.preventDefault()},onDrop:r=>{r.preventDefault();const c=r.dataTransfer.getData("text/plain"),d=r.target.parentNode.dataset.index;o(c,d),t("change-column-order",{column:e.orderedColumns[d],columns:e.updatedColumns}),t("change-column-info",{type:"order",columns:e.updatedColumns})}}},z0={name:"EvGrid",directives:{clickoutside:Lo,observeVisibility:Xi,resize:wn},components:{Toolbar:Yb,GridPagination:mr,GridSummary:br,ColumnSetting:Cr,FilterSetting:x0,GridSortButton:Sr,GridOptionButton:Rs},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array],default:()=>[]},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},uncheckable:{type:[Array],default:()=>[]},expanded:{type:[Array],default:()=>[]},disabledRows:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})}},emits:{"update:selected":null,"update:checked":null,"update:expanded":null,"check-row":null,"check-all":null,"click-row":null,"dblclick-row":null,"page-change":null,"sort-column":null,"expand-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-order":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var Ar,zr,Fr,Hr,Wr,$r,Xr,Ur,Yr;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=v0(),f=i.ref(null),u=i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:Q.use)||!1}),m=i.computed(()=>e.option.showHeader??!0),p=i.computed(()=>{var F;return((F=e.option)==null?void 0:F.useSummary)||!1}),g=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.stripe)||!1}),x=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.border)||""}),b=i.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.highlight)??-1}),y=i.computed(()=>e.option.emptyText??"No records"),M=e.option.rowMinHeight||35,E=i.ref(0),I=i.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),T=i.reactive({isSearch:!1,searchWord:"",isFiltering:i.computed(()=>e.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),V=i.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:Q.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((zr=(Ar=e.option)==null?void 0:Ar.useGridSetting)==null?void 0:zr.columnMenuText)??"Column List",search:((Hr=(Fr=e.option)==null?void 0:Fr.useGridSetting)==null?void 0:Hr.searchText)??"Search",empty:(($r=(Wr=e.option)==null?void 0:Wr.useGridSetting)==null?void 0:$r.emptyText)??"No records",ok:((Ur=(Xr=e.option)==null?void 0:Xr.useGridSetting)==null?void 0:Ur.okBtnText)??"OK"}}),C=i.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:i.computed(()=>{const F=T.isFiltering?C.filterStore:C.originStore;return T.isSearch?C.searchStore:F}),filteredColumns:[],movedColumns:[],originColumns:i.computed(()=>e.columns.map((F,Q)=>{var Ce;return{index:Q,hiddenDisplay:!1,...F,width:isFinite(F.width)?F.width:void 0,sortOption:{sortType:((Ce=F==null?void 0:F.sortOption)==null?void 0:Ce.sortType)||"init"}}})),orderedColumns:i.computed(()=>{const F=C.movedColumns.length?C.movedColumns:C.originColumns;return C.filteredColumns.length?C.filteredColumns:F}),updatedColumns:i.computed(()=>ii(C))}),S=i.reactive({usePage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.use)||!1}),useClient:((Yr=e.option.page)==null?void 0:Yr.useClient)||!1,isInfinite:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:i.computed(()=>{var F,Q;return(F=e.option.page)!=null&&F.useClient?C.store.length:(Q=e.option.page)==null?void 0:Q.total}),perPage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.perPage)||20}),visiblePage:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.visiblePage)||8}),order:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.order)||"center"}),showPageInfo:i.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.showPageInfo)||!1}),isClientPaging:i.computed(()=>S.useClient&&S.usePage&&!S.isInfinite),isHighlight:!1,highlightPage:0}),w=i.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:i.computed(()=>e.option.useCheckbox||{})}),k=i.reactive({expandedRows:e.expanded,useRowDetail:i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:Q.use)??!1}),detailRowHeight:i.computed(()=>{var F,Q;return(Q=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:Q.detailRowHeight})}),B=i.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),D=i.reactive({contextmenuInfo:e.contextmenuInfo,selectedRow:e.selected,useSelect:i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.useSelection)==null?void 0:Q.use)??!0}),multiple:i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.useSelection)==null?void 0:Q.multiple)??!1})}),O=i.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),L=i.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:i.computed(()=>{var F,Q;return((Q=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:Q.customContextMenu)||[]}),isShowMenuOnClick:!1}),v=i.reactive({minWidth:40,rendererMinWidth:80,iconWidth:42,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:i.computed(()=>e.option.rowHeight>M?e.option.rowHeight:M),gridWidth:i.computed(()=>e.width?h(e.width):"100%"),gridHeight:i.computed(()=>e.height?h(e.height):"100%")}),N=()=>{w.checkedRows=[],w.isHeaderChecked=!1,w.isHeaderIndeterminate=!1,C.store.forEach(F=>{F[1]=!1})},R=()=>{D.selectedRow=[],C.store.forEach(F=>{F[3]=!1})},P=()=>{C.store.forEach(F=>{F[4]=!1}),k.expandedRows=[]},{getPagingData:_,updatePagingInfo:A,changePage:z}=_0({stores:C,pageInfo:S,sortInfo:O,filterInfo:T,elementInfo:I,clearCheckInfo:N}),X=i.ref(0),{updateVScroll:W,updateHScroll:H,onScroll:U}=T0({scrollInfo:B,stores:C,elementInfo:I,resizeInfo:v,pageInfo:S,summaryScroll:X,expandedInfo:k,getPagingData:_,updatePagingInfo:A}),{onCheck:j,onCheckAll:K}=O0({checkInfo:w,stores:C,pageInfo:S,getPagingData:_}),{onExpanded:q}=L0({expandedInfo:k}),{onSort:ee,getSortTarget:J,setSort:te,setSortInfo:G,hasSortTarget:oe}=R0({sortInfo:O,stores:C,updatePagingInfo:A}),{onSearch:Z,setFilter:ae,setHeaderCheckboxByFilter:me}=N0({columnSettingInfo:V,filterInfo:T,stores:C,checkInfo:w,pageInfo:S,getConvertValue:c,updateVScroll:W,getPagingData:_,updatePagingInfo:A,getColumnIndex:d}),{setStore:re}=P0({selectInfo:D,checkInfo:w,stores:C,sortInfo:O,elementInfo:I,filterInfo:T,expandedInfo:k,setSort:te,setSortInfo:G,updateVScroll:W,setFilter:ae}),{calculatedColumn:fe,onResize:ke,onShow:rt,onColumnResize:ct}=B0({resizeInfo:v,elementInfo:I,checkInfo:w,expandedInfo:k,stores:C,isRenderer:a,updateVScroll:W,updateHScroll:H,contextInfo:L}),{setPositionColumnSetting:yt,initColumnSettingInfo:ho,onApplyColumn:fo,setColumnHidden:uo}=wr({stores:C,columnSettingInfo:V,contextInfo:L,onSearch:Z,onResize:ke}),{setContextMenu:Zt,onContextMenu:_s,onColumnContextMenu:As,onGridSettingContextMenu:ci}=V0({contextInfo:L,stores:C,selectInfo:D,useGridSetting:u,filterInfo:T,columnSettingInfo:V,setColumnHidden:uo,onSort:ee}),{onRowClick:di,onRowDblClick:hi}=D0({selectInfo:D,stores:C}),{onDragStart:fi,onDragOver:ui,onDrop:mi}=A0({stores:C}),gi=F=>{L.gridSettingContextMenuItems.length=0,L.customGridSettingContextMenu.length?ci(F):V.isShowColumnSetting=!0},qt=F=>{var Q,Ce,xt,Kt,mo,It,Je,pi,yi,jr;F.type==="wheel"&&((Q=L.menu)==null||Q.hide(F)),F.type==="scroll"&&!((Ce=F.target.classList)!=null&&Ce.contains("table-body"))&&!((Kt=(xt=F.target.offsetParent)==null?void 0:xt.classList)!=null&&Kt.contains("ev-select-dropbox"))&&!((It=(mo=F.target.offsetParent)==null?void 0:mo.classList)!=null&&It.contains("ev-grid-column-setting"))&&!((pi=(Je=F.target.offsetParent)==null?void 0:Je.classList)!=null&&pi.contains("ev-text-field-wrapper"))&&(T.isShowFilterSetting=!1,V.isShowColumnSetting=!1,L.isShowMenuOnClick=!1,(yi=L.columnMenu)==null||yi.hide(F),(jr=L.gridSettingMenu)==null||jr.hide())};i.onMounted(()=>{fe(),re({rows:e.rows,isInit:!0}),document.addEventListener("wheel",qt,{capture:!1}),document.addEventListener("scroll",qt,{capture:!0})}),i.onUnmounted(()=>{document.removeEventListener("wheel",qt,{capture:!1}),document.removeEventListener("scroll",qt,{capture:!0})}),i.onActivated(()=>{ke()}),i.onUpdated(()=>{var F;E.value=((F=I["grid-wrapper"])==null?void 0:F.offsetWidth)/1.5||0}),i.watch(()=>V.isShowColumnSetting,F=>{var Q;if(!F){(Q=L.gridSettingMenu)==null||Q.hide();return}yt(f.value)}),i.watch(()=>e.columns,()=>{oe()?G(J()):(G(J()),te()),T.filteringColumn=null,T.filteringItemsByColumn={},C.filterStore=[],re({rows:[],isMakeIndex:!1}),ho(),C.movedColumns.length=0},{deep:!0}),i.watch(()=>O.isSorting,F=>{F&&(re({rows:C.originStore,isMakeIndex:!1}),O.isSorting=!F,S.isClientPaging&&(S.currentPage=1,C.pagingStore=_(),N()))}),i.watch(()=>e.rows,F=>{re({rows:F}),T.isSearch&&Z(T.searchWord),ke()},{deep:!0}),i.watch(()=>e.uncheckable,()=>{re({rows:e.rows})},{deep:!0}),i.watch(()=>e.checked,F=>{w.checkedRows=F}),i.watch(()=>e.disabledRows,()=>{C.store.length&&C.store.forEach(F=>{F[6]=e.disabledRows.includes(F[2])})},{deep:!0}),i.watch(()=>w.checkedRows,F=>{w.isHeaderChecked=!1;let Q=C.store;S.isClientPaging&&(Q=_()),Q.length&&(Q.forEach(Ce=>{Ce[1]=F.includes(Ce[2])}),w.isHeaderChecked=F.length===Q.length),W()}),i.watch(()=>e.selected,F=>{D.useSelect&&(D.selectedRow=F)}),i.watch(()=>D.selectedRow,F=>{D.useSelect&&(C.store.forEach(Q=>{Q[3]=F.includes(Q[2])&&!e.disabledRows.includes(Q[2])}),W())}),i.watch(()=>b.value,async F=>{if(await i.nextTick(),F>=0){if(S.usePage&&!S.isInfinite&&(S.highlightPage=Math.ceil(F/S.perPage)||1,S.highlightPage!==S.currentPage)){S.currentPage=S.highlightPage,S.isHighlight=!0;return}I.body.scrollTop=v.rowHeight*b.value}}),i.watch(()=>w.useCheckbox.mode,()=>{N()}),i.watch(()=>D.useSelect,()=>{R()}),i.watch(()=>D.multiple,()=>{R()}),i.watch(()=>e.checked.length,F=>{F||N()}),i.watch(()=>e.expanded.length,F=>{F||P(),W()}),i.watch(()=>[e.option.columnWidth,v.gridWidth],async()=>{await i.nextTick(),v.columnWidth=e.option.columnWidth;const F=I["grid-wrapper"];F.style.width=v.gridWidth,F.style.height=v.gridHeight,C.orderedColumns.map(Q=>{var xt;const Ce=Q;return!((xt=e.columns[Q.index])!=null&&xt.width)&&!Ce.resized&&(Ce.width=0),Ce}),ke()}),i.watch(()=>e.option.searchValue,F=>{F!==void 0&&(Z((F==null?void 0:F.value)??F),S.isClientPaging&&(N(),R()))},{immediate:!0}),i.watch(()=>{var F;return(F=e.option.page)==null?void 0:F.currentPage},F=>{var Ce;const Q=F||1;S.currentPage=(Ce=e.option.page)!=null&&Ce.isInfinite?1:Q},{immediate:!0}),i.watch(()=>S.currentPage,(F,Q)=>{i.nextTick(()=>{z(Q),S.isClientPaging&&F!==Q&&(N(),R()),W(),F===S.highlightPage&&S.isHighlight&&(I.body.scrollTop=v.rowHeight*b.value,S.isHighlight=!S.isHighlight)})});const gn=i.reactive({boxTop:0,boxLeft:0}),$=i.ref(null),ne=i.ref(!1),he=i.ref(!1),xe=i.ref(null),Me=i.ref({}),Pe=i.reactive({caption:"",field:""}),Xe=i.ref([]),sw=[{name:"AND",value:"and"},{name:"OR",value:"or"}],zs=i.ref(0),lw=({caption:F,field:Q},Ce)=>{if(Pe.caption=F,Pe.field=Q,Xe.value=Ce,(Ce==null?void 0:Ce.length)>1){ne.value=!0;const xt=$.value.getBoundingClientRect().left,Kt=window.pageYOffset+$.value.getBoundingClientRect().top+$.value.getBoundingClientRect().height;gn.boxTop=`${Kt}px`,gn.boxLeft=`${xt}px`}},aw=()=>{C.filterStore=[],re({rows:[],isMakeIndex:!1})},Fs=async F=>{var Kt,mo;F&&he.value&&(zs.value=0);const Q=(Kt=$.value)==null?void 0:Kt.getElementsByClassName("filtering-items__item"),Ce=[];let xt=0;if(Q){for(let It=0;It<Q.length;It++){const Je=Q[It];Je.classList.remove("non-display");const pi=(mo=$.value.getBoundingClientRect())==null?void 0:mo.width,{width:yi}=Je.getBoundingClientRect();xt+=yi+10,pi-150<=xt&&!Je.classList.contains("filtering-items__item--count")?(zs.value++,Ce.push(Je),Me.value={...Me.value,[Je.dataset.field]:Se(T.filteringItemsByColumn[Je.dataset.field])}):delete Me.value[Je.dataset.field]}Q.forEach(It=>{const Je=Ce.includes(It);It.classList.toggle("non-display",Je)})}},rw=async(F,Q)=>{Q!=null&&Q.length?(T.filteringItemsByColumn[F]=Q,he.value=!0):(delete Me.value[F],delete T.filteringItemsByColumn[F]),await i.nextTick(),Fs(!0),T.isShowFilterSetting=!1,C.filterStore=[],re({rows:[],isMakeIndex:!1}),me(C.filterStore)};let Hs=null;const cw=()=>{Hs&&clearTimeout(Hs),Hs=setTimeout(()=>{he.value=!he.value,Fs(he.value)},150)},dw=()=>{T.filteringColumn=null,T.filteringItemsByColumn={},Me.value={},C.filterStore=[],re({rows:[],isMakeIndex:!1})},hw=i.computed(()=>{var F;return{width:`${E.value}px`,top:`${((F=$.value)==null?void 0:F.getBoundingClientRect().height)||0}px`}}),fw=F=>{const Q=T.filteringItemsByColumn[F];return Q==null?void 0:Q[Q.length-1]},uw=()=>{const F=document.createElement("div");F.id="ev-grid-filtering-items-modal",F.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild(F)};return i.onBeforeMount(()=>uw()),{idColIndex:i.computed(()=>{var F;return(F=C.orderedColumns.find(Q=>Q.field==="id"))==null?void 0:F.index}),summaryScroll:X,showHeader:m,stripeStyle:g,borderStyle:x,highlightIdx:b,useSummary:p,useGridSetting:u,toolbarRef:f,stores:C,emptyText:y,...i.toRefs(I),...i.toRefs(C),...i.toRefs(T),...i.toRefs(B),...i.toRefs(S),...i.toRefs(v),...i.toRefs(D),...i.toRefs(w),...i.toRefs(k),...i.toRefs(O),...i.toRefs(L),...i.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:W,updateHScroll:H,onScroll:U,calculatedColumn:fe,onResize:ke,onShow:rt,onColumnResize:ct,onRowClick:di,onRowDblClick:hi,onCheck:j,onCheckAll:K,onExpanded:q,onSort:ee,setSort:te,setStore:re,setContextMenu:Zt,onContextMenu:_s,onSearch:Z,setGridSetting:gi,onApplyColumn:fo,onColumnContextMenu:As,filteringItemsWidth:E,isShowColumnFilteringItems:he,operatorItems:sw,selectedFilteringItems:Xe,selectedFilteringColumn:Pe,filteringItemsRef:$,isShowFilteringItemsBox:ne,filteringItemsStyle:hw,hiddenFilteringItemsCount:zs,...i.toRefs(gn),hiddenFilteringItemsRef:xe,hiddenFilteringItemsByColumn:Me,removeAllFiltering:dw,onExpandFilteringItems:cw,setColumnFilteringItems:Fs,onChangeOperator:aw,onApplyFilter:rw,onClickFilteringItem:lw,getFilteringItemByField:fw,onDragStart:fi,onDragOver:ui,onDrop:mi,ROW_DISABLED_INDEX:6}}},F0={key:0,class:"filtering-items filtering-items--used"},H0={key:1,ref:"filteringItemsRef",class:"filtering-items"},W0=["data-field","onClick"],$0={class:"filtering-items__item--title"},X0=["title"],U0={key:1,class:"filtering-items__item--value"},Y0=["onClick"],j0={class:"filtering-items__item--title"},G0=["title"],Z0={key:1,class:"filtering-items__item--value"},q0={class:"column-list"},K0=["data-index"],J0=["title","onClick"],Q0=["onClick"],eC=["onMousedown"],tC={ref:"table"},nC=["data-index","disabled","onClick","onContextmenu","onDblclick"],oC=["data-name","data-index","disabled"],iC={key:0},sC=["title"],lC=["disabled"],aC=["disabled"],rC={key:0},cC=["colspan"],dC={key:0},hC={class:"is-empty"},fC={ref:"resizeLine",class:"table-resize-line"};function uC(e,t,n,o,s,l){var E;const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("ev-select"),c=i.resolveComponent("grid-option-button"),d=i.resolveComponent("toolbar"),h=i.resolveComponent("ev-checkbox"),f=i.resolveComponent("grid-sort-button"),u=i.resolveComponent("ev-context-menu"),m=i.resolveComponent("grid-summary"),p=i.resolveComponent("grid-pagination"),g=i.resolveComponent("filter-setting"),x=i.resolveComponent("column-setting"),b=i.resolveDirective("clickoutside"),y=i.resolveDirective("resize"),M=i.resolveDirective("observe-visibility");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.$slots.toolbar||o.useGridSetting?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:i.normalizeStyle(`width: ${e.gridWidth};`)},[i.createVNode(d,null,{toolbarWrapper:i.withCtx(()=>[i.createElementVNode("div",{class:"filtering",style:i.normalizeStyle({width:`${o.filteringItemsWidth}px`})},[e.isFiltering&&!Object.keys(e.filteringItemsByColumn).length?(i.openBlock(),i.createElementBlock("div",F0,[i.createVNode(a,{icon:"ev-icon-filter-list"}),t[18]||(t[18]=i.createElementVNode("span",null,"Filter",-1))])):i.createCommentVNode("",!0),e.isFiltering&&Object.keys(e.filteringItemsByColumn).length?(i.openBlock(),i.createElementBlock("div",H0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(e.filteringItemsByColumn),(I,T)=>{var V,C,S,w;return i.openBlock(),i.createElementBlock(i.Fragment,{key:T},[T===0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=i.withModifiers((...k)=>o.onExpandFilteringItems&&o.onExpandFilteringItems(...k),["stop"]))},[i.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),i.createElementVNode("span",null," Filter ("+i.toDisplayString(Object.keys(e.filteringItemsByColumn).length)+") ",1),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:i.withModifiers(o.removeAllFiltering,["stop"])},null,8,["onClick"])])):i.createCommentVNode("",!0),T===1?(i.openBlock(),i.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=k=>e.columnOperator=k),items:o.operatorItems,class:"filtering-items__item--operator",onChange:o.onChangeOperator},null,8,["modelValue","items","onChange"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"filtering-items__item non-display","data-field":I,onClick:i.withModifiers(k=>{var B;return o.onClickFilteringItem({caption:(B=o.getFilteringItemByField(I))==null?void 0:B.caption,field:I},e.filteringItemsByColumn[I])},["stop"])},[i.createElementVNode("span",$0,i.toDisplayString((V=o.getFilteringItemByField(I))==null?void 0:V.caption)+" "+i.toDisplayString((C=o.getFilteringItemByField(I))==null?void 0:C.comparison),1),e.filteringItemsByColumn[I].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=o.getFilteringItemByField(I))==null?void 0:S.value},i.toDisplayString((w=o.getFilteringItemByField(I))==null?void 0:w.value),9,X0)):(i.openBlock(),i.createElementBlock("span",U0," + "+i.toDisplayString(e.filteringItemsByColumn[I].length),1)),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:k=>o.onApplyFilter(I,[])},null,8,["onClick"])],8,W0)],64)}),128)),o.isShowColumnFilteringItems&&Object.keys(e.filteringItemsByColumn).length&&o.hiddenFilteringItemsCount>0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:t[2]||(t[2]=(...I)=>o.onExpandFilteringItems&&o.onExpandFilteringItems(...I))}," + "+i.toDisplayString(o.hiddenFilteringItemsCount),1)):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),!o.isShowColumnFilteringItems&&Object.keys(o.hiddenFilteringItemsByColumn).length?i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:i.normalizeStyle(o.filteringItemsStyle)},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.keys(o.hiddenFilteringItemsByColumn),(I,T)=>{var V,C,S,w;return i.openBlock(),i.createElementBlock("div",{key:T,class:"filtering-items__item",onClick:i.withModifiers(k=>{var B;return o.onClickFilteringItem({caption:(B=o.getFilteringItemByField(I))==null?void 0:B.caption,field:I},o.hiddenFilteringItemsByColumn[I])},["stop"])},[i.createElementVNode("span",j0,i.toDisplayString((V=o.getFilteringItemByField(I))==null?void 0:V.caption)+" "+i.toDisplayString((C=o.getFilteringItemByField(I))==null?void 0:C.comparison),1),o.hiddenFilteringItemsByColumn[I].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(S=o.getFilteringItemByField(I))==null?void 0:S.value},i.toDisplayString((w=o.getFilteringItemByField(I))==null?void 0:w.value),9,G0)):(i.openBlock(),i.createElementBlock("span",Z0," + "+i.toDisplayString(o.hiddenFilteringItemsByColumn[I].length),1)),i.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:k=>o.onApplyFilter(I,[],!0)},null,8,["onClick"])],8,Y0)}),128))],4)),[[b,()=>{o.isShowColumnFilteringItems||o.onExpandFilteringItems()}]]):i.createCommentVNode("",!0)],4),o.useGridSetting?(i.openBlock(),i.createBlock(c,{key:0,class:"grid-setting__icon",onClick:t[3]||(t[3]=I=>o.setGridSetting(I))})):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"toolbar",{item:{onSearch:o.onSearch}},void 0,!0)]),_:3})],4)):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createElementBlock("div",i.mergeProps({ref:"grid-wrapper"},e.$attrs,{class:"grid-wrapper",style:`width: ${e.gridWidth}; height: ${e.gridHeight};`}),[i.createElementVNode("div",{ref:"grid",class:i.normalizeClass({table:!0,adjust:e.adjust,"ev-grid":!0,"non-header":!o.showHeader,"ev-grid--empty":!e.viewStore.length})},[i.withDirectives(i.createElementVNode("div",{ref:"header",class:i.normalizeClass({"table-header":!0,"non-border":!!o.borderStyle})},[i.createElementVNode("ul",q0,[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[e.useCheckbox.use&&e.useCheckbox.headerCheck&&e.useCheckbox.mode!=="single"?(i.openBlock(),i.createBlock(h,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[4]||(t[4]=I=>e.isHeaderChecked=I),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:o.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0),e.useRowDetail?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({column:!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(I,T)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:T},[!I.hide&&!I.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":T,class:i.normalizeClass({column:!0,render:o.isRenderer(I),"non-border":!!o.borderStyle,[I.field]:I.field}),style:i.normalizeStyle({width:`${I.width}px`,"min-width":`${o.isRenderer(I)?e.rendererMinWidth:e.minWidth}px`,"margin-right":e.orderedColumns.length-1===T&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===T?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:t[6]||(t[6]=(...V)=>o.onDragStart&&o.onDragStart(...V)),onDragover:t[7]||(t[7]=(...V)=>o.onDragOver&&o.onDragOver(...V)),onDrop:t[8]||(t[8]=(...V)=>o.onDrop&&o.onDrop(...V))},[I.customHeader&&e.$slots.customHeader?i.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:I.caption,class:"column-name",onClick:[V=>o.onColumnContextMenu(V,I),t[5]||(t[5]=i.withModifiers((...V)=>e.columnMenu.show&&e.columnMenu.show(...V),["prevent"]))]},[i.createTextVNode(i.toDisplayString(I.caption)+" ",1),i.createElementVNode("span",{onClick:i.withModifiers(V=>o.onSort(I),["stop"])},[e.$slots.sortIcon?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[I.sortable===void 0||I.sortable?(i.openBlock(),i.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):i.createCommentVNode("",!0),e.sortField===I.field?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[I.sortable===void 0||I.sortable?(i.openBlock(),i.createBlock(f,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):i.createCommentVNode("",!0),e.sortField===I.field?(i.openBlock(),i.createBlock(f,{key:1,class:i.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),icon:e.sortOrder,style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?I.hidden:!0})},null,8,["class","icon","style"])):i.createCommentVNode("",!0)],64))],8,Q0)],8,J0)),i.createElementVNode("span",{class:"column-resize",onMousedown:i.withModifiers(V=>o.onColumnResize(T,V),["stop","left"])},null,40,eC)],46,K0)):i.createCommentVNode("",!0)],64))),128)),(E=e.$props.option.customContextMenu)!=null&&E.length?(i.openBlock(),i.createElementBlock("li",{key:2,class:i.normalizeClass({column:!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):i.createCommentVNode("",!0)])],2),[[i.vShow,o.showHeader]]),i.createElementVNode("div",{ref:"body",class:i.normalizeClass({stripe:o.stripeStyle,"table-body":!0,"bottom-border":!!e.viewStore.length,"non-border":!!o.borderStyle}),onScroll:t[11]||(t[11]=(...I)=>o.onScroll&&o.onScroll(...I)),onContextmenu:t[12]||(t[12]=I=>o.onContextMenu(I))},[i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),i.createElementVNode("table",tC,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(I,T)=>{var V,C;return i.openBlock(),i.createElementBlock(i.Fragment,{key:o.idColIndex!=null?I[2][o.idColIndex]:T},[i.createElementVNode("tr",{"data-index":I[0],class:i.normalizeClass({row:!0,selected:I[3],highlight:I[0]===o.highlightIdx,"non-border":!!o.borderStyle&&o.borderStyle!=="rows"}),disabled:I[o.ROW_DISABLED_INDEX],onClick:S=>o.onRowClick(S,I),onContextmenu:S=>o.onRowClick(S,I,!0),onDblclick:S=>o.onRowDblClick(S,I)},[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("td",{key:0,class:i.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(h,{modelValue:I[1],"onUpdate:modelValue":S=>I[1]=S,class:"row-checkbox-input",disabled:I[5]||I[o.ROW_DISABLED_INDEX],onChange:S=>o.onCheck(S,I)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):i.createCommentVNode("",!0),e.useRowDetail?(i.openBlock(),i.createElementBlock("td",{key:1,class:i.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!o.borderStyle,"row-detail-toggle--expanded":I[4]}),style:i.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(a,{modelValue:I[4],"onUpdate:modelValue":S=>I[4]=S,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:i.withModifiers(S=>o.onExpanded(S,I),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(S,w)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`${o.idColIndex!=null?I[2][o.idColIndex]:T}-${w}`},[!S.hide&&!S.hiddenDisplay?(i.openBlock(),i.createElementBlock("td",{key:0,"data-name":S.field,"data-index":S.index,class:i.normalizeClass({cell:!0,render:o.isRenderer(S),[S.type]:S.type,[S.align]:S.align,[S.field]:S.field,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${S.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${o.isRenderer(S)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===w?"none":"1px solid #CFCFCF"}),disabled:I[o.ROW_DISABLED_INDEX]},[e.$slots[S.field]?(i.openBlock(),i.createElementBlock("div",iC,[i.renderSlot(e.$slots,S.field,{item:{row:I,column:S},disabled:I[o.ROW_DISABLED_INDEX]},void 0,!0)])):(i.openBlock(),i.createElementBlock("div",{key:1,title:o.getConvertValue(S,I[2][S.index])},i.toDisplayString(o.getConvertValue(S,I[2][S.index])),9,sC))],14,oC)):i.createCommentVNode("",!0)],64))),128)),(V=e.$props.option.customContextMenu)!=null&&V.length?(i.openBlock(),i.createElementBlock("td",{key:2,class:i.normalizeClass({"row-contextmenu":!0,"non-border":!!o.borderStyle}),style:i.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${e.rowHeight}px`,"min-width":"30px","line-height":`${e.rowHeight}px`}),disabled:I[o.ROW_DISABLED_INDEX]},[e.$slots.contextmenuIcon?(i.openBlock(),i.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:I[o.ROW_DISABLED_INDEX],onClick:t[9]||(t[9]=S=>o.onContextMenu(S))},[i.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,aC)):(i.openBlock(),i.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:I[o.ROW_DISABLED_INDEX],onClick:t[10]||(t[10]=S=>o.onContextMenu(S))},null,8,["disabled"]))],14,lC)):i.createCommentVNode("",!0)],42,nC),e.useRowDetail&&((C=e.$slots)!=null&&C.rowDetail)&&I[4]?(i.openBlock(),i.createElementBlock("tr",rC,[i.createElementVNode("td",{colspan:I.length},[i.createElementVNode("div",{style:i.normalizeStyle({width:"100%",height:`${e.detailRowHeight}px`,"min-height":`${e.detailRowHeight}px`,"max-height":`${e.detailRowHeight}px`})},[i.renderSlot(e.$slots,"rowDetail",{item:{row:I}},void 0,!0)],4)],8,cC)])):i.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("tr",dC,[i.createElementVNode("td",hC,i.toDisplayString(o.emptyText),1)]))])],512),i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),i.createVNode(u,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),i.createVNode(u,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),i.createVNode(u,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),i.withDirectives(i.createElementVNode("div",fC,null,512),[[i.vShow,e.showResizeLine]])],2)],16)),[[y,o.onResize],[M,{callback:o.onShow,once:!0}]]),o.useSummary?(i.openBlock(),i.createBlock(m,{key:1,"ordered-columns":e.orderedColumns,stores:o.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:o.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":o.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):i.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(i.openBlock(),i.createBlock(p,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[13]||(t[13]=I=>e.currentPage=I),total:e.pageTotal,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):i.createCommentVNode("",!0),i.createVNode(g,{"is-show":e.isShowFilterSetting,"onUpdate:isShow":t[14]||(t[14]=I=>e.isShowFilterSetting=I),items:e.filteringItemsByColumn,"onUpdate:items":t[15]||(t[15]=I=>e.filteringItemsByColumn=I),column:e.filteringColumn,position:e.filterSettingPosition,onApplyFiltering:o.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),i.createVNode(x,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[16]||(t[16]=I=>e.isShowColumnSetting=I),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[17]||(t[17]=I=>e.isShowMenuOnClick=I),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:o.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const no=le(z0,[["render",uC],["__scopeId","data-v-22cd2bf6"]]);no.install=e=>{e.component(no.name,no)};var mC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kr={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(mC,function(){var n=1e3,o=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",f="month",u="quarter",m="year",p="date",g="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var L=["th","st","nd","rd"],v=O%100;return"["+O+(L[(v-20)%10]||L[v]||L[0])+"]"}},M=function(O,L,v){var N=String(O);return!N||N.length>=L?O:""+Array(L+1-N.length).join(v)+O},E={s:M,z:function(O){var L=-O.utcOffset(),v=Math.abs(L),N=Math.floor(v/60),R=v%60;return(L<=0?"+":"-")+M(N,2,"0")+":"+M(R,2,"0")},m:function O(L,v){if(L.date()<v.date())return-O(v,L);var N=12*(v.year()-L.year())+(v.month()-L.month()),R=L.clone().add(N,f),P=v-R<0,_=L.clone().add(N+(P?-1:1),f);return+(-(N+(v-R)/(P?R-_:_-R))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:f,y:m,w:h,d,D:p,h:c,m:r,s:a,ms:l,Q:u}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},I="en",T={};T[I]=y;var V="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[V])},S=function O(L,v,N){var R;if(!L)return I;if(typeof L=="string"){var P=L.toLowerCase();T[P]&&(R=P),v&&(T[P]=v,R=P);var _=L.split("-");if(!R&&_.length>1)return O(_[0])}else{var A=L.name;T[A]=L,R=A}return!N&&R&&(I=R),R||!N&&I},w=function(O,L){if(C(O))return O.clone();var v=typeof L=="object"?L:{};return v.date=O,v.args=arguments,new B(v)},k=E;k.l=S,k.i=C,k.w=function(O,L){return w(O,{locale:L.$L,utc:L.$u,x:L.$x,$offset:L.$offset})};var B=function(){function O(v){this.$L=S(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[V]=!0}var L=O.prototype;return L.parse=function(v){this.$d=function(N){var R=N.date,P=N.utc;if(R===null)return new Date(NaN);if(k.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var _=R.match(x);if(_){var A=_[2]-1||0,z=(_[7]||"0").substring(0,3);return P?new Date(Date.UTC(_[1],A,_[3]||1,_[4]||0,_[5]||0,_[6]||0,z)):new Date(_[1],A,_[3]||1,_[4]||0,_[5]||0,_[6]||0,z)}}return new Date(R)}(v),this.init()},L.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},L.$utils=function(){return k},L.isValid=function(){return this.$d.toString()!==g},L.isSame=function(v,N){var R=w(v);return this.startOf(N)<=R&&R<=this.endOf(N)},L.isAfter=function(v,N){return w(v)<this.startOf(N)},L.isBefore=function(v,N){return this.endOf(N)<w(v)},L.$g=function(v,N,R){return k.u(v)?this[N]:this.set(R,v)},L.unix=function(){return Math.floor(this.valueOf()/1e3)},L.valueOf=function(){return this.$d.getTime()},L.startOf=function(v,N){var R=this,P=!!k.u(N)||N,_=k.p(v),A=function(q,ee){var J=k.w(R.$u?Date.UTC(R.$y,ee,q):new Date(R.$y,ee,q),R);return P?J:J.endOf(d)},z=function(q,ee){return k.w(R.toDate()[q].apply(R.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ee)),R)},X=this.$W,W=this.$M,H=this.$D,U="set"+(this.$u?"UTC":"");switch(_){case m:return P?A(1,0):A(31,11);case f:return P?A(1,W):A(0,W+1);case h:var j=this.$locale().weekStart||0,K=(X<j?X+7:X)-j;return A(P?H-K:H+(6-K),W);case d:case p:return z(U+"Hours",0);case c:return z(U+"Minutes",1);case r:return z(U+"Seconds",2);case a:return z(U+"Milliseconds",3);default:return this.clone()}},L.endOf=function(v){return this.startOf(v,!1)},L.$set=function(v,N){var R,P=k.p(v),_="set"+(this.$u?"UTC":""),A=(R={},R[d]=_+"Date",R[p]=_+"Date",R[f]=_+"Month",R[m]=_+"FullYear",R[c]=_+"Hours",R[r]=_+"Minutes",R[a]=_+"Seconds",R[l]=_+"Milliseconds",R)[P],z=P===d?this.$D+(N-this.$W):N;if(P===f||P===m){var X=this.clone().set(p,1);X.$d[A](z),X.init(),this.$d=X.set(p,Math.min(this.$D,X.daysInMonth())).$d}else A&&this.$d[A](z);return this.init(),this},L.set=function(v,N){return this.clone().$set(v,N)},L.get=function(v){return this[k.p(v)]()},L.add=function(v,N){var R,P=this;v=Number(v);var _=k.p(N),A=function(W){var H=w(P);return k.w(H.date(H.date()+Math.round(W*v)),P)};if(_===f)return this.set(f,this.$M+v);if(_===m)return this.set(m,this.$y+v);if(_===d)return A(1);if(_===h)return A(7);var z=(R={},R[r]=o,R[c]=s,R[a]=n,R)[_]||1,X=this.$d.getTime()+v*z;return k.w(X,this)},L.subtract=function(v,N){return this.add(-1*v,N)},L.format=function(v){var N=this,R=this.$locale();if(!this.isValid())return R.invalidDate||g;var P=v||"YYYY-MM-DDTHH:mm:ssZ",_=k.z(this),A=this.$H,z=this.$m,X=this.$M,W=R.weekdays,H=R.months,U=R.meridiem,j=function(ee,J,te,G){return ee&&(ee[J]||ee(N,P))||te[J].slice(0,G)},K=function(ee){return k.s(A%12||12,ee,"0")},q=U||function(ee,J,te){var G=ee<12?"AM":"PM";return te?G.toLowerCase():G};return P.replace(b,function(ee,J){return J||function(te){switch(te){case"YY":return String(N.$y).slice(-2);case"YYYY":return k.s(N.$y,4,"0");case"M":return X+1;case"MM":return k.s(X+1,2,"0");case"MMM":return j(R.monthsShort,X,H,3);case"MMMM":return j(H,X);case"D":return N.$D;case"DD":return k.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return j(R.weekdaysMin,N.$W,W,2);case"ddd":return j(R.weekdaysShort,N.$W,W,3);case"dddd":return W[N.$W];case"H":return String(A);case"HH":return k.s(A,2,"0");case"h":return K(1);case"hh":return K(2);case"a":return q(A,z,!0);case"A":return q(A,z,!1);case"m":return String(z);case"mm":return k.s(z,2,"0");case"s":return String(N.$s);case"ss":return k.s(N.$s,2,"0");case"SSS":return k.s(N.$ms,3,"0");case"Z":return _}return null}(ee)||_.replace(":","")})},L.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},L.diff=function(v,N,R){var P,_=this,A=k.p(N),z=w(v),X=(z.utcOffset()-this.utcOffset())*o,W=this-z,H=function(){return k.m(_,z)};switch(A){case m:P=H()/12;break;case f:P=H();break;case u:P=H()/3;break;case h:P=(W-X)/6048e5;break;case d:P=(W-X)/864e5;break;case c:P=W/s;break;case r:P=W/o;break;case a:P=W/n;break;default:P=W}return R?P:k.a(P)},L.daysInMonth=function(){return this.endOf(f).$D},L.$locale=function(){return T[this.$L]},L.locale=function(v,N){if(!v)return this.$L;var R=this.clone(),P=S(v,N,!0);return P&&(R.$L=P),R},L.clone=function(){return k.w(this.$d,this)},L.toDate=function(){return new Date(this.valueOf())},L.toJSON=function(){return this.isValid()?this.toISOString():null},L.toISOString=function(){return this.$d.toISOString()},L.toString=function(){return this.$d.toUTCString()},O}(),D=B.prototype;return w.prototype=D,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",f],["$y",m],["$D",p]].forEach(function(O){D[O[1]]=function(L){return this.$g(L,O[0],O[1])}}),w.extend=function(O,L){return O.$i||(O(L,B,w),O.$i=!0),w},w.locale=S,w.isDayjs=C,w.unix=function(O){return w(1e3*O)},w.en=T[I],w.Ls=T,w.p={},w})})(kr);var pC=kr.exports;const at=gC(pC),si=document.createElement("canvas").getContext("2d"),Y={hexToRgb(e){if(!e)return!1;const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e),n=parseInt(t[1],16),o=parseInt(t[2],16),s=parseInt(t[3],16);return`${n},${o},${s}`},getColorStringType(e){if(!e)return"";const t=e.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(t),o=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/.exec(t),s=/^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1?)\s*[)]$/.exec(t);let l="";return n?l="HEX":o?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(e,t=1){const n=e.replace(/ /g,""),o=this.getColorStringType(n);let s="";switch(o){case"HEX":s=`rgba(${this.hexToRgb(n)},${t})`;break;case"RGB":s=n.replace(")",`, ${t})`).replace("rgb","rgba");break;case"RGBA":s=n.replace(`${this.getOpacity(e)})`,`${t})`);break;default:s=`rgba(0, 0, 0, ${t})`;break}return s},getOpacity(e){const t=e==null?void 0:e.replace(/ /g,"");return this.getColorStringType(t)==="RGBA"?t.replace(/^.*,(.+)\)/,"$1"):"1"},calculateMagnitude(e){return Math.floor(Math.log(e)/Math.LN10)},aliasPixel(e){return e%2===0?0:.5},getLabelStyle(e){const{fontStyle:t="normal",fontWeight:n="normal",fontSize:o="12",fontFamily:s="Roboto"}=e;return`${t} normal ${n} ${o}px ${s}`},labelSignFormat(e,t=null){const n=gh(1),o=mh(1),s=uh(1),l=fh(1),a=1e3;let r;if(!ut(e))return e;const c=e<0,d=Math.abs(e),h=(f,u,m)=>{let p;return f%u===0?p=pt(t)?`${f/u}${m}`:`${(f/u).toFixed(t)}${m}`:p=`${(f/u).toFixed(1)}${m}`,c?`-${p}`:p};if(d>=n)r=h(d,n,"P");else if(d>=o)r=h(d,o,"T");else if(d>=s)r=h(d,s,"G");else if(d>=l)r=h(d,l,"M");else if(d>=a)r=h(d,1e3,"K");else{const f=pt(t)?d:d.toFixed(t);r=c?`-${f}`:`${f}`}return r},calcTextSize(e,t,n=0){const o=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${t}; padding: 0 ${n}px`;o.setAttribute("style",s),o.style.font=t,o.textContent=e,document.body.appendChild(o);const l=o.getBoundingClientRect(),a=l.width||2,r=l.height||2;return o.remove(),{width:a,height:r}},calcTextSizeCanvas(e,t){if(!e)return{width:2,height:2};si.save(),si.font=t;const n=si.measureText(e),o=t.match(/(\d+(?:\.\d+)?)px/),l=(o?Number(o[1]):14)*1.2;return si.restore(),{width:Math.max(Math.ceil(n.width),2),height:Math.max(Math.ceil(l),2)}},getStringMinMax(e){const t={min:e[0],max:e[0]};return e.forEach(n=>{var o,s;((o=t==null?void 0:t.max)==null?void 0:o.length)<(n==null?void 0:n.length)&&(t.max=n),((s=t==null?void 0:t.min)==null?void 0:s.length)>(n==null?void 0:n.length)&&(t.min=n)}),t},truncateLabelWithEllipsis(e,t,n,o="right"){if(!e)return"";if(!t)return e;const s="…",l=n.measureText(s).width;let a=e,r=n.measureText(a).width;if(r<=t||r<=l)return e;let c=a.length;for(;r>=t-l&&c-- >0;)a=o==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return o==="right"?a+s:s+a},showLabelTip(e){const{ctx:t,width:n,height:o,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=e,f=s-n/2,u=s+n/2,m=l-o,p=l;t.beginPath(),t.save(),t.fillStyle=d||"#E96E2C",t.strokeStyle=d||"#E96E2C",t.shadowBlur=0,t.moveTo(f+r,m),t.quadraticCurveTo(f,m,f,m+r),t.lineTo(f,p-r),t.quadraticCurveTo(f,p,f+r,p),t.lineTo(u-r,p),t.quadraticCurveTo(u,p,u,p-r),t.lineTo(u,m+r),t.quadraticCurveTo(u,m,u-r,m),t.lineTo(s-a,m),t.lineTo(s,m-a),t.lineTo(s+a,m),t.lineTo(f+r,m),t.closePath(),t.fill(),t.restore(),t.save(),t.font="normal normal bold 12px Roboto",t.fillStyle=h||"#FFF",t.textBaseline="middle",t.textAlign="center",t.fillText(`${c}`,s,m+o/2),t.restore(),t.beginPath()},isPieType(e){return e==="pie"||e==="doughnut"||e==="sunburst"},isDoughnutHole(e){return e==="doughnut"||e==="sunburst"},setDOMStyle(e,t){var n;!e||!t||(n=Object.keys(t))==null||n.forEach(o=>{e.style[o]=t[o]})},checkSafeInteger(e){return e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER},htmlToElement(e){const t=document.createElement("template");return t.innerHTML=e.trim(),t.content.firstChild},isNullOrUndefined(e){return e==null},rgbaAdjustHalfOpacity(e){const t=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/,n=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;if(t.test(e)){const[,o,s,l]=e.match(t);return`rgba(${o}, ${s}, ${l}, 0.5)`}if(n.test(e)){const[,o,s,l,a]=e.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${o}, ${s}, ${l}, ${r})`}return e.startsWith("#")&&e.length>7?e:`${e}80`}},yC={createDataSet(e,t){Object.keys(this.seriesInfo.charts).forEach(n=>{const o=this.seriesInfo.charts[n];o.length&&(n==="pie"?this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,o):n==="scatter"?o.forEach(s=>{const l=this.seriesList[s],a=e[s],r=l==null?void 0:l.passingValue;l&&a&&(l.data=this.addSeriesDSforScatter(a),l.minMax=this.getSeriesMinMax(l.data,r))}):n==="heatMap"?o.forEach(s=>{const l=this.seriesList[s],a=l==null?void 0:l.passingValue,r=e[s];l&&r&&(l.labels=t,l.data=this.addSeriesDSForHeatMap(r),l.minMax=this.getSeriesMinMax(l.data,a),l.valueOpt=this.getSeriesValueOptForHeatMap(l))}):o.forEach(s=>{var c,d;const l=this.seriesList[s],a=(c=e==null?void 0:e[s])==null?void 0:c.some(h=>h===l.passingValue);l.hasPassingValueInData=a;const r=(d=e==null?void 0:e[s])==null?void 0:d.map(h=>l.interpolation==="zero"&&!h?0:h===l.passingValue?null:h);l&&r&&(l.isExistGrp&&l.stackIndex&&!l.isOverlapping?l.data=this.addSeriesStackDS(r,t,l.bsIds,l.stackIndex):l.data=this.addSeriesDS(r,t,l.isExistGrp),l.minMax=this.getSeriesMinMax(l.data,l.passingValue))}))})},createRealTimeScatterDataSet(e){var o,s,l;const t=Object.keys(e),n={maxY:0,minY:1/0,fromTime:0,toTime:0};for(let a=0;a<t.length;a++){const r=t[a],c=e[r],d=c==null?void 0:c.length;if(!this.isInit||this.updateSeries||!this.dataSet[r]){const w={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0};this.dataSet[r]={...w,...this.dataSet[r]}}const h=this.dataSet[r],f=h.dataGroup,u=this.options.realTimeScatter.range||300,m=h.length!==u;h.length=u;const p=h.length;let g=0;for(let w=0;w<d;w++){const k=c[w];k&&g<k.x&&(g=k.x)}g=g?Math.floor(g/1e3)*1e3:0;const x=((l=(s=(o=f.at(-1))==null?void 0:o.data)==null?void 0:s.at(-1))==null?void 0:l.x)||Date.now(),b=Math.floor(x/1e3)*1e3,y=h.toTime||b,M=g||y;if(h.endIndex==null||m){h.startIndex=0,h.endIndex=p-1,f.length=p;for(let w=0;w<p;w++)f[w]=f[w]||{data:[],max:0,min:1/0},f[w].data.length=0,f[w].max=0,f[w].min=1/0;h.toTime=M,h.fromTime=h.toTime-p*1e3}const E=(M-y)/1e3,I=Number.isFinite(E)?Math.max(0,Math.floor(E)):0;if(h.toTime=M,h.fromTime=h.toTime-p*1e3,g&&(h.toTime-g)/1e3>p&&r==="")return;const T=w=>{w.data.length=0,w.max=0,w.min=1/0};for(let w=0;w<p;w++)f[w]?f[w].data||(f[w].data=[],f[w].max=0,f[w].min=1/0):f[w]={data:[],max:0,min:1/0};if(I>0)if(I>=p){for(let w=0;w<p;w++)T(f[w]);h.startIndex=0,h.endIndex=p-1}else{let w=h.startIndex,k=h.endIndex;for(let B=0;B<I;B++)T(f[w]),w=(w+1)%p,k=(k+1)%p;h.startIndex=w,h.endIndex=k}for(let w=0;w<d;w++){const k=c[w];if(k){const B=Math.floor(k.x/1e3)*1e3;if(h.fromTime<=B){let D=h.endIndex-(h.toTime-B)/1e3;D<0&&(D=p+D);const O=f[D];O.data.push({x:k.x,y:k.y,o:k.value??k.y,color:k.color}),O.max=Math.max(O.max,k.y),O.min=Math.min(O.min,k.y)}}}const V=1e3,C={maxY:0,minY:1/0};for(let w=0;w<p;w++){const k=f[w];for(let B=0;B<k.data.length;B++){const D=k.data[B],O=Math.floor(D.x/V)*V;O>=h.fromTime&&O<=h.toTime&&Number.isFinite(D.y)&&(D.y>C.maxY&&(C.maxY=D.y),D.y<C.minY&&(C.minY=D.y))}}Number.isFinite(C.minY)&&(n.maxY=Math.max(n.maxY,C.maxY),n.minY=Math.min(n.minY,C.minY)),n.fromTime=h.fromTime,n.toTime=h.toTime}Number.isFinite(n.minY)||(n.minY=0,n.maxY=1),this.seriesInfo.charts.scatter.forEach(a=>{const r=this.seriesList[a];r.data=this.dataSet,r.minMax={minX:at(n.fromTime),minY:n.minY,maxX:at(n.toTime),maxY:n.maxY}})},createSunburstDataSet(e){this.pieDataSet=[];const t=this.pieDataSet,n=[];for(let o=0;o<e.length;o++){const s=e[o],l=this.seriesList[s.id];let a=!1;if(t[0]||(t[0]={ir:0,or:0,total:0,data:[]}),l.show){if(t[0].total+=s.value||0,t[0].data.push({parent:"$ev-root",id:s.id,value:s.value,sa:0,ea:0}),s.children)for(let r=0;r<s.children.length;r++)this.seriesList[s.children[r].id].show&&(a=!0),n.push({parent:s.id,data:s.children[r],depth:1});else{const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}if(!a){const r={id:"dummy",value:s.value};n.push({parent:s.id,data:r,depth:1})}}}for(t[0].data.sort((o,s)=>s.value-o.value);n.length;){const o=n.shift(),s=o.parent,l=o.data,a=o.depth;let r=!1;t[a]||(t[a]={ir:0,or:0,total:{},data:[]}),t[a].total[s]||(t[a].total[s]=0);const c=this.seriesList[l.id];if(l.id==="dummy")t[a].data.push({parent:s,id:"dummy",value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value;else if(c&&c.show){if(t[a].data.push({parent:s,id:l.id,value:l.value,sa:0,ea:0}),t[a].total[s]+=l.value,l.children)for(let d=0;d<l.children.length;d++)this.seriesList[l.children[d].id].show&&(r=!0),n.push({parent:l.id,data:l.children[d],depth:a+1});else{const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}if(!r){const d={id:"dummy",value:l.value};n.push({parent:l.id,data:d,depth:a+1})}}t[a].data.sort((d,h)=>h.value-d.value)}},createPieDataSet(e,t){this.pieDataSet=[];const n=this.pieDataSet;n[0]={data:[],ir:0,or:0,total:0},t.forEach(o=>{if(this.seriesList[o].show){const s=e[o][0]??0;n[0].total+=s,n[0].data.push({id:o,value:s,sa:0,ea:0})}}),n.forEach(o=>{o.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(e,t,n,o=0){const s=this.seriesList,l=this.options.horizontal,a=[],r=new Map,c=(h,f,u)=>{const m=`${h}-${f}-${u>=0?"pos":"neg"}`;if(r.has(m))return r.get(m);let p=0,g=h;for(;g>=0;){const x=s[n[g]];if(x!=null&&x.show){const b=x.data[f],y=l?b==null?void 0:b.x:b==null?void 0:b.y,M=b==null?void 0:b.o,E=!Y.isNullOrUndefined(x.passingValue)&&x.passingValue===M,I=u>=0&&M>=0||u<0&&M<0;if(y!=null&&!E&&I){p=y;break}}g--}return r.set(m,p),p},d=n.length-1;return e.forEach((h,f)=>{const u=Math.max(0,d);let m=c(u,f,h),p=h,g=t[f],x=h;if(m!=null&&g!=null){x&&typeof x=="object"&&("x"in x||"y"in x)&&(p=l?h.x:h.y,g=l?h.y:h.x);const b=(p==null?void 0:p.value)??p;o>0?b!=null?x=m+b:x=p:(m=0,x=b),a.push(this.addData(x,g,p,m))}}),a},addSeriesDS(e,t,n){var a;const o=this.options.horizontal,s=[],l=(a=this.seriesList[Object.keys(this.seriesList)[0]])==null?void 0:a.passingValue;return e.forEach((r,c)=>{let d=r,h=t[c];if(d&&typeof d=="object"&&(r.x||r.y)&&(d=o?r.x:r.y,h=o?r.y:r.x),h!==null){const f=n&&!Y.isNullOrUndefined(l)&&d===l;s.push(this.addData(f?0:d,h,d))}}),s},addSeriesDSforScatter(e){return e.map(t=>{const n=t.x,o={value:t.y,color:(t==null?void 0:t.color)||null};return this.addData(o,n,o)})},addSeriesDSForHeatMap(e){return e.map(({x:t,y:n,value:o,color:s=null})=>({x:t,y:n,o,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(e,t,n=null,o=null){let s,l=null,a=null,r=null,c=null,d=null;return e!==null&&typeof e=="object"?(l=e.value,r=e.color,d=e.textColor):l=e??null,n!==null&&typeof n=="object"?(a=n.value,c=n.color):a=n??null,this.options.horizontal?s={x:l,y:t,o:a,b:o}:s={x:t,y:l,o:a,b:o},s.xp=null,s.yp=null,s.w=null,s.h=null,s.dataColor=r??c,s.dataTextColor=d,s},getSeriesMinMax(e,t){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},o=this.options.horizontal;if(e.length){const s=!Y.isNullOrUndefined(t);return e.reduce((l,a,r)=>{var u,m,p;const c=l,d=((u=a.x)==null?void 0:u.value)||a.x,h=((m=a.y)==null?void 0:m.value)||a.y,f=((p=a.o)==null?void 0:p.value)||a.o;return(s?f!==t&&d<=c.minX:d<=c.minX)&&(c.minX=d===null?0:d),(s?f!==t&&h<=c.minY:h<=c.minY)&&(c.minY=h===null?0:h),(s?f!==t&&d>=c.maxX:d>=c.maxX)&&(c.maxX=d===null?0:d,o&&d!==null&&(c.maxDomain=h,c.maxDomainIndex=r)),(s?f!==t&&h>=c.maxY:h>=c.maxY)&&(c.maxY=h===null?0:h,!o&&h!==null&&(c.maxDomain=d,c.maxDomainIndex=r)),c},{minX:e[0].x,minY:e[0].y,maxX:e[0].x,maxY:e[0].y,maxDomain:o?e[0].y:e[0].x,maxDomainIndex:0})}return n},getSeriesValueOptForHeatMap(e){const{data:t,colorState:n,isGradient:o}=e,s=this.options.heatMapColor,l=s.colorsByRange.length||s.rangeCount,a=s.decimalPoint;let r,c=0,d=!1;t.forEach(({o:f})=>{c<f&&(c=Math.max(c,f)),f<0?d=!0:r===void 0?r=f:r=Math.min(r,f)}),d&&!o&&n.length===l&&n.push({id:`color#${l}`,color:s.error,state:"normal",label:"Error",show:!0});let h=c>r?Math.floor((c-r)/l):1;return c-r<=l&&(a>0?h=+((c-r)/l).toFixed(a):h=1),{min:r,max:c,interval:h,existError:d,decimalPoint:a}},getItemByLabelIndex(e){if(e<0)return!1;const t=Object.keys(this.seriesList),n=!!this.options.horizontal;let o=null,s=null,l=null,a="",r=0,c=!1,d=!1;if(e>-1){for(let h=0;h<t.length;h++){const f=t[h],u=this.seriesList[f],m=u.data[e];if(m&&u.show&&u.showLegend){const p=n?m.y:m.x,g=n?m.yp:m.xp;if(p!=null){const x=n?m.o||m.x:m.o||m.y;u.stackIndex?(r+=isNaN(m.o)?0:m.o,c=!0):r+=m.y,(l===null||l<=x)&&(l=x,a=f,o=p,s=g)}}}d={label:o,pos:s,value:l===null?0:l,sId:a,acc:r,useStack:c,maxIndex:e}}return d},getItem(e,t=!1){const{seriesID:n,dataIndex:o}=e;let s;if("seriesID"in e){const l=this.getDataByValues(n,o);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getItemByPosition([l.xp,l.yp],t,o,!0)]}else{const l=Object.entries(this.seriesList);let a;for(let r=0;r<l.length;r++){const[c,d]=l[r];if(d.show){a=c;break}}s=o==null?void 0:o.map(r=>{const c=this.getDataByValues(a,r);return c?this.getItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0):null})}return s},getDataByValues(e,t){const n=this.seriesList[e];return!n||isNaN(t)||t<0||(n==null?void 0:n.data.length)<=t?!1:n.data[t]},getItemByPosition(e,t=!1,n,o=!1){const s=Object.keys(this.seriesList),l=!!this.options.horizontal;let a=null,r=null,c=null,d=null,h="",f=0,u=!1,m=null;for(let p=0;p<s.length;p++){const g=s[p],x=this.seriesList[g],b=t?x.findApproximateData:x.findGraphData;if(b){const y=b.call(x,e,l,n,o),M=y.data,E=y.index;if(M)if(Y.isPieType(y.type))r=g,h=g,c=(M.ea-M.sa)/2,d=M.o,m=M.index,a=y.type;else{const I=l?M.y:M.x,T=l?M.yp:M.xp;if(I!=null){const V=l?M.o||M.x:M.o||M.y;x.stackIndex!=null?(f+=isNaN(M.o)?0:M.o,u=!0):f+=M.y,a==="bar"&&u?y.hit&&(d=V,h=g,m=E,r=I,c=T,a=x.type):(d===null||d<=V)&&(d=V,h=g,r=I,c=T,m=E,a=x.type)}}}}return{type:a,label:r,pos:c,value:d??0,sId:h,acc:f,useStack:u,maxIndex:m}},getLabelInfoByPosition(e,t){var g,x,b;const[n,o]=e,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=this.data.series,a=((g=Object.values(l).sort((y,M)=>M.pointSize??0-y.pointSize??0)[0])==null?void 0:g.pointSize)??3,{horizontal:r,selectLabel:c}=this.options;let d,h;t==="xAxis"?(d=this.axesX[0],h=this.scrollbar.x):t==="yAxis"?(d=this.axesY[0],h=this.scrollbar.y):(d=r?this.axesY[0]:this.axesX[0],h=r?this.scrollbar.y:this.scrollbar.x);const f=s[d.units.rectStart],u=s[d.units.rectEnd];let m,p;if(h!=null&&h.use&&((x=d==null?void 0:d.labels)!=null&&x.length)){const{type:y,range:M,interval:E=1}=h,[I,T]=M??[0,d.labels.length],V=Math.floor((+T-+I)/E)+1,C=(u-f)/V,w=Math.floor(((t==="yAxis"||r?o:n)-f)/C);y==="step"?m=I+w:m=(d==null?void 0:d.labels.findIndex(B=>B===+I))+w}else if((b=d==null?void 0:d.labels)!=null&&b.length){const y=(u-f)/d.labels.length,E=Math.floor(((t==="yAxis"?o:n)-f)/y);m=d.labels.length>E?E:-1}else{let y,M;n<f-a?(y=f,M=0):n>u+a?(y=u,M=this.data.labels.length-1):y=n,p=this.getItemByPosition([y,o],c==null?void 0:c.useApproximateValue,M,!0),m=p.maxIndex??-1}return{labelIndex:m,hitInfo:p}},getCurMouseLabelVal(e,t,n){const{type:o,horizontal:s}=this.options,l=e==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let f="";switch(o){case"bar":case"line":{f=s&&!l||!s&&l?this.data.labels[n]:"";break}case"heatMap":{f=this.data.labels[a][n];break}}return f},h=()=>{let f="";const u={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},{steps:m,interval:p,graphMin:g}=this.axesSteps[a][0],{width:x,height:b}=this.axesRange[a][0].size,y=l?this.axesX:this.axesY,M=u[y[0].units.rectStart],E=u[y[0].units.rectEnd],I=Math.abs(t[l?0:1]-M),T=(l?x:b)/2,V=Math.abs(M-E)/m,C=Math.floor((I+T)/V);return V*C+T>I&&V*C-T<I&&(f=C*p+g),f};return typeof n=="number"&&(r=d(),c=n),r||(r=h(),c=-1),{labelVal:r,labelIdx:c}},getStoreMinMax(){const e=Object.keys(this.seriesList),t=this.options.horizontal,n={x:[{min:null,max:null}],y:[{min:null,max:null}]};return e.length?e.reduce((o,s)=>{const l=o,a=this.seriesList[s],r=a.minMax,c=a.xAxisIndex,d=a.yAxisIndex;if(l.x[c]||(l.x[c]={min:null,max:null,maxSID:null}),l.y[d]||(l.y[d]={min:null,max:null,maxSID:null}),r&&a.show){t?((l.x[c].min===null||r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY<l.y[d].min)&&(l.y[d].min=r.minY));const h=this.seriesList[s].isExistGrp,f=l.x[c].max<0;(h&&f||!l.x[c].max||r.maxX>=l.x[c].max)&&(l.x[c].max=r.maxX,l.x[c].maxSID=s);const u=l.y[d].max<0;(h&&u||!l.y[d].max||r.maxY>=l.y[d].max)&&(l.y[d].max=r.maxY,l.y[d].maxSID=s)}return l},{x:[{min:null,max:null,maxSID:null}],y:[{min:null,max:null,maxSID:null}]}):n},calculateAngle(){const e=this.pieDataSet;let t,n,o,s,l,a,r,c,d;const h=[],f={"$ev-root":1.5*Math.PI};for(let u=0;u<e.length;u++){const m=e[u];d=!0;for(let p=0;p<m.data.length;p++)if(t=m.data[p],n=t.value,d&&(d=t.id==="dummy"),!u)a=f["$ev-root"],l=2*Math.PI*(n/m.total),r=a+l,t.sa=a,t.ea=r,f["$ev-root"]+=l;else{if(o=this.getParentInfo(u-1,t.parent),!o)break;f[t.parent]||(f[t.parent]=o.sa),a=f[t.parent],c=o.ea-o.sa,s=m.total[t.parent]||0,l=c*(n/s),r=a+l,t.sa=a,t.ea=r,f[t.parent]+=l}d&&h.push(u)}for(let u=0;u<h.length;u++)this.pieDataSet.splice(h,1);this.options.reverse&&(this.pieDataSet=zp(this.pieDataSet))},getParentInfo(e,t){for(let n=e;n>=0;n--){const o=this.pieDataSet[n];for(let s=0;s<o.data.length;s++)if(o.data[s].id===t)return o.data[s]}return null},getAggregations(){const e=this.data.data,t=this.data.series,n={},o=Object.keys(t);return o==null||o.forEach(s=>{const l=e[s].map(u=>u!=null&&u.value?u.value:u),a=l[l.length-1],r=l.filter(u=>u!=null),c=Math.min(...r),d=Math.max(...r),h=r.reduce((u,m)=>u+m,0),f=h/r.length||0;(!Y.checkSafeInteger(c)||!Y.checkSafeInteger(d)||!Y.checkSafeInteger(f)||!Y.checkSafeInteger(h)||!Y.checkSafeInteger(a))&&console.warn("[EVUI][Chart] The aggregated value exceeds 9007199254740991 or less than -9007199254740991."),n[s]={min:c,max:d,avg:f,total:h,last:a}}),n}},xC={x:{rectStart:"x1",rectEnd:"x2",rectOffsetCounter:e=>e==="top"?"y2":"y1",rectOffset:e=>e==="top"?"y1":"y2"},y:{rectStart:"y2",rectEnd:"y1",rectOffsetCounter:e=>e==="left"?"x2":"x1",rectOffset:e=>e==="left"?"x1":"x2"}},Vt=["#2b99f0","#8ac449","#00C4C5","#ffde00","#ff7781","#8470ff","#75cd8e","#48d1cc","#fec64f","#fe984f","#0052ff","#00a48c","#83cfde","#dfe32d","#ff7d40","#99c7ff","#a5fee3","#0379c9","#eef093","#ffa891","#00c5cd","#009bc7","#cacaff","#ffc125","#df6264"],Mr={show:!0,highlight:{defaultSize:4,maxSize:6,maxShadowSize:10,maxShadowOpacity:.4},xAxisIndex:0,yAxisIndex:0,point:!0,pointHighlight:!0,pointSize:3,pointStyle:"",lineWidth:2,fill:!1,fillOpacity:.4,showLegend:!0,passingValue:null,interpolation:"none"},bC={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},CC={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Ir={min:null,max:null,autoScaleRatio:null,startToZero:!1,showAxis:!0,axisLineColor:"#C9CFDC",axisLineWidth:1,showGrid:!0,gridLineColor:"#C9CFDC",showAxisTick:!0,showIndicator:!1,timeFormat:"mm:ss",range:null,interval:null,decimalPoint:"auto",fixedSteps:!1,scaleChange:!1,labelStyle:{show:!0,fontSize:12,color:"#25262E",fontFamily:"Roboto",fontWeight:400,fitWidth:!1,fitDir:"right",alignToGridLine:!1,padding:0,fixWidth:void 0},showLastLabel:!1,lastLabelFontStyle:null,title:{use:!1,text:null,fontWeight:400,fontSize:12,fontFamily:"Roboto",textAlign:"right",fontStyle:"normal",color:"#808080"},scrollbar:{use:!1,width:14,height:14,background:"#F2F2F2",showButton:!0,thumbStyle:{background:"#929292",radius:0}}},Er={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null},vr={color:"#FF0000",lineWidth:1,label:Er},Tr={color:"#FAE59D"},SC={show:!0,xAxisIndex:0,yAxisIndex:0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:0},highlight:{stroke:{use:!1,color:null,width:1,radius:0},shadow:{use:!0,offsetX:0,offsetY:0,blur:4,color:"#959494"}}},li={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:26784e5,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},Vs=Object.freeze([1,2,2.5,5,10]),ie={calculateX(e,t,n,o,s=0){if(e==null||e>n||e<t)return null;const l=o/(n-t);return Math.ceil(s+l*(e-t))},calculateSubX(e,t,n,o,s=0){if(e==null)return null;const l=o/(n-t);return Math.ceil(s+l*(e-t))},calculateY(e,t,n,o,s=0){let l;if(e==null||e>n||e<t)return null;const a=o/(n-t);return s?l=s-a*(e-(t||0)):l=-(a*(e-(t||0))),Math.floor(l)},drawPoint(e,t,n,o,s){let l,a,r,c,d;if(isNaN(n)||n<=0)return;let h,f,u,m;switch(t){case"triangle":e.beginPath(),l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,e.moveTo(o-l/2,s+c/3),e.lineTo(o+l/2,s+c/3),e.lineTo(o,s-2*c/3),e.closePath(),e.fill();break;case"rect":d=1/Math.SQRT2*n,e.beginPath(),e.fillRect(o-d,s-d,2*d,2*d),e.strokeRect(o-d,s-d,2*d,2*d);break;case"rectRounded":h=n/Math.SQRT2,f=o-h,u=s-h,m=Math.SQRT2*n,e.beginPath(),this.roundedRect(e,f,u,m,m,n/2),e.closePath(),e.fill();break;case"rectRot":d=1/Math.SQRT2*n,e.beginPath(),e.moveTo(o-d,s),e.lineTo(o,s+d),e.lineTo(o+d,s),e.lineTo(o,s-d),e.closePath(),e.fill();break;case"cross":e.beginPath(),e.moveTo(o,s+n),e.lineTo(o,s-n),e.moveTo(o-n,s),e.lineTo(o+n,s),e.closePath();break;case"crossRot":e.beginPath(),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(o-a,s-r),e.lineTo(o+a,s+r),e.moveTo(o-a,s+r),e.lineTo(o+a,s-r),e.closePath();break;case"star":e.beginPath(),e.moveTo(o,s+n),e.lineTo(o,s-n),e.moveTo(o-n,s),e.lineTo(o+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(o-a,s-r),e.lineTo(o+a,s+r),e.moveTo(o-a,s+r),e.lineTo(o+a,s-r),e.closePath();break;case"line":e.beginPath(),e.moveTo(o-n,s),e.lineTo(o+n,s),e.closePath();break;default:e.beginPath(),e.arc(o,s,n,0,Math.PI*2),e.closePath(),e.fill();break}e.stroke()},roundedRect(e,t,n,o,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,o/2),d=t+c,h=n+c,f=t+o-c,u=n+s-c;e.moveTo(t,h),d<f&&h<u?(e.arc(d,h,c,-a,-r),e.arc(f,h,c,-r,0),e.arc(f,u,c,0,r),e.arc(d,u,c,r,a)):d<f?(e.moveTo(d,n),e.arc(f,h,c,-r,r),e.arc(d,h,c,r,a+r)):h<u?(e.arc(d,h,c,-a,0),e.arc(d,u,c,0,a)):e.arc(d,h,c,-a,a),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,o,s)},createGradient(e,t,n,o,s,l){const{x:a,y:r,w:c,h:d}=n;let h;t?h=e.createLinearGradient(a,0,a+c,0):h=e.createLinearGradient(0,r,0,r+d);for(let f=0;f<o.length;f++){const u=o[f][0]??0,m=o[f][1]??"rgba(255, 255, 255, 0)",p=m.includes("rgba")?Y.getOpacity(m):1,g=s?l:p;h.addColorStop(u,Y.colorStringToRgba(m,g))}return h}};class wC{constructor(t,n,o){const s=Fe({},n,Mr);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${o}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Vt[o%Vt.length])}),this.type="line",this.sId=t,this.extent={downplay:{opacity:.3,lineWidth:1},normal:{opacity:1,lineWidth:1},highlight:{opacity:1,lineWidth:2}},this.data=[],this.beforeMouseXp=0,this.beforeMouseYp=0,this.beforeFindItemIndex=-1,this.size={comboOffset:0}}useLinearInterpolation(){return this.interpolation==="linear"||this.interpolation==="none"&&!!this.passingValue&&this.hasPassingValueInData}draw(t){var P,_,A,z,X,W,H;if(!this.show)return;const{ctx:n,chartRect:o,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h}=t,f=a==null?void 0:a.option,u=(f==null?void 0:f.use)&&(f==null?void 0:f.useSeriesOpacity),m=((P=a==null?void 0:a.selected)==null?void 0:P.dataIndex)??[];let p;if(c)p=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((_=r==null?void 0:r.option)!=null&&_.use&&((z=(A=r==null?void 0:r.selected)==null?void 0:A.seriesId)!=null&&z.length)){const U=(W=(X=r==null?void 0:r.selected)==null?void 0:X.seriesId)==null?void 0:W.includes(this.sId);p=this.extent[U?"highlight":"downplay"]}else u&&m.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const g=U=>U!=null&&U.includes("rgba")?Y.getOpacity(U):p.opacity,x=this.color,b=g(x),y=this.pointFill,M=g(y),E=this.extent.downplay?this.fillOpacity*p.opacity:this.fillOpacity,I=this.lineWidth*p.lineWidth;n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=I,n.strokeStyle=Y.colorStringToRgba(x,b),this.segments&&n.setLineDash(this.segments);const T=this.useLinearInterpolation();let V=0;const C=l.x[this.xAxisIndex],S=l.y[this.yAxisIndex];let w=o.chartWidth-(s.left+s.right);const k=o.chartHeight-(s.top+s.bottom);this.combo&&(V=w/(this.data.length||1),w-=V,this.size.comboOffset=V);const B=o.x1+s.left+V/2,D=o.y2-s.bottom,O=U=>{const j=Math.min(Math.max(U,C.graphMin),C.graphMax);return ie.calculateX(j,C.graphMin,C.graphMax,w,B)},L=U=>{const j=Math.min(Math.max(U,S.graphMin),S.graphMax);return ie.calculateY(j,S.graphMin,S.graphMax,k,D)},v=this.data.some(U=>U.o<0),N=v?L(0):o.y2-s.bottom;let R;if(this.data.forEach(U=>{let j=O(U.x),K=L(U.y);this.isExistGrp&&T&&U.o===null&&(K=L(U.b??0)),j!==null&&(j+=Y.aliasPixel(j)),U.xp=j,U.yp=K,!(T&&U.o===null)&&(pt(R==null?void 0:R.y)&&!this.isExistGrp||!T&&(pt(R==null?void 0:R.y)||pt(U.o))?n.moveTo(j,K):n.lineTo(j,K),R=U)}),n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const U=Y.colorStringToRgba(this.fillColor||x,E);if((H=this.fill)!=null&&H.gradient){let J=this.data[0].yp,te=this.data[0].y;this.data.forEach(Z=>{Z.yp&&Z.yp<=J?J=Z.yp:Z.y&&Z.y>=te&&(te=Z.y)});const G=n.createLinearGradient(0,o.y2,0,J),oe=p.opacity<1?U:x;G.addColorStop(0,v?oe:U),G.addColorStop(.5,U),G.addColorStop(1,oe),n.fillStyle=G}else n.fillStyle=U;let j=null,K=null;const q=this.data.map(J=>J==null?void 0:J.o),ee=[];for(let J=0;J<q.length+1;J++)if(T&&Pp(q[J])||!T&&pt(q[J])){if(j!==null&&K!==null){const G=q.slice(j,J).findLastIndex(oe=>!pt(oe)&&oe!==null);ee.push([j,j+G]),j=null,K=null}}else T&&q[J]===null||(j=j===null?J:j),K=J;ee.forEach(([J,te])=>{if(J===te){const G=this.data[J];n.moveTo(G.xp-I,G.yp),n.lineTo(G.xp+I,G.yp),n.lineTo(G.xp+I,L(G.b)??N),n.closePath();return}for(let G=J;G<=te;G++){const oe=this.data[G];if(G===J?n.moveTo(oe.xp,oe.yp):oe.o!==null&&n.lineTo(oe.xp,oe.yp),G===te){for(let Z=te;Z>=J;Z--){const ae=this.data[Z],me=O(ae.x);if(ae.o!==null){const re=L(ae.b)??L(0);n.lineTo(me,re)}}n.closePath()}}}),n.fill()}if(!d){n.strokeStyle=Y.colorStringToRgba(x,b);const U=Y.colorStringToRgba(y,1),j=Y.colorStringToRgba(y,M),K=this.interpolation==="linear"&&this.data.filter(q=>q.o!==null).length===1;this.data.forEach((q,ee)=>{var Z,ae;if(q.xp===null||q.yp===null||q.o===null)return;const J=(Z=this.data[ee-1])==null?void 0:Z.o,te=(ae=this.data[ee+1])==null?void 0:ae.o,G=!T&&pt(J)&&pt(te)||K,oe=m.includes(ee);(this.point||G||oe)&&(n.fillStyle=oe&&!c?U:j,ie.drawPoint(n,this.pointStyle,this.pointSize,q.xp,q.yp))})}n.restore()}itemHighlight(t,n){const o=t.data,s=n,{xp:l,yp:a,o:r}=o;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=Y.colorStringToRgba(this.color,0),s.fillStyle=Y.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),ie.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,ie.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ie.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(t,n,o,s){var h;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this.data.filter(f=>!Y.isNullOrUndefined(f.x)),d=this.useLinearInterpolation();if(c!=null&&c.length)if(typeof o=="number"&&this.show){if(r.data=c[o],r.index=o,r.data){const f=c[o];Math.abs(a-f.yp)<=15&&(r.hit=!0)}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let f=1/0,u=-1;const m=[];c.forEach((b,y)=>{b.xp!==null&&b.yp!==null&&b.o!==null&&m.push({...b,originalIndex:y})}),m.length===0&&c.forEach((b,y)=>{m.push({...b,originalIndex:y})});let p=0,g=m.length-1;for(;p<=g;){const b=Math.floor((p+g)/2),y=m[b],M=Math.abs(l-y.xp);if(M<f&&(f=M,u=y.originalIndex),y.xp<l){if(p=b+1,p<m.length){const E=Math.abs(l-m[p].xp);E<f&&(f=E,u=m[p].originalIndex)}}else if(y.xp>l){if(g=b-1,g>=0){const E=Math.abs(l-m[g].xp);E<f&&(f=E,u=m[g].originalIndex)}}else break}const x=m.findIndex(b=>b.originalIndex===u);if(x!==-1)for(let b=Math.max(0,x-2);b<=Math.min(m.length-1,x+2);b++){const y=m[b],M=Math.abs(l-y.xp);M<f&&(f=M,u=y.originalIndex)}if(u!==-1){let b=50;if(c.length>1){const M=[];for(let E=1;E<c.length;E++)c[E].xp!==null&&c[E-1].xp!==null&&M.push(Math.abs(c[E].xp-c[E-1].xp));M.length>0&&(b=M.reduce((E,I)=>E+I,0)/M.length)}const y=Math.max(b,1);if(f<=y)r.data=c[u],r.index=u;else{let M=!1,E=d?1/0:y;const I=d?m:c;for(let T=0;T<I.length;T++){const V=Math.abs(l-I[T].xp);V<=E&&(M=!0,E=V,u=d?I[T].originalIndex:T)}M&&(r.data=c[u],r.index=u)}if(r.data){const M=c[u];Math.abs(a-M.yp)<=15&&(r.hit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((h=r==null?void 0:r.data)==null?void 0:h.o)===null&&(r.data=null),r}findApproximateData(t){var u,m;const n=t[0],o=t[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(p=>!Y.isNullOrUndefined(p.x));if(!l.length)return s;const a=l.length>1?Math.abs(((u=l[1])==null?void 0:u.xp)-((m=l[0])==null?void 0:m.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,f=1/0;for(;c<=d;){const p=Math.floor((c+d)/2),g=l[p].xp;if(g-r<=n&&n<=g+r){const x=Math.max(0,p-2),b=Math.min(l.length-1,p+2);for(let y=x;y<=b;y++)if(l[y].xp!==null&&l[y].yp!==null){const M=Math.sqrt((n-l[y].xp)**2+(o-l[y].yp)**2);M<f&&(f=M,h=y)}return h!==-1&&(s.data=l[h],s.index=h,f<5&&(s.hit=!0)),s}else if(g+r<n){if(p<d&&n<l[p+1].xp){const x=Math.abs(l[p].xp-n),b=Math.abs(l[p+1].xp-n);s.data=x>b?l[p+1]:l[p],s.index=x>b?p+1:p;const y=s.data;return Math.abs(o-y.yp)<10&&(s.hit=!0),s}c=p+1}else{if(p>0&&n>l[p-1].xp){const x=Math.abs(l[p-1].xp-n),b=Math.abs(l[p].xp-n);s.data=x>b?l[p]:l[p-1],s.index=x>b?p:p-1;const y=s.data;return Math.abs(o-y.yp)<10&&(s.hit=!0),s}d=p-1}}return s}findItems({xsp:t,width:n}){const o=t+n;return this.data.filter(s=>t-1<=s.xp&&s.xp<=o+1)}}class kC{constructor(t,n,o,s=!1){const l=ys({},Mr,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${o}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Vt[o%Vt.length])}),this.sId=t,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(t,n){const o=`${t}_${n}`;if(this._colorCache.has(o))return this._colorCache.get(o);const s=Y.colorStringToRgba(t,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(o,s),s}draw(t){this.show&&(this.realTimeScatter?this.realTimeScatterDraw(t):this.defaultScatterDraw(t))}getOpacity(t,n,o){const s=n.includes("rgba")?Y.getOpacity(n):1;let l=!1;const{selectInfo:a,legendHitInfo:r,unSelectedOpacity:c}=t;return r?l=r.sId!==this.sId:a&&(l=(a==null?void 0:a.seriesID)!==this.sId||(a==null?void 0:a.dataIndex)!==o),l?c:s}calcItem(t,n){const{chartRect:o,labelOffset:s,axesSteps:l,displayOverflow:a}=n;let r;const c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex],h=o.chartWidth-(s.left+s.right),f=o.chartHeight-(s.top+s.bottom),u=o.x1+s.left,m=o.y2-s.bottom;let p=ie.calculateX(t.x,c.graphMin,c.graphMax,h,u);const g=ie.calculateY(a&&t.y>d.graphMax?d.graphMax:t.y,d.graphMin,d.graphMax,f,m);p!==null&&(r=Y.aliasPixel(p),p+=r),t.xp=p,t.yp=g}defaultScatterDraw(t){const{ctx:n,axesSteps:o,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=o.y[this.yAxisIndex];for(let c=0;c<this.data.length;c++){const d=this.data[c],h=c,f=a!==!1;let u;if(l?u=l.sId===this.sId:f?u=s.get(`${d.x}${d.y}`)===this.sId:u=!0,u&&(this.calcItem(d,t),d.xp!==null&&d.yp!==null)){const p=d.y>r.graphMax&&this.overflowColor||d.dataColor||this.color,g=this.getOpacity(t,p,h);n.strokeStyle=this.getCachedColor(p,g);const x=d.dataColor||this.pointFill,b=this.getOpacity(t,x,h);n.fillStyle=this.getCachedColor(x,b),ie.drawPoint(n,this.pointStyle,this.pointSize,d.xp,d.yp)}}}realTimeScatterDraw(t){var f,u,m,p,g,x;const{ctx:n,axesSteps:o,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=o.y[this.yAxisIndex],c=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,d=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;let h=0;for(let b=0;b<((u=(f=this.data[this.sId])==null?void 0:f.dataGroup)==null?void 0:u.length);b++)for(let y=0;y<((p=(m=this.data[this.sId])==null?void 0:m.dataGroup[b])==null?void 0:p.data.length);y++){const M=(x=(g=this.data[this.sId])==null?void 0:g.dataGroup[b])==null?void 0:x.data[y];h++;const E=a!==!1;let I;if(l?I=l.sId===this.sId:E?I=s.get(`${M.x}${M.y}`)===this.sId:I=!0,I&&(this.calcItem(M,t),M.xp!==null&&M.yp!==null)){const T=M.y>r.graphMax&&this.overflowColor,V=T||M.color||this.color,C=T||M.color||this.pointFill||this.color,S=this.getOpacity(t,V,y),w=this.getOpacity(t,C,y);n.strokeStyle=this.getCachedColor(V,S),n.fillStyle=this.getCachedColor(C,w),ie.drawPoint(n,c,d,M.xp,M.yp)}}this._rtTotalCount=h}findItemsInRange(t,n,o,s,l){return t.filter(a=>n-1<=a.xp&&a.xp<=s+1&&o-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(t,n,o,s,l){return this.findItemsInRange(t,n,o,s,l)}realTimeScatterFindItems(t,n,o,s,l){const a=[];for(let r=0;r<t[this.sId].dataGroup.length;r++){const c=t[this.sId].dataGroup[r];a.push(...this.findItemsInRange(c.data,n,o,s,l))}return a}findItems({xsp:t,ysp:n,width:o,height:s}){const l=this.data,a=t+o,r=n+s;let c=[];return this.realTimeScatter?c=this.realTimeScatterFindItems(l,t,n,a,r):c=this.defaultScatterFindItems(l,t,n,a,r),c}itemHighlight(t,n){const o=t.data,s=n,l=o.xp,a=o.yp;if(s.save(),l!==null&&a!==null){const r=o.dataColor||this.color,c=o.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),ie.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,ie.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ie.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(t){var c;const n=t[0],o=t[1],s={data:null,hit:!1,color:this.color,index:null},l=this.pointSize;if(this.realTimeScatter){const d=(c=this.data[this.sId])==null?void 0:c.dataGroup;if(!d)return s;let f=this._rtTotalCount-1;for(let u=d.length-1;u>=0;u--){const m=d[u];if(m!=null&&m.data)for(let p=m.data.length-1;p>=0;p--){const g=m.data[p];if(g.xp!==null&&g.yp!==null){const x=g.xp,b=g.yp;if(x-l<=n&&n<=x+l&&b-l<=o&&o<=b+l)return s.data=g,s.index=f,s.hit=!0,s}f--}}return s}const a=this.data,r=a.findIndex(d=>{const h=d.xp,f=d.yp;return h-l<=n&&n<=h+l&&f-l<=o&&o<=f+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class Br{constructor(t,n,o,s){const l=Fe({},n,bC);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Vt[o%Vt.length]),this.type="bar",this.sId=t,this.data=[],this.isHorizontal=s,this.size={cat:0,bar:0,cPad:0,bPad:0,w:0,h:0,ix:0}}draw(t){var z,X,W,H,U;if(!this.show)return;const{isHorizontal:n,showValue:o}=this,s=t.ctx,l=t.chartRect,a=t.labelOffset,r=t.axesSteps,c=t.showIndex,d=t.thickness,h=t.showSeriesCount;let f,u;const m=r.x[this.xAxisIndex],p=r.y[this.yAxisIndex];let g=this.data.length;const[x,b]=n?[p.minIndex,p.maxIndex]:[m.minIndex,m.maxIndex];ve(x)&&ve(b)&&(g=b-x+1);const y=l.chartWidth-(a.left+a.right),M=l.chartHeight-(a.top+a.bottom),E=l.x1+a.left,I=l.y2-a.bottom,T=ie.calculateX(0,m.graphMin,m.graphMax,y),V=ie.calculateY(0,p.graphMin,p.graphMax,M),C=n?E+T:E,S=n?I:I+V,w=n?M:y,k=w/(g||1);let B;t.cPadRatio>=1||t.cPadRatio<=0?B=2:B=Math.max(w*(t.cPadRatio/2)/g,2);let O,L,v;O=k>B*2?k-B*2:k,O=this.isExistGrp?O:O/h;const N=this.calculateBarSize(d,O);L=n?null:N,v=n?N:null;const R=n?(O-v)/2:(O-L)/2,P=this.isExistGrp?1:c+1;this.size.cat=k,this.size.bar=O,this.size.cPad=B,this.size.bPad=R,this.size.w=L,this.size.h=v,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=t.borderRadius,this.filteredCount=g;const _=ve(x)?x:0,A=ve(b)?b:this.data.length-1;this.visibleStartIndex=_;for(let j=_;j<=A;j++){const K=j-_,q=this.data[j];if(q){const ee=n?S-k*K-B:C+k*K+B;if(n?(f=C,u=Math.round(ee-(O*P-(v+R)))):(f=Math.round(ee+(O*P-(L+R))),u=S),n){const fe=q.b?q.o:q.x,ke=Math.min(Math.max(fe,m.graphMin),m.graphMax);if(L=ie.calculateX(ke,m.graphMin,m.graphMax,y,-T),q.b){const ct=Math.min(Math.max(q.b,m.graphMin),m.graphMax);f=ie.calculateX(ct,m.graphMin,m.graphMax,y,C-T)}const rt=fe>0?-1:1;L=fe&&Math.abs(L)===0?rt:L}else{const fe=q.b?q.o:q.y,ke=Math.min(Math.max(fe,p.graphMin),p.graphMax);if(v=ie.calculateY(ke,p.graphMin,p.graphMax,M,-V),q.b){const ct=Math.min(Math.max(q.b,p.graphMin),p.graphMax);u=ie.calculateY(ct,p.graphMin,p.graphMax,M,S-V)}const rt=fe>0?-1:1;v=fe&&Math.abs(v)===0?rt:v}const J=q.dataColor||this.color,te=t==null?void 0:t.legendHitInfo,G=(z=t==null?void 0:t.selectLabel)==null?void 0:z.option,oe=(X=t==null?void 0:t.selectItem)==null?void 0:X.option,Z=((H=(W=t==null?void 0:t.selectLabel)==null?void 0:W.selected)==null?void 0:H.dataIndex)??[],{dataIndex:ae,seriesID:me}=((U=t==null?void 0:t.selectItem)==null?void 0:U.selected)??{};let re=!1;if(te?re=(te==null?void 0:te.sId)!==this.sId:G!=null&&G.use&&(G!=null&&G.useSeriesOpacity)?re=Z.length&&!Z.includes(j):ut(ae)&&(oe!=null&&oe.useSeriesOpacity)&&(this.isExistGrp?re=ae!==j:re=ae!==j||me!==this.sId),typeof J!="string")s.fillStyle=ie.createGradient(s,n,{x:f,y:u,w:L,h:v},J,re,t.unSelectedOpacity);else{const fe=J.includes("rgba")?Y.getOpacity(J):1,ke=re?t.unSelectedOpacity:fe;s.fillStyle=Y.colorStringToRgba(J,ke)}this.drawBar({ctx:s,positions:{x:f,y:u,w:L,h:v}}),o.use&&this.drawValueLabels({context:s,data:q,positions:{x:f,y:u,h:v,w:L},isHighlight:!1,textColor:q.dataTextColor,index:j}),q.xp=f,q.yp=u,q.w=L,q.h=n?-v:v,q.index=j}}}itemHighlight(t,n,o,s){const l=this.showValue,a=t.data,r=n,c=a.xp,d=a.yp,h=a.w,f=a.h;r.save(),r.shadowOffsetX=0,r.shadowOffsetY=0,r.shadowBlur=4;const u=t.data.dataColor||this.color;if(typeof u!="string"){const m=ie.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:f},u,!1,s);r.fillStyle=m,r.shadowColor=u[u.length-1][1]}else r.fillStyle=u,r.shadowColor=u;r.beginPath(),this.drawBar({ctx:r,positions:{x:c,y:d,w:h,h:this.isHorizontal?-f:f}}),l.use&&this.drawValueLabels({context:r,data:a,positions:{x:c,y:d,h:f,w:h},isHighlight:!0,textColor:t.data.dataTextColor||t.dataTextColor,index:o}),r.restore()}findGraphData(t,n,o,s){if(typeof o=="number"&&this.show&&s){const l=this.data,a={data:null,hit:!1,color:this.color},r=this.visibleStartIndex??0,c=r+(this.filteredCount??l.length)-1,d=Math.max(r,Math.min(o,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(t,l[d])),a}return n?this.findGraphRangeCount(t):this.findGraphRange(t)}binarySearchBar(t,n){const[o,s]=t,l={data:null,hit:!1,color:this.color},a=this.data,r=this.visibleStartIndex??0,c=this.filteredCount??a.length;let d=r,h=r+c-1;for(;d<=h;){const f=Math.floor((d+h)/2),u=a[f],{xp:m,yp:p,w:g,h:x}=u,b=m+g,y=p+x;if(n?y<=s&&s<=p:m<=o&&o<=b)return l.data=u,l.index=u.index,l.hit=this.isPointInBar(t,u),l;(n?!(y<s):m+4<o)?d=f+1:h=f-1}return l}findGraphRange(t){return this.binarySearchBar(t,!1)}findGraphRangeCount(t){return this.binarySearchBar(t,!0)}drawValueLabels({context:t,data:n,positions:o,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:f,decimalPoint:u}=this.showValue,{x:m,y:p,w:g,h:x}=o,b=t;b.save(),b.beginPath(),b.font=`normal normal normal ${c}px Roboto`,b.fillStyle=l||d,b.lineWidth=1,b.textBaseline="middle",b.textAlign=r&&h!=="center"?"left":"center";let y;const M=ut(this.stackIndex);M?y=n.o:y=(r?n.x:n.y)??"";let E;f&&(E=f(y,{label:r?n.y:n.x,index:a})),(!f||typeof E!="string")&&(E=Y.labelSignFormat(y,u)??"");const I=y<0,T=Math.round(b.measureText(E).width),V=c,C=10,S=I?m-C:m+C,w=I?p+C:p-C,k=m+g/2,B=s?p+x/2:p-x/2,D=Math.abs(g)-C,O=Math.abs(x)-C;switch(h){case"start":{if(r&&T<D){const L=I?S-T:S;b.fillText(E,L,B)}else if(!r&&V<O){const L=I?p+C:p-C;b.fillText(E,k,L)}break}case"center":{r&&T<D?b.fillText(E,k,B):!r&&V<O&&b.fillText(E,k,p+x/2);break}case"out":{if(M){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const L=this.chartRect.x1+this.labelOffset.left,v=this.chartRect.x2-this.labelOffset.right;if(I){const N=m-C+g-T;N>L&&b.fillText(E,N,B)}else{const N=m+C+g;N+T<v&&b.fillText(E,N,B)}}else{const L=I?p+x+C:p+x-C;b.fillText(E,k,L)}break}default:case"end":{if(r&&T<D){const L=I?m+g+C:m+g-T-C;b.fillText(E,L,B)}else if(!r){if(I){const L=p+x-C;L>w&&b.fillText(E,k,L)}else if(V<O){const L=p+x+C;b.fillText(E,k,L)}}break}}b.restore()}calculateBarSize(t,n){return typeof t=="string"&&/[0-9]+px/.test(t)?Math.min(n,Number(t.replace("px",""))):typeof t=="number"&&t<=1&&t>=0?Math.ceil(n*t):n}drawBar({ctx:t,positions:n}){const{isHorizontal:o,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=o?-n.h:n.h;if(!(d===0||h===0)){if(t.save(),a&&!l)try{this.drawRoundedRect(t,n)}catch{t.fillRect(r,c,d,h)}else t.fillRect(r,c,d,h);t.restore()}}isPointInBar(t,n){const[o,s]=t,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=o&&o<=d&&h<=s&&s<=a}drawRoundedRect(t,n){const{chartRect:o,labelOffset:s,isHorizontal:l,borderRadius:a}=this,{x:r,y:c}=n;let{w:d,h}=n,f=a;const u=new Path2D;u.rect(o.x1+s.left,o.y1,o.chartWidth-s.right,o.chartHeight-s.bottom),t.clip(u),t.beginPath(),t.moveTo(r,c),Math.abs(d)<f*2&&(f=Math.abs(d)/2),Math.abs(h)<f*2&&(f=Math.abs(h)/2),l?d<0?(d+=f,t.lineTo(r+d,c),t.arcTo(r+d-f,c,r+d-f,c-f,f),t.arcTo(r+d-f,c-h,r+d,c-h,f),t.lineTo(r,c-h),t.lineTo(r,c)):(d-=f,t.lineTo(r+d,c),t.arcTo(r+d+f,c,r+d+f,c-f,f),t.arcTo(r+d+f,c-h,r+d,c-h,f),t.lineTo(r,c-h),t.lineTo(r,c)):h>0?(h-=f,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h+f,r-d+f,c+h+f,f),t.arcTo(r,c+h+f,r,c+h,f),t.lineTo(r,c)):(h+=f,t.lineTo(r+d,c),t.lineTo(r+d,c+h),t.arcTo(r+d,c+h-f,r+d-f,c+h-f,f),t.arcTo(r,c+h-f,r,c+h,f),t.lineTo(r,c)),t.fill(),t.closePath()}}class MC extends Br{draw(t){if(!this.show)return;const n=t.ctx,o=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.isHorizontal,c=t.thickness,d=t.showSeriesCount;let h,f;const u=l.x[this.xAxisIndex],m=l.y[this.yAxisIndex],p=o.chartWidth-(s.left+s.right),g=o.chartHeight-(s.top+s.bottom),x=o.x1+s.left,b=o.y2-s.bottom,y=o.x2-s.right,E=(r?g:p)/(this.data.length||1),I=2;let T;this.isExistGrp?T=E-I*2:T=(E-I*2)/d;const C=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(T,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(T*c):T;let S=r?null:C,w=r?null:C,k=r?C:null;const B=r?(T-k)/2:(T-S)/2,D=this.isExistGrp?1:a+1;this.size.cat=E,this.size.bar=T,this.size.cPad=I,this.size.bPad=B,this.size.w=S,this.size.ix=D,this.chartRect=o,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((O,L)=>{if(n.beginPath(),r?(h=x,f=ie.calculateY(O.y,m.graphMin,m.graphMax,g,b)):(h=ie.calculateSubX(O.x,u.graphMin,u.graphMax,p,x),h<x?(w-=x-h,h=h+S<x?null:x):h+S>y&&(w-=w-(y-h)),h>=y&&(h=null),h!==null&&(h+=Math.ceil(T*D)-Math.round(S+B)),f=b),r?O.b?(S=ie.calculateX(O.x-O.b,u.graphMin,u.graphMax,p),h=ie.calculateX(O.b,u.graphMin,u.graphMax,p,x)):S=ie.calculateX(O.x,u.graphMin,u.graphMax,p):O.b?(k=ie.calculateY(O.y-O.b,m.graphMin,m.graphMax,g),f=ie.calculateY(O.b,m.graphMin,m.graphMax,g,b)):k=ie.calculateY(O.y,m.graphMin,m.graphMax,g),h!==null&&f!==null){const v=O.dataColor||this.color,N=v.includes("rgba")?Y.getOpacity(v):1,R=this.state==="downplay"?t.unSelectedOpacity:N;typeof v!="string"?(S=S!==w?w:S,n.fillStyle=ie.createGradient(n,r,{x:h,y:f,w:S,h:k},v,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=Y.colorStringToRgba(v,R),this.drawBar({ctx:n,positions:{x:h,y:f,w:S,h:k}}),this.showValue.use&&this.drawValueLabels({context:n,data:O,positions:{x:h,y:f,h:k,w:S},isHighlight:!1,index:L})}w=S,O.xp=h,O.yp=f,O.w=S,O.h=r?-k:k})}}class IC{constructor(t,n,o){const s=ys({},CC,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Vt[o%Vt.length]),this.sId=t,this.show=!0,this.data=[],this.type="pie",this.centerX=0,this.centerY=0,this.radius=0,this.doughnutHoleSize=0,this.startAngle=0,this.endAngle=0,this.ctx=null,this.isSelect=!1}draw(t,n,o){var h;const s=t??this.ctx,l=new Path2D,a=this.isSelect?this.radius+5:this.radius,r=this.color,c=r.includes("rgba")?Y.getOpacity(r):1,d=this.isDownplay?o:c;s.beginPath(),l.moveTo(this.centerX,this.centerY),l.arc(this.centerX,this.centerY,a,this.startAngle,this.endAngle),l.lineTo(this.centerX,this.centerY),s.fillStyle=Y.colorStringToRgba(r,d),s.fill(l),n.use&&(s.lineCap="round",s.lineWidth=n==null?void 0:n.lineWidth,s.strokeStyle=n==null?void 0:n.color,s.stroke(l)),(h=this.showValue)!=null&&h.use&&this.drawValueLabels(s),s.closePath(),this.ctx=s}findGraphData([t,n]){const o={data:null,hit:!1,color:null,index:-1},{radius:s,startAngle:l,endAngle:a,centerX:r,centerY:c}=this,d=Math.sqrt((t-r)**2+(n-c)**2),h=2.5*Math.PI-Math.atan2(t-r,n-c),f=s>d&&h>=l&&h<=a;return this.show&&f&&(o.type=this.type,o.data=this.data,o.hit=!0,o.color=this.color,o.index=0),o}itemHighlight(t,n){var a,r;const o=n,s=this.isSelect?this.radius+5:this.radius;o.save(),o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=4;const l=((a=t==null?void 0:t.data)==null?void 0:a.dataColor)||this.color;o.fillStyle=l,o.shadowColor=l,o.beginPath(),o.moveTo(this.centerX,this.centerY),o.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),o.lineTo(this.centerX,this.centerY),o.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(o),o.closePath(),o.restore()}drawValueLabels(t){const n=t,o=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:o,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=Y.labelSignFormat(o));const c=1.8,d=this.radius-this.doughnutHoleSize,h=(this.endAngle-this.startAngle)*180/Math.PI,f=s+4,u=Math.round(n.measureText(r).width);if(h>=u*c&&h>=f*c&&d>=u*c&&d>=f*c){n.save(),n.beginPath();const m=l.includes("rgba")?Y.getOpacity(l):1,p=this.state==="downplay"?this.unSelectedOpacity:m;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=Y.colorStringToRgba(l,p),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const g=d/2+this.doughnutHoleSize,x=(this.endAngle-this.startAngle)/2+this.startAngle,b=g*Math.cos(x)+this.centerX,y=g*Math.sin(x)+this.centerY;n.fillText(r,b,y),n.restore()}}}class EC{constructor(t,n,o,s,l){const a=ys({},SC,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(o),this.sId=t,this.data=[],this.labels={x:[],y:[]},this.valueOpt={},this.size={w:0,h:0},this.type="heatMap",this.currentLabelInfo={x:{steps:0,min:0,max:0},y:{steps:0,min:0,max:0}}}createColorState(t){const n=[],o=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=t,h=s.includes("#")?Y.hexToRgb(s):s.replace(o,""),f=l.includes("#")?Y.hexToRgb(l):l.replace(o,""),[u,m,p]=h.split(","),[g,x,b]=f.split(",");if(this.isGradient)n.push({minColor:{minR:u,minG:m,minB:p},maxColor:{maxR:g,maxG:x,maxB:b},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:y,label:M},E)=>{n.push({id:`color#${E}`,color:y,label:M,state:"normal",show:!0})});else{const y=Math.floor((u-g)/(a-1)),M=Math.floor((m-x)/(a-1)),E=Math.floor((p-b)/(a-1));for(let I=0;I<a;I++){const T=+u-y*I,V=+m-M*I,C=+p-E*I;n.push({id:`color#${I}`,color:`rgb(${T},${V},${C})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(t){const{minColor:n,maxColor:o}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=o,h=+s-Math.floor((s-r)*t/100),f=+l-Math.floor((l-c)*t/100),u=+a-Math.floor((a-d)*t/100);return`rgb(${h},${f},${u})`}getColorIndexByValue(t){const{existError:n,min:o,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&t<0)return a;const r=Math.floor(+(t-o).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(t){const{min:n,max:o}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=We(t-n,o-n),{start:a,end:r,selectedValue:c}=this.colorState[0];(t<0||a<=l&&l<=r)&&(s.show=!0,s.isHighlight=c!==null&&Math.floor(t)===Math.floor(n+(o-n)*(c/100)),s.dataColor=t<0?this.errorColor:this.getColorForGradient(l))}else{const l=this.getColorIndexByValue(t),{show:a,state:r,color:c,id:d}=this.colorState[l];s.show=a,s.opacity=r==="downplay"?.1:1,s.dataColor=t<0?this.errorColor:c,s.id=d}return s}drawItem(t,n,o,s,l,a){if(t.beginPath(),!(s<0||l<0)){if(a.show){const{radius:r}=a;if(r>0){const c=Math.min(s,l);let d=r;d>c/2&&(d=Math.floor(c/2)),t.moveTo(n+d,o),t.arcTo(n+s,o,n+s,o+l,d),t.arcTo(n+s,o+l,n,o+l,d),t.arcTo(n,o+l,n,o,d),t.arcTo(n,o,n+s,o,d),t.stroke(),t.fill()}else t.strokeRect(n,o,s,l),t.fillRect(n,o,s,l)}else{const r=Y.aliasPixel(1);t.fillRect(n,o-r,s+r,l+r)}t.closePath()}}calculateXY(t,n,o,s){let l=null;if(this.labels[t]&&this.labels[t].length){let a=this.labels[t].findIndex(u=>u===n);a===-1&&(a=this.labels[t].findIndex(u=>+u==+n));const{minIndex:r,maxIndex:c,graphMin:d,graphMax:h}=s;if(ve(c)&&a>c||ve(r)&&a<r||Gi(r)&&Gi(c)&&(n<d||n>h))return null;const f=r??this.labels[t].findIndex(u=>+u==+d);a>-1&&(a-=f>-1?f:0,l=t==="x"?o+this.size.w*a:o-this.size.h*(a+1))}return l}draw(t){if(!this.show)return;const{ctx:n,chartRect:o,labelOffset:s,overlayCtx:l,selectLabel:a,legendHitInfo:r,selectItem:c,axesSteps:d}=t,h=o.chartWidth-(s.left+s.right),f=o.chartHeight-(s.top+s.bottom),u=o.x1+s.left,m=o.y2-s.bottom,p=d.x[this.xAxisIndex],g=d.y[this.yAxisIndex];this.size.w=h/p.oriSteps,this.size.h=f/g.oriSteps,this.currentLabelInfo={x:{steps:p.oriSteps,min:p.graphMin,max:p.graphMax},y:{steps:g.oriSteps,min:g.graphMin,max:g.graphMax}};const x=(b,y,M)=>{var E,I;if(!r){let T;const{option:V,selected:C}=c,{option:S,selected:w}=a,k=ut(C==null?void 0:C.dataIndex)&&(C==null?void 0:C.dataIndex)>-1,B=((E=w==null?void 0:w.label)==null?void 0:E.length)>0;return k?T=V.useSeriesOpacity?M!==(C==null?void 0:C.dataIndex):!1:B&&(T=S.useSeriesOpacity?!((I=w==null?void 0:w.label)!=null&&I.includes(this.getItemLabel(a,b))):!1),T?.1:y}return y};this.data.forEach((b,y)=>{var S;let E=this.calculateXY("x",b.x,u,p),I=this.calculateXY("y",b.y,m,g),T=this.size.w,V=this.size.h;const C=b.o;if(E!==null&&I!==null&&C!==null&&C!==void 0){const{show:w,opacity:k,dataColor:B,id:D,isHighlight:O}=this.getItemInfo(C);let L=k;k===1&&Y.getColorStringType(b.dataColor)==="RGBA"&&(L=Y.getOpacity(b.dataColor));const v=x(b,L,y);if(b.dataColor||(b.dataColor=B),b.cId=D,n.save(),w){n.fillStyle=Y.colorStringToRgba(b.dataColor,v);let N=this.stroke;const R=c==null?void 0:c.option,P=(R==null?void 0:R.use)&&(R==null?void 0:R.showBorder),_=y===((S=c==null?void 0:c.selected)==null?void 0:S.dataIndex);P&&_&&(N={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let A=!1;if(N.show&&N.lineWidth>0){const{color:z,lineWidth:X,opacity:W}=N,H=X*2;A=H<Math.floor(T)&&H<Math.floor(V),n.strokeStyle=A?Y.colorStringToRgba(z,v===1?W:v):void 0,A?(n.lineWidth=X,E+=X,I+=X,T-=H,V-=H):n.lineWidth=0}E+=1,b.xp=E,b.yp=I,b.w=T,b.h=V,this.drawItem(n,E,I,T,V,{...N,show:A}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:b}),O&&this.itemHighlight({data:b},l)}}})}drawValueLabels({context:t,data:n}){const{fontSize:o,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:f,o:u}=n,m=t;m.save(),m.beginPath(),m.font=`normal normal normal ${o}px Roboto`,m.fillStyle=s,m.lineWidth=1,m.textBaseline="middle",m.textAlign=l!=="center"?"left":"center";let p;a&&(p=a(u)),(!a||typeof p!="string")&&(p=Y.labelSignFormat(u,r));const g=Math.round(m.measureText(p).width),x=o,b=c+h/2,y=d+f/2;if(!(g>=h||x>=f||p<0)){switch(l){case"top":{const M=b-g/2,E=y-x/2;m.fillText(p,M,E);break}case"right":{const M=c+h-g;m.fillText(p,M,y);break}case"bottom":{const M=b-g/2,E=y+x/2;m.fillText(p,M,E);break}case"left":m.fillText(p,c,y);break;default:{const M=b-g/2;m.fillText(p,M,y);break}}m.restore()}}getAdjustedBounds({xp:t,yp:n,width:o,height:s}){const a=Math.max(0,o),r=Math.max(0,s);return{xsp:Math.floor(t*100)/100,xep:Math.ceil((t+a)*100)/100,ysp:Math.floor(n*100)/100,yep:Math.ceil((n+r)*100)/100}}findItems(t){const n=this.data,{xsp:o,xep:s,ysp:l,yep:a}=this.getAdjustedBounds({xp:t.xsp,yp:t.ysp,width:t.width,height:t.height});return n.filter(({xp:r,yp:c,w:d,h})=>{const{xsp:f,xep:u,ysp:m,yep:p}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return f>=o&&u<=s&&m>=l&&p<=a})}itemHighlight(t,n){var g;const o=t.data,s=n,{stroke:l,shadow:a}=this.highlight,r=o.xp,c=o.yp,d=o.w,h=o.h,f=o.cId;let u;if(this.isGradient){const{min:x,max:b}=this.valueOpt,y=We(o.o-x,b-x),{start:M,end:E}=this.colorState[0];u=M<=y&&y<=E||o.o===-1}else u=(g=this.colorState.find(({id:x})=>x===f))==null?void 0:g.show;if(r===null||c===null||!u)return;s.save();const m=Y.getColorStringType(o.dataColor)==="RGBA"?t.dataColor:Y.colorStringToRgba(o.dataColor,1);s.fillStyle=m,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const p={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:x,width:b,radius:y}=l;p.show=!0,p.radius=y,s.lineWidth=b,p.lineWidth=b,s.strokeStyle=x||m,p.color=x||m}else p.show=!1,s.strokeStyle=m,p.color=m;this.drawItem(s,r-.5,c-.5,d+1,h+1,p),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:o})}findGraphData(t){const n=t[0],o=t[1],s={data:null,hit:!1,color:null,dataColor:null,name:null},l=this.data,a=l.findIndex(r=>{const{xp:c,yp:d,w:h,h:f}=r;return c<=n&&n<=c+h&&d<=o&&o<=d+f});if(a>-1){const r=l[a];s.data=r,s.color=r.dataColor,s.dataColor=r.dataColor,s.index=a,s.hit=!0}return s}findBlockRange({xcp:t,xep:n,ycp:o,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(t,n),ysp:Math.min(o,s),width:Math.ceil(Math.abs(n-t)),height:Math.ceil(Math.abs(s-o))};if(a.x.length&&a.y.length){const d=this.currentLabelInfo.x.steps||a.x.length,h=this.currentLabelInfo.y.steps||a.y.length,{x1:f,x2:u,y1:m,y2:p}=l,g=(u-f)/d,x=(p-m)/h,b={xsp:t,xep:n,ysp:o,yep:s},y=(M,E,I)=>{let T,V,C;M==="x"?(V=g,C=f+r):(V=x,C=m),a[M].findIndex((w,k)=>(T=C+V*k,T<=E&&E<=T+V))>-1?b[I]=["xsp","ysp"].includes(I)?T:T+V:E<C&&(b[I]=C)};y("x",Math.min(t,n),"xsp"),y("x",Math.max(t,n),"xep"),y("y",Math.min(o,s),"ysp"),y("y",Math.max(o,s),"yep"),c.xsp=Math.min(b.xsp,b.xep),c.ysp=Math.min(b.ysp,b.yep),c.width=Math.abs(b.xep-b.xsp),c.height=Math.abs(b.yep-b.ysp)}return c}getFilteredLabel(t,n,o,s){return t.length!==n?t.filter(l=>o<=l&&l<=s):t}findSelectionRange(t){const{xsp:n,ysp:o,width:s,height:l,range:a}=t;let r=null;const{x1:c,x2:d,y1:h,y2:f}=a,{x:u,y:m}=this.labels;if(u.length&&m.length){const{x:{steps:p,min:g,max:x},y:{steps:b,min:y,max:M}}=this.currentLabelInfo,E=p||u.length,I=b||m.length,T=(d-c)/E,V=(f-h)/I,C=n+s,S=o+l,w={min:Math.floor((n-c)/T),max:Math.floor((C-c-T)/T)},k=I-1,B={min:k-Math.round((S-h-V)/V),max:k-Math.round((o-h)/V)},D=this.getFilteredLabel(u,E,g,x),O=this.getFilteredLabel(m,I,y,M);r={xMin:D[w.min],xMax:D[w.max],yMin:O[B.min],yMax:O[B.max]}}return r}getItemLabel(t,n){const{option:o,selected:s}=t;let l=this.isHorizontal?n.y:n.x;return o!=null&&o.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const Dr={Store:yC,Series:{createSeriesSet(e,t,n,o){let s=Object.keys(e);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(e,t,o)),s.forEach((l,a)=>{const r=e[l].type||t;this.seriesList[l]=this.addSeries({type:r,id:l,opt:e[l],index:a,isHorizontal:n})})},getOverlappingSeriesKeys(e,t,n){const o=[],s=[],l=n.flat();return Object.keys(e).forEach(a=>{if((e[a].type||t)==="bar"&&l.length){const d=l.findIndex(h=>h===a);o.push({key:a,overlappingIdx:d})}else s.push({key:a})}),o.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...o,...s].map(({key:a})=>a)},addSeries(e){var a;const{type:t,id:n,opt:o,index:s,isHorizontal:l}=e;if(t==="line")return this.seriesInfo.charts.line.push(n),new wC(n,o,s);if(t==="scatter")return this.seriesInfo.charts.scatter.push(n),new kC(n,o,s,(a=this.options.realTimeScatter)==null?void 0:a.use);if(t==="bar")return this.seriesInfo.charts.bar.push(n),o.timeMode?new MC(n,o,s,l):new Br(n,o,s,l);if(t==="pie")return this.seriesInfo.charts.pie.push(n),new IC(n,o,s);if(t==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:r,legend:c}=this.options,d=c.type==="gradient";return new EC(n,o,r,l,d)}return!1},addGroupInfo(e){e.forEach((t,n)=>{let o=0;t.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+o,r.groupIndex=n,r.isExistGrp=!0,r.bsId=s,r.bsIds=t.filter((c,d)=>c!==l&&a>d),r.isOverlapping=this.options.overlapping.use,r.show||o--,r.show?l:s},t[0])})}}};class oo{constructor(t,n,o,s){const l=Fe({},n,Ir);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=o,this.units=xC[this.type],this.options=s,this.position||(this.position=t==="x"?"bottom":"left")}calculateLabelRange(t,n,o,s){let l,a,r;t==="x"?(l=n.chartWidth,r=Math.floor(s*1.1),a=[o.left,o.right]):(l=n.chartHeight,a=[o.top,o.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r)-1,1);return{min:d,max:h}}calculateScaleRange(t,n){var d;let o,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(o=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(o=a[1],s=a[0]):typeof a=="function"?[s,o]=a(t.min,t.max):(o=t.max,s=t.min),this.autoScaleRatio&&(o=Math.ceil(o*(this.autoScaleRatio+1))),this.startToZero&&(s=0),o===s&&(o+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(o,{isMaxValueSameAsMin:l});return{min:s,max:o,minLabel:r,maxLabel:c,size:Y.calcTextSizeCanvas(c,Y.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n){return(t??[]).reduce((o,s)=>{var r;const l=this.getLabelFormat(s),a=((r=Y.calcTextSizeCanvas(l,Y.getLabelStyle(this.labelStyle)))==null?void 0:r.width)??0;return Math.max(o,a)},0)}calculateSteps(t){const{maxValue:n,minValue:o}=t;let{maxSteps:s}=t,l=this.getInterval(t),a=o,r;for(;a<n;)a+=l;const c=a,d=o,h=c-d;if(r=Math.round(h/l),n===1&&(this.decimalPoint?s>2?(l=.2,r=5,s=5):(l=.5,r=2,s=2):(l=1,r=1,s=1)),this.fixedSteps)return{steps:r,interval:l,graphMin:d,graphMax:c};for(;r>s;)l*=2,r=Math.round(h/l),l=Math.ceil(h/r);return c-d>r*l&&(l=Math.ceil((c-d)/r)),{steps:r,interval:l,graphMin:d,graphMax:c}}drawAxisTitle(t,n){const o=this.title;if(!(o!=null&&o.use)||isNaN(o.fontSize))return;const s=this.ctx;s.save(),s.font=Y.getLabelStyle(o),s.fillStyle=o.color,s.textAlign=o.textAlign;const l={xLeft:t.x1+n.left,xRight:t.x2-n.right,yTop:t.y1};let a,r;const c=10;this.type==="x"?(a=l.xRight,r=t.y2+o.fontSize+c):(r=l.yTop-o.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(o.text,a,r),s.restore()}draw(t,n,o,s,l,a){var E,I,T,V,C,S,w,k,B,D,O,L,v,N,R,P,_,A,z,X;const r=this.ctx,c=this.options,d={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},h=o.steps,f=o.graphMin,u=o.graphMax,m=o.interval,p=d[this.units.rectStart],g=d[this.units.rectEnd],x=d[this.units.rectOffset(this.position)],b=d[this.units.rectOffsetCounter(this.position)],y=5;let M;if(this.drawAxisTitle(t,n),r.font=Y.getLabelStyle(this.labelStyle),r.fillStyle=this.labelStyle.color,this.type==="x"?(r.textAlign="center",r.textBaseline=this.position==="top"?"bottom":"top"):(r.textAlign=this.position==="left"?"right":"left",r.textBaseline="middle"),this.showAxis&&(r.lineWidth=this.axisLineWidth,M=Y.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(p,x+M),r.lineTo(g,x+M)):(r.moveTo(x+M,p),r.lineTo(x+M,g)),r.stroke(),r.closePath()),!(h===0||f===null)){if((E=this.labelStyle)!=null&&E.show){const W=g-p,H=W/h,U=[],j=o.interval;let K=null,q=null,ee=p,J=f;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const G=Math.floor(f/j)*j;G!==+f&&(J=G+j,ee+=W/(u-f)*(J-f))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,M=Y.aliasPixel(r.lineWidth);let te;for(let G=0;G<=h;G++)if(K=Math.round(ee+H*G),K<=g||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),U[G]=J+G*m,U[G]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,q=K+M,te=this.getLabelFormat(Math.min(u,U[G]),{prev:U[G-1]??""});const Z=((T=(I=this.options)==null?void 0:I.selectLabel)==null?void 0:T.use)&&((C=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:C.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((S=l==null?void 0:l.dataIndex)==null?void 0:S.length)&&!(l!=null&&l.label.map(fe=>this.getLabelFormat(Math.min(u,fe),{prev:U[G-1]??""})).includes(te));let ae;G===h&&this.lastLabelFontStyle?(r.font=Y.getLabelStyle(this.lastLabelFontStyle),ae=this.lastLabelFontStyle.color):(r.font=Y.getLabelStyle(this.labelStyle),ae=this.labelStyle.color);let me=1;Y.getColorStringType(ae)==="RGBA"&&(me=Y.getOpacity(ae)),r.fillStyle=Y.colorStringToRgba(ae,Z?(w=this.options)==null?void 0:w.unSelectedOpacity:me);let re;if(this.type==="x"){if(re=this.position==="top"?x-10:x+10,((k=c==null?void 0:c.brush)!=null&&k.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),K,re),!Z&&((B=c==null?void 0:c.selectItem)!=null&&B.showLabelTip)&&(s!=null&&s.label)&&!((D=this.options)!=null&&D.horizontal)){const fe=this.getLabelFormat(Math.min(u,s.label+0*m));if(fe===te){const ke=Math.round(r.measureText((O=this.labelStyle)==null?void 0:O.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(fe).width)+10,height:ke,x:K,y:re+(ke-2),borderRadius:2,arrowSize:3,text:te,backgroundColor:(v=(L=c==null?void 0:c.selectItem)==null?void 0:L.labelTipStyle)==null?void 0:v.backgroundColor,textColor:(R=(N=c==null?void 0:c.selectItem)==null?void 0:N.labelTipStyle)==null?void 0:R.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(q,x),r.lineTo(q,x+y),r.stroke(),r.closePath()),(G!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(q,x),r.lineTo(q,b),r.stroke(),r.closePath())}else re=this.position==="left"?x-10:x+10,((P=c==null?void 0:c.brush)!=null&&P.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),re,K),G===h&&(q-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(x+(this.axisLineWidth??1),q),r.lineTo(x-y,q),r.stroke(),r.closePath()),G!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(x,q),r.lineTo(b,q),r.stroke(),r.closePath())}}if((_=this.plotBands)!=null&&_.length||(A=this.plotLines)!=null&&A.length){const W=t.chartWidth-(n.left+n.right),H=t.chartHeight-(n.top+n.bottom),U=M+1,j=d.x1,K=d.x2+U,q=d.y1-U,ee=d.y2;(z=this.plotBands)==null||z.forEach(J=>{const te=Fe({},J,Tr),{from:G,to:oe,label:Z}=te,ae=Y.isNullOrUndefined(G)?f:Math.max(G,f),me=Y.isNullOrUndefined(oe)?u:Math.min(oe,u);this.setPlotBandStyle(te);let re,fe;if(this.type==="x"){if(re=ie.calculateX(ae,f,u,W,j),fe=ie.calculateX(me,f,u,W,j),re===null||fe===null)return;this.drawXPlotBand(re,fe,j,K,q,ee)}else{if(re=ie.calculateY(ae,f,u,H,ee),fe=ie.calculateY(me,f,u,H,ee),re===null||fe===null)return;this.drawYPlotBand(re,fe,j,K,q,ee)}if(Z.show){const ke=this.getNormalizedLabelOptions(t,Z),rt=this.getPlotBandLabelPosition(re,fe,ke,K,q);this.drawPlotLabel(ke,rt)}r.restore()}),(X=this.plotLines)==null||X.forEach(J=>{if(typeof+J.value!="number")return;const te=Fe({},J,vr),{value:G,label:oe}=te;let Z;if(this.type==="x"){if(Z=ie.calculateX(G,f,u,W,j),Z===null)return;this.setPlotLineStyle(te),this.drawXPlotLine(Z,j,K,q,ee)}else{if(Z=ie.calculateY(G,f,u,H,ee),Z===null)return;this.setPlotLineStyle(te),this.drawYPlotLine(Z,j,K,q,ee)}if(oe.show){const ae=this.getNormalizedLabelOptions(t,oe),me=this.getPlotLineLabelPosition(Z,ae,K,q);this.drawPlotLabel(ae,me)}r.restore()})}}}setPlotLineStyle(t){const n=this.ctx,{color:o,lineWidth:s}=t;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=o,t.segments&&n.setLineDash(t.segments)}setPlotBandStyle(t){const n=this.ctx,{color:o}=t;n.beginPath(),n.save(),n.fillStyle=o}drawXPlotBand(t,n,o,s,l,a){const r=this.ctx,c=d=>d||d>o||d<s;if(!c(t)||!c(n)){r.closePath(),r.restore();return}r.moveTo(t,l),r.lineTo(t,a),r.lineTo(n,a),r.lineTo(n,l),r.lineTo(t,l),r.stroke(),r.fill(),r.restore(),r.closePath()}drawXPlotLine(t,n,o,s,l){const a=this.ctx;if(!t||t<n||t>o){a.closePath(),a.restore();return}let r=t;r+=Y.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(t,n,o,s,l){const a=this.ctx;if(!t||t>l||t<s){a.closePath(),a.restore();return}let r=t;r+=Y.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(o,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(t,n,o,s,l,a){const r=this.ctx,c=d=>d||d>l||d<a;if(!c(t)||!c(n)){r.closePath(),r.restore();return}r.moveTo(o,t),r.lineTo(o,n),r.lineTo(s,n),r.lineTo(s,t),r.lineTo(o,t),r.fill(),r.restore(),r.closePath()}getNormalizedLabelOptions(t,n){const o=Fe({},n,Er),s=this.ctx,{maxWidth:l}=o,a=o.fontSize>20?20:o.fontSize;let r=o.text,c=l??s.measureText(r).width;const d=this.type==="y"?t.width-t.chartWidth:l??t.width;return d<s.measureText(r).width&&o.textOverflow==="ellipsis"&&(r=Y.truncateLabelWithEllipsis(o.text,d,s),c=s.measureText(r).width),{label:r,fontSize:a,labelWidth:c,labelBoxPadding:a/4,labelHalfWidth:c/2,labelHalfHeight:a/2,...o}}getPlotBandLabelPosition(t,n,o,s,l){const{fontSize:a,labelWidth:r,labelHalfWidth:c,labelHalfHeight:d,labelBoxPadding:h,textAlign:f,verticalAlign:u}=o;if(a<=0)return{textX:0,textY:0};let m,p;if(this.type==="x")switch(p=l-h-a,f){case"left":m=t+c+h;break;case"right":m=n-c-h;break;case"center":default:m=(n-t)/2+t;break}else switch(m=s+r+h,u){case"top":p=n+d+h;break;case"bottom":p=t-d-h;break;case"middle":default:p=(t-n)/2+n;break}return{textX:m,textY:p}}getPlotLineLabelPosition(t,n,o,s){const{fontSize:l,labelWidth:a,labelHalfWidth:r,labelHalfHeight:c,labelBoxPadding:d}=n;if(l<=0)return{textX:0,textY:0};let h,f;if(this.type==="x")switch(f=s-d-l,n.textAlign){case"left":h=t-r-d;break;case"right":h=t+r+d;break;case"center":default:h=t;break}else switch(h=o+a+d,n.verticalAlign){case"top":f=t-c-d;break;case"bottom":f=t+c+d;break;case"middle":default:f=t;break}return{textX:h,textY:f}}drawPlotLabel(t,n){if(!n)return;const{textX:o,textY:s}=n,{label:l,fontSize:a,fontColor:r,fillColor:c,lineColor:d,lineWidth:h,labelBoxPadding:f,labelWidth:u,labelHalfWidth:m,labelHalfHeight:p}=t;if(a<=0)return;const g=this.ctx;g.save(),g.beginPath(),g.font=Y.getLabelStyle(t);let x=0,b=0,y=0,M=0;this.type==="x"?(x=s-f,b=s+a,y=o-m-f,M=o+m+f):(x=s-p-f,b=s+p+f,y=o-u,M=o+f),g.fillStyle=c,g.strokeStyle=d,g.lineWidth=h,g.moveTo(y,b),g.lineTo(y,x),g.lineTo(M,x),g.lineTo(M,b),g.lineTo(y,b),g.fill(),h>0&&g.stroke(),g.fillStyle=r,g.fillText(l,o,s),g.closePath()}checkFixWidth(t){const{fixWidth:n,fitDir:o}=this.labelStyle;return ve(n)&&n>0?Y.truncateLabelWithEllipsis(t,n,this.ctx,o):t}}class vC extends oo{getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return at(t).format(this.timeFormat)}getInterval(t){const n=t.maxValue,o=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return li[this.interval].size;if(typeof this.interval=="object")return this.interval.time*li[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-o)/s)}calculateSteps(t){const{maxValue:n,minValue:o}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=1e-10,h=+o;let f=+n;if(l&&c){const x=r,y=(f-h)/x;if(Math.abs(y-Math.round(y))<d&&this.fixedSteps)return{steps:Math.round(y),interval:x,graphMin:h,graphMax:f}}if(c){const x=f-h;let b=r,y=Math.ceil(x/b);for(;y>s;)b*=2,y=Math.ceil(x/b);return f=h+b*y,{steps:y,interval:b,graphMin:h,graphMax:f}}let u=this.getInterval(t),m=o;for(;m<n;)m+=u;f=m;const p=f-h;let g=Math.round(p/u);for(;g>s;){u*=2,g=Math.round(p/u);const x=p/g;u=this.decimalPoint?x:Math.ceil(x)}if(p>g*u){const x=p/g;u=this.decimalPoint?x:Math.ceil(x)}return{steps:g,interval:u,graphMin:h,graphMax:f}}}class TC extends oo{getTruthyValue(t){const n=this.adjustedDecimalPoint??this.decimalPoint;return ve(t)?Number(t.toFixed(n)):t}getLabelFormat(t,n={}){if(this.formatter){const s=this.getTruthyValue(t),l=this.formatter(s,{...n,prevOriginalValue:n==null?void 0:n.prev,prevDecimalPointValue:this.getTruthyValue(n==null?void 0:n.prev),currentOriginalValue:t,currentDecimalPointValue:s});if(typeof l=="string")return l}const o=this.adjustedDecimalPoint??this.decimalPoint;return Y.labelSignFormat(t,o)}getInterval(t){if(this.interval)return this.interval;let n=0;const o=t.maxValue,s=t.minValue,l=t.maxSteps;if(!l||l<=0)return 0;if(this.startToZero&&s<0){const a=Math.abs(s)+Math.abs(o),r=Math.abs(s)/a,c=Math.abs(o)/a;let d=Math.max(1,Math.round(r*l)),h=Math.max(1,l-d);d+h>l&&(r>c?d-=1:h-=1),n=Math.max(Math.abs(s)/(d||1),Math.abs(o)/(h||1))}else n=(o-s)/l;return this.decimalPoint?n:Math.ceil(n)}getNiceInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),o=Math.floor(Math.log10(n)),s=n/10**o;let l=10;for(let r=0;r<Vs.length;r++)if(Vs[r]>=s){l=Vs[r];break}const a=l*10**o;return t<0?-a:a}getStepsWithNiceScale({max:t,min:n,maxSteps:o}){let s=t,l=n,a=0,r=0,c=1/0;const d=Math.max(1,o-1),h=o+1;for(let f=d;f<=h;f++){const u=(t-n)/f,m=this.getNiceInterval(u);if(m>0){const p=Math.floor(n/m)*m,g=p+m*f;if(g>=t){const x=n-p,b=g-t,y=x+b;y<c&&(s=g,l=p,a=m,r=f,c=y)}}}if(!(a>0)||r<=0){const f=Math.max(1,o),u=(t-n)/f||1;return{max:t,min:n,interval:u,steps:f}}return{max:s,min:l,interval:a,steps:r}}getDecimalPointFromInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),o=10,s=1e-10,l=(c,d=0)=>{const h=10**d;return Math.round((c+Number.EPSILON)*h)/h},a=(c,d)=>{const h=l(c,d);return Math.abs(c-h)<s};if(n>=1&&a(n,0))return 0;const r=n>=1?0:Math.max(0,Math.ceil(-Math.log10(n)));for(let c=r;c<=o;c+=1)if(a(n,c))return c;return o}calculateSteps(t){const{minValue:n,maxValue:o}=t,s=Math.max(1,t.maxSteps??1),l=Array.isArray(this.range)&&this.range.length===2,r=typeof this.interval=="number"||typeof this.interval=="object"&&this.interval!==null?this.getInterval(t):null,c=r!=null&&r>0&&Number.isFinite(r),d=l?+this.range[0]:null,h=l?+this.range[1]:null,f=1e-10,u=y=>{if(this.decimalPoint==="auto"){const M=this.getDecimalPointFromInterval(y);M!=null&&!Number.isNaN(M)?this.adjustedDecimalPoint=M:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(y):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},m=(y,M)=>Math.max(1,Math.round(y/M+f)),p=({min:y,max:M,interval:E})=>{let I=0,T=0;return y>=0?(I=+y,T=Math.ceil(M/E)*E):M>=0?(I=Math.floor(y/E)*E,T=Math.ceil(M/E)*E):(T=+M,I=Math.floor(y/E)*E),{graphMin:I,graphMax:T}};if(l&&c){const y=d,M=h,E=r,T=(M-y)/E;if(Math.abs(T-Math.round(T))<f||this.fixedSteps){const C=Math.round(T);return u(E),{steps:C,interval:E,graphMin:y,graphMax:M}}}if(l){const y=d,M=h,E=M-y,I=s,T=E/I;return u(T),{steps:I,interval:T,graphMin:y,graphMax:M}}if(c){let y=r,M=0,E=0,I=0,T=0;for({graphMin:M,graphMax:E}=p({min:n,max:o,interval:y}),I=E-M,T=m(I,y);T>s;)y*=2,{graphMin:M,graphMax:E}=p({min:n,max:o,interval:y}),I=E-M,T=m(I,y);return u(y),{steps:T,interval:y,graphMin:M,graphMax:E}}const g=this.startToZero&&n>=0?0:n,x=this.startToZero&&o<=0?0:o,b=this.getStepsWithNiceScale({min:g,max:x,maxSteps:s});return u(b.interval),{steps:b.steps,interval:b.interval,graphMin:b.min,graphMax:b.max}}calculateScaleRange(t,n){var h;let o,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(o=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(o=a[1],s=a[0]):typeof a=="function"?[s,o]=a(t.min,t.max):(o=t.max,s=t.min);const r=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!r){const f=o,u=o*(this.autoScaleRatio+1);if(o=this.decimalPoint?u:Math.ceil(u),o>0&&s<0){const m=f-o;s+=m}else if(o<0&&s<0){const m=s*(this.autoScaleRatio+1);s=this.decimalPoint?m:Math.ceil(m)}}this.startToZero&&!r&&(s>0&&(s=0),o<0&&(o=0)),o===s&&(o+=1,l=!0);const c=this.getLabelFormat(s),d=this.getLabelFormat(o,{isMaxValueSameAsMin:l});return{min:s,max:o,minLabel:c,maxLabel:d,size:Y.calcTextSizeCanvas(d,Y.getLabelStyle(this.labelStyle),(h=this.labelStyle)==null?void 0:h.padding)}}}class BC extends oo{calculateScaleRange(t){let n,o,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],o=this.range[0]):typeof range=="function"?[o,n]=this.range(t.min,t.max):(n=t.max,o=t.min);const l=Y.calculateMagnitude(n-o);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(o=0),n===o&&(n+=1,s=!0);const a=this.getLabelFormat(o),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:o,max:n,minLabel:a,maxLabel:r,size:Y.calcTextSize(r,Y.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const o=t.maxValue,s=t.minValue,l=t.maxSteps,a=Y.calculateMagnitude(o-s);let r=this.getInterval(t),c;const d=o,h=s,f=d-h;for(c=Math.round(f/r),o===1&&(r=.2,c=5);(c>l||c*2<l)&&!n;)if(c>l)r*=2,c=Math.ceil(f/r);else if(a>=0)if(r/2%1===0)r/=2,c=Math.ceil(f/r);else break;else r/=2,c=Math.ceil(f/r);return{steps:c,interval:r,graphMin:h,graphMax:Math.ceil(h+c*r)}}getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return Y.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,o=t.minValue;return 10**Y.calculateMagnitude(n-o)}}class DC extends oo{constructor(t,n,o,s,l){super(t,n,o,l),this.labels=s}getMaxWidth(t,n){var s;const o=(s=this.labelStyle)==null?void 0:s.maxWidth;if(o==null)return n;if(typeof o=="string"){const l=o.trim();if(l.includes("%")){const r=Number.parseFloat(l.replace("%",""));return Number.isNaN(r)?n:t.chartWidth*(r/100)}const a=Number.parseFloat(l);return Number.isNaN(a)?n:a}return o}calculateScaleRange(t,n,o){const s=this.labelStyle.alignToGridLine?t:Y.getStringMinMax(this.labels);let l=s.max,a=s.min,r=0,c=this.labels.length-1,d=this.labels.length;const h=n!=null&&n.use?n==null?void 0:n.range:this.range;if(Array.isArray(h)&&(h!=null&&h.length)){const[u,m]=h;ve(u)&&ve(m)&&(r=u<r?r:u,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[u,m]=h(a,l);r=u<r?r:u,c=m>c?c:m,l=this.labels[c],a=this.labels[r],d=c-r+1}const f=this.getMaxWidth(o,o.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,f),maxLabel:this.getLabelFormat(l,f),size:Y.calcTextSizeCanvas(this.getLabelFormat(l,f),Y.getLabelStyle(this.labelStyle))}}getIndexInterval(t){const n=t.maxSteps;return this.interval?this.interval:Math.ceil(this.labels.length/n)}calculateSteps(t){const{minValue:n,maxValue:o,minIndex:s,maxIndex:l}=t,a=l-s+1;let r=1;const c=this.labels.every(d=>!isNaN(d));return this.labelStyle.alignToGridLine&&c&&(r=this.getIndexInterval(t)),{oriSteps:a,steps:a,indexInterval:r,graphMin:n,graphMax:o,minIndex:s,maxIndex:l}}draw(t,n,o,s,l){var y,M,E,I,T,V,C,S,w,k,B;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=o.steps,h=o.indexInterval,f=o.minIndex,u=c[this.units.rectStart],m=c[this.units.rectEnd],p=c[this.units.rectOffset(this.position)],g=c[this.units.rectOffsetCounter(this.position)],x=this.getMaxWidth(t,t.chartWidth/(d+2)),b=5;if(this.drawAxisTitle(t,n),(y=this.labelStyle)!=null&&y.show){a.font=Y.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const D=Y.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(u,p+D),a.lineTo(m,p+D)):(a.moveTo(p+D,u),a.lineTo(p+D,m)),a.stroke(),d===0)return;const O=(m-u)/d,L=this.labelStyle.alignToGridLine;let v=null,N=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let R,P,_;for(_=0;_<d;_+=h){const A=f+_,z=this.labels[A];v=Math.round(u+O*_),N=v+D,R=this.getLabelFormat(z,x);const{selectLabel:X,selectItem:W,horizontal:H}=this.options;let U;l!=null&&l.targetAxis?U=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":U=H?"y":"x";const j=(X==null?void 0:X.use)&&(X==null?void 0:X.useLabelOpacity)&&U===this.type&&((M=l==null?void 0:l.dataIndex)==null?void 0:M.length)&&!((E=l==null?void 0:l.dataIndex)!=null&&E.includes(A));let K=this.labelStyle.color,q=1;if(Y.getColorStringType(K)==="RGBA"&&(q=Y.getOpacity(K)),_===d-1&&this.lastLabelFontStyle&&(a.font=Y.getLabelStyle(this.lastLabelFontStyle),K=this.lastLabelFontStyle.color),a.fillStyle=Y.colorStringToRgba(K,j?(I=this.options)==null?void 0:I.unSelectedOpacity:q),this.type==="x"){P=this.position==="top"?p-10:p+10;const J=L?v:v+O/2;if(a.fillText(this.checkFixWidth(R),J,P),!j&&(W!=null&&W.showLabelTip)&&(s!=null&&s.label)&&!H){const te=s.label;if(te===R){const G=Math.round(a.measureText((T=this.labelStyle)==null?void 0:T.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(te).width)+10,height:G,x:v+O/2,y:P+(G-2),borderRadius:2,arrowSize:3,text:R,backgroundColor:(V=W==null?void 0:W.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(C=W==null?void 0:W.labelTipStyle)==null?void 0:C.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(v+O/2,p),a.lineTo(v+O/2,p+b),a.stroke(),a.closePath()),_>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(N,p),a.lineTo(N,g),a.stroke(),a.closePath())}else{P=this.position==="left"?p-10:p+10;const J=L?v:v+O/2;a.fillText(this.checkFixWidth(R),P,J),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(p+(this.axisLineWidth??1),J),a.lineTo(p-b,J),a.stroke(),a.closePath()),_>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(p,N),a.lineTo(g,N),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const A=f+d-1;if(f+Math.floor((d-1)/h)*h!==A){const X=Math.round(u+O*(d-1)),W=L?X:X+O/2,H=this.getLabelFormat(r[A],x);a.font=this.lastLabelFontStyle?Y.getLabelStyle(this.lastLabelFontStyle):Y.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(H),W,P):a.fillText(this.checkFixWidth(H),P,W),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(W,p),a.lineTo(W,p+b)):(a.moveTo(p+(this.axisLineWidth??1),W),a.lineTo(p-b,W)),a.stroke(),a.closePath())}}if(L&&!this.showLastLabel){const A=Kb(+r[1],+r[0]),z=Ls(+r[r.length-1],A);if(isNaN(z))return;v=Math.round(u+O*this.labels.length),N=v+D;const X=this.getLabelFormat(`${z}`,x),W=v+O/2;a.font=Y.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(X),v,P):a.fillText(this.checkFixWidth(X),P,v),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(W,p),a.lineTo(W,p+b)):(a.moveTo(p+(this.axisLineWidth??1),N),a.lineTo(p-b,N)),a.stroke(),a.closePath())}a.closePath()}if((S=this.plotBands)!=null&&S.length||(w=this.plotLines)!=null&&w.length){const D=Y.aliasPixel(a.lineWidth)+1,O=c.x1+D,L=c.x2,v=c.y1+D,N=c.y2,R=(m-u)/(this.labelStyle.show?r.length:1);(k=this.plotBands)==null||k.forEach(P=>{if(!P.from&&!P.to)return;const _=Fe({},P,Tr),{from:A=0,to:z=r.length,label:X}=_,W=Math.round(u+R*A),H=Math.round(u+R*z);if(this.setPlotBandStyle(_),this.type==="x"?this.drawXPlotBand(W,H,O,L,v,N):this.drawYPlotBand(W,H,O,L,v,N),X.show){const U=this.getNormalizedLabelOptions(t,X),j=this.getPlotBandLabelPosition(W,H,U,L,v);this.drawPlotLabel(U,j)}a.restore()}),(B=this.plotLines)==null||B.forEach(P=>{if(!P.value)return;const _=Fe({},P,vr),{value:A,label:z}=_,X=Math.round(u+R*A)+R/2;if(this.setPlotLineStyle(_),this.type==="x"?this.drawXPlotLine(X,O,L,v,N):this.drawYPlotLine(X,O,L,v,N),z.show){const W=this.getNormalizedLabelOptions(t,z),H=this.getPlotLineLabelPosition(X,W,L,v);this.drawPlotLabel(W,H)}a.restore()})}}getLabelFormat(t,n,o={}){if(this.formatter){const s=this.formatter(t,o);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(t,n):t}fittingString(t,n){const o=this.ctx;o.save(),o.font=Y.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return Y.truncateLabelWithEllipsis(t,n,o,s)}getLabelWidthHasMaxLength(t,n){const o=Y.getLabelStyle(this.labelStyle),s=(t==null?void 0:t.length)??0,l=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(s+2));return(t??[]).reduce((a,r)=>{var h;const c=this.getLabelFormat(r,l),d=((h=Y.calcTextSizeCanvas(c,o))==null?void 0:h.width)??0;return Math.max(a,d)},0)}}class OC extends oo{constructor(t,n,o,s,l){super(t,n,o),this.labels=s,this.options=l}getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return at(t).format(this.timeFormat)}getInterval(t){const n=t.maxValue,o=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return li[this.interval].size;if(typeof this.interval=="object")return this.interval.time*li[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-o)/s)}calculateSteps(t){const{maxValue:n,minValue:o,maxSteps:s}=t,l=this.getInterval(t);let a=l,r=o,c;for(;r<n;)r+=a;const d=r>n?n:r,h=o,f=d-h;c=Math.round(f/a)+1;const u=c;for(n===1&&(a=.2,c=5);c>s;)a*=2,c=Math.round(f/a),a=Math.ceil(f/c);return d-h>c*a&&(a=Math.ceil((d-h)/c)),{steps:c,oriSteps:u,interval:a,rawInterval:l,graphMin:h,graphMax:d}}draw(t,n,o,s,l){var L,v,N,R,P,_,A,z,X,W,H,U,j,K,q,ee;const a=this.ctx,r=this.labels,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=o.steps,h=o.graphMin,f=o.graphMax,u=o.rawInterval,m=o.oriSteps;let p=c[this.units.rectStart];const g=c[this.units.rectEnd],x=c[this.units.rectOffset(this.position)],b=c[this.units.rectOffsetCounter(this.position)],y=5;this.drawAxisTitle(t,n),a.font=Y.getLabelStyle(this.labelStyle),this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),a.fillStyle=this.labelStyle.color,a.lineWidth=this.axisLineWidth;const M=Y.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(p,x+M),a.lineTo(g,x+M)):(a.moveTo(x+M,p),a.lineTo(x+M,g)),a.stroke(),a.closePath(),d===0||h===null)return;const E=this.labelStyle.alignToGridLine,I=(g-p)/(m||1);this.categoryMode&&!E&&(p+=Math.ceil(I/2)-2);const T=[];let V=null,C=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let S,w,k,B=d<=2?m:Math.round(m/d);const D=p>Math.ceil(c[this.units.rectStart]);this.type==="x"&&D&&B===m&&(B=1);const O=B===m?m:m-1;for(k=0;k<=O;k+=B){T[k]=at(h).valueOf()+k*u,V=Math.round(p+I*k),C=V+M;let J;for(let Z=0;Z<T.length;Z++)T[Z]!==void 0&&Z!==k&&(J=T[Z]);S=this.getLabelFormat(Math.min(f,T[k]),{prev:J});const te=((v=(L=this.options)==null?void 0:L.selectLabel)==null?void 0:v.use)&&((R=(N=this.options)==null?void 0:N.selectLabel)==null?void 0:R.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((P=l==null?void 0:l.dataIndex)==null?void 0:P.length)&&!(l!=null&&l.label.map(Z=>this.getLabelFormat(Math.min(f,Z),{prev:J})).includes(S)),G=this.labelStyle.color;let oe=1;if(Y.getColorStringType(G)==="RGBA"&&(oe=Y.getOpacity(G)),a.fillStyle=Y.colorStringToRgba(G,te?(_=this.options)==null?void 0:_.unSelectedOpacity:oe),this.type==="x"){if(w=this.position==="top"?x-10:x+10,a.fillText(this.checkFixWidth(S),V,w),!te&&((z=(A=this.options)==null?void 0:A.selectItem)!=null&&z.showLabelTip)&&(s!=null&&s.label)&&!((X=this.options)!=null&&X.horizontal)){const Z=this.getLabelFormat(Math.min(f,s.label+0*u));if(Z===S){const ae=Math.round(a.measureText((W=this.labelStyle)==null?void 0:W.fontSize).width);Y.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(Z).width)+10,height:ae,x:V,y:w+(ae-2),borderRadius:2,arrowSize:3,text:S,backgroundColor:(j=(U=(H=this.options)==null?void 0:H.selectItem)==null?void 0:U.labelTipStyle)==null?void 0:j.backgroundColor,textColor:(ee=(q=(K=this.options)==null?void 0:K.selectItem)==null?void 0:q.labelTipStyle)==null?void 0:ee.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(C,x),a.lineTo(C,x+y),a.stroke(),a.closePath()),k<m&&this.showGrid&&(D||!D&&k!==0)&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(C,x),a.lineTo(C,b),a.stroke(),a.closePath())}else w=this.position==="left"?x-10:x+10,a.fillText(this.checkFixWidth(S),w,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(x+(this.axisLineWidth??1),C),a.lineTo(x-y,C),a.stroke(),a.closePath()),k<m&&this.showGrid&&(D||!D&&k!==0)&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(x,C),a.lineTo(b,C),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&E&&k*B===m){const J=at(r[1]).diff(at(r[0])),te=this.getLabelFormat(at(T[m-1]+J));V=Math.round(p+I*m),C=V+M,this.type==="x"?(a.fillText(this.checkFixWidth(te),V,w),this.showGrid&&(a.moveTo(C,x),a.lineTo(C,b))):(a.fillText(this.checkFixWidth(te),w,V),this.showGrid&&(a.moveTo(x,C),a.lineTo(b,C))),a.stroke()}a.closePath()}}const LC={createTitle(){this.titleDOM=document.createElement("div"),this.titleDOM.className="ev-chart-title",this.wrapperDOM.appendChild(this.titleDOM)},initTitle(){this.isInitTitle||this.createTitle(),this.updateTitle(),this.isInitTitle=!0},showTitle(){this.titleDOM.style.display="block",this.wrapperDOM.style.paddingTop=`${this.options.title.height}px`},hideTitle(){this.titleDOM.style.display="none",this.wrapperDOM.style.paddingTop="0px"},updateTitle(){const e=this.options.title;Object.keys(e.style).forEach(t=>{this.titleDOM.style[t]=e.style[t]}),this.titleDOM.textContent=e.text,this.titleDOM.style.height=`${e.height}px`,this.titleDOM.style.lineHeight=`${e.height}px`}},RC={createLegendLayout(){var e,t;this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",(t=(e=this.options)==null?void 0:e.legend)!=null&&t.allowResize&&(this.resizeDOM=document.createElement("div"),this.resizeDOM.className="ev-chart-resize-bar",this.ghostDOM=document.createElement("div"),this.ghostDOM.className="ev-chart-resize-ghost",this.wrapperDOM.appendChild(this.resizeDOM)),this.useTable?(this.legendTableDOM=document.createElement("table"),this.legendTableDOM.className="ev-chart-legend--table",this.setLegendColumnHeader(),this.legendBoxDOM.appendChild(this.legendTableDOM),this.legendDOM.style.overflow="auto"):(this.legendBoxDOM.style.overflowX="hidden",this.legendBoxDOM.style.overflowY="auto",this.legendBoxDOM.style.height="100%"),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM),this.options.legend.virtualScroll&&!this.useTable&&(this.legendTopSpacer=document.createElement("div"),this.legendTopSpacer.className="ev-chart-legend--top-spacer",this.legendTopSpacer.style.clear="both",this.legendTopSpacer.style.opacity=0,this.legendBottomSpacer=document.createElement("div"),this.legendBottomSpacer.className="ev-chart-legend--bottom-spacer",this.legendBottomSpacer.style.clear="both",this.legendBottomSpacer.style.opacity=0,this.legendBoxDOM.appendChild(this.legendTopSpacer),this.legendBoxDOM.appendChild(this.legendBottomSpacer),this.updateVisibleRowCountFrameId=requestAnimationFrame(()=>{this.updateVisibleRowCount()}))},setLegendColumnHeader(){var o;const e=(o=this.options.legend)==null?void 0:o.table,t=e.columns;["color",...Object.keys(t)].forEach(s=>{var a,r;const l=document.createElement("th");if(l.className="ev-chart-legend--table__column-name",(a=t[s])!=null&&a.use||s==="color"||s==="name"){const c=t[s],d=(c==null?void 0:c.title)??"";l.textContent=d,l.setAttribute("title",d),l.dataset.type=d,Y.setDOMStyle(l,(r=e==null?void 0:e.style)==null?void 0:r.header),this.legendTableDOM.append(l)}})},initLegend(){var e,t;this.isHeatMapType=this.options.type==="heatMap",this.useTable=!!((t=(e=this.options.legend)==null?void 0:e.table)!=null&&t.use)&&this.options.type!=="heatmap"&&this.options.type!=="scatter",this.legendItemHeight=18,this.isInitLegend||this.createLegendLayout(),this.isHeatMapType?(this.initEventForColorLegend(),this.addColorLegendList()):(this.initEvent(),this.addLegendList()),this.initResizeEvent(),this.isInitLegend=!0,this.isLegendMove=!1},updateVisibleRowCount(){const e=this.options.legend.position==="right"||this.options.legend.position==="left",t=this.legendBoxDOM.clientHeight,n=this.legendBoxDOM.clientWidth,o=Math.max(this.options.legend.width-8,1),s=Object.values(this.seriesList).filter(l=>l.showLegend!==!1).length;this.itemsPerRow=e?1:Math.floor(n/o),this.totalRowCount=Math.ceil(s/this.itemsPerRow),this.visibleRowCount=t>this.legendItemHeight?Math.round(t/this.legendItemHeight)+1:this.totalRowCount},updateStartEndRowIndex(){var t;const e=Math.max(Math.floor(((t=this.legendBoxDOM)==null?void 0:t.scrollTop)/this.legendItemHeight),0);this.startRowIndex=Math.min(e,Math.max(this.totalRowCount-this.visibleRowCount,0)),this.endRowIndex=this.startRowIndex+this.visibleRowCount+1},renderVisibleLegends(){this.updateStartEndRowIndex();const e=this.legendBoxDOM.querySelectorAll(".ev-chart-legend-container");if(e&&e.length)for(const c of e)c.remove();const t=this.totalRowCount*this.legendItemHeight,n=this.startRowIndex*this.legendItemHeight,o=Math.max(t-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${o}px`;const s=this.startRowIndex*this.itemsPerRow,l=this.endRowIndex*this.itemsPerRow,a=this.data.groups.at(0);let r=[];if(a?r=a.filter(c=>this.seriesList[c].showLegend).map(c=>[c,this.seriesList[c]]):r=Object.entries(this.seriesList).filter(([,c])=>c.showLegend),r&&r.length)for(let c=s;c<l&&c<r.length;c++){const[,d]=r[c];this.addLegend(d)}},addLegendList(){const{groups:e}=this.data,{seriesList:t}=this;this.options.legend.virtualScroll&&!this.useTable?this.renderVisibleLegendsFrameId=requestAnimationFrame(()=>{this.renderVisibleLegends()}):(this.addLegendForGroups(e,t,this.useTable),this.addStandaloneLegends(t,this.useTable))},addLegendForGroups(e,t,n){e==null||e.forEach(o=>{o==null||o.forEach(s=>{const l=t[s];l&&l.showLegend&&this.addLegendBasedOnType(l,n)})})},addStandaloneLegends(e,t){Object.values(e).forEach(n=>{!n.isExistGrp&&n.showLegend&&this.addLegendBasedOnType(n,t)})},addLegendBasedOnType(e,t){t?this.addLegendWithValues(e):this.addLegend(e)},addColorLegendList(){const e=this.seriesList;Object.values(e).forEach(t=>{if(!t.isExistGrp&&t.showLegend){const{colorState:n,valueOpt:o}=t,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=o,d=n.length,h=r?d-2:d-1;for(let f=0;f<d;f++){const{id:u,color:m,label:p=""}=n[f],g=s+a*f;let x=g+a;f<h?x-=.1**c:x=l+.1**c;let b=p;if(!b)if(b=`${g.toFixed(c)} - ${x.toFixed(c)}`,s===void 0||l===void 0)if(f===0)b="0";else break;else{if(g>l)break;a<=1&&c===0&&(b=g)}this.addLegend({cId:u,color:m,name:b,show:!0})}}})},getContainerDOM(e){let t=null;const n=e.target.dataset.type;return n==="container"?t=e.target:["name","color","min","max","avg","total","last"].includes(n)&&(t=e.target.parentElement,t!=null&&t.series||(t=t.parentElement)),t},initEvent(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`,value:`ev-chart-legend${this.useTable?"--table__value":"-value"}`},t=(l,a)=>{const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=l==null?void 0:l.getElementsByClassName(e.value),h=l==null?void 0:l.series;if(r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a,d&&d.length)for(const f of d)f.style.color=a;h.show=!1,l.dataset.inactive=!0},n=(l,a)=>{var u,m;let r;const c=l==null?void 0:l.getElementsByClassName(e.color)[0],d=l==null?void 0:l.getElementsByClassName(e.name)[0],h=l==null?void 0:l.getElementsByClassName(e.value),f=l==null?void 0:l.series;if(typeof f.color!="string"?r=f.color[f.color.length-1][1]:r=f.color,f.type==="line"&&f.fill?(c.style.height="8px",c.style.backgroundColor=Y.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const p of h){const g=(m=(u=this.options.legend.table)==null?void 0:u.columns[p.dataset.type])==null?void 0:m.style;p.style.color=g!=null&&g.color?g.color:a}f.show=!0,l.dataset.inactive=!1},o=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!1})},s=()=>{(this.data.groups.at(0)?this.data.groups.at(0).slice().reverse().filter(a=>this.seriesList[a].showLegend).map(a=>[a,this.seriesList[a]]):Object.entries(this.seriesList).filter(([,a])=>a.showLegend)).forEach(([,a])=>{a.show=!0})};this.onLegendBoxClick=l=>{var x;const{legend:a}=this.options;if(a!=null&&a.stopClickEvt)return;const{chartIdx:r}=this.data,c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],f=(c==null?void 0:c.dataset.inactive)==="false";if(!d||!h)return;if(a.clickMode==="active"){const b=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));b.every(E=>E.dataset.inactive==="false")?(b.forEach(E=>{t(E,a.inactive)}),o(),n(c,a.color),this.seriesInfo.count=1):f?(t(c,a.inactive),this.seriesInfo.count--):f||(n(c,a.color),this.seriesInfo.count++),b.every(E=>E.dataset.inactive==="true")&&(b.forEach(E=>{n(E,a.color)}),s(),this.seriesInfo.count=b.length)}if(a.clickMode!=="active"){if(f&&this.seriesInfo.count===1)return;f?(t(c,a.inactive),this.seriesInfo.count--):(n(c,a.color),this.seriesInfo.count++)}if(this.brushSeries){const b=[...this.brushSeries.list];b[r]=this.seriesList,this.brushSeries.list=b,this.brushSeries.chartIdx=r}((x=this.options.eventBehavior)==null?void 0:x.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=Object.values(this.seriesList).filter(b=>b.show).map(b=>b.sId),p=m.length===Object.values(this.seriesList).length,g={e:l,data:{seriesIds:p?[]:m,isActiveAll:p}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](g)},this.onLegendBoxLeave=()=>{this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})},this.onLegendBoxOver=l=>{var d;const a=this.getContainerDOM(l);if(!a){this.onLegendBoxLeave();return}const c={sId:(d=a==null?void 0:a.series)==null?void 0:d.sId,type:this.options.type};this.legendHover=c,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:c},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.addEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.addEventListener("scroll",this.renderVisibleLegends.bind(this))),this.initResizeEvent()},initEventForColorLegend(){if(this.isInitLegend)return;const e={container:`ev-chart-legend${this.useTable?"--table__row":"-container"}`,color:`ev-chart-legend${this.useTable?"--table__color":"-color"}`,name:`ev-chart-legend${this.useTable?"--table__name":"-name"}`},t=(l,a)=>{var u;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(u=l==null?void 0:l.series)==null?void 0:u.cId;r.style.backgroundColor=a,r.style.borderColor=a,c.style.color=a;const f=d.colorState.findIndex(m=>m.id===h);f>-1&&(d.colorState[f].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var u,m;const r=l==null?void 0:l.getElementsByClassName(e.color)[0],c=l==null?void 0:l.getElementsByClassName(e.name)[0],d=Object.values(this.seriesList)[0],h=(u=l==null?void 0:l.series)==null?void 0:u.cId;r.style.backgroundColor=(m=l==null?void 0:l.series)==null?void 0:m.color,c.style.color=a;const f=d.colorState.findIndex(p=>p.id===h);f>-1&&(d.colorState[f].show=!0),l.dataset.inactive=!1},o=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!1})},s=()=>{Object.values(this.seriesList)[0].colorState.forEach(a=>{a.show=!0})};this.onLegendBoxClick=l=>{var b;const a=this.options.legend;if(a!=null&&a.stopClickEvt)return;const r=Object.values(this.seriesList)[0],c=this.getContainerDOM(l);if(!c)return;const d=c==null?void 0:c.getElementsByClassName(e.color)[0],h=c==null?void 0:c.getElementsByClassName(e.name)[0],f=(c==null?void 0:c.dataset.inactive)==="false",u=r.colorState.filter(y=>y.show).length;if(!d||!h)return;if(a.clickMode==="active"){const y=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));y.every(I=>I.dataset.inactive==="false")?(y.forEach(I=>{t(I,a.inactive)}),o(),n(c,a.color)):f?t(c,a.inactive):f||n(c,a.color),y.every(I=>I.dataset.inactive==="true")&&(y.forEach(I=>{n(I,a.color)}),s())}if(a.clickMode!=="active"){if(f&&u===1)return;f?t(c,a.inactive):n(c,a.color)}((b=this.options.eventBehavior)==null?void 0:b.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const m=r.colorState.filter(y=>y.show),p=m.map(y=>+y.id.split("#")[1]),g=r.colorState.length===m.length,x={e:l,data:{seriesIndices:g?[]:p,isActiveAll:g}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](x)},this.onLegendBoxLeave=()=>{this.legendHover=null,Object.values(this.seriesList)[0].colorState.forEach(a=>{a.state="normal"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:!0})},this.onLegendBoxOver=l=>{var h,f;const a=(h=Object.values(this.seriesList))==null?void 0:h[0],r=this.getContainerDOM(l);if(!r){this.onLegendBoxLeave();return}const c=(f=r==null?void 0:r.series)==null?void 0:f.cId,d={sId:c,type:this.options.type};this.legendHover=d,a.colorState.forEach(u=>{u.state=u.id===c?"highlight":"downplay"}),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:d},lightUpdate:!0})},this.legendBoxDOM.addEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave),this.initResizeEvent()},initResizeEvent(){this.onResizeMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=this.options,n=t.legend.position,o=t.title.show?t.title.height:0,s=this.ghostDOM;this.resizeDOM.style.display="none",this.wrapperDOM.appendChild(s),n==="left"||n==="right"?(s.style.top=`${o}px`,s.style.left=this.resizeDOM.style.left,s.style.right=this.resizeDOM.style.right,s.style.height=this.resizeDOM.style.height):(s.classList.add("horizontal"),n==="top"?s.style.top=this.resizeDOM.style.top:n==="bottom"&&(s.style.bottom=this.resizeDOM.style.bottom)),this.wrapperDOM.addEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.addEventListener("mouseup",this.mouseUp,!1)},this.resizeDOM&&(this.resizeDOM.addEventListener("mousedown",this.onResizeMouseDown),this.mouseMove=this.onMouseMove.bind(this),this.mouseUp=this.onMouseUp.bind(this))},updateLegend(){this.resetLegend(),this.isHeatMapType?this.addColorLegendList():this.addLegendList()},updateLegendTableValues(){var o,s,l,a,r;const e=(l=(s=(o=this.options)==null?void 0:o.legend)==null?void 0:s.table)==null?void 0:l.columns,t=this.getAggregations(),n=(a=this.legendBoxDOM)==null?void 0:a.getElementsByClassName("ev-chart-legend--table__row");if(n&&n.length)for(const c of n){const d=c==null?void 0:c.getElementsByClassName("ev-chart-legend--table__value");if(d&&d.length)for(const h of d){const f=h.dataset.type;if(f!=="name"){const u=c.series.sId,m=(r=t==null?void 0:t[u])==null?void 0:r[f];h.textContent=this.getFormattedValue(e[f],m)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var t,n;const e=this.legendBoxDOM;if(e){if(this.useTable){const o=this.legendTableDOM;for(;o.hasChildNodes();)o.removeChild(o.firstChild);this.setLegendColumnHeader()}else if(this.options.legend.virtualScroll)((n=(t=this.legendDOM)==null?void 0:t.style)==null?void 0:n.display)==="none"?this.legendNeedsUpdate=!0:(this.updateVisibleRowCount(),this.renderVisibleLegends());else for(;e.hasChildNodes();)e.removeChild(e.firstChild);this.seriesInfo.count=0}},destroyLegend(){const e=this.legendDOM;this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),e&&(e.remove(),this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.isInitLegend=!1,this.seriesInfo.count=0)},addLegend(e){const t=this.options.legend,n=document.createElement("div"),o=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!e.show,n.series=e,o.className="ev-chart-legend-color",e.type==="line"&&e.point&&!e.fill&&(o.className+=" ev-chart-legend-color--point-line"),s.className="ev-chart-legend-name";let l;e.show?typeof e.color!="string"?l=e.color[e.color.length-1][1]:l=e.color:l=t.inactive,e.type==="line"&&e.fill?(o.style.height="8px",o.style.backgroundColor=e.show?Y.rgbaAdjustHalfOpacity(l):t.inactive,o.style.border=`1px solid ${l}`):o.style.backgroundColor=l,o.dataset.type="color",s.style.color=t.color,s.textContent=e.name,s.setAttribute("title",e.name),s.dataset.type="name",n.appendChild(o),n.appendChild(s),t.position==="top"||t.position==="bottom"?(n.style.width=`${t.width-8}px`,n.style.margin="0 4px"):n.style.width="100%",n.style.height=`${this.legendItemHeight}px`,n.style.display="inline-block",n.style.overflow="hidden",n.dataset.type="container",this.legendBoxDOM.insertBefore(n,this.legendBottomSpacer),e.show&&this.seriesInfo.count++},addLegendWithValues(e){var h,f,u,m,p;const t=this.options.legend,n=(h=t==null?void 0:t.table)==null?void 0:h.columns,o=(f=this.getAggregations())==null?void 0:f[e==null?void 0:e.sId];if(!o||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!e.show,Y.setDOMStyle(s,(m=(u=t.table)==null?void 0:u.style)==null?void 0:m.row),s.series=e,s.dataset.type="container";const l=document.createElement("td");l.className="ev-chart-legend--table__color-wrapper",l.dataset.type="color";const a=document.createElement("div");a.className="ev-chart-legend--table__color",a.dataset.type="color";let r;switch(e.show?typeof e.color!="string"?r=e.color[e.color.length-1][1]:r=e.color:r=t.inactive,e.type){case"line":{e.fill?(a.style.backgroundColor=Y.rgbaAdjustHalfOpacity(r),a.style.border=`1px solid ${r}`):(e.point&&(a.className+=" ev-chart-legend--table__color--point-line"),a.className+=" ev-chart-legend--table__color--line",a.style.backgroundColor=r);break}case"bar":case"pie":default:{a.style.height="10px",a.style.backgroundColor=r;break}}e.type==="line"&&e.fill?(a.style.height="8px",a.style.backgroundColor=e.show?Y.rgbaAdjustHalfOpacity(r):t.inactive,a.style.border=`1px solid ${r}`):a.style.backgroundColor=r,l.appendChild(a),s.appendChild(l);const c=document.createElement("td");c.className="ev-chart-legend--table__name",c.style.color=e.show?t.color:t.inactive,c.textContent=e.name,c.setAttribute("title",e.name),c.dataset.type="name",Y.setDOMStyle(c,(p=n==null?void 0:n.name)==null?void 0:p.style),e.show||(c.style.color=t.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(g=>{var x;if(g!=="name"&&n[g].use){const b=this.getFormattedValue(n[g],o[g]),y=document.createElement("td");y.className="ev-chart-legend--table__value",y.style.color=e.show?t.color:t.inactive,y.textContent=b,y.dataset.type=g.toString(),Y.setDOMStyle(y,(x=n[g])==null?void 0:x.style),e.show||(y.style.color=t.inactive),s.appendChild(y)}}),this.legendTableDOM.appendChild(s),e.show&&this.seriesInfo.count++},setLegendPosition(){var p,g,x,b,y,M,E,I,T;const e=this.options,t=(p=e==null?void 0:e.legend)==null?void 0:p.position,n=(g=this.wrapperDOM)==null?void 0:g.style,o=(x=this.legendDOM)==null?void 0:x.style,s=(b=this.legendBoxDOM)==null?void 0:b.style,l=(y=this.resizeDOM)==null?void 0:y.style;let a,r;const c=(M=e==null?void 0:e.title)!=null&&M.show?(E=e==null?void 0:e.title)==null?void 0:E.height:0,d=c+((I=e==null?void 0:e.legend)==null?void 0:I.height),{top:h=0,bottom:f=0,left:u=0,right:m=0}=((T=e==null?void 0:e.legend)==null?void 0:T.padding)??{};if(!(!n||!o))switch(s.padding=`${h}px ${m}px ${f}px ${u}px`,t){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(o.paddingTop)+parseInt(o.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,o.top=`${c}px`,o.right="",o.bottom="",o.left="",o.width=`${a.width}px`,o.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top=`${d}px`,l.right="",l.bottom="",l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"right":n.padding=`${c}px ${e.legend.width}px 0 0`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width-10}px`,s.maxHeight=`${a.height}px`,o.paddingLeft="10px",o.top=`${c}px`,o.right="0px",o.bottom="",o.left="",o.width=`${e.legend.width}px`,o.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right=`${e.legend.width}px`,l.bottom="",l.left="",l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break;case"bottom":n.padding=`${c}px 0 ${e.legend.height}px 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(o.paddingTop)+parseInt(o.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,o.top="",o.right="",o.bottom="0px",o.left="0px",o.width=`${a.width}px`,o.height=`${e.legend.height+(l?4:0)}px`,l&&(l.top="",l.right="",l.bottom=`${e.legend.height}px`,l.left="",l.width=`${a.width}px`,l.height="4px",l.cursor="row-resize");break;case"left":n.padding=`${c}px 0 0 ${e.legend.width}px`,a=this.chartDOM.getBoundingClientRect(),s.width=`${e.legend.width}px`,s.maxHeight=`${a.height}px`,s.display="absolute",s.bottom="0px",o.top=`${c}px`,o.right="",o.bottom="",o.left="0px",o.width=`${e.legend.width}px`,o.height=`${a.height}px`,l&&(l.top=`${c}px`,l.right="",l.bottom="",l.left=`${e.legend.width}px`,l.width="4px",l.height=`${a.height}px`,l.cursor="col-resize");break}},updateLegendContainerSize(){var n;if(!this.options||!this.legendBoxDOM)return;const e=(n=this.options)==null?void 0:n.legend,t=this.legendBoxDOM.getElementsByClassName("ev-chart-legend-container");if(t)for(let o=0;o<t.length;o++)e.position==="top"||e.position==="bottom"?(t[o].style.width=`${e.width-8}px`,t[o].style.margin="0 4px"):t[o].style.width="100%"},onMouseMove(e){e.stopPropagation(),e.preventDefault();const t=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,o=this.wrapperDOM.offsetHeight,s=this.options.title.show?this.options.title.height:0,l=this.options.legend.position,a=150,r=70,c=120,d=20;let h;switch(l){case"left":h=e.clientX-t.left,h<c?h=c:h>n-a&&(h=n-a),this.ghostDOM.style.left=`${h}px`;break;case"right":h=e.clientX-t.left,h<a?h=a:h>n-c&&(h=n-c),this.ghostDOM.style.left=`${h}px`;break;case"top":h=e.clientY-t.top,h<d+s?h=d+s:h>o-r&&(h=o-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=e.clientY-t.top,h<r+s?h=r+s:h>o-d&&(h=o-d),this.ghostDOM.style.bottom=`${this.wrapperDOM.offsetHeight-h}px`;break}this.isLegendMove=!0},onMouseUp(e){e.stopPropagation(),e.preventDefault(),this.wrapperDOM.removeEventListener("mousemove",this.mouseMove,!1),this.wrapperDOM.removeEventListener("mouseup",this.mouseUp,!1);const t=this.options,n=t.legend.position,o=this.resizeDOM.style,s=this.legendDOM.style,l=this.legendBoxDOM.style,a=this.ghostDOM.style,r=this.wrapperDOM.style,c=t.title.show?t.title.height:0,d=+this.legendDOM.style.paddingLeft.replace("px","");let h;if(this.isLegendMove)switch(n){case"top":o.top=a.top,h=+a.top.replace("px",""),s.height=`${h-c}px`,l.height=`${h-c-4}px`,t.legend.height=h-c-4,r.padding=`${h}px 0 0 0`;break;case"right":o.left=a.left,h=+a.left.replace("px",""),s.width=`${this.wrapperDOM.offsetWidth-h-4}px`,l.width=`${this.wrapperDOM.offsetWidth-h-4-d}px`,t.legend.width=this.wrapperDOM.offsetWidth-h-4,r.padding=`${c}px ${this.wrapperDOM.offsetWidth-h}px 0 0`;break;case"bottom":o.bottom=a.bottom,h=this.wrapperDOM.offsetHeight-+a.bottom.replace("px",""),s.height=`${this.wrapperDOM.offsetHeight-h}px`,l.height=`${h-c-4}px`,t.legend.height=this.wrapperDOM.offsetHeight-h,r.padding=`${c}px 0 ${this.wrapperDOM.offsetHeight-h}px 0`;break;case"left":o.left=a.left,h=+a.left.replace("px",""),s.width=`${h}px`,l.width=`${h}px`,t.legend.width=h,r.padding=`${c}px 0 0 ${h-4}px`;break}o.display="block",this.ghostDOM.remove(),this.isLegendMove&&(this.render(),this.isLegendMove=!1)},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block"),this.legendNeedsUpdate&&this.options.legend.virtualScroll&&!this.useTable&&(this.legendNeedsUpdate=!1,this.updateVisibleRowCount(),this.renderVisibleLegends())},hideLegend(){var l,a,r,c,d;const e=this.options,t=(l=this.wrapperDOM)==null?void 0:l.style,n=(a=this.resizeDOM)==null?void 0:a.style,o=(r=this.legendDOM)==null?void 0:r.style,s=(c=e==null?void 0:e.title)!=null&&c.show?(d=e==null?void 0:e.title)==null?void 0:d.height:0;!o||!t||(n&&(n.display="none"),o.display="none",o.width="0",o.height="0",t.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:e,decimalPoint:t},n){if(n==null)return"Null";let o;return e&&(o=e(+n)),(!e||typeof o!="string")&&(o=Y.labelSignFormat(+n,t)),o}},Or=28,NC={width:70,height:60},VC={createLegendLayout(){this.legendDOM=document.createElement("div"),this.legendDOM.className="ev-chart-legend",this.legendBoxDOM=document.createElement("div"),this.legendBoxDOM.className="ev-chart-legend-box",this.containerDOM=document.createElement("div"),this.containerDOM.className="ev-chart-legend-container",this.legendBoxDOM.appendChild(this.containerDOM),this.legendDOM.appendChild(this.legendBoxDOM),this.wrapperDOM.appendChild(this.legendDOM)},initLegend(){this.isInitLegend||(this.createLegendLayout(),this.createLegend()),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)}),this.initEvent(),this.isInitLegend=!0,this.legendDragInfo={dragging:!1,isStart:!0}},initEvent(){this.isInitLegend||(this.onLegendMouseDown=e=>{e.stopPropagation(),e.preventDefault();const t=e.target.dataset.type;let n;if(t==="handle")n=e.target;else if(t==="handle-btn")n=e.target.parentElement;else if(t==="handle-btn-color")n=e.target.parentElement.parentElement;else return;const o=Object.values(this.seriesList);if(!o.length)return;const{colorState:s}=o[0],{start:l,end:a}=s[0];s[0].selectedValue=null,this.clearOverlay(),this.legendDragInfo.dragging=!0,this.legendDragInfo.isStart=l!==a?n.className.includes("start"):this.legendDragInfo.isStart,n.classList.add("dragging"),this.legendBoxDOM.addEventListener("mousemove",this.onLegendMouseMove,!1),this.legendBoxDOM.addEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendMouseMove=e=>{e.stopPropagation(),e.preventDefault();const{dragging:t,isStart:n}=this.legendDragInfo;if(t){let o=this.getSelectedValue(e);o=this.isSide?100-o:o;const s=n?"start":"end",l=Object.values(this.seriesList);if(!l.length)return;const{colorState:a}=l[0],{start:r,end:c}=a[0];if(n&&o>c||!n&&o<r)return;a[0][s]=o,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})}},this.onLegendMouseUp=()=>{this.legendDragInfo.dragging=!1;const e=this.containerDOM.getElementsByClassName("ev-chart-legend-handle dragging")[0];e==null||e.classList.remove("dragging"),this.legendBoxDOM.removeEventListener("mouseup",this.onLegendMouseUp,!1)},this.onLegendBoxOver=e=>{const t=e.target.dataset.type,n=Object.values(this.seriesList);if(!n.length)return;const{colorState:o,valueOpt:s}=n[0],l=o[0];let a=this.getSelectedValue(e);if(a=this.isSide?100-a:a,["line","thumb","layer","overlay","overlay-item"].includes(t))if(l.start<=a&&a<=l.end)l.selectedValue=a,this.createLegendOverlay(a,s);else return;else if(["handle","handle-btn","handle-btn-color"].includes(t)){const r=e.target.className.includes("start");l.selectedValue=r?l.start:l.end,this.clearOverlay()}else return;this.legendHover={sId:"gradient",type:this.options.type},this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.onLegendBoxLeave=()=>{this.legendDragInfo.dragging=!1,this.legendHover=null,this.clearOverlay();const e=Object.values(this.seriesList);if(!e.length)return;const{colorState:t}=e[0];t[0].selectedValue=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})},this.legendBoxDOM.addEventListener("mousedown",this.onLegendMouseDown),this.legendBoxDOM.addEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.addEventListener("mouseleave",this.onLegendBoxLeave))},getSelectedValue(e){const{x:t,y:n,width:o,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?t:n,r=l?o:s;let c=l?e.clientX:e.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+We(d,r)},updateLegend(){this.resetLegend(),this.createLegend(),Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},resetLegend(){const e=this.containerDOM;if(e)for(;e.hasChildNodes();)e.removeChild(e.firstChild)},clearOverlay(){const e=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],t=e==null?void 0:e.getElementsByClassName("ev-chart-legend-overlay")[0];if(t){e.removeChild(t);const o=e.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(o&&o.length)for(const s of o)s.style.opacity=1}},createLegendOverlay(e,t){this.clearOverlay();const n=this.legendHandleSize,{min:o,max:s}=t;if(o===void 0||s===void 0)return;const l=this.containerDOM.getElementsByClassName("ev-chart-legend-line")[0],a=document.createElement("div");a.className="ev-chart-legend-overlay",a.dataset.type="overlay";const r=document.createElement("div");r.className="ev-chart-legend-overlay-tooltip",r.innerText=Math.floor(o+(s-o)*(e/100));const c=document.createElement("span");c.className="ev-chart-legend-overlay-item",c.dataset.type="overlay-item";let d,h;const f=Math.floor(n/2)+14;this.isSide?(h=`top:${100-e}%;left:${f}px;transform:translateY(-50%);`,d=`top:${100-e}%;transform:translateY(-50%);`):(h=`top:-${f}px;left:${e}%;transform:translateX(-50%);`,d=`left:${e}%;transform:translateX(-50%);`),d+=`width:${n-10}px;height:${n-10}px;`,r.style.cssText=h,c.style.cssText=d,a.appendChild(r),a.appendChild(c),l==null||l.appendChild(a);const u=l==null?void 0:l.getElementsByClassName("ev-chart-legend-thumb")[0];if(u){const m=u.children;if(m&&m.length)for(const p of m)p.style.opacity=.2}},createLegendHandle(e){const t=document.createElement("span");t.className=`ev-chart-legend-handle-btn-color ${e}`,t.dataset.type="handle-btn-color";const n=document.createElement("div");n.className=`ev-chart-legend-handle-btn ${e}`,n.dataset.type="handle-btn",n.appendChild(t);const o=document.createElement("div");return o.className=`ev-chart-legend-handle ${e}`,o.dataset.type="handle",o.appendChild(n),o},createLegendLabel(){const e=document.createElement("span");e.className="ev-chart-legend-label-text";const t=document.createElement("div");return t.className="ev-chart-legend-label",t},createLegend(){if(!Object.values(this.seriesList).length)return;const e=this.options.legend;this.isSide=!["top","bottom"].includes(e.position);const t=this.isSide?e.width:e.height;this.legendHandleSize=t>Or?Or:t;const n=this.legendHandleSize,o=this.createLegendHandle(this.isSide?"end":"start",n),s=this.createLegendHandle(this.isSide?"start":"end",n),l=document.createElement("div");l.className="ev-chart-legend-line-layer",l.dataset.type="line-layer";const a=document.createElement("div");a.className="ev-chart-legend-thumb",a.dataset.type="thumb",a.appendChild(this.createLegendLabel()),a.appendChild(this.createLegendLabel());const r=document.createElement("div");r.className="ev-chart-legend-line",r.dataset.type="line",r.appendChild(l),r.appendChild(a),this.containerDOM.appendChild(r),this.containerDOM.appendChild(o),this.containerDOM.appendChild(s)},setLegendStyle(e){const t=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:o,colorState:s}=e,{min:l,max:a,decimalPoint:r}=o,{start:c,end:d}=s[0],h=e.getColorForGradient(c),f=e.getColorForGradient(d);let u=`linear-gradient(to ${t}, `;u+=`${h}, ${f})`;const m=Math.floor(n/2)+14;let p=`width:${n}px;height:${n}px;`,g,x,b,y=`background:${u};`;this.isSide?(p+=`margin-top:-${n/2}px;`,g=`left:${m}px;transform:translateY(-50%);top:`,x=`top:${100-d}%;`,b=`top:${100-c}%;`,y+=`top:${100-d}%;height:${d-c}%;`):(p+=`margin-left:-${n/2}px;`,g=`top:-${m}px;transform:translateX(-50%);left:`,x=`left:${c}%;`,b=`left:${d}%;`,y+=`left:${c}%;width:${d-c}%;`);const M=(l+(a-l)*(c/100)).toFixed(r),E=(l+(a-l)*(d/100)).toFixed(r),I=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];I.style.cssText=y;const T=I.getElementsByClassName("ev-chart-legend-label");T[0].style.cssText=`${g}0%;`,T[1].style.cssText=`${g}100%;`,l!==void 0&&a!==void 0&&(T[0].innerText=this.isSide?E:M,T[1].innerText=this.isSide?M:E);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=p+x,V[1].style.cssText=p+b;const C=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");C[0].style.backgroundColor=this.isSide?f:h,C[1].style.backgroundColor=this.isSide?h:f},setLegendPosition(){var x,b,y,M;const e=this.options,t=(x=e==null?void 0:e.legend)==null?void 0:x.position,{width:n,height:o}=NC,s=this.legendHandleSize,l=(b=e==null?void 0:e.title)!=null&&b.show?(y=e==null?void 0:e.title)==null?void 0:y.height:0,a=l+o,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((M=e==null?void 0:e.legend)==null?void 0:M.padding)??{},f=this.wrapperDOM.style;if(!f)return;let u,m,p,g;switch(t){case"top":f.padding=`${a}px 0 0 0`,g=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%",m+=`height${o}px;`,u=`width:${g.width}px;`,u+=`height:${o}px;`,u+=`top:${l}px;`;break;case"right":f.padding=`${l}px ${n}px 0 0`,g=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+=`width:${n}px;`,m+="height:100%;",m+=`max-height:${g.height}px;`,u=`width:${n}px;`,u+=`height:${g.height}px;`,u+=`top:${l}px;right:0px;`;break;case"bottom":f.padding=`${l}px 0 ${o}px 0`,g=this.chartDOM.getBoundingClientRect(),m=`padding:${s+7}px ${h}px ${c}px ${d}px;`,m+="width:100%;",m+=`height:${o}px;`,u=`width:${g.width}px;`,u+=`height:${o}px;`,u+="bottom:0px;left:0px;";break;case"left":f.padding=`${l}px 0 0 ${n}px`,g=this.chartDOM.getBoundingClientRect(),m=`padding:${r}px ${h}px ${c}px ${d}px;`,m+="display:absolute;",m+="bottom:0px;",m+=`width:${n}px;`,m+="height:100%;",m+=`maxHeight:${g.height}px;`,u=`width:${n}px;`,u+=`height:${g.height}px;`,u+=`top:${l}px;left:0px`;break}if(["top","bottom"].includes(t)){const E=g.width/2;p=`left:${g.width/2-E/2}px;`,p+=`width:${E}px;`,p+=`height:${s}px;`,p+="padding:4px 0;",p+="margin:0 4px;"}else{const E=g.height/2;p=`top:${g.height/2-E/2}px;`,p+="left:5px;",p+=`width:${s}px;`,p+=`height:${E}px;`,p+="padding:0 4px;",p+="margin:4px 0;"}this.containerDOM.style.cssText=p,this.legendBoxDOM.style.cssText=m,this.legendDOM.style.cssText=u},updateLegendContainerSize(){Object.values(this.seriesList).forEach(e=>{this.setLegendStyle(e)})},showLegend(){this.resizeDOM&&(this.resizeDOM.style.display="block"),this.legendDOM&&(this.legendDOM.style.display="block")},hideLegend(){var s,l,a,r;const e=this.options,t=(s=this.wrapperDOM)==null?void 0:s.style,n=(l=this.legendDOM)==null?void 0:l.style,o=(a=e==null?void 0:e.title)!=null&&a.show?(r=e==null?void 0:e.title)==null?void 0:r.height:0;!n||!t||(n.display="none",n.width="0",n.height="0",t.padding=`${o}px 0 0 0`)}},PC={initScrollbar(){var e,t,n,o,s,l;(n=(t=(e=this.options.axesX)==null?void 0:e[0])==null?void 0:t.scrollbar)!=null&&n.use&&this.initScrollbarInfo(this.options.axesX,"x"),(l=(s=(o=this.options.axesY)==null?void 0:o[0])==null?void 0:s.scrollbar)!=null&&l.use&&this.initScrollbarInfo(this.options.axesY,"y")},initScrollbarInfo(e,t){var s,l,a,r,c,d;const n=this.scrollbar[t],o=Fe({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,Ir.scrollbar);Object.keys(o).forEach(h=>{n[h]=o[h]}),n.resetPosition&&(n.range=(a=(l=e==null?void 0:e[0])==null?void 0:l.range)!=null&&a.length?[...e[0].range]:null,this.resetScrollbarSavedPositions(t)),n.isInit||(n.type=(r=e==null?void 0:e[0])==null?void 0:r.type,n.range=(d=(c=e==null?void 0:e[0])==null?void 0:c.range)!=null&&d.length?[...e[0].range]:null,this.resetScrollbarSavedPositions(t),this.initScrollbarRange(t),this.createScrollbarLayout(t),this.createScrollbar(t),this.createScrollEvent(t),n.isInit=!0)},initScrollbarRange(e){var s,l;const t=this.scrollbar[e],n=t.type,o=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;if((s=t.range)!=null&&s.length&&o.length){const[a,r]=t.range;let c,d;if(ve(a)&&ve(r)){if(n==="step")c=0,d=o.length-1;else{const u=(l=this.minMax[e])==null?void 0:l[0];c=+u.min,d=+u.max}const h=r-a,f=d-c;h>=f?(t.range[0]=c,t.range[1]=d):(t.range[0]=+a<c?c:+a,t.range[1]=+r>d?d:+r,t.range[1]-t.range[0]<h&&(t.range[0]=t.range[1]-h,t.range[0]<c&&(t.range[0]=c)))}}},updateScrollbarInfo(e,t){var r,c,d,h,f,u,m,p,g,x,b,y,M,E,I,T;const{axesX:n,axesY:o}=this.options,s=e==="x"?n:o;if(!this.scrollbar[e].isInit&&((c=(r=s==null?void 0:s[0])==null?void 0:r.scrollbar)!=null&&c.use)&&((d=s==null?void 0:s[0])!=null&&d.range)){this.initScrollbarInfo(s,e);return}else if(!((h=s==null?void 0:s[0].scrollbar)!=null&&h.use)||Gi((f=s==null?void 0:s[0])==null?void 0:f.range)){this.destroyScrollbar(e);return}const l=e==="x"?this.axesX:this.axesY,a=!je((u=s==null?void 0:s[0])==null?void 0:u.range,(m=l==null?void 0:l[0])==null?void 0:m.range);if(a||t){const V=e==="x"?(x=(g=(p=this.options.axesX)==null?void 0:p[0])==null?void 0:g.scrollbar)==null?void 0:x.resetPosition:(M=(y=(b=this.options.axesY)==null?void 0:b[0])==null?void 0:y.scrollbar)==null?void 0:M.resetPosition;a&&(this.scrollbar[e].range=(I=(E=s==null?void 0:s[0])==null?void 0:E.range)!=null&&I.length?[...s[0].range]:null),(V||t)&&this.resetScrollbarSavedPositions(e),this.initScrollbarRange(e)}this.scrollbar[e].use=!!((T=s==null?void 0:s[0].scrollbar)!=null&&T.use)},updateScrollbarPosition(){var e,t,n,o,s,l,a,r,c,d;if((e=this.scrollbar.x)!=null&&e.use&&((t=this.scrollbar.x)!=null&&t.isInit)){const h=!((s=(o=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:o.scrollbar)!=null&&s.resetPosition);this.setScrollbarPosition("x",h)}if((l=this.scrollbar.y)!=null&&l.use&&((a=this.scrollbar.y)!=null&&a.isInit)){const h=!((d=(c=(r=this.options.axesY)==null?void 0:r[0])==null?void 0:c.scrollbar)!=null&&d.resetPosition);this.setScrollbarPosition("y",h)}},createScrollbarLayout(e){const t=this.scrollbar[e];t.dom=document.createElement("div"),t.dom.className="ev-chart-scrollbar",t.dom.dataset.type="scrollbar";const n=document.createElement("div");n.className="ev-chart-scrollbar-container",n.dataset.type=e,t.dom.appendChild(n),this.wrapperDOM.appendChild(t.dom)},createScrollbar(e){const t=this.scrollbar[e],n=t.dom.children[0];this.createScrollbarTrack(n),this.createScrollbarThumb(n),t.showButton&&this.createScrollbarButton(n)},createScrollbarTrack(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-track",t.dataset.type="track",e.appendChild(t)},createScrollbarThumb(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-thumb",t.dataset.type="thumb",e.appendChild(t)},createScrollbarButton(e){const t=document.createElement("div");t.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-up",t.dataset.type="button";const n=document.createElement("i");n.className="ev-icon ev-icon-triangle-up ev-chart-scrollbar-button-icon",n.dataset.type="button-icon",t.appendChild(n);const o=document.createElement("div");o.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",o.dataset.type="button";const s=document.createElement("i");s.className="ev-icon ev-icon-triangle-down ev-chart-scrollbar-button-icon",s.dataset.type="button-icon",o.appendChild(s),e.appendChild(t),e.appendChild(o)},setScrollbarPosition(e,t=!1){var V,C;const n=this.scrollbar[e];if(!n.use||!n.range)return;const o=n.dom,s=this.chartRect,l=this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(V=this.options.title)!=null&&V.show?(C=this.options.title)==null?void 0:C.height:0,c=e==="x",d=c?n.height:n.width,h=c?a.x2-a.x1:a.y2-a.y1,f=n.showButton?d:0,u=h-f*2,m=this.getScrollbarThumbSize(e,u);if(t&&n.savedPositionRatio!==void 0){const S=Math.max(0,u-m.size);n.savedAtStart?m.position=0:n.savedAtEnd?m.position=S:m.position=Math.min(n.savedPositionRatio*u,S)}const p=Math.max(0,u-m.size);p>0&&(n.savedPositionRatio=m.position/u,n.savedAtStart=m.position<=0,n.savedAtEnd=m.position>=p);let g="display: block;",x,b,y,M,E=`width:${f}px;height:${f}px;`;c?(g=`top: ${s.y2+r+l.top}px;`,g+=`left: ${a.x1}px;`,g+=`width: ${h}px;`,g+=` height: ${d}px;`,x="top: 0;",x+=`left: ${f}px;`,x+=`width: ${u}px;`,x+="height: 100%;",b=`width: ${m.size}px;`,b+="height: 100%;",b+=`left: ${m.position+f}px`,E+="transform:rotate(90deg);top: 0;",y=`${E}right:0;`,M=`${E}left:0;`):(g=`top: ${a.y1+r}px;`,g+=`left: ${a.x2+10}px;`,g+=`width: ${d}px;`,g+=`height: ${h}px;`,x=`top: ${f}px;`,x+="left: 0;",x+="width: 100%;",x+=`height: ${u}px;`,b="width: 100%;",b+=`height: ${m.size}px;`,b+=`bottom: ${m.position+f}px`,E+="left:0;",y=`${E}top: 0;`,M=`${E}bottom: 0;`),o.style.cssText=g;const I=o.getElementsByClassName("ev-chart-scrollbar-track");I[0].style.cssText=x,I[0].style.backgroundColor=n.background;const T=o.getElementsByClassName("ev-chart-scrollbar-thumb");if(T[0].style.cssText=b,T[0].style.backgroundColor=n.thumbStyle.background,T[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const S=o.getElementsByClassName("ev-chart-scrollbar-button-up"),w=Math.floor(u-m.size),k=Math.floor(m.position)>w?.5:1;S[0].style.cssText=`background-color: ${n.background};${y}`,S[0].style.opacity=k,S[0].children[0].style.display="block";const B=o.getElementsByClassName("ev-chart-scrollbar-button-down");B[0].style.cssText=`background-color: ${n.background};${M}`,B[0].style.opacity=Math.floor(m.position)<0?.5:1,B[0].children[0].style.display="block"}},getScrollbarThumbSize(e,t){var f,u,m,p;const n=this.scrollbar[e],[o,s]=n.range,l=n.type;let a,r,c=1,d=0,h=0;if(l==="step"){const g=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels,x=s-o+1;r=g.length;const b=t/r;a=b*x,h=b*o}else{const g=e==="x"?this.axesX:this.axesY,x=(f=this.minMax[e])==null?void 0:f[0],b=+x.max-+x.min,y=+s-+o;l==="time"&&(c=(p=g==null?void 0:g[0])==null?void 0:p.getInterval({minValue:x.min,maxValue:x.max,maxSteps:(m=(u=this.labelRange[e])==null?void 0:u[0])==null?void 0:m.max})),r=Math.ceil(b/c)+1,d=+x.min;const M=t/r,E=y/c+1,I=+o-d;a=M*E,h=M*(I/c)}return n.startValue=d,n.steps=r,n.interval=c,{size:a,position:h}},getScrollbarContainerDOM(e){const t=["track","thumb","button"],n=e.dataset.type;return t.includes(n)?e.parentElement:n==="button-icon"?e.parentElement.parentElement:n==="scrollbar"?e.getElementsByClassName("ev-chart-scrollbar-container")[0]:e},updateScrollbarRange(e,t){const n=this.scrollbar[e],{startValue:o,range:s,interval:l,steps:a}=n,r=o+l*a,c=e==="x"?this.axesX[0]:this.axesY[0],[d,h]=s??[];(!ve(d)||!ve(h))&&(n.range=(c==null?void 0:c.range)||null);let f,u,m=!1;t?(f=d+l,u=h+l,m=u>=r):(f=d-l,u=h-l,m=f<o),m||(n.range=[f,u],this.resetScrollbarSavedPositions(e),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:f>1,updateByScrollbar:!0}))},resetScrollbarSavedPositions(e){const t=this.scrollbar[e];t&&(delete t.savedPositionRatio,delete t.savedAtStart,delete t.savedAtEnd)},createScrollEvent(){var t,n,o;this.onScrollbarClick=s=>{s.preventDefault();const l=s.target.dataset.type,a=this.getScrollbarContainerDOM(s.target),r=["button","button-icon"],c=a.dataset.type;let d;if(r.includes(l)){let h;l==="button"?h=s.target:l==="button-icon"&&(h=s.target.parentElement),d=h.className.includes("up")}else if(l==="track"){const h=a.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:f,y:u}=h[0].getBoundingClientRect(),m=c==="x",p=m?s.clientX:-s.clientY,g=m?f:-u;d=p>g}else return;this.updateScrollbarRange(c,d)},this.onScrollbarDown=s=>{if(s.preventDefault(),s.target.dataset.type!=="thumb")return;const l=this.getScrollbarContainerDOM(s.target),a=l.dataset.type,r=l.getElementsByClassName("ev-chart-scrollbar-thumb"),{x:c,y:d,height:h}=r[0].getBoundingClientRect(),f=this.scrollbar[a];f.scrolling=!0,a==="x"?f.pointInThumb=s.clientX-c:f.pointInThumb=d+h-s.clientY;const u=f.dom;u.addEventListener("mousemove",this.onScrollbarMove),u.addEventListener("mouseup",this.onScrollbarUp)};const e=s=>{this.scrolling(s)};if(this.onScrollbarMove=xs(e,5),this.onScrollbarUp=s=>{s.preventDefault(),this.stopScrolling(s)},this.onScrollbarLeave=s=>{s.preventDefault(),this.scrolling(s),this.stopScrolling(s)},this.onScrollbarWheel=s=>{var h,f,u,m,p,g,x,b;const l=((f=(h=this.tooltipDOM)==null?void 0:h.style)==null?void 0:f.display)==="block",a=this.tooltipBodyDOM||((u=this.tooltipDOM)==null?void 0:u.querySelector(this.options.tooltip.htmlScrollTarget));if(l&&a){const{scrollTop:y,scrollHeight:M,clientHeight:E}=a,I=y<=0,T=y+E>=M,V=s.deltaY<0,C=s.deltaY>0;if(!(I&&V||T&&C))return}s.preventDefault();const r=1;if((m=this.scrollbar.x)!=null&&m.use&&s.shiftKey&&Math.abs(s.deltaY)>r){this.updateScrollbarRange("x",s.deltaY>0);return}const c=Math.abs(s.deltaX),d=Math.abs(s.deltaY);if(c>r&&d>r){c>d&&((p=this.scrollbar.x)!=null&&p.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((g=this.scrollbar.y)!=null&&g.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((x=this.scrollbar.x)!=null&&x.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(b=this.scrollbar.y)!=null&&b.use&&d>r&&this.updateScrollbarRange("y",s.deltaY<0)},this.scrollbar.x.use&&!this.scrollbar.x.isInit){const s=this.scrollbar.x.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}if(this.scrollbar.y.use&&!this.scrollbar.y.isInit){const s=this.scrollbar.y.dom;s.addEventListener("click",this.onScrollbarClick),s.addEventListener("mousedown",this.onScrollbarDown),s.addEventListener("mouseleave",this.onScrollbarLeave)}((t=this.scrollbar.x)!=null&&t.use||(n=this.scrollbar.y)!=null&&n.use)&&((o=this.overlayCanvas)==null||o.addEventListener("wheel",this.onScrollbarWheel,{passive:!1}))},scrolling(e){const t=this.getScrollbarContainerDOM(e.target),n=t.dataset.type;if(!this.scrollbar[n].scrolling)return;const{steps:o,range:s,pointInThumb:l,startValue:a,interval:r}=this.scrollbar[n],c=t.getElementsByClassName("ev-chart-scrollbar-track"),{x:d,y:h,width:f,height:u}=c[0].getBoundingClientRect(),m=n==="x",p=m?d:h,g=m?f:u,x=g/o,b=a+(o-1)*r;let y=m?e.clientX:e.clientY;y<p?y=p:y>p+g&&(y=p+g);let M;if(m?M=y-p-l:M=p+g-y-l,M<=0)return;let E,I;const T=Math.round(Math.abs(M)/x)*r,[V,C]=s;if(M>0){const S=a+(T-+V);E=+V+S,I=E+(+C-+V)}E<a||I>b||(this.scrollbar[n].range=[E,I],this.resetScrollbarSavedPositions(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:E>1,updateByScrollbar:!0}))},stopScrolling(e){const n=this.getScrollbarContainerDOM(e.target).dataset.type,o=this.scrollbar[n];if(o.scrolling){o.scrolling=!1;const s=o.dom;s.removeEventListener("mousemove",this.onScrollbarMove,!1),s.removeEventListener("mouseup",this.onScrollbarUp,!1)}},hideScrollbar(e){const t=this.scrollbar[e].dom;if(!t)return;const n=t==null?void 0:t.style;n.display="none",n.width="0",n.height="0"},destroyScrollbar(e){var n,o,s;const t=this.scrollbar[e].dom;t&&(t.remove(),this.scrollbar[e]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((o=this.scrollbar.y)!=null&&o.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function _C(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function Lr(e,t,n){let o,s,l,a,r,c,d=0,h=!1,f=!1,u=!0;const m=!t&&t!==0&&typeof root.requestAnimationFrame=="function";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0,_C(n)&&(h=!!n.leading,f="maxWait"in n,l=f?Math.max(+n.maxWait||0,t):l,u="trailing"in n?!!n.trailing:u);function p(w){const k=o,B=s;return o=s=void 0,d=w,a=e.apply(B,k),a}function g(w,k){return m?(window.cancelAnimationFrame(r),window.requestAnimationFrame(w)):setTimeout(w,k)}function x(w){if(m)return window.cancelAnimationFrame(w);clearTimeout(w)}function b(w){return d=w,r=g(E,t),h?p(w):a}function y(w){const k=w-c,B=w-d,D=t-k;return f?Math.min(D,l-B):D}function M(w){const k=w-c,B=w-d;return c===void 0||k>=t||k<0||f&&B>=l}function E(){const w=Date.now();if(M(w))return I(w);r=g(E,y(w))}function I(w){return r=void 0,u&&o?p(w):(o=s=void 0,a)}function T(){r!==void 0&&x(r),d=0,o=c=s=r=void 0}function V(){return r===void 0?a:I(Date.now())}function C(){return r!==void 0}function S(...w){const k=Date.now(),B=M(k);if(o=w,s=this,c=k,B){if(r===void 0)return b(c);if(f)return r=g(E,t),p(c)}return r===void 0&&(r=g(E,t)),a}return S.cancel=T,S.flush=V,S.pending=C,S}const AC="Expected a function";function zC(e,t,n){let o=!0,s=!0;if(typeof e!="function")throw new TypeError(AC);return Lr(e,t,{leading:o,maxWait:t,trailing:s})}const FC={createEventFunctions(){var e,t,n,o;this.onMouseMove=s=>{var u,m;if((u=this.dragInfo)!=null&&u.isMove||this.isMobile)return;const l={e:s},{indicator:a,tooltip:r,type:c}=this.options,d=this.getMousePosition(s),h=this.findHitItem(d);r!=null&&r.showAllValueInRange&&(h!=null&&h.items)&&this.addNotHitInfo(h);const f=this.overlayCtx;if(this.overlayClear(),Object.keys(h.items).length){if(r.use&&this.isInitTooltip)if(this.drawItemsHighlight(h,f),typeof(r==null?void 0:r.returnValue)=="function"){const g=[];Object.keys(h.items).forEach(x=>{g.push({sId:x,data:h.items[x].data,color:h.items[x].color,name:h.items[x].name,dataId:h.items[x].id,index:h.items[x].index})}),this.hideTooltipDOM(),r.returnValue(g,s)}else(m=r==null?void 0:r.formatter)!=null&&m.html?(this.drawCustomTooltip(h==null?void 0:h.items),this.setCustomTooltipLayoutPosition(h,s)):(this.setTooltipLayoutPosition(h,s),c==="scatter"?this.drawTooltipForScatter(h,this.tooltipCtx):c==="heatMap"?this.drawToolTipForHeatMap(h,this.tooltipCtx):this.drawTooltip(h,this.tooltipCtx));const p=Object.values(this.seriesList||{}).some(g=>g.type==="line");if(r.use&&(c==="line"||p)){const g=this.drawIndicatorForTooltip(h,a.color),x=g==null?void 0:g.labelValue,b=this.getTimeLabel(d);l.hoveredLabel={horizontal:this.options.horizontal,label:b,mousePosition:[s.clientX,s.clientY],dataLabel:x}}}else r.use&&this.isInitTooltip&&(typeof(r==null?void 0:r.returnValue)=="function"&&r.returnValue([],s),this.hideTooltipDOM());if(this.dragInfoBackup&&this.drawSelectionArea(this.dragInfoBackup),!l.hoveredLabel&&!this.isNotUseIndicator()){const p=Object.values(this.seriesList||{}).some(x=>x.type==="line");(c!=="line"&&!p||!r.use||!Object.keys(h.items).length)&&this.drawIndicator(d,a.color);const g=this.getTimeLabel(d);l.hoveredLabel={horizontal:this.options.horizontal,label:g,mousePosition:[s.clientX,s.clientY]}}else l.hoveredLabel||(l.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(c!=="pie"&&(l.curMouseTargetVal=this.getCurMouseTargetVal(d,h)),this.listeners["mouse-move"](l))},this.onMouseLeave=s=>{const{tooltip:l,dragSelection:a}=this.options;l.throttledMove&&this.onMouseMove.cancel(),(!a.use||!a.keepDisplay)&&this.overlayClear(),l.use&&this.isInitTooltip&&(typeof(l==null?void 0:l.returnValue)=="function"&&l.returnValue([],s),this.tooltipClear()),this.listeners["mouse-leave"]()},this.onDblClick=s=>{const l={e:s},a=this.getMousePosition(s),{type:r,selectItem:c,selectLabel:d,selectSeries:h}=this.options,f=(c==null?void 0:c.use)&&(c==null?void 0:c.useClick),u=(d==null?void 0:d.use)&&(d==null?void 0:d.useClick),m=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick);f?l.eventTarget="item":u?l.eventTarget="label":m&&(l.eventTarget="series");const p=()=>{var E,I;const b=this.findHitItem(a),y=b.hitId||Object.keys(b.items)[0],M=b.items[y];M&&(l.label=M.label,l.value=(E=M.data)==null?void 0:E.o,l.seriesId=y,l.dataIndex=M.index,l.acc=(I=M.data)==null?void 0:I.acc)},g=b=>{var V,C;const y=this.findHitItem(a),M=y.hitId||Object.keys(y.items)[0],E=y.items[M],{labelIndex:I}=this.getLabelInfoByPosition(a,b),{dataIndex:T}=this.regulateSelectedLabelInfo(I,b);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(T,b),E&&(l.label=E.label,l.seriesId=M,l.value=(V=E.data)==null?void 0:V.o,l.acc=(C=E.data)==null?void 0:C.acc,l.dataIndex=E.index)},x=()=>{var E,I,T;const b=this.findHitItem(a),y=b.hitId||Object.keys(b.items)[0],M=b.items[y];if(y!==null){const V=this.updateSelectedSeriesInfo(y,!0);M&&(l.label=M.label,l.value=(E=M.data)==null?void 0:E.o,l.seriesId=(I=V.seriesId)==null?void 0:I.at(0),l.acc=(T=M.data)==null?void 0:T.acc,l.dataIndex=M.index)}};switch(r){case"bar":{u?g(this.options.horizontal?"yAxis":"xAxis"):p();break}case"line":{f?p():u?g():m&&x();break}default:{p();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](l)},this.onClick=s=>{var b;if(this.isMouseMove){this.isMouseMove=!1;return}const l={e:s},a=this.getMousePosition(s),{type:r,selectItem:c,selectLabel:d,selectSeries:h}=this.options,f=(c==null?void 0:c.use)&&(c==null?void 0:c.useClick),u=(d==null?void 0:d.use)&&(d==null?void 0:d.useClick),m=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick),p=()=>{const y=this.getItemByPosition(a,!1);({label:l.label,value:l.value,sId:l.seriesId,maxIndex:l.dataIndex,acc:l.acc}=y),y!=null&&y.sId&&(l.selected={eventTarget:"item",seriesId:this.isDeselectItem(y)?null:y.sId,dataIndex:this.isDeselectItem(y)?null:y.maxIndex})},g=y=>{var I,T,V,C;const{labelIndex:M}=this.getLabelInfoByPosition(a,y),{dataIndex:E}=this.regulateSelectedLabelInfo(M,y);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(E,y),y&&(this.defaultSelectInfo.targetAxis=E!=null&&E.length?y:null),l.selected={eventTarget:"label",...Se(this.defaultSelectInfo)},l.label=(T=(I=this.defaultSelectInfo)==null?void 0:I.label)==null?void 0:T.at(0),l.dataIndex=(C=(V=this.defaultSelectInfo)==null?void 0:V.dataIndex)==null?void 0:C.at(0)},x=()=>{const y=this.findHitItem(a),M=y.hitId||Object.keys(y.items)[0],E=y.items[M];if(!pt(M)){const I=this.updateSelectedSeriesInfo(M,!1);this.defaultSelectInfo.seriesId=I.seriesId,l.selected={eventTarget:"series",...Se(this.defaultSelectInfo)},l.label=E.label,l.dataIndex=E.index}};switch(r){default:case"bar":{f?p():u&&g(this.options.horizontal?"yAxis":"xAxis");break}case"line":{f?p():u?g():m&&x();break}case"heatMap":{const y=!!this.options.horizontal;if(f&&u){const{useBothAxis:M}=d,E=this.getCurMouseLocation(a);if(E==="chartBackground")this.clearSelectedLabelInfo(),l.deselected={eventTarget:"label"},p();else if(E==="yAxis"||E==="xAxis"){if(this.clearSelectedItemInfo(),l.deselected={eventTarget:"item"},!M&&E!==(y?"yAxis":"xAxis"))return;g(E)}}else if(f)p();else if(u){const{useBothAxis:M}=d,E=this.getCurMouseLocation(a);if((E==="yAxis"||E==="xAxis")&&!M&&E!==(y?"yAxis":"xAxis"))return;E!=="canvas"&&g(M?E:null)}break}case"pie":{f&&p();break}case"scatter":{if(f&&p(),(b=this.options.dragSelection)!=null&&b.use&&this.isMobile){let y=this.setTouchInfo(s);this.overlayClear(),this.options.dragSelection.keepDisplay&&(s.layerX<y.range.x1||s.layerY<y.range.y1||s.layerX>y.range.x2||s.layerY>y.range.y2)?this.isTouchOverlay=!1:(y=this.setTouchBoxDimensions(y),this.isTouchOverlay=!0,this.drawSelectionArea(y)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),l.e=s,l.touchInfo=y,l.data=this.findSelectedItems(y),l.range=this.getSelectionRange(y),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](l)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(l))},this.onMouseDown=s=>{const{dragSelection:l,type:a}=this.options;l.use&&(a==="scatter"||a==="line"||a==="heatMap")&&(this.removeSelectionArea(),this.dragStart(s,a))},this.onWheel=s=>{var r,c,d;const l=((c=(r=this.tooltipDOM)==null?void 0:r.style)==null?void 0:c.display)==="block",a=(d=this.tooltipDOM)==null?void 0:d.querySelector(this.options.tooltip.htmlScrollTarget);(l||a&&a.scrollHeight>a.clientHeight)&&(s.preventDefault(),l&&(this.tooltipBodyDOM.scrollTop+=s.deltaY),a&&(a.scrollTop+=s.deltaY))},(t=(e=this.options)==null?void 0:e.tooltip)!=null&&t.useScrollbar&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(o=(n=this.options)==null?void 0:n.tooltip)!=null&&o.throttledMove&&(this.onMouseMove=zC(this.onMouseMove,30)),this.overlayCanvas.addEventListener("mousemove",this.onMouseMove),this.overlayCanvas.addEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.addEventListener("dblclick",this.onDblClick),this.overlayCanvas.addEventListener("click",this.onClick),this.overlayCanvas.addEventListener("mousedown",this.onMouseDown),this.dragTouchSelectionEvent=s=>this.dragTouchSelectionDestroy(s),window.addEventListener("click",this.dragTouchSelectionEvent)},dragStart(e,t){let[n,o]=this.getMousePosition(e);const s=this.chartRect,l=this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom};n<a.x1&&(n=a.x1),n>a.x2&&(n=a.x2),o<a.y1&&(o=a.y1),o>a.y2&&(o=a.y2),this.dragInfo={xcp:n,ycp:o,range:a};const r=d=>{d.preventDefault();const[h,f]=this.getMousePosition(d),u=this.dragInfo,{xcp:m,ycp:p,range:g}=u;let x,b;if(u.isMove=!0,this.isMouseMove=!0,h<g.x1?x=g.x1:h>g.x2?x=g.x2:x=h,f<g.y1?b=a.y1:f>g.y2?b=g.y2:b=f,t==="heatMap"){const y={xcp:m,xep:x,ycp:p,yep:b,range:g},{xsp:M,ysp:E,width:I,height:T}=this.getDragInfoForHeatMap(y);u.xsp=M,u.ysp=E,u.width=I,u.height=T}else u.xsp=Math.min(m,x),u.ysp=t==="scatter"?Math.min(p,b):g.y1,u.width=Math.ceil(Math.abs(x-m)),u.height=t==="scatter"?Math.ceil(Math.abs(b-p)):g.y2-g.y1;this.overlayClear(),this.drawSelectionArea(u)},c=d=>{var f,u;const h=this.dragInfo;if(h!=null&&h.isMove&&(h==null?void 0:h.width)>1&&(h==null?void 0:h.height)>1){const m={e:d,data:this.findSelectedItems(h),range:t==="heatMap"?this.getSelectionRangeForHeatMap(h):this.getSelectionRange(h)};if(this.dragInfoBackup=Fe({},h),typeof this.listeners["drag-select"]=="function"&&!((u=(f=this.options)==null?void 0:f.zoom)!=null&&u.use))this.listeners["drag-select"](m);else{const{xsp:p,range:g,width:x}=h,b=p-g.x1;m.range.dragSelectionInfo={dragXsp:b,dragXep:b+x,exceptAxesYChartWidth:g.x2-g.x1,exceptAxesXChartHeight:g.y2-g.y1,chartRange:g,chartTitle:this.options.title.text},this.options.zoom.getRangeInfo(m)}this.options.dragSelection.keepDisplay||this.removeSelectionArea()}this.dragInfo=null,window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",c)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",c)},drawSelectionArea({xsp:e,ysp:t,width:n,height:o,range:s}){const l=this.overlayCtx,{fillColor:a,opacity:r}=this.options.dragSelection,c=this.chartRect,d=this.labelOffset,h={x1:c.x1+d.left,x2:c.x2-d.right,y1:c.y1+d.top,y2:c.y2-d.bottom};if(l.fillStyle=a,l.globalAlpha=r,je(h,s))l.fillRect(e,t,n,o);else{const f=s.x2-s.x1,u=s.y2-s.y1,m=h.x2-h.x1,p=h.y2-h.y1,g=(e-s.x1)/f,x=(t-s.y1)/u,b=h.x1+m*g,y=h.y1+p*x,M=n/f,E=o/u,I=m*M,T=p*E;l.fillRect(b,y,I,T)}l.globalAlpha=1},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear()},getMousePosition(e){const t=e.originalEvent||e,n=this.overlayCanvas.getBoundingClientRect();return[t.clientX-n.left,t.clientY-n.top,n.width,n.height]},getCurMouseTargetVal(e,t){const n=this.getCurMouseLocation(e),o={location:n,labelIdx:-1,labelVal:"",dataIdx:-1,maxDataVal:"",originVal:""};if(n==="chartBackground"){const{maxHighlight:s,items:l}=t;if(s!=null&&s.length){const[a,r]=s;l[a]&&(o.dataIdx=l[a].index,o.maxDataVal=r,o.originVal=t)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{o.labelIdx=d,o.labelVal=c[0].type==="time"?at(h).format(c[0].timeFormat):h,o.originVal=c[0].type==="time"?at(h):h};(c=>{const{labelIndex:d}=this.getLabelInfoByPosition(e,n),{labelVal:h,labelIdx:f}=this.getCurMouseLabelVal(c,e,d);a(c==="xAxis"?s:l,f,h)})(n)}return o},setTouchInfo(e){let[t,n]=this.getMousePosition(e);const o=this.chartRect,s=this.labelOffset,l={x1:o.x1+s.left,x2:o.x2-s.right,y1:o.y1+s.top,y2:o.y2-s.bottom};return t=Math.max(l.x1,Math.min(t,l.x2)),n=Math.max(l.y1,Math.min(n,l.y2)),{xcp:t,ycp:n,range:l}},setTouchBoxDimensions(e){var h;const t=((h=this.options.dragSelection)==null?void 0:h.size)||50,n=t/2,{xcp:o,ycp:s,range:l}=e;let a=o-n,r=s-n,c=t,d=t;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},o<l.x1+n&&(a=l.x1,c=n-(l.x1-o),this.boxOverflow.x1=!0),o>l.x2-n&&(c=n-(o-l.x2),this.boxOverflow.x2=!0),s<l.y1+n&&(r=l.y1,d=n-(l.y1-s),this.boxOverflow.y1=!0),s>l.y2-n&&(d=n-(s-l.y2),this.boxOverflow.y2=!0),e.xsp=a,e.ysp=r,e.width=c,e.height=d,e},dragTouchSelectionDestroy(e){var t;(t=this.options.dragSelection)!=null&&t.use&&e.target!==this.overlayCanvas&&this.isTouchOverlay&&(this.isTouchOverlay=!1,this.overlayClear())},findHitItem(e){var g,x;const t=Object.keys(this.seriesList),n={},o=!!this.options.horizontal,s=this.tooltipCtx;let l=null,a="",r=0,c="",d=null,h=null,f=1/0;const u=this.findClosestDataIndex(e,t);if(u===-1&&!this.isNotUseIndicator())return{items:n,hitId:l,maxTip:[a,c],maxHighlight:null};const m=t.every(b=>this.seriesList[b].type==="bar");for(let b=0;b<t.length;b++){const y=t[b],M=this.seriesList[y];if(M.findGraphData&&M.show){const E=M.findGraphData(e,o,u,!m);if(E!=null&&E.data){let I;if(E.data.o===null&&M.interpolation!=="zero"?M.isExistGrp||(I=o?E.data.x:E.data.y):isNaN(E.data.o)||(I=E.data.o),I!=null){const T=this.getFormattedTooltipLabel({dataId:M.id,seriesId:y,seriesName:M.name,itemData:E.data}),V=s?s.measureText(T).width:1;E.id=M.id,E.name=T,E.axis={x:M.xAxisIndex,y:M.yAxisIndex},E.label=o?(g=E.data)==null?void 0:g.y:(x=E.data)==null?void 0:x.x,n[y]=E;const C=this.getFormattedTooltipValue({dataId:M.id,seriesId:y,seriesName:T,value:I,itemData:E.data});if(E.data.formatted=C,r<V&&(a=T,r=V),c.length<=`${C}`.length&&(c=`${C}`),(d===null||d<=I)&&(d=I,h=y),E.hit&&E.data.xp!==void 0&&E.data.yp!==void 0){const S=(E.data.xp-e[0])**2+(E.data.yp-e[1])**2;S<f&&(f=S,l=y)}}}}}return l=l===null?Object.keys(n)[0]:l,{items:n,hitId:l,maxTip:[a,c],maxHighlight:d!==null?[h,d]:null}},findClosestDataIndex(e,t){var f;const[n,o]=e,s=!!this.options.horizontal,l=s?o:n,a=t.find(u=>{var p;const m=this.seriesList[u];return(m==null?void 0:m.show)&&((p=m==null?void 0:m.data)==null?void 0:p.length)>0});if(!a||!((f=this.seriesList[a])!=null&&f.data))return-1;const r=this.seriesList[a].data;let c=50;if(r.length>1){const u=[];for(let m=1;m<r.length;m++){const p=r[m-1],g=r[m];if(p&&g){let x,b;s?(x=p.h?p.yp+p.h/2:p.yp,b=g.h?g.yp+g.h/2:g.yp):(x=p.w?p.xp+p.w/2:p.xp,b=g.w?g.xp+g.w/2:g.xp),x!==null&&b!==null&&u.push(Math.abs(b-x))}}u.length>0&&(c=u.reduce((m,p)=>m+p,0)/u.length)}let d=1/0,h=-1;for(let u=0;u<r.length;u++)if(t.some(p=>{var x,b,y,M;const g=this.seriesList[p];return(g==null?void 0:g.show)&&((b=(x=g.data)==null?void 0:x[u])==null?void 0:b.o)!==null&&((M=(y=g.data)==null?void 0:y[u])==null?void 0:M.o)!==void 0})){const p=r[u];if(p){let g;if(s?g=p.h?p.yp+p.h/2:p.yp:g=p.w?p.xp+p.w/2:p.xp,g!==null){const x=Math.abs(l-g);x<d&&(d=x,h=u)}}}return d>=c?t.some(m=>{const p=this.seriesList[m];if(p!=null&&p.show){const g=p.passingValue,x=p.interpolation,b=p.hasPassingValueInData;return x==="linear"||x==="none"&&!!g&&b}return!1})?h:-1:h},getFormattedTooltipLabel({dataId:e,seriesId:t,seriesName:n,itemData:o}){var c;const l=this.options.tooltip,a=(c=l==null?void 0:l.formatter)==null?void 0:c.label;let r=n;return a&&(r=a({dataId:e,seriesId:t,seriesName:n,itemData:o})),r},getFormattedTooltipValue({dataId:e,seriesId:t,seriesName:n,value:o,itemData:s}){var h;const l=this.options,a=!!l.horizontal,r=l.tooltip,c=typeof(r==null?void 0:r.formatter)=="function"?r==null?void 0:r.formatter:(h=r==null?void 0:r.formatter)==null?void 0:h.value;let d=o;return c&&(l.type==="pie"?d=c({value:o,name:n,percentage:s==null?void 0:s.percentage,seriesId:t,dataId:e}):l.type==="heatMap"?d=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:o>-1?o:"error",seriesId:t,dataId:e}):d=c({x:a?o:s==null?void 0:s.x,y:a?s==null?void 0:s.y:o,o:s==null?void 0:s.o,name:n,seriesId:t,dataId:e})),o&&(!c||typeof d!="string")&&(l.type==="heatMap"?d=o<0?"error":$t(o):d=$t(o)),d},addNotHitInfo(e){var c,d,h,f,u,m;const t=this.tooltipCtx,n=!!this.options.horizontal,o=Object.keys(e.items)[0],s=n?(h=(d=(c=e.items)==null?void 0:c[o])==null?void 0:d.data)==null?void 0:h.y:(m=(u=(f=e.items)==null?void 0:f[o])==null?void 0:u.data)==null?void 0:m.x;let l="",a="";const r=Object.keys(this.seriesList);for(let p=0;p<r.length;p++){const g=r[p],x=this.seriesList[g];if(x!=null&&x.show){const b=x.data.find(C=>n?(C==null?void 0:C.y)===s:(C==null?void 0:C.x)===s),y=this.getFormattedTooltipLabel({dataId:x.id,seriesId:g,seriesName:x.name,itemData:b}),M=this.getFormattedTooltipValue({dataId:x.id,seriesId:g,seriesName:y,value:b==null?void 0:b.o,itemData:b});if(b&&b.o!==null&&b.o!==void 0&&!e.items[g]){const C={};C.color=x.color,C.hit=!1,C.name=y,C.axis={x:x.xAxisIndex,y:x.yAxisIndex},C.index=n?x.yAxisIndex:x.xAxisIndex,C.data=b,C.data.formatted=M,e.items[g]=C}const E=t?t.measureText(l).width:1,I=t?t.measureText(y).width:1;E<I&&(l=y);const T=t?t.measureText(a).width:1,V=t?t.measureText(`${M}`).width:1;T<V&&(a=`${M}`)}}e.maxTip=[l,a]},selectItemByData(e,t){this.defaultSelectItemInfo=e;let n;t==="pie"?n={type:"pie",sId:e.seriesID}:n=isNaN(e==null?void 0:e.dataIndex)?null:this.getItem(e,!1),this.render(n)},selectLabelByData(e,t){this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(e,t),this.render()},selectSeriesByData(e){this.defaultSelectInfo.seriesId=e,this.render()},getSelectedLabelInfoWithLabelData(e,t){const{selectLabel:n,type:o,horizontal:s}=this.options,l=Se(this.defaultSelectInfo);switch(l.dataIndex=e,o){default:case"bar":case"line":{l.dataIndex.splice(n.limit),l.label=l.dataIndex.map(r=>this.data.labels[r]);const a=Object.entries(this.data.data);l.data=l.dataIndex.map(r=>Object.fromEntries(a.map(([c,d])=>[c,d[r]])));break}case"heatMap":{const{limit:a,useBothAxis:r}=this.options.selectLabel;l.dataIndex.splice(a);let c;r?c=t==="yAxis"?"y":"x":c=s?"y":"x",l.label=l.dataIndex.map(h=>this.data.labels[c][h]);const d=Object.values(this.data.data)[0];l.data=d.filter(({x:h,y:f})=>l.label.includes(c==="y"?f:h));break}}return l},regulateSelectedLabelInfo(e,t){var l,a;const n=((l=this.options)==null?void 0:l.selectLabel)??{},o=t===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===t?{...this.defaultSelectInfo,targetAxis:t}:{dataIndex:[],targetAxis:t},s=Se(o);if(o.dataIndex.includes(e)){const r=o.dataIndex.indexOf(e);s.dataIndex.splice(r,1)}else e>-1&&(s.dataIndex.push(e),n.limit>0&&n.limit<s.dataIndex.length&&(n.useDeselectOverflow?s.dataIndex.splice(0,1):s.dataIndex.pop()));return s},updateSelectedSeriesInfo(e,t){var l;const n=((l=this.options)==null?void 0:l.selectSeries)??{},o=this.defaultSelectInfo??{seriesId:[]};typeof o.seriesId=="string"&&(o.seriesId=[o.seriesId]);const s=Se(o);if(o.seriesId.includes(e)){if(!t){const a=o.seriesId.indexOf(e);s.seriesId.splice(a,1)}}else e&&(s.seriesId.push(e),n.limit>0&&n.limit<s.seriesId.length&&(n.useDeselectOverflow?s.seriesId.splice(0,1):s.seriesId.pop()));return s},drawIndicatorForTooltip(e,t){var d;if(!(e!=null&&e.items)||!Object.keys(e.items).length)return null;const n=this.overlayCtx,{horizontal:o}=this.options,s={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},l=Object.keys(e.items)[0],a=e.items[l];if(!(a!=null&&a.data))return null;const r=o?a.data.y:a.data.x;let c;if(o){const h=a.data.yp+(a.data.h?a.data.h/2:0);c=[s.x1,h]}else c=[a.data.xp+(a.data.w?a.data.w/2:0),s.y1];return n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=this.options.indicator)!=null&&d.segments&&n.setLineDash(this.options.indicator.segments),o?(n.moveTo(s.x1,c[1]+.5),n.lineTo(s.x2,c[1]+.5)):(n.moveTo(c[0]+.5,s.y1),n.lineTo(c[0]+.5,s.y2)),n.stroke(),n.restore(),n.closePath(),{labelValue:r,position:c}},findSelectedItems(e){const t=[],n=Object.keys(this.seriesList);for(let o=0;o<n.length;o++){const s=n[o],l=this.seriesList[s],a=l.findItems;if(a){const r=a.call(l,e);r&&r.length&&t.push({seriesName:l.name,seriesId:s,items:r})}}return t},getSelectionRange({xsp:e,ysp:t,width:n,height:o,range:s}){var M,E,I,T;const l=this.axesSteps.x.length?this.axesSteps.x[0]:null,a=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!l||!a)return null;const r=e+n,c=t+o,d=l.graphMax-l.graphMin,h=a.graphMax-a.graphMin,f=this.getRatioInRange(s.x1,s.x2,e),u=this.getRatioInRange(s.x1,s.x2,r),m=this.getRatioInRange(s.y1,s.y2,c),p=this.getRatioInRange(s.y1,s.y2,t),g=this.isMobile&&((M=this.boxOverflow)!=null&&M.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*f,l.graphMin),x=this.isMobile&&((E=this.boxOverflow)!=null&&E.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*u,l.graphMax),b=this.isMobile&&((I=this.boxOverflow)!=null&&I.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-m),a.graphMin),y=this.isMobile&&((T=this.boxOverflow)!=null&&T.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-p),a.graphMax);return{xMin:+g.toFixed(3),xMax:+x.toFixed(3),yMin:+b.toFixed(3),yMax:+y.toFixed(3)}},getRatioInRange(e,t,n){const o=t-e;return(n-e)/o},getDragInfoForHeatMap(e){const t=Object.keys(this.seriesList)[0];return this.seriesList[t].findBlockRange(e)},getSelectionRangeForHeatMap(e){const t=this.axesSteps.x.length?this.axesSteps.x[0]:null,n=this.axesSteps.y.length?this.axesSteps.y[0]:null;if(!t||!n)return null;const o=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[o].findSelectionRange(e)??{};return{xMin:s??t.graphMin,xMax:l??t.graphMax,yMin:a??n.graphMin,yMax:r??n.graphMax}},isDeselectItem(e){var t,n;return this.options.selectItem.useDeselectItem&&(e==null?void 0:e.maxIndex)===((t=this.defaultSelectItemInfo)==null?void 0:t.dataIndex)&&(e==null?void 0:e.sId)===((n=this.defaultSelectItemInfo)==null?void 0:n.seriesID)&&!isNaN(e==null?void 0:e.maxIndex)},getCurMouseLocation(e){const[t,n]=e,o={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},s=o[this.axesX[0].units.rectStart],l=o[this.axesX[0].units.rectEnd],a=o[this.axesY[0].units.rectStart],r=o[this.axesY[0].units.rectEnd];return gt(t,this.chartRect.x1,o.x1)&&gt(n,a,r)?"yAxis":gt(t,s,l)&&gt(n,o.y2,this.chartRect.y2)?"xAxis":gt(t,o.x1,o.x2)&&gt(n,o.y1,o.y2)?"chartBackground":"canvas"},isNotUseIndicator(){return this.options.type==="pie"||this.options.type==="scatter"||this.options.type==="heatMap"},clearSelectedLabelInfo(){this.defaultSelectInfo={dataIndex:[]}},clearSelectedItemInfo(){this.defaultSelectItemInfo=null}},Ps=8,ai=50,io=17,HC=8,WC={createTooltipDOM(){var e,t;this.tooltipDOM=document.createElement("div"),this.tooltipDOM.className="ev-chart-tooltip",this.tooltipHeaderDOM=document.createElement("div"),this.tooltipHeaderDOM.className="ev-chart-tooltip-header",this.tooltipBodyDOM=document.createElement("div"),this.tooltipBodyDOM.className="ev-chart-tooltip-body",this.tooltipCanvas=document.createElement("canvas"),this.tooltipCanvas.className="ev-chart-tooltip-canvas",this.tooltipCtx=this.tooltipCanvas.getContext("2d"),this.tooltipDOM.style.display="none",(t=(e=this.options.tooltip)==null?void 0:e.formatter)!=null&&t.html||this.setDefaultTooltipLayout(),document.body.appendChild(this.tooltipDOM),this.options.tooltip.debouncedHide?this.hideTooltipDOM=Lr(()=>{this.tooltipDOM.style.display="none"},200):this.hideTooltipDOM=()=>{this.tooltipDOM.style.display="none"},this.isInitTooltip=!0},setDefaultTooltipLayout(){this.tooltipBodyDOM.appendChild(this.tooltipCanvas),this.tooltipDOM.appendChild(this.tooltipHeaderDOM),this.tooltipDOM.appendChild(this.tooltipBodyDOM)},getFontStyle(e){var s,l;const t=(s=this.options)==null?void 0:s.tooltip,n=((l=t==null?void 0:t.fontSize)==null?void 0:l[e])??14,o=(t==null?void 0:t.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${o}`},getTextHeight(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+6},getColorMargin(){var e,t,n;return(((n=(t=(e=this.options)==null?void 0:e.tooltip)==null?void 0:t.fontSize)==null?void 0:n.contents)??14)+2},getBoxPadding(){var s,l;const{top:e=0,right:t=20,bottom:n=3,left:o=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t:e,l:o,b:n,r:t}},setTooltipLayoutPosition(e,t){var A,z,X,W,H,U,j;const n=this.tooltipCtx,o=t.pageX,s=t.pageY,l=e.items,[a,r]=e.maxTip,d=Object.keys(l).length,h=this.getBoxPadding(),f=this.options.tooltip,u=this.getColorMargin(),m=e.hitId,p=l[m].data,g=l[m].axis,x=(A=f.formatter)==null?void 0:A.title;this.axesX.length&&this.axesY.length&&f.showHeader&&(x?this.tooltipHeaderDOM.textContent=x({x:p.x,y:p.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[g.y].getLabelFormat(p.y):this.axesX[g.x].getLabelFormat(p.x)),f.textOverflow&&this.tooltipHeaderDOM.classList.add(`ev-chart-tooltip-header--${f.textOverflow}`),this.tooltipHeaderDOM.style.visibility="hidden",n.save(),n.font=this.getFontStyle("contents");const y=!!this.options.horizontal?(X=(z=l[e.hitId])==null?void 0:z.data)==null?void 0:X.y:(H=(W=l[e.hitId])==null?void 0:W.data)==null?void 0:H.x,M=(y==null?void 0:y.length)>a.length?y:a,E=Math.round(n.measureText(M).width),I=Math.round(n.measureText(r).width),T=E+I+h.l+h.r+u+ai+io,V=T>f.maxWidth?f.maxWidth:T;let C=f.textOverflow==="wrap"?0:d;if(f.textOverflow==="wrap"){const K=f.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+u+ai+io);Object.values(l).map(ee=>ee.name).forEach(ee=>{if(n.measureText(ee).width>K){let J="";for(let te=0;te<ee.length;te++){const G=ee[te],oe=`${J}${G}`;n.measureText(oe).width>K?(J=G,C+=1):J=oe}}C+=1}),n.restore()}const S=h.t+C*this.getTextHeight()+d*Ps+h.b;let w;f.useScrollbar&&S>f.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",w=f.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",w=S),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=S*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${S}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${w+6}px`,this.tooltipDOM.style.display="block";const k=document.body.clientWidth,B=document.body.clientHeight,D=20,O=((U=this.tooltipDOM)==null?void 0:U.offsetHeight)||((j=this.tooltipHeaderDOM)==null?void 0:j.offsetHeight)+w+HC,L=k-V-D,v=B-O-D,N=o+D,R=s+D,P=o-V-D,_=s-O-D;this.tooltipDOM.style.left=N>L?`${P}px`:`${N}px`,this.tooltipDOM.style.top=R>v?`${_}px`:`${R}px`},drawSeriesColorShape(e,t,n){var a,r;const o=(r=(a=this.options.tooltip)==null?void 0:a.fontSize)==null?void 0:r.contents,{x:s,y:l}=n;if(t==="circle"){e.beginPath();const c=o/2;e.arc(s,l-c/2,c,0,2*Math.PI),e.fill()}else{const c=o;e.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(e,t){const n=t,o=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(o)),a=this.getBoxPadding(),r=this.options.horizontal,c=this.options.tooltip,d=this.getTextHeight(),h=this.getColorMargin();this.axesX.length&&this.axesY.length&&c.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let f=2,u=2;f+=Y.aliasPixel(f),u+=Y.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=io),f+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const m=[];l.forEach(g=>{m.push({id:g,data:o[g].data,color:o[g].color,name:o[g].name,dataId:o[g].id})}),c.sortByValue&&m.sort((g,x)=>{let b=g.data.o,y=x.data.o;return b==null&&(b=r?g.data.x:g.data.y),y==null&&(y=r?x.data.x:x.data.y),y-b}),this.setTooltipDOMStyle(c);let p=1;for(let g=0;g<m.length;g++){const x=m[g].data,b=m[g].color,y=m[g].name,M=x.formatted;let E=f+4,I=u+p*d;E+=Y.aliasPixel(E),I+=Y.aliasPixel(I),n.beginPath(),typeof b!="string"?n.fillStyle=ie.createGradient(n,r,{x:E-4,y:I,w:12,h:-12},b):n.fillStyle=b;const T={id:m[g].id,name:m[g].name,value:M,dataId:m[g].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:E,y:I}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(T):c.fontColor.label??c.fontColor;const V=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ai,C=E+h,S=I;if(V>n.measureText(y).width)n.fillText(y,C,S);else if(c.textOverflow==="wrap"){let w="",k=S;for(let B=0;B<y.length;B++){const D=y[B],O=`${w}${D}`;n.measureText(O).width>V?(n.fillText(w,C,k),w=D,p+=1,k+=d):w=O}n.fillText(w,C,k)}else{const w=Y.truncateLabelWithEllipsis(y,V,n);n.fillText(w,C,S)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(T):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(M,this.tooltipDOM.offsetWidth-a.r,I),n.restore(),n.closePath(),u+=Ps,p+=1}n.restore()},drawToolTipForHeatMap(e,t){const n=t,o=e.items,s=e.hitId,l=o[s].data,a=o[s].axis,r=o[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,f=Object.values(this.seriesList)[0],u=this.getTextHeight(),m=this.getColorMargin();let p=!1,g=l.formatted;const{colorState:x,isGradient:b}=f;if(b){const{min:I,max:T}=f.valueOpt,V=We(l.o-I,T-I),{start:C,end:S}=x[0];p=C<=V&&V<=S||l.o===-1}else{const I=x.find(({id:T})=>T===l.cId);p=I==null?void 0:I.show,g=(I==null?void 0:I.label)??g}if(!p){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=io);const y=c.l+2,M=c.t+u+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=ie.createGradient(n,d,{x:y,y:M,w:12,h:-12},r):n.fillStyle=r;const E={id:e.hitId,name:l.y,value:g,dataId:o[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:y,y:M}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(E):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),y+m,M),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(E):h.fontColor.value??h.fontColor,n.fillText(g,this.tooltipDOM.offsetWidth-c.r,M),n.closePath()},drawTooltipForScatter(e,t){const n=t,o=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(o)),a=this.getBoxPadding(),r=this.options.tooltip,c=this.getTextHeight(),d=this.getColorMargin();this.axesX.length&&this.axesY.length&&r.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none";let h=2,f=2;h+=Y.aliasPixel(h),f+=Y.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=io),h+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const u=[];l.forEach(p=>{u.push({data:o[p].data,color:o[p].color,name:o[p].name})}),r.sortByValue&&u.sort((p,g)=>{let x=p.data.o,b=g.data.o;return x==null&&(x=p.data.y),b==null&&(b=g.data.y),b-x}),this.setTooltipDOMStyle(r);let m=1;for(let p=0;p<u.length;p++){const g=u[p].data,x=u[p].color,b=u[p].name,y=g.formatted;let M=h+4,E=f+m*c;M+=Y.aliasPixel(M),E+=Y.aliasPixel(E),n.beginPath(),typeof x!="string"?n.fillStyle=ie.createGradient(n,!1,{x:M-4,y:E,w:12,h:-12},x):n.fillStyle=x;const I={id:e.hitId,name:u[p].name,value:y,dataId:u[p].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:M,y:E}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(I):r.fontColor.label??r.fontColor;const T=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ai,V=M+d,C=E;if(T>n.measureText(b).width)n.fillText(b,V,C);else if(r.textOverflow==="wrap"){let S="",w=C;for(let k=0;k<b.length;k++){const B=b[k],D=`${S}${B}`;n.measureText(D).width>T?(n.fillText(S,V,w),S=B,m+=1,w+=c):S=D}n.fillText(S,V,w)}else{const S=Y.truncateLabelWithEllipsis(b,T,n);n.fillText(S,V,C)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(I):r.fontColor.value??r.fontColor,n.fillText(y,this.tooltipDOM.offsetWidth-a.r,E),n.restore(),n.closePath(),f+=Ps,m+=1}n.restore()},setCustomTooltipLayoutPosition(e,t){var b,y;const n=t.pageX,o=t.pageY,s=(b=this.tooltipDOM.getElementsByClassName("ev-chart-tooltip-custom"))==null?void 0:b[0];if(!s&&!this.tooltipDOM)return;this.tooltipDOM.style.display="block";const l=s.offsetWidth,a=s.offsetHeight;this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${a+6}px`;const r=document.body.clientWidth,c=document.body.clientHeight,d=(y=this.tooltipDOM)==null?void 0:y.getBoundingClientRect(),h=20,f=r-l-h,u=c-(d==null?void 0:d.height)-h,m=n+h,p=o+h,g=n-l-h,x=o-(d==null?void 0:d.height)-h;this.tooltipDOM.style.left=m>f?`${g}px`:`${m}px`,this.tooltipDOM.style.top=p>u?`${x}px`:`${p}px`},drawCustomTooltip(e){var n,o,s,l;const t=(n=this.options)==null?void 0:n.tooltip;if((o=t.formatter)!=null&&o.html){this.tooltipDOM.innerHTML="";const a=[];Object.keys(e).forEach(c=>{a.push({sId:c,data:e[c].data,color:e[c].color,name:e[c].name,dataId:e[c].id,index:e[c].index})});const r=Y.htmlToElement((s=t==null?void 0:t.formatter)==null?void 0:s.html(a));r&&this.tooltipDOM.appendChild(r),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((l=t.fontColor)==null?void 0:l.title)??t.fontColor}},setTooltipDOMStyle(e){var t;if(this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=e.backgroundColor,this.tooltipDOM.style.border=`1px solid ${e.borderColor}`,this.tooltipDOM.style.color=((t=e.fontColor)==null?void 0:t.title)??e.fontColor,this.tooltipHeaderDOM.style.fontSize=`${e.fontSize.title}px`,this.tooltipHeaderDOM.style.fontFamily=this.getFontStyle("title"),e.useShadow){const n=`rgba(0, 0, 0, ${e.shadowOpacity})`;this.tooltipDOM.style.boxShadow=`2px 2px 2px ${n}`}this.tooltipDOM.style.display="block"},drawItemsHighlight(e,t){Object.keys(e.items).forEach(n=>{var s;const o=this.seriesList[n];o.itemHighlight(e.items[n],t,e.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),Y.isDoughnutHole(o.type)&&this.drawDoughnutHole(t)})},drawIndicator(e,t){var d;const n=this.overlayCtx,[o,s]=e,l={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},a=15,r=15,c=this.options;o>=l.x1-a&&o<=l.x2+a&&s>=l.y1-r&&s<=l.y2+r&&(n.beginPath(),n.save(),n.strokeStyle=t,n.lineWidth=1,(d=c.indicator)!=null&&d.segments&&n.setLineDash(c.indicator.segments),c.horizontal?(n.moveTo(l.x1,s+.5),n.lineTo(l.x2,s+.5)):(n.moveTo(o+.5,l.y1),n.lineTo(o+.5,l.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(e){var h,f;const t=this.options;if(t.syncHover===!1||!t.horizontal&&!t.axesX.every(({type:u})=>u==="time")||t.horizontal&&!t.axesY.every(({type:u})=>u==="time"))return null;const n=+((h=this.data.labels)==null?void 0:h[0]),o=+((f=this.data.labels)==null?void 0:f[this.data.labels.length-1]);if(n==null||o==null)return null;const[s,l]=e,a={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(t.horizontal){const u=a.y2-a.y1,p=(l-a.y1)*(o-n)/u+n;return Math.round(p)}const r=a.x2-a.x1,d=(s-a.x1)*(o-n)/r+n;return Math.round(d)},drawSyncedIndicator({horizontal:e,label:t,mousePosition:n,dataLabel:o}){var p,g;if(!this._canDrawSyncedIndicator(e,n))return;if(o){this.drawSyncedIndicatorForTooltip({dataLabel:o,mousePosition:n});return}const s=+((p=this.data.labels)==null?void 0:p[0]),l=+((g=this.data.labels)==null?void 0:g[this.data.labels.length-1]),[a,r]=n,{top:c,bottom:d,left:h,right:f}=this.chartDOM.getBoundingClientRect();if(gt(a,h,f)&&gt(r,d,c))return;this.overlayClear();const m={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom};if(e){const b=(m.y2-m.y1)*(t-s)/(l-s)+m.y1;this.drawIndicator([m.x2,b],this.options.indicator.color)}else{const b=(m.x2-m.x1)*(t-s)/(l-s)+m.x1;this.drawIndicator([b,m.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(e,t){return!t||!!e!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(e)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(e){var n,o;return this.options.syncHover===!1||!((o=(n=this.data)==null?void 0:n.labels)!=null&&o.length)?!1:e?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,o;const e=+((n=this.data.labels)==null?void 0:n[0]),t=+((o=this.data.labels)==null?void 0:o[this.data.labels.length-1]);return e!=null&&t!=null},drawSyncedIndicatorForTooltip({dataLabel:e,mousePosition:t}){var f,u,m,p,g,x,b,y,M,E,I,T,V;if(!((f=this.data)!=null&&f.labels)||!e)return;const n=this.data.labels.findIndex(C=>(C==null?void 0:C.valueOf())===(e==null?void 0:e.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:o}=this.options,s=this.chartDOM.getBoundingClientRect(),[l,a]=t;if(gt(l,s.left,s.right)&&gt(a,s.bottom,s.top))return;this.overlayClear();const c={x1:this.chartRect.x1+this.labelOffset.left,x2:this.chartRect.x2-this.labelOffset.right,y1:this.chartRect.y1+this.labelOffset.top,y2:this.chartRect.y2-this.labelOffset.bottom},d=this.data.labels.length;let h;if(o){const C=c.y2-c.y1,S=(u=this.options.axesY)==null?void 0:u.some(B=>B.categoryMode),w=(m=this.options.axesY)==null?void 0:m.some(B=>B.type==="time");let k;if(S)k=c.y1+C*(n+.5)/d;else if(w){const B=(g=(p=this.axesSteps)==null?void 0:p.y)==null?void 0:g[0],D=(B==null?void 0:B.graphMin)??+((x=this.data.labels)==null?void 0:x[0]),O=(B==null?void 0:B.graphMax)??+((b=this.data.labels)==null?void 0:b[this.data.labels.length-1]);k=c.y1+C*(+e-D)/(O-D)}else k=c.y1+C*n/(d-1);h=[c.x2,k]}else{const C=c.x2-c.x1,S=(y=this.options.axesX)==null?void 0:y.some(B=>B.categoryMode),w=(M=this.options.axesX)==null?void 0:M.some(B=>B.type==="time");let k;if(S)k=c.x1+C*(n+.5)/d;else if(w){const B=(I=(E=this.axesSteps)==null?void 0:E.x)==null?void 0:I[0],D=(B==null?void 0:B.graphMin)??+((T=this.data.labels)==null?void 0:T[0]),O=(B==null?void 0:B.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);k=c.x1+C*(+e-D)/(O-D)}else k=c.x1+C*n/(d-1);h=[k,c.y2]}this.drawIndicator(h,this.options.indicator.color)},tooltipClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.tooltipCtx.clearRect(0,0,this.tooltipCanvas.width/this.clearRectRatio,this.tooltipCanvas.height/this.clearRectRatio),this.tooltipDOM.style.display="none"},alignSeriesList(e){const t=this.data.groups,n=this.seriesList,o=[];return t.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&e.includes(l)&&o.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&e.includes(s)&&o.push(s)}),o},tooltipDestroy(){this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.isInitTooltip=!1}},$C={pieDataSet:[],drawPie(e){var E;const t=this.bufferCtx,n=this.chartRect,o=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,f,u,m;const p=n.width/2,g=n.height/2,x=p-(l.left+l.right),b=g-(l.bottom+l.top);if(typeof x=="number"&&x<0||typeof b=="number"&&b<0)return;const y=Math.min(x,b)*s.doughnutHoleSize,M=Math.min(x,b);for(let I=0;I<o.length;I++){const T=o[I];if(!T)return;let V=M-(M-y)/o.length*I;if((E=s==null?void 0:s.pieStroke)!=null&&E.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(T.or=V,I<o.length-1?T.ir=M-(M-y)/o.length*(I+1):T.ir=1,T.total){for(let C=0;C<T.data.length;C++)if(r=T.data[C],c=r.value,m=c/T.total*100,d=2*Math.PI*(c/T.total),f=h+d,r.sa=h,r.ea=f,u=this.seriesList[r.id],c){const S={...s.pieStroke};T.data.length===1&&s.pieStroke.use&&(S.use=!1,t.lineWidth=s.pieStroke.lineWidth,t.strokeStyle=s.pieStroke.color,t.arc(p,g,V,0,2*Math.PI),t.stroke());const{selectInfo:w,legendHitInfo:k,unSelectedOpacity:B}=e;u.isSelect=(w==null?void 0:w.sId)===r.id,u.isDownplay=k&&k.sId!==r.id,u.type=a?"doughnut":"pie",u.centerX=p,u.centerY=g,u.radius=V,u.doughnutHoleSize=V*(s.doughnutHoleSize??0),u.startAngle=h,u.endAngle=f,u.data={o:c,percentage:m},u.draw(t,S,B),h+=d}}}},drawSunburst(e){var g;const t=this.bufferCtx,{width:n,height:o}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=o/2,f=d-(a.left+a.right),u=h-(a.bottom+a.top);if(typeof f=="number"&&f<0||typeof u=="number"&&u<0)return;const m=Math.min(f,u)*l.doughnutHoleSize,p=Math.min(f,u);for(let x=0;x<s.length;x++){const b=s[x];if(!b)return;let y=p-(p-m)/s.length*x;if((g=l==null?void 0:l.pieStroke)!=null&&g.use&&(y-=l.pieStroke.lineWidth),y<0)return;b.or=y,x<s.length-1?b.ir=p-(p-m)/s.length*(x+1):b.ir=1;for(let M=0;M<b.data.length;M++)if(r=b.data[M],r.id==="dummy")t.save(),t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle="#fff",t.lineWidth=2,t.strokeStyle="#fff",t.moveTo(d,h),t.arc(d,h,y,r.sa,r.ea),t.stroke(),t.fill(),t.closePath(),t.restore();else if(c=this.seriesList[r.id],r.value){const E={...l.pieStroke};b.data.length===1&&l.pieStroke.use&&(E.use=!1,t.lineWidth=l.pieStroke.lineWidth,t.strokeStyle=l.pieStroke.color,t.arc(d,h,y,0,2*Math.PI),t.stroke());const{selectInfo:I,legendHitInfo:T,unSelectedOpacity:V}=e;c.isSelect=(I==null?void 0:I.sId)===r.id,c.isDownplay=T&&T.sId!==r.id,c.type="sunburst",c.centerX=d,c.centerY=h,c.radius=y,c.doughnutHoleSize=y*(l.doughnutHoleSize??0),c.startAngle=r.sa,c.endAngle=r.ea,c.data={o:r.value},c.draw(t,E,V)}}},drawDoughnutHole(e=this.bufferCtx){var h;const t=this.options,{width:n,height:o}=this.chartRect,s=this.options.padding,l=n/2,a=o/2,r=l-(s.left+s.right),c=a-(s.bottom+s.top);if(typeof r=="number"&&r<0||typeof c=="number"&&c<0)return;const d=Math.min(r,c)*t.doughnutHoleSize;e.save(),e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle="#fff",e.fillOpacity=0,e.arc(l,a,d,0,2*Math.PI),e.fill(),e.strokeStyle="#fff",e.stroke(),e.closePath(),e.restore(),(h=t==null?void 0:t.pieStroke)!=null&&h.use&&(e.beginPath(),e.strokeStyle=t.pieStroke.color,e.lineWidth=t.pieStroke.lineWidth,e.arc(l,a,d,0,Math.PI*2),e.stroke(),e.closePath()),this.pieDataSet[this.pieDataSet.length-1].ir=d}},XC={drawTips(e){var h,f,u,m,p,g;const t=this.options;let n=null;const o=!!t.horizontal,s=t.maxTip,l=t.selectItem,a=t.selectLabel;let r,c;typeof((h=t.tooltip)==null?void 0:h.formatter)=="function"?n=(f=t.tooltip)==null?void 0:f.formatter:typeof((m=(u=t.tooltip)==null?void 0:u.formatter)==null?void 0:m.value)=="function"&&(n=(g=(p=t.tooltip)==null?void 0:p.formatter)==null?void 0:g.value),a.use&&a.showTip&&(c=t.type==="heatMap"?this.drawLabelTipForHeatMap():this.drawTipForSelectedLabel());const d=x=>{e.forEach(b=>{if(b){const y=this.seriesList[b==null?void 0:b.sId];if(!(y!=null&&y.show))return;const M=this.calculateTipInfo(y,"sel",b);if(M){let E=!1;if(s.use&&(r==null?void 0:r.dp)===M.dp&&(E=!0),x.showTextTip||x.showTip){if(x.tipText==="label"){const I=o?t.axesY[0]:t.axesX[0],T=M.label;M.text=I.type==="time"?at(T).format(I.timeFormat):T}else M.text=$t(M.value);this.drawTextTip({opt:x,tipType:"sel",seriesOpt:y,isSamePos:E,...M})}x.showIndicator&&this.drawFixedIndicator({opt:x,seriesOpt:y,...M})}b&&(b!=null&&b.label)&&(b==null?void 0:b.label)===0&&(this.lastHitInfo=b)}})};if(e&&!c&&(l.use?d(l):a.use&&t.type==="line"&&d(a)),s.use&&!c){const x=this.minMax[o?"x":"y"][0].maxSID,b=this.seriesList[x];r=this.calculateTipInfo(b,"max",null),s.use&&r&&(n?r.text=n({seriesId:b.sId,x:o?r.value:void 0,y:o?void 0:r.value}):r.text=$t(r.value),this.drawTextTip({opt:s,tipType:"max",seriesOpt:b,...r}),s.showIndicator&&this.drawFixedIndicator({opt:s,seriesOpt:b,...r}))}},calculateTipInfo(e,t,n){if(!e)return!1;const o=!!this.options.horizontal,s=this.lastTip,l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=l.chartHeight-(a.top+a.bottom),d=l.chartWidth-(a.left+a.right),h=this.axesSteps.x[e.xAxisIndex],f=this.axesSteps.y[e.yAxisIndex],u=r.x1,m=r.x2,p=r.y2,{type:g,size:x}=e,{maxDomain:b,maxDomainIndex:y}=e.minMax;if(b===null||y<0)return!1;let M=g==="bar"?y:b;t==="sel"&&(n&&n.label!==null?(s.pos=g==="bar"?n.maxIndex:n.label,M=s.pos):s.pos!==null&&(M=s.pos));let E=o?e.minMax.maxX:e.minMax.maxY,I;if(t==="sel"){if(n&&n.value!==null)E=n.useStack?n.acc:n.value,I=n.label,s.value=E,s.label=I;else if(s.value!==null)E=s.value,I=s.label;else if(s.pos!==null){const k=g==="bar"?this.getItemByLabelIndex(s.pos):this.getItemByLabel(s.pos);E=k.useStack?k.acc:k.value,I=k.label,s.value=E,s.label=I}}let T,V,C;if(g==="bar"){const k=o?this.scrollbar.y:this.scrollbar.x;if(k!=null&&k.use){const[B,D]=(k==null?void 0:k.range)??[];if(M>=B&&M<=D)M-=B??0;else return!1}o?(V=Math.round(x.h/2),T=p-x.cat*M-x.cPad,C=T-(x.bar*x.ix-(x.h+x.bPad))-V):(V=Math.round(x.w/2),T=u+x.cat*M+x.cPad,C=T+(x.bar*x.ix-(x.w+x.bPad))+V)}else g==="line"?C=ie.calculateX(M,h.graphMin,h.graphMax,d-x.comboOffset,u+x.comboOffset/2):g==="scatter"&&(C=ie.calculateX(M,h.graphMin,h.graphMax,d,u));return{...{xArea:d,yArea:c,graphX:h,graphY:f,xsp:u,xep:m,ysp:p},...{dp:C,value:E,label:I,type:g}}},drawFixedIndicator(e){const t=!!this.options.horizontal,n=this.bufferCtx,{graphX:o,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:f,opt:u,seriesOpt:m}=e;let p=0;h==="line"?p+=3:h==="scatter"&&(p+=(m==null?void 0:m.pointSize)??0);let g;if(u.fixedPosTop)t?g=ie.calculateX(o.graphMax,o.graphMin,o.graphMax,l,r):(g=ie.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),g-=p);else if(t){const x=Math.min(Math.max(f,o.graphMin),o.graphMax);g=ie.calculateX(x,o.graphMin,o.graphMax,l,r)}else{const x=Math.min(Math.max(f,s.graphMin),s.graphMax);g=ie.calculateY(x,s.graphMin,s.graphMax,a,c),g-=p}d!==null&&(n.beginPath(),n.save(),n.strokeStyle=u.indicatorColor,n.lineWidth=2,t?(n.moveTo(r,d),n.lineTo(g,d)):(n.moveTo(d,c),n.lineTo(d,g)),n.stroke(),n.restore(),n.closePath())},drawTipForSelectedLabel(){var r,c;const e=this.options,t=!!e.horizontal,n=e.selectLabel,{dataIndex:o,data:s,label:l}=this.defaultSelectInfo;let a=!1;if(o.length){a=!0;const d=this.chartRect,h=this.labelOffset,f={x1:d.x1+h.left,x2:d.x2-h.right,y1:d.y1+h.top,y2:d.y2-h.bottom},u=t?this.axesY[0]:this.axesX[0],m=t?this.axesX[0]:this.axesY[0],p=t?this.axesSteps.x[0]:this.axesSteps.y[0],g=t?ie.calculateX:ie.calculateY,x=t?ie.calculateY:ie.calculateX,b=t?this.scrollbar.y:this.scrollbar.x,y=d.chartWidth-(h.left+h.right),M=d.chartHeight-(h.top+h.bottom),E=t?y:M,I=f[m.units.rectStart];let T=this.options.type==="bar"?4:6;T*=t?1:-1;const V=Object.keys(this.seriesList??{}),C=V.filter(z=>this.seriesList[z].show),S=V.some(z=>this.seriesList[z].isExistGrp&&!this.seriesList[z].isOverlapping),w=((r=this.data.groups)==null?void 0:r[0])??[];let k,B,D,O,L,v,N,R,P,_=0,A=(c=u.labels)==null?void 0:c.length;if(u.labels){let z=u.labels.length;if(b!=null&&b.use){const{range:X,interval:W,type:H}=b,[U,j]=X??[];ve(U)&&ve(j)&&(z=Math.floor((+j-+U)/W)+1,_=H==="step"?U:u.labels.findIndex(K=>K===+U),A=H==="step"?j:u.labels.findIndex(K=>K===+j))}O=f[u.units.rectStart],L=f[u.units.rectEnd],v=(L-O)/z}else N=this.axesSteps.x[0],R=V.find(z=>{var X;return((X=this.seriesList[z])==null?void 0:X.type)==="line"}),P=this.seriesList[R].size;s.forEach((z,X)=>{var W;if(D=p.graphMax,!n.fixedPosTop){if(S){const H=C==null?void 0:C.reduce((K,q)=>{var ee,J;return w.includes(q)&&(((ee=z[q])==null?void 0:ee.value)??z[q])>0?K+(((J=z[q])==null?void 0:J.value)??z[q]):K},0),U=((W=C==null?void 0:C.filter(K=>!w.includes(K)))==null?void 0:W.map(K=>{var q;return((q=z[K])==null?void 0:q.value)??z[K]}))??[],j=(U==null?void 0:U.length)>0?U.reduce((K,q)=>Math.max(K,q??-1/0),-1/0):-1/0;D=H>0?Math.max(j,H):Math.max(j,0)}else if(C.length){const H=C.map(j=>{var K;return((K=z[j])==null?void 0:K.value)??z[j]}),U=H.length>0?H.reduce((j,K)=>Math.max(j,K??-1/0),-1/0):-1/0;D=U>0||this.options.type!=="bar"?U:0}}if(u.labels){if(o[X]<_||o[X]>A)return;const H=o[X]-_;k=Math.round(O+v*H)+v/2}else k=x(l[X],N.graphMin,N.graphMax,y-P.comboOffset,f.x1+P.comboOffset/2);B=g(D,p.graphMin,p.graphMax,E,I)+T,this.showTip({context:this.bufferCtx,x:t?B:k,y:t?k:B,opt:n,isSamePos:!1})})}return a},drawLabelTipForHeatMap(){const e=this.options,t=!!e.horizontal,n=e.selectLabel,{dataIndex:o}=this.defaultSelectInfo;let s=!1;if(o){s=!0;const l=this.chartRect,a=this.labelOffset,r={x1:l.x1+a.left,x2:l.x2-a.right,y1:l.y1+a.top,y2:l.y2-a.bottom},c=t?this.axesY[0]:this.axesX[0],d=r[c.units.rectStart],f=(r[c.units.rectEnd]-d)/c.labels.length,u=t?this.axesX[0]:this.axesY[0],m=6*(t?1:-1),p=r[u.units.rectEnd]+m;o==null||o.forEach(g=>{const b=Math.round(d+f*g)+f/2;this.showTip({context:this.bufferCtx,x:t?p:b,y:t?b:p,opt:n,isSamePos:!1})})}return s},drawTextTip(e){const t=!!this.options.horizontal,n=this.bufferCtx,{graphX:o,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=e,{dp:h,value:f,text:u,opt:m,type:p,tipType:g,isSamePos:x,seriesOpt:b}=e,y=4,M=4,{fontSize:E,fontFamily:I,fontWeight:T,height:V}=m.tipStyle,C=`normal normal ${T} ${E}px ${I}`;let S=1;p==="line"?S+=6:p==="scatter"?S+=b==null?void 0:b.pointSize:p==="bar"&&(S+=4);let w,k=h;if(m.fixedPosTop)t?(w=ie.calculateX(o.graphMax,o.graphMin,o.graphMax,l,r),w+=S):(w=ie.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),w-=S);else if(t){const O=Math.min(Math.max(f,o.graphMin),o.graphMax);w=ie.calculateX(O,o.graphMin,o.graphMax,l,r),w=f<0?w-S:w+S}else{const O=p==="bar"&&f<0?0:f,L=Math.min(Math.max(O,s.graphMin),s.graphMax);w=ie.calculateY(L,s.graphMin,s.graphMax,a,d),w=O<0?w+S:w-S}let B="center";n.save(),n.font=C;const D=Math.round(Math.max(n.measureText(u).width+12,40));t||(h+D/2>c-10?(B="right",k-=D/2-y*2):h-D/2<r+10&&(B="left",k+=D/2-y*2)),n.restore(),(m.showTextTip||g==="max")&&this.showTextTip({context:n,type:B,width:D,height:V,x:t?w+D/2:k,y:t?k+V/2:w,opt:m,arrowSize:y,borderRadius:M,text:u,textStyle:C,isNegative:f<0}),m.showTip&&g==="sel"&&this.showTip({context:n,x:t?w:h,y:t?h:w,opt:m,isSamePos:x})},showTextTip(e){const t=!!this.options.horizontal,{type:n,width:o,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:f,isNegative:u}=e,m=e.context;let p=l-o/2,g=l+o/2;const x=a-s,b=a;u&&t&&(p=l-o/2-o,g=l-o/2),m.save(),m.font=f,m.fillStyle=h.tipBackground??h.tipStyle.background,m.shadowBlur=0,m.beginPath(),m.moveTo(p+c,x),m.quadraticCurveTo(p,x,p,x+c),m.lineTo(p,b-c),m.quadraticCurveTo(p,b,p+c,b),m.lineTo(g-c,b),m.quadraticCurveTo(g,b,g,b-c),m.lineTo(g,x+c),m.quadraticCurveTo(g,x,g-c,x),m.lineTo(p+c,x),m.closePath(),m.fill(),m.beginPath(),t?(u?(m.moveTo(g,b),m.lineTo(g,x+c+r/2),m.lineTo(g+r,b-s/2),m.lineTo(g,b-c-r/2)):(m.moveTo(p,x),m.lineTo(p,x+c+r/2),m.lineTo(p-r,b-s/2),m.lineTo(p,b-c-r/2)),m.closePath(),m.fill()):(u?n==="left"?(m.lineTo(p+c+r,b+r),m.lineTo(p+c+r*2,b)):n==="right"?(m.lineTo(g-r*2-c,b),m.lineTo(g-r-c,b+r)):(m.lineTo(l-r,b),m.lineTo(l,b+r),m.lineTo(l+r,b)):u||(n==="left"?(m.moveTo(p,x),m.lineTo(p+c+r,b+r),m.lineTo(p+c+r*2,b)):n==="right"?(m.moveTo(g,x),m.lineTo(g-r*2-c,b),m.lineTo(g-r-c,b+r)):(m.lineTo(l-r,b),m.lineTo(l,b+r),m.lineTo(l+r,b))),m.closePath(),m.fill()),m.restore(),m.save(),m.font=f,m.fillStyle=h.tipTextColor??h.tipStyle.textColor,m.textBaseline="middle",m.textAlign="center",m.fillText(`${d}`,p+o/2,x+s/2),m.restore()},showTip(e){const t=!!this.options.horizontal,{x:n,y:o,opt:s,isSamePos:l}=e,a=e.context,c=o-(l?24:0);a.save(),a.fillStyle=s.tipBackground??s.tipStyle.background,a.beginPath(),a.moveTo(n,c),t?(a.lineTo(n+6,c-6),a.lineTo(n+6,c+6)):(a.lineTo(n+6,c-6),a.lineTo(n-6,c-6)),a.lineTo(n,c),a.closePath(),a.fill(),a.restore()}};let Rr=class{constructor(t,n,o,s,l,a,r){Object.keys(Dr).forEach(c=>Object.assign(this,Dr[c])),o.brush||(Object.assign(this,WC),Object.assign(this,FC),Object.assign(this,XC),Object.assign(this,RC),Object.assign(this,$C),Object.assign(this,LC),Object.assign(this,PC)),o.type==="heatMap"&&o.legend.type==="gradient"&&Object.assign(this,VC),this.isMobile=ph(),this.brushSeries=r,this.target=t,this.data=n,this.options=o,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=o.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=o.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM),this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d"),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d"),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),o.brush||(this.overlayCanvas=document.createElement("canvas"),this.overlayCanvas.setAttribute("style","display: block; z-index: 2;"),this.overlayCanvas.setAttribute("class","overlay-canvas"),this.overlayCtx=this.overlayCanvas.getContext("2d"),this.chartDOM.appendChild(this.overlayCanvas),this.overlayCanvas.style.position="absolute",this.overlayCanvas.style.top="0px",this.overlayCanvas.style.left="0px"),this.isInitLegend=!1,this.isInitTitle=!1,this.isInit=!1,this.scrollbar={x:{isInit:!1},y:{isInit:!1}},this.seriesList={},this.lastTip={pos:null,value:null},this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.defaultSelectItemInfo=l,this.defaultSelectInfo=a,this.legendHover=null}init(){var f,u,m,p,g;const{series:t,data:n,labels:o,groups:s}=this.data,{type:l,axesX:a,axesY:r,tooltip:c,horizontal:d,realTimeScatter:h}=this.options;this.createSeriesSet(t,l,d,s),s.length&&this.addGroupInfo(s),h!=null&&h.use?(this.dataSet={},this.createRealTimeScatterDataSet(n)):this.createDataSet(n,o),this.minMax=this.getStoreMinMax(),this.initRect(),this.axesX=this.createAxes("x",a),this.axesY=this.createAxes("y",r),((u=(f=a==null?void 0:a[0])==null?void 0:f.scrollbar)!=null&&u.use||(p=(m=r==null?void 0:r[0])==null?void 0:m.scrollbar)!=null&&p.use)&&this.initScrollbar(),this.initDefaultSelectInfo(),this.drawChart(),c.use&&!this.isInitTooltip&&this.createTooltipDOM(),(g=this.createEventFunctions)==null||g.call(this),this.isInit=!0}_updateSeriesCount(){this.seriesInfo.count=Object.values(this.seriesList).filter(t=>t.show).length}initRect(){const t=this.options;t.title.show&&(this.isInitTitle||this.initTitle(),this.showTitle()),t.legend.show&&!t.legend.external?(this.isInitLegend||this.initLegend(),this.setLegendPosition()):t.legend.show&&t.legend.external&&this._updateSeriesCount(),this.chartRect=this.getChartRect()}drawSyncedIndicator({horizontal:t,label:n,mousePosition:o}){this.drawSyncedIndicator({horizontal:t,label:n,mousePosition:o})}adjustXAndYAxisWidth(){var o,s,l,a;const t=(r,c,d)=>{const{interval:h,graphMin:f,graphMax:u,steps:m=0,minIndex:p,maxIndex:g,indexInterval:x}=r??{};let b=[];if((d==null?void 0:d.type)==="step"&&p!==void 0&&g!==void 0&&x!==void 0){const{labels:y}=this.data,M=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[];b=[];for(let E=p;E<=g;E+=x)M[E]!==void 0&&b.push(M[E])}else if(h)b=Array.from({length:m},(y,M)=>f+M*h),b.push(u);else{const{labels:y}=this.data;b=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[]}return b},n={x:(s=(o=this.axesRange)==null?void 0:o.x)==null?void 0:s.map((r,c)=>{var p,g,x;const d=this.axesX[c],h=(p=this.axesSteps)==null?void 0:p.x[c],f=t(h,"x",d),u=ve((g=d==null?void 0:d.labelStyle)==null?void 0:g.fixWidth)?d.labelStyle.fixWidth:0,m=((x=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:x.call(d,f,this.chartRect))??0;return{...r,size:{width:u||Math.max(m,r.size.width),height:r.size.height}}}),y:(a=(l=this.axesRange)==null?void 0:l.y)==null?void 0:a.map((r,c)=>{var p,g,x;const d=this.axesY[c],h=(p=this.axesSteps)==null?void 0:p.y[c],f=t(h,"y",d),u=ve((g=d==null?void 0:d.labelStyle)==null?void 0:g.fixWidth)?d.labelStyle.fixWidth:0,m=((x=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:x.call(d,f,this.chartRect))??0;return{...r,size:{width:u||Math.max(m,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}emitAxesScaleChange(){var c;if(typeof((c=this.listeners)==null?void 0:c["axes-scale-change"])!="function")return;const t=this._lastEmittedAxesRange,n=this.labelRange,o=(d,h)=>(d==null?void 0:d.min)===(h==null?void 0:h.min)&&(d==null?void 0:d.max)===(h==null?void 0:h.max),s=({min:d,max:h})=>({minSteps:d,maxSteps:h}),l=n.x.every((d,h)=>{var u;return!!!((u=this.options.axesX[h])!=null&&u.scaleChange)||!!t&&o(d,t.x[h])}),a=n.y.every((d,h)=>{var u;return!!!((u=this.options.axesY[h])!=null&&u.scaleChange)||!!t&&o(d,t.y[h])});if(l&&a)return;this._lastEmittedAxesRange=n;const r={x:n.x.map(s),y:n.y.map(s)};this.listeners["axes-scale-change"](r)}drawChart(t){var n,o,s,l,a,r;this.initScale(),this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange(),((o=(n=this.scrollbar)==null?void 0:n.x)!=null&&o.use||(l=(s=this.scrollbar)==null?void 0:s.y)!=null&&l.use)&&this.updateScrollbarPosition(),this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),this.emitAxesScaleChange(),this.drawAxis(t),this.drawSeries(t),this.drawTip(),this.bufferCanvas&&((a=this.bufferCanvas)==null?void 0:a.width)>1&&((r=this.bufferCanvas)==null?void 0:r.height)>1&&this.displayCtx.drawImage(this.bufferCanvas,0,0)}collectDuplicatePoints(t,n){var s,l,a;const o=!!this.options.seriesReverse;for(let r=o?n.length-1:0;o?r>=0:r<n.length;o?r--:r++){const c=this.seriesList[n[r]];if(!!(c!=null&&c.show))if((s=this.options.realTimeScatter)!=null&&s.use){const h=(l=c.data[c.sId])==null?void 0:l.dataGroup;for(let f=0;f<h.length;f++){const u=((a=h[f])==null?void 0:a.data)||[];for(let m=0;m<u.length;m++){const p=u[m];t.set(`${p.x}${p.y}`,c.sId)}}}else{const h=this.data.data[n[r]]??[];for(let f=0;f<h.length;f++){const u=h[f];t.set(`${u.x}${u.y}`,c.sId)}}}}drawSeries(t){var p;const{maxTip:n,selectLabel:o,selectItem:s,selectSeries:l,brush:a,displayOverflow:r,unSelectedOpacity:c}=this.options,d={ctx:this.bufferCtx,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:n.background,color:n.color},selectLabel:{option:o,selected:this.defaultSelectInfo},selectSeries:{option:l,selected:this.defaultSelectInfo},selectItem:{option:s,selected:this.defaultSelectItemInfo},overlayCtx:this.overlayCtx,isBrush:!!a,displayOverflow:r,unSelectedOpacity:c};let h=0,f=0;this.seriesInfo.charts.bar.forEach(g=>{this.seriesList[g].show&&f++});const u=new Map,m=Object.keys(this.seriesInfo.charts);for(let g=0;g<m.length;g++){const x=m[g],b=this.seriesInfo.charts[x];x==="scatter"&&this.options.coordinateDedupe&&this.collectDuplicatePoints(u,b);for(let y=0;y<b.length;y++){let M=this.seriesList[b[y]];switch(x){case"line":{const E=t==null?void 0:t.legend;M.draw({legendHitInfo:E,...d});break}case"heatMap":{const E=t==null?void 0:t.legend;M.draw({legendHitInfo:E,...d});break}case"bar":{const E=t==null?void 0:t.legend,{thickness:I,cPadRatio:T,borderRadius:V}=this.options;M.draw({thickness:I,cPadRatio:T,borderRadius:V,showSeriesCount:f,showIndex:h,legendHitInfo:E,...d}),M.show&&h++;break}case"pie":{const E=this.lastHitInfo??{sId:(p=this.defaultSelectItemInfo)==null?void 0:p.seriesID},I=t==null?void 0:t.legend;this.options.sunburst?this.drawSunburst({selectInfo:E,legendHitInfo:I,unSelectedOpacity:d.unSelectedOpacity}):this.drawPie({selectInfo:E,legendHitInfo:I,unSelectedOpacity:d.unSelectedOpacity}),this.options.doughnutHoleSize>0&&this.drawDoughnutHole();break}case"scatter":{const E=t==null?void 0:t.legend;let I;if(s.use&&s.useSeriesOpacity){const T=this.lastHitInfo,V=this.defaultSelectItemInfo;T!=null&&T.maxIndex||(T==null?void 0:T.maxIndex)===0?I={seriesID:T.sId,dataIndex:T.maxIndex}:V!=null&&V.dataIndex||(V==null?void 0:V.dataIndex)===0?I={...V}:I=null}this.options.seriesReverse&&(M=this.seriesList[b.at(-1-y)]),M.draw({legendHitInfo:E,selectInfo:I,duple:u,coordinateDedupe:this.options.coordinateDedupe,...d});break}}}}}drawTip(){var n;let t;this.lastHitInfo?t=this.lastHitInfo:this.defaultSelectItemInfo?t=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?t=this.getItem(this.defaultSelectInfo,!1):t=null,(n=this.drawTips)==null||n.call(this,t)}createAxes(t,n=[]){const o=this.bufferCtx,l=this.options.type==="heatMap"?this.data.labels[t]:this.data.labels,a=this.options;return n.map(r=>{switch(r.type){case"linear":return new TC(t,r,o,a);case"time":return r.categoryMode?new OC(t,r,o,l,a):new vC(t,r,o,a);case"log":return new BC(t,r,o);case"step":return new DC(t,r,o,l,a);default:return!1}})}getAxesRange(){const t=this.axesX.map((o,s)=>o.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((o,s)=>o.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:t,y:n}}drawAxis(t){this.axesX.forEach((n,o)=>{n.draw(this.chartRect,this.labelOffset,this.axesSteps.x[o],t,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((n,o)=>{n.draw(this.chartRect,this.labelOffset,this.axesSteps.y[o],t,this.defaultSelectInfo)})}calculateSteps(){const t=this.axesX.map((o,s)=>{const l={minValue:this.axesRange.x[s].min,maxValue:this.axesRange.x[s].max,minIndex:this.axesRange.x[s].minIndex,maxIndex:this.axesRange.x[s].maxIndex,minSteps:this.labelRange.x[s].min,maxSteps:this.labelRange.x[s].max};return o.calculateSteps(l)}),n=this.axesY.map((o,s)=>{const l={minValue:this.axesRange.y[s].min,maxValue:this.axesRange.y[s].max,minIndex:this.axesRange.y[s].minIndex,maxIndex:this.axesRange.y[s].maxIndex,minSteps:this.labelRange.y[s].min,maxSteps:this.labelRange.y[s].max};return o.calculateSteps(l)});return{x:t,y:n}}getAxesLabelRange(){const t=this.axesX.map((o,s)=>{const l=this.axesRange.x[s].size;return o.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((o,s)=>{const l=this.axesRange.y[s].size;return o.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:t,y:n}}initScale(){const t=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;this.pixelRatio=t/n,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.scale(this.pixelRatio,this.pixelRatio),this.overlayCtx&&this.overlayCtx.scale(this.pixelRatio,this.pixelRatio)}getChartDOMRect(){var s;const t=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(t==null?void 0:t.width)||10,o=(t==null?void 0:t.height)||10;return this.setWidth(n),this.setHeight(o),{width:n,height:o}}getChartRect(){var I,T,V,C;const{width:t,height:n}=this.getChartDOMRect(),o=this.options.padding,s=(T=(I=this.options.axesX)==null?void 0:I[0])==null?void 0:T.title,l=(C=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:C.title,a=10;let r=0;s!=null&&s.use&&(s!=null&&s.text)&&(r=(isNaN(s==null?void 0:s.fontSize)?12:s==null?void 0:s.fontSize)+a);let c=0;l!=null&&l.use&&(l!=null&&l.text)&&(c=(isNaN(l==null?void 0:l.fontSize)?12:l==null?void 0:l.fontSize)+a);const d=this.scrollbar.x,h=this.scrollbar.y;let f=0;d!=null&&d.use&&(f=d==null?void 0:d.height);let u=0;h!=null&&h.use&&(u=h==null?void 0:h.width);const m=o.left+o.right+u,p=o.top+o.bottom+r+c+f,g=t>m?t-m:t,x=n>p?n-p:n,b=o.left,y=Math.max(t-o.right-u,b+2),M=o.top+c,E=Math.max(n-o.bottom-r-f,M+2);return{x1:b,x2:y,y1:M,y2:E,chartWidth:g,chartHeight:x,width:t,height:n}}setWidth(t){this.displayCanvas&&(this.displayCanvas.width=t*this.pixelRatio,this.displayCanvas.style.width=`${t}px`,this.bufferCanvas.width=t*this.pixelRatio,this.bufferCanvas.style.width=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.width=t*this.pixelRatio,this.overlayCanvas.style.width=`${t}px`))}setHeight(t){this.displayCanvas&&(this.displayCanvas.height=t*this.pixelRatio,this.displayCanvas.style.height=`${t}px`,this.bufferCanvas.height=t*this.pixelRatio,this.bufferCanvas.style.height=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.height=t*this.pixelRatio,this.overlayCanvas.style.height=`${t}px`))}getLabelOffset(t=null){const n=this.axesX,o=this.axesY,s=t??this.axesRange,l={top:2,left:2,right:2,bottom:2},a={width:14,height:4};let r=0,c=0;return n.forEach((d,h)=>{var f;(f=d.labelStyle)!=null&&f.show&&(r=s.x[h].size.width+a.width,c=s.x[h].size.height+a.height,d.position==="bottom"?c>l.bottom&&(l.bottom=c):d.position==="top"&&c>l.top&&(l.top=c),l.left=r/2>l.left?r/2:l.left,l.right=r/2>l.right?r/2:l.right)}),o.forEach((d,h)=>{var f;(f=d.labelStyle)!=null&&f.show&&(r=s.y[h].size.width+a.width,d.position==="left"?r>l.left&&(l.left=r):d.position==="right"&&r>l.right&&(l.right=r),l.top=c/2>l.top?c/2:l.top,l.bottom=c/2>l.bottom?c/2:l.bottom)}),l}updateScrollbar(t,n){var c,d,h,f,u,m,p,g,x,b;const o=n||t,s=((h=(d=(c=this.options.axesX)==null?void 0:c[0])==null?void 0:d.scrollbar)==null?void 0:h.use)??!1,l=((m=(u=(f=this.options.axesY)==null?void 0:f[0])==null?void 0:u.scrollbar)==null?void 0:m.use)??!1,a=((g=(p=this.scrollbar)==null?void 0:p.x)==null?void 0:g.use)??!1,r=((b=(x=this.scrollbar)==null?void 0:x.y)==null?void 0:b.use)??!1;(s!==a||s||o&&s)&&this.updateScrollbarInfo("x",t),(l!==r||l||o&&l)&&this.updateScrollbarInfo("y",t)}update(t){var x,b,y,M,E,I;const n=this.options,o=this.data.data,s=this.data.labels,l=this.data.groups,a=this.data.series,{updateSeries:r,updateSelTip:c,updateLegend:d,updateData:h,updateTooltip:f,lightUpdate:u,updateByScrollbar:m}=t;if(!this.isInit)return;if(this.updateScrollbar(h,m),this.resetProps(),this.updateSeries=r,r&&(this.seriesInfo=null,this.seriesList=null,this.lastTip=null,this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.seriesList={},this.lastTip={pos:null,value:null},this.createSeriesSet(a,n.type,n.horizontal,l),this.legendDOM&&!n.legend.external&&this.updateLegend()),c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!u)if(l.length&&this.addGroupInfo(l),(x=this.options.realTimeScatter)!=null&&x.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(o)):this.createDataSet(o,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const T=!!((y=(b=n.legend)==null?void 0:b.table)!=null&&y.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():T&&h&&this.updateLegendTableValues():this.initLegend(),this.setLegendPosition(),this.updateLegendContainerSize(),this.showLegend()}else n.legend.show&&n.legend.external?(r||h)&&(this._updateSeriesCount(),this.emitLegendData()):this.isInitLegend&&this.hideLegend();f&&(this.isInitTooltip||this.createTooltipDOM(),this.tooltipDOM.innerHTML="",(E=(M=n.tooltip)==null?void 0:M.formatter)!=null&&E.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let p=t==null?void 0:t.hitInfo;!(p!=null&&p.legend)&&((I=this.legendHover)!=null&&I.sId)&&(p={...p||{},legend:this.legendHover}),this.render(p),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(this.dragInfoBackup=null)}resetProps(){this.axesX[0]=null,this.axesY[0]=null,this.axesX=null,this.axesY=null,this.minMax=null,this.axesRange=null,this.labelOffset=null,this.chartRect=null}overlayClear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}clear(){this.clearRectRatio=this.pixelRatio<1?this.pixelRatio:1,this.displayCanvas&&this.displayCtx.clearRect(0,0,this.displayCanvas.width/this.clearRectRatio,this.displayCanvas.height/this.clearRectRatio),this.bufferCanvas&&this.bufferCtx.clearRect(0,0,this.bufferCanvas.width/this.clearRectRatio,this.bufferCanvas.height/this.clearRectRatio),this.overlayCanvas&&this.overlayCtx.clearRect(0,0,this.overlayCanvas.width/this.clearRectRatio,this.overlayCanvas.height/this.clearRectRatio)}resize(t){var n,o,s,l,a,r,c;this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.initRect(),((s=(o=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:o.scrollbar)!=null&&s.use||(r=(a=(l=this.options.axesY)==null?void 0:l[0])==null?void 0:a.scrollbar)!=null&&r.use)&&this.initScrollbar(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),t&&t(!0)}render(t){this.isInit&&(this.clear(),this.chartRect=this.getChartRect(),this.drawChart(t))}_getLegendSeries(){var n;const t=(n=this.data.groups)==null?void 0:n.at(0);return t?t.filter(o=>{var s;return(s=this.seriesList[o])==null?void 0:s.showLegend}).map(o=>[o,this.seriesList[o]]):Object.entries(this.seriesList).filter(([,o])=>o.showLegend)}_seriesToLegendItem(t){const n=typeof t.color!="string"?t.color[t.color.length-1][1]:t.color;return{sId:t.sId,name:t.name,color:n,type:t.type,show:t.show,fill:t.fill,fillColor:t.fillColor}}buildLegendData(){return this._getLegendSeries().map(([,t])=>this._seriesToLegendItem(t))}emitLegendData(){typeof this.listeners["update:legendData"]=="function"&&this.listeners["update:legendData"](this.buildLegendData())}toggleSeries(t){var d;const n=this.seriesList[t];if(!n)return;const o=this.options.legend,s=this._getLegendSeries();if(o.clickMode==="active")s.every(([,u])=>u.show)?(s.forEach(([,u])=>{u.show=!1}),n.show=!0,this.seriesInfo.count=1):n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++),s.every(([,u])=>!u.show)&&(s.forEach(([,u])=>{u.show=!0}),this.seriesInfo.count=s.length);else{if(n.show&&this.seriesInfo.count===1)return;n.show?(n.show=!1,this.seriesInfo.count--):(n.show=!0,this.seriesInfo.count++)}if(this.brushSeries){const{chartIdx:h}=this.data,f=[...this.brushSeries.list];f[h]=this.seriesList,this.brushSeries.list=f,this.brushSeries.chartIdx=h}((d=this.options.eventBehavior)==null?void 0:d.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const a=Object.values(this.seriesList).filter(h=>h.show).map(h=>h.sId),r=a.length===Object.values(this.seriesList).length,c={data:{seriesIds:r?[]:a,isActiveAll:r}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](c),this.options.legend.show&&this.options.legend.external&&this.emitLegendData()}highlightSeries(t){const n={sId:t,type:this.options.type};this.legendHover=n,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:n},lightUpdate:!0})}unhighlightSeries(){this.legendHover=null,this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},hitInfo:{legend:null},lightUpdate:!0})}destroy(){if(!this.isInit)return;const t=this.target;for(this.options.legend.show&&!this.options.legend.external&&(this.legendBoxDOM&&(this.legendBoxDOM.removeEventListener("click",this.onLegendBoxClick),this.legendBoxDOM.removeEventListener("mouseover",this.onLegendBoxOver),this.legendBoxDOM.removeEventListener("mouseleave",this.onLegendBoxLeave),this.options.legend.type==="gradient"&&this.legendBoxDOM.removeEventListener("mousedown",this.onLegendMouseDown),this.options.legend.virtualScroll&&!this.useTable&&(this.legendBoxDOM.removeEventListener("resize",this.updateVisibleRowCount),this.legendBoxDOM.removeEventListener("scroll",this.renderVisibleLegends))),this.resizeDOM&&this.resizeDOM.removeEventListener("mousedown",this.onResizeMouseDown)),this.overlayCanvas&&(this.overlayCanvas.removeEventListener("mousemove",this.onMouseMove),this.overlayCanvas.removeEventListener("mouseleave",this.onMouseLeave),this.overlayCanvas.removeEventListener("dblclick",this.onDblClick),this.overlayCanvas.removeEventListener("click",this.onClick),this.overlayCanvas.removeEventListener("mousedown",this.onMouseDown),this.overlayCanvas.removeEventListener("wheel",this.onWheel),window.removeEventListener("click",this.dragTouchSelectionEvent)),this.isInitTooltip&&this.tooltipDestroy(),this.renderVisibleLegendsFrameId!=null&&(cancelAnimationFrame(this.renderVisibleLegendsFrameId),this.renderVisibleLegendsFrameId=null),this.updateVisibleRowCountFrameId!=null&&(cancelAnimationFrame(this.updateVisibleRowCountFrameId),this.updateVisibleRowCountFrameId=null),this.wrapperDOM=null,this.chartDOM=null,this.legendDOM=null,this.legendBoxDOM=null,this.resizeDOM=null,this.ghostDOM=null,this.titleDOM=null,this.displayCanvas=null,this.bufferCanvas=null,this.overlayCanvas=null;t.hasChildNodes();)t.removeChild(t.firstChild)}hideTooltip(){var t;this.options.tooltip.use&&((t=this.tooltipDOM)!=null&&t.style)&&(this.tooltipDOM.style.display="none")}initDefaultSelectInfo(){var s,l;const{type:t,selectLabel:n,selectSeries:o}=this.options;if(n.use){let a=null;t==="heatMap"&&(n!=null&&n.useBothAxis)&&(a=(s=this.defaultSelectInfo)==null?void 0:s.targetAxis),this.defaultSelectInfo=(l=this.defaultSelectInfo)!=null&&l.dataIndex?this.getSelectedLabelInfoWithLabelData(this.defaultSelectInfo.dataIndex,a):{dataIndex:[],label:[],data:[]}}o.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};const UC={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},YC={class:"ev-chart-toolbar"},jC={class:"ev-chart-toolbar__icon"};function GC(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon");return i.openBlock(),i.createElementBlock("div",YC,[i.createElementVNode("div",jC,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.$props.toolbar.items,(r,c)=>(i.openBlock(),i.createBlock(a,{key:`${c}-${r.icon}`,class:i.normalizeClass(c),icon:r.icon,size:r.size,title:r.title,onClick:d=>e.$emit("onClickToolbar",d,c)},null,8,["class","icon","size","title","onClick"]))),128))])])}const Nr=le(UC,[["render",GC],["__scopeId","data-v-dfbffbab"]]);class ZC{constructor(t,n,o,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=t.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=o.zoom;this.setEvChartZoomOptions(c),this.setIcon(s);const d=n.data[0].labels.length-1;this.cloneLabelsLastIdx=d,this.isAnimationFinish=!0,this.zoomAreaMemory={previous:[],current:[[0,d]],latest:[]},r&&(this.emitFunc=r,r.updateZoomStartIdx(0),r.updateZoomEndIdx(d)),c.useWheelMove&&(this.wrapWheelMoveZoomArea=this.wheelMoveZoomArea.bind(this)),this.evChartDomContainers=c.useAnimation?this.drawAnimationCanvas(t.dom):t.dom}setEvChartZoomOptions(t){this.evChartZoomOptions=t}setIcon(t){if(!t)return;const n=t.querySelector(".dragZoom");this.resetIcon=t.querySelector(".reset"),this.previousIcon=t.querySelector(".previous"),this.latestIcon=t.querySelector(".latest"),this.dragZoomIcon=n,this.iconStyle(n,"enable")}drawAnimationCanvas(t){return t.forEach(n=>{const o=document.createElement("canvas");o.setAttribute("style","display: block;"),o.setAttribute("class","animation-canvas"),o.style.position="absolute",n.appendChild(o)}),t}setEventListener(t){const n=t?"addEventListener":"removeEventListener";this.isUseZoomMode=t,this.evChartDomContainers.forEach(o=>{o[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(t){t.preventDefault();const[n,o]=this.zoomAreaMemory.current[0];if(n===o)return;let s,l;if(t.deltaY>0){if(!n)return;s=n-1,l=o-1}else{if(o===this.cloneLabelsLastIdx)return;s=n+1,l=o+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(t){if(!this.zoomAreaMemory[t].length)return;const[n,o]=this.zoomAreaMemory[t].pop();this.isUseToolbar=!0,this.executeZoom(n,o),this.setZoomAreaMemory(n,o,t==="previous"?"latest":"previous")}dragZoom({data:t,range:{dragSelectionInfo:n}}){const{dragXsp:o,dragXep:s,exceptAxesYChartWidth:l,chartTitle:a}=n,{options:r,data:c}=this.evChartProps,d=r.length>1?r.findIndex(h=>{var f;return(((f=h==null?void 0:h.title)==null?void 0:f.text)??"")===a}):0;if(r[d].axesX[0].type==="time"){const h=t[0].items,f=h[0].x,u=h[h.length-1].x,m=c[d].labels,p=this.evChartCloneData[d].labels,[g,x]=this.zoomAreaMemory.current[0];let b=p.findIndex(T=>+T.$d==+f.$d),y=p.findLastIndex(T=>+T.$d==+u.$d);const M=T=>l/(m.length-1)*(T-g);let E=M(b);if(b===y&&(E-o>=s-E?b-=1:y+=1),b===g&&y===x)return;b-y===-1&&(E=M(b));const I=M(y);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,b,y,E,I):(this.executeZoom(b,y),this.setZoomAreaMemory(b,y))}}dragZoomAnimation(t,n,o,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=t,d=window.devicePixelRatio||1,h=Array.from(this.evChartDomContainers).map(f=>{const u=f.querySelector(".animation-canvas");return[f.children[0],u]});for(let f=0;f<h.length;f++){const[u,m]=h[f],p=m.getContext("2d");m.style.top=`${a.y1}px`,m.style.left=`${a.x1}px`,m.width=r*d,m.style.width=`${r}px`,m.height=c*d,m.style.height=`${c}px`,m.style.display==="none"&&(m.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(u,p,t,s,l).then(g=>{m.style.display="none",g&&f===h.length-1&&(this.isAnimationFinish=g,this.executeZoom(n,o),this.setZoomAreaMemory(n,o))})}}executeZoom(t,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let o=0;o<this.evChartCloneData.length;o++){const{data:s,labels:l,series:a}=this.evChartCloneData[o],r=this.evChartProps.data[o],c=Object.keys(a);for(let d=0;d<c.length;d++){const h=c[d];r.data[h]=s[h].filter((f,u)=>t<=u&&n>=u)}r.labels=l.filter((d,h)=>t<=h&&n>=h)}!this.brushIdx.isUseButton&&!this.brushIdx.isUseScroll&&(this.brushIdx.start=t,this.brushIdx.end=n),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(t),this.emitFunc.updateZoomEndIdx(n))}setBrushIdx(t,n){this.brushIdx.end=-1;for(let o=0;o<n.value.length;o++){const s=t.data[n.value[o]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(t,n,o,s){const l=t.data[0].labels.length-1;if(this.cloneLabelsLastIdx=l,this.evChartCloneData=t.data,s){const a=this.zoomAreaMemory.current[0];let r=a[0],c=a[1];r===0&&c===-1&&(r=0,c=l,this.zoomAreaMemory={previous:[],current:[[r,c]],latest:[]}),this.emitFunc&&(this.emitFunc.updateZoomStartIdx(r),this.emitFunc.updateZoomEndIdx(c)),this.executeZoom(r,c)}else this.dragZoomIcon&&this.dragZoomIcon.classList.remove("active"),this.zoomAreaMemory={previous:[],current:[[0,l]],latest:[]},this.emitFunc&&(this.emitFunc.updateZoomStartIdx(0),this.emitFunc.updateZoomEndIdx(l)),this.setIconStyle(o),this.setBrushIdx(t,n)}setZoomAreaMemory(t,n,o){if(t<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;o?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[o].push(r)):(t!==r[0]||n!==r[1])&&(r[0]===0&&r[1]===-1?s.push([0,this.cloneLabelsLastIdx]):s.push(r),a.length=0),l.push([t,n]),this.setIconStyle(this.isUseZoomMode)}executeDragZoomAnimation(t,n,o,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=o;let d=0,h=s,f=l-s,u=l,m=1;const p=.0015;let g=.5;const x=.1,b=.05,y=50,M=Math.ceil(y*(s/r)),E=Math.ceil(y*((r-l)/r)),I=T=>(n.clearRect(0,0,r,c),h<=0&&f>=r?(t.style.opacity="initial",T(!0)):(g>=x&&(t.style.opacity=g,g-=b),n.globalAlpha=m,n.drawImage(t,a.x1,a.y1,s,c,d,0,s,c),n.drawImage(t,a.x1+s,a.y1,l-s,c,h,0,f,c),n.drawImage(t,a.x1+l,a.y1,r,c,u,0,r,c),m-=p,d-=M,h-=M,f+=M+E,u+=E,requestAnimationFrame(()=>I(T))));return new Promise(T=>I(T))}setIconStyle(t){const n=(o,s)=>{s?this.iconStyle(o,"enable"):this.iconStyle(o,"disable")};if(t&&this.dragZoomIcon.classList.contains("active")){const{previous:o,latest:s}=this.zoomAreaMemory;n(this.previousIcon,o.length),n(this.latestIcon,s.length),this.iconStyle(this.resetIcon,"enable")}else n(this.resetIcon),n(this.previousIcon),n(this.latestIcon)}iconStyle(t,n){if(!t)return;const[o,s]=n==="enable"?[1,"initial"]:[.5,"none"];t.style.opacity=o,t.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[t,n]=this.zoomAreaMemory.current[0],o=this.cloneLabelsLastIdx;(t!==0||n!==o)&&(this.isUseToolbar=!0,this.executeZoom(0,o),this.setZoomAreaMemory(0,o))}}const qC={padding:{top:20,right:2,left:2,bottom:4},border:2,title:{show:!1,height:40,text:"",style:{fontSize:15,color:"#000",fontFamily:"Roboto"}},legend:{show:!0,type:"icon",position:"right",color:"#353740",inactive:"#aaa",width:140,height:24,allowResize:!1,virtualScroll:!1,clickMode:"active",external:!1,table:{use:!1,columns:{name:{title:"Name"},min:{title:"MIN",use:!1},max:{title:"MAX",use:!1},avg:{title:"AVG",use:!1},total:{title:"TOTAL",use:!1},last:{title:"LAST",use:!1}}}},itemHighlight:!0,seriesHighlight:!0,unSelectedOpacity:.3,useSelect:!1,doughnutHoleSize:0,pieStroke:{use:!0,lineWidth:2,color:"#FFFFFF"},reverse:!1,horizontal:!1,overlapping:{use:!1},width:"100%",height:"100%",thickness:1,cPadRatio:0,borderRadius:0,combo:!1,tooltip:{use:!0,sortByValue:!0,backgroundColor:"#4C4C4C",fontColor:"#FFFFFF",borderColor:"#666666",shadowOpacity:.25,useShadow:!1,throttledMove:!1,debouncedHide:!1,useScrollbar:!1,textOverflow:"wrap",fontFamily:"Roboto",colorShape:"rect",fontSize:{title:16,contents:14},rowPadding:{top:0,bottom:3,right:20,left:16},showHeader:!0},indicator:{use:!0,color:"#EE7F44",segments:null},maxTip:{use:!1,fixedPosTop:!1,showIndicator:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400}},selectItem:{use:!1,useClick:!0,showTextTip:!1,tipText:"value",showTip:!1,showIndicator:!1,fixedPosTop:!1,useApproximateValue:!1,indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},useSeriesOpacity:!1,useDeselectItem:!1,showBorder:!1,borderStyle:{color:"#FFFFFF",lineWidth:1,opacity:1,radius:0}},selectLabel:{use:!1,useClick:!0,tipText:"value",limit:1,useDeselectOverflow:!1,showTip:!1,useSeriesOpacity:!0,useLabelOpacity:!0,fixedPosTop:!1,useApproximateValue:!1,tipBackground:"#000000",indicatorColor:"#000000",tipStyle:{height:20,background:"#000000",textColor:"#FFFFFF",fontSize:14,fontFamily:"Roboto",fontWeight:400},showTextTip:!1,showIndicator:!1,useBothAxis:!1},selectSeries:{use:!1,useClick:!0,limit:1,useDeselectOverflow:!1},dragSelection:{use:!1,keepDisplay:!0,size:50,fillColor:"#38ACEC",opacity:.65},zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}},heatMapColor:{min:"#FFFFFF",max:"#0052FF",rangeCount:1,colorsByRange:[],stroke:{show:!1,color:"#FFFFFF",lineWidth:1,opacity:1,radius:0},error:"#FF0000",decimalPoint:0},seriesReverse:!1,coordinateDedupe:!0,eventBehavior:{legendClick:"update"}},KC={series:{},groups:[],labels:[],data:{}},JC=()=>{let e=null,t=0;const n=200;return{clickEventCallback:l=>{t++,t===1&&(e=setTimeout(()=>{t===1&&l(),t=0},n))},dblClickEventCallback:l=>{e&&(clearTimeout(e),e=null),l(),t=0}}},Vr=(e,t)=>{const{props:n,emit:o}=i.getCurrentInstance(),s=u=>{const m=Fe({},u,qC);return(u.type==="scatter"||u.type==="heatMap")&&!(u!=null&&u.tooltip)&&(m.tooltip.use=!1),u.type==="pie"&&!(u!=null&&u.padding)&&(m.padding={top:2,right:2,left:2,bottom:4}),m},l=u=>Fe(u,KC),a=Se(n.selectedItem),r=Se(n.selectedLabel??(e==null?void 0:e.value)),c=Se(n.selectedSeries),{clickEventCallback:d,dblClickEventCallback:h}=JC();return{eventListeners:{click:async u=>{await i.nextTick(),d(()=>{const{seriesId:m,dataIndex:p,eventTarget:g,targetAxis:x}=(u==null?void 0:u.selected)??{},{eventTarget:b}=(u==null?void 0:u.deselected)??{};switch(g){case"item":{m!==null?(o("update:selectedItem",{seriesID:m,dataIndex:p}),b==="label"&&o("update:selectedLabel",{dataIndex:[]})):o("update:selectedItem",null);break}case"label":{e!=null&&e.value?e.value.dataIndex=p:(o("update:selectedLabel",{dataIndex:p,targetAxis:x}),b==="item"&&o("update:selectedItem",null));break}case"series":{o("update:selectedSeries",{seriesId:m});break}}o("click",u)})},"dbl-click":async u=>{await i.nextTick(),h(()=>{const{eventTarget:m}=u;switch(m){case"series":{o("update:selectedSeries",{seriesId:u.seriesId?[u.seriesId]:[]});break}}o("dbl-click",u)})},"drag-select":async u=>{await i.nextTick(),o("drag-select",u)},"mouse-move":async u=>{t!=null&&t.value&&(t.value=u.hoveredLabel),await i.nextTick(),o("mouse-move",u)},"mouse-leave":()=>{t!=null&&t.value&&(t.value.label=null)},"click-legend":async u=>{await i.nextTick(),o("click-legend",u)},"update:legendData":async u=>{await i.nextTick(),o("update:legendData",u)},"axes-scale-change":u=>{o("axes-scale-change",u)}},selectItemInfo:a,selectLabelInfo:r,selectSeriesInfo:c,getNormalizedData:l,getNormalizedOptions:s}},Pr=e=>{const t=i.ref(),n=i.computed(()=>{const o=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:o(Zl(e.width)),height:o(Zl(e.height))}});return{wrapper:t,wrapperStyle:n}},_r=(e,{wrapper:t,evChartGroupRef:n},o,s)=>{const{props:l,emit:a}=i.getCurrentInstance(),r=i.ref(!1),c=i.ref(!1),d=i.ref(!0),h=i.ref(),f=i.reactive({zoom:e.zoom}),u=i.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let m=null;const p=i.reactive({dom:[],props:{data:[],options:[]}}),g=i.reactive({data:null,options:null}),x=i.ref([]),b=S=>{S.data.length&&S.range&&c.value&&m.dragZoom(S)},y=()=>{p.props.options.forEach((S,w)=>{if(S.zoom={...S.zoom,use:c.value,getRangeInfo:b},c.value)S.dragSelection={...S.dragSelection,use:!0,keepDisplay:!1};else{const{use:k,keepDisplay:B}=g.options[w].dragSelection??{};S.dragSelection={use:!!k,keepDisplay:!!B}}})},M=()=>{if(n!=null&&n.value?(p.dom=n.value.querySelectorAll(".ev-chart-container"),p.dom.length&&s.value.forEach(({data:S,options:w},k)=>{S.chartIdx=k,p.props.data.push(S),p.props.options.push(w),x.value.push(k)})):(p.dom=[t.value.querySelector(".ev-chart-container")],p.props.data.push(l.data),p.props.options.push(l.options)),p.props.data.length){g.data=Se(p.props.data),g.options=Se(p.props.options);const S={updateZoomStartIdx:w=>a("update:zoomStartIdx",w),updateZoomEndIdx:w=>a("update:zoomEndIdx",w)};m=new ZC(p,g,f,h.value,r,u,S)}},E=S=>{g.data[0].labels.length<=1||(c.value=!c.value,S?S.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),y(),m.setIconStyle(c.value),m.setEventListener(c.value))},I=(S,w)=>{if(m.isAnimationFinish)switch(w){case"dragZoom":E(S.target);break;case"reset":m.initZoom();break;case"previous":case"latest":m.clickMoveZoomArea(w);break}};i.onUpdated(()=>{m&&h.value&&m.setIcon(h.value)});const T=S=>{!je(S.zoom,f.zoom)&&(f.zoom=S.zoom,m?(!f.zoom.toolbar.show&&c.value&&E(),m.setEvChartZoomOptions(f.zoom)):f.zoom.toolbar.show&&!n&&M())},V=S=>{d.value?(r.value||(g.data=n?Se(S):[Se(S)],f.zoom.keepZoomStatus?d.value=!1:(c.value=!1,y()),m&&m.updateEvChartCloneData(g,x,c.value,f.zoom.keepZoomStatus)),r.value=!1):d.value=!0},C=(S,w)=>{if(m.isUseToolbar){m.isUseToolbar=!1;return}c.value&&(m.executeZoom(S,w),m.setZoomAreaMemory(S,w))};return i.watch(()=>[u.start,u.end],([S,w],[k])=>{if(o!=null&&o.value)if(typeof o.value.dataIndex=="number")S>=(k??0)?o.value.dataIndex-=S-(k??0):o.value.dataIndex+=k-S;else for(let B=0;B<o.value.dataIndex.length;B++)S>=(k??0)?o.value.dataIndex[B]-=S-(k??0):o.value.dataIndex[B]+=k-S;(u.isUseButton||u.isUseScroll)&&m.executeZoom(S,w)}),i.watch(()=>[u.isUseButton,u.isUseScroll],([S,w],[k,B])=>{k&&!S?m.setZoomAreaMemory(u.start,u.end):B&&!w&&(m.zoomAreaMemory.current[0]=[u.start,u.end])}),{evChartZoomOptions:f,evChartInfo:p,evChartToolbarRef:h,evChartClone:g,brushIdx:u,createEvChartZoom:M,setOptionsForUseZoom:T,setDataForUseZoom:V,controlZoomIdx:C,onClickToolbar:I}},QC={name:"EvChart",components:{EvChartToolbar:Nr},directives:{resize:wn},props:{selectedItem:{type:Object,default:null},selectedLabel:{type:Object,default:null},selectedSeries:{type:Object,default:null},options:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})},resizeTimeout:{type:Number,default:0},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},realTimeScatterReset:{type:Boolean,default:!1},legendData:{type:Array,default:()=>[]}},emits:["click","dbl-click","drag-select","mouse-move","update:selectedItem","update:selectedLabel","update:selectedSeries","update:zoomStartIdx","update:zoomEndIdx","update:realTimeScatterReset","click-legend","update:legendData","axes-scale-change"],setup(e,{emit:t}){let n=null;const o=i.ref(!1),s=i.inject("isChartGroup",!1),l=i.inject("brushSeries",{list:[],chartIdx:null}),a=i.inject("groupSelectedLabel",null),r=i.inject("groupHoveredLabel",null),c=i.inject("brushIdx",{start:0,end:-1}),d=i.inject("evChartPropsInGroup",[]),{eventListeners:h,selectItemInfo:f,selectLabelInfo:u,selectSeriesInfo:m,getNormalizedData:p,getNormalizedOptions:g}=Vr(a,r),x=p(e.data),b=g(e.options),y=i.computed(()=>e.selectedLabel),M=i.computed(()=>e.selectedItem),{wrapper:E,wrapperStyle:I}=Pr(b),{evChartZoomOptions:T,evChartToolbarRef:V,createEvChartZoom:C,setOptionsForUseZoom:S,setDataForUseZoom:w,controlZoomIdx:k,onClickToolbar:B}=s?{}:_r(b,{wrapper:E,evChartGroupRef:null},e.selectedLabel?y:M,d),D=()=>{var z;let _;b.selectLabel.use?_=u:b.selectSeries.use&&(_=m);const A=(z=e.options.realTimeScatter)!=null&&z.use?{...e.data,groups:[],labels:[]}:x;n=new Rr(E.value,A,b,h,f,_,l)},O=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&C(),b.legend.show&&b.legend.external&&n.emitLegendData())};i.watch(()=>e.options,_=>{var H,U;const A=g(_),z=((U=(H=n.options)==null?void 0:H.legend)==null?void 0:U.show)??!1,X=!je(A.legend.table,n.options.legend.table),W=A.tooltip.use&&!je(A.tooltip,n.options.tooltip);n.options=Se(A),n.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:X,updateTooltip:W}),A.legend.show&&A.legend.external&&!z&&n.emitLegendData(),s||S(A)},{deep:!0,flush:"post"}),i.watch(()=>e.data,_=>{var W,H;const A=(W=e.options.realTimeScatter)!=null&&W.use?{..._,groups:[],labels:[]}:p(_),z=!je(A.series,n.data.series)||!je(A.groups,n.data.groups)||e.options.type==="heatMap",X=!je(A,n.data);n.data=(H=e.options.realTimeScatter)!=null&&H.use?A:Se(A),n.update({updateSeries:z,updateSelTip:{update:!0,keepDomain:!1},updateData:X}),!s&&X&&w(A)},{deep:!0,flush:"post"}),s&&!(a!=null&&a.value)&&i.watch(()=>c.start,(_,A)=>{if(y!=null&&y.value)for(let z=0;z<y.value.dataIndex.length;z++)_>=(A??0)?y.value.dataIndex[z]-=_-(A??0):y.value.dataIndex[z]+=A-_;else M!=null&&M.value&&(_>=(A??0)?M.value.dataIndex-=_-(A??0):M.value.dataIndex+=A-_)}),i.watch(()=>M.value,_=>{const A=e.options.type;n.selectItemByData(_,A)},{deep:!0,flush:"post"}),i.watch(()=>(a==null?void 0:a.value)??y.value,_=>{_!=null&&_.dataIndex&&n.selectLabelByData(_.dataIndex,_==null?void 0:_.targetAxis)},{deep:!0,flush:"post"}),i.watch(()=>e.selectedSeries,_=>{var A;(A=b.selectSeries)!=null&&A.use?_.seriesId&&n.selectSeriesByData(_.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||i.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([_,A])=>{k(_,A)}),i.watch(()=>e.realTimeScatterReset,_=>{_&&(Object.keys(n.dataSet??{}).forEach(A=>{n.dataSet[A]&&(n.dataSet[A].dataGroup=[])}),t("update:realTimeScatterReset",!1))}),i.watch(()=>{var _;return(_=e.options.realTimeScatter)==null?void 0:_.use},_=>{n.options.realTimeScatter.use=_??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),i.watch(()=>r==null?void 0:r.value,_=>{_&&e.options.syncHover!==!1&&(_.label==null?n.overlayClear():n.drawSyncedIndicator(_))},{deep:!0,flush:"post"}),i.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await D(),await O(),o.value=!0}),i.onBeforeUnmount(()=>{var _;n&&"destroy"in n&&n.destroy(),(_=d==null?void 0:d.value)!=null&&_.length&&(d.value.length=0),o.value=!1}),i.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const L=_=>{n==null||n.toggleSeries(_)},v=_=>{n==null||n.highlightSeries(_)},N=()=>{n==null||n.unhighlightSeries()},R=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},P=jo(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return i.onActivated(()=>{o.value&&P()}),{wrapper:E,wrapperStyle:I,onResize:P,redraw:R,toggleSeries:L,highlightSeries:v,unhighlightSeries:N,evChartToolbarRef:V,injectIsChartGroup:s,onClickToolbar:B,normalizedOptions:b,zoomOptions:i.toRef(T??{zoom:{}},"zoom")}}},eS={key:0,ref:"evChartToolbarRef"};function tS(e,t,n,o,s,l){var c;const a=i.resolveComponent("ev-chart-toolbar"),r=i.resolveDirective("resize");return i.openBlock(),i.createElementBlock(i.Fragment,null,[(c=o.zoomOptions.toolbar)!=null&&c.show&&!o.injectIsChartGroup?(i.openBlock(),i.createElementBlock("div",eS,[i.createVNode(a,{toolbar:o.zoomOptions.toolbar,onOnClickToolbar:o.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("div",{ref:"wrapper",style:i.normalizeStyle(o.wrapperStyle),class:"ev-chart"},null,4),[[r,o.onResize]])],64)}const so=le(QC,[["render",tS]]);so.install=e=>{e.component(so.name,so)};const nS={zoom:{bufferMemoryCnt:100,keepZoomStatus:!1,useAnimation:!0,useWheelMove:!0,toolbar:{show:!1,items:{previous:{icon:"ev-icon-allow2-left",size:"medium",title:"Previous"},latest:{icon:"ev-icon-allow2-right",size:"medium",title:"Latest"},reset:{icon:"ev-icon-redo",size:"medium",title:"Reset"},dragZoom:{icon:"ev-icon-zoomin",size:"medium",title:"Drag Zoom"}}}}},oS=()=>{const e=i.ref(!1),t=i.ref(),n=i.ref([]),o=i.reactive({list:[],chartIdx:null});return{getNormalizedOptions:l=>Fe({},l,nS),isExecuteZoom:e,brushSeries:o,evChartGroupRef:t,evChartPropsInGroup:n}},iS={name:"EvChartGroup",components:{evChartToolbar:Nr},props:{options:{type:Object,default:()=>({})},zoomStartIdx:{type:Number,default:0},zoomEndIdx:{type:Number,default:0},groupSelectedLabel:{type:Object,default:null}},emits:["update:groupSelectedLabel","update:zoomStartIdx","update:zoomEndIdx","update:groupHoveredLabel"],setup(e,{emit:t}){const{getNormalizedOptions:n,isExecuteZoom:o,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a}=oS(),r=n(e.options);i.provide("isExecuteZoom",o),i.provide("isChartGroup",!0),i.provide("brushSeries",s),i.provide("evChartPropsInGroup",a);const c=i.computed({get:()=>e.groupSelectedLabel,set:E=>t("update:groupSelectedLabel",E)});i.provide("groupSelectedLabel",c);const d=i.ref(null);i.provide("groupHoveredLabel",d),i.watch(()=>e.options.syncHover,E=>{E?d.value={label:"",horizontal:!1}:d.value=null},{immediate:!0});const{evChartZoomOptions:h,evChartInfo:f,evChartToolbarRef:u,evChartClone:m,brushIdx:p,createEvChartZoom:g,setOptionsForUseZoom:x,setDataForUseZoom:b,controlZoomIdx:y,onClickToolbar:M}=_r(r,{wrapper:null,evChartGroupRef:l},c,a);return i.provide("evChartClone",m),i.provide("evChartInfo",f),i.provide("brushIdx",p),i.onMounted(()=>{g()}),i.watch(()=>f.props.data,E=>{b(E)},{deep:!0}),i.watch(()=>e.options,E=>{const I=n(E);x(I)},{deep:!0}),i.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([E,I])=>{p.isUseButton||p.isUseScroll||y(E,I)}),{evChartGroupRef:l,evChartToolbarRef:u,zoomOptions:i.toRef(h,"zoom"),onClickToolbar:M}}},sS={key:0,ref:"evChartToolbarRef"},lS={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function aS(e,t,n,o,s,l){const a=i.resolveComponent("ev-chart-toolbar");return i.openBlock(),i.createElementBlock(i.Fragment,null,[o.zoomOptions.toolbar.show?(i.openBlock(),i.createElementBlock("div",sS,[i.createVNode(a,{toolbar:o.zoomOptions.toolbar,onOnClickToolbar:o.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):i.createCommentVNode("",!0),i.createElementVNode("div",lS,[i.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const lo=le(iS,[["render",aS],["__scopeId","data-v-b1c0c322"]]);lo.install=e=>{e.component(lo.name,lo)};const Ie={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Le={LEFT:"leftX",RIGHT:"rightX"};let rS=class{constructor(t,n,o,s,l){this.evChart=t,this.evChartBrushOptions=o,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,o.value.useDebounce&&(this.debounceBrushIdx={start:s.start,end:s.end})}init(t){var n;if(this.brushIdx.start>this.brushIdx.end){this.removeBrushCanvas();return}if((n=this.evChartBrushRef)!=null&&n.value){const o=this.evChartBrushRef.value.querySelector(".brush-canvas");if(o)this.drawBrushRect({brushCanvas:o,isResize:t});else{const s=document.createElement("canvas");s.setAttribute("class","brush-canvas"),s.setAttribute("style","display: block; z-index: 1;");const l=this.evChartBrushRef.value.querySelector(".ev-chart-brush-container");l&&(this.brushCanvas=s,l.appendChild(s),this.evChartBrushContainer=l,this.drawBrushRect({brushCanvas:s}),this.addEvent(s))}}}drawBrushRect({brushCanvas:t,isResize:n,isDebounce:o,mode:s,offsetX:l}){const{chartRect:a,labelOffset:r}=this.evChart;if(!a&&!r)return;const c=this.evChartData.value.labels.length-1;this.labelEndIdx=c;const d={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},h=this.setCanvasWidthHeight(d,t);if(!(n&&this.isEqualWidth)&&c>=0){const f=this.setBrushXAndWidth(h,l,o,s);h&&f&&this.drawBrush(h,f,d,t)}}setCanvasWidthHeight(t,n){const s=t.x2-t.x1+6,l=t.y2-t.y1,a=(t.x2-t.x1)/this.labelEndIdx,r=window.devicePixelRatio||1;return this.isEqualWidth=n.width===Math.floor(s*r),{brushButtonWidth:6,brushCanvasHeight:l,brushCanvasWidth:s,axesXInterval:a,pixelRatio:r}}setBrushXAndWidth(t,n=0,o,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=t;!o&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case Ie.BUTTON.INCREASE:case Ie.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Le.LEFT?(this.brushRectWidth=this.beforeBrushRectWidth?this.beforeBrushRectWidth-n:this.brushRectWidth-n,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=n*c,this.beforeBrushRectX=this.brushRectX)):this.curBrushButtonType===Le.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case Ie.GRAB.UP:case Ie.GRAB.DOWN:this.brushRectX<=0&&s===Ie.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===Ie.GRAB.UP?this.offsetXAndRectXInterval=null:(this.offsetXAndRectXInterval||(this.offsetXAndRectXInterval=n-this.brushRectX),this.brushRectX=n-this.offsetXAndRectXInterval);break;default:n||(this.brushRectX=d.start*r*c,this.brushRectWidth=(a-(this.labelEndIdx-(d.end-d.start))*r)*c,this.beforeBrushRectX=this.brushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX);break}return{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(t,n,o,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=t,{brushRectX:h,brushRectWidth:f}=n,{height:u,selection:{fillColor:m,opacity:p}}=this.evChartBrushOptions.value,g=u-o.y1,x=h,b=h+f;s.style.position||(s.style.position="absolute",s.style.top=`${o.y1}px`,s.style.left=`${o.x1-l/2}px`),this.isEqualWidth||(s.width=r*d,s.style.width=`${r}px`,s.height=a*d,s.style.height=`${a}px`);const y=s.getContext("2d");y.clearRect(0,0,r*d,a*d),y.fillStyle=m,y.globalAlpha=p,y.fillRect(h,0,f,g),y.fillRect(x,0,l,g),y.fillRect(b-l,0,l,g),this.brushPosInfo={leftX:x/d,rightX:b/d,buttonWidth:l,axesXInterval:c,...t,...n}}addEvent(){let t;this.onMouseDown=s=>{s.preventDefault(),t.isInsideButton?this.clickBrushInsideX=-1:t.isInsideBrush?this.clickBrushInsideX=s.offsetX:t.isOutsideBrush&&this.teleportBrush(s)};const n=s=>{this.clickBrushInsideX?this.mouseDownAndMove(s):(t=this.getMousePosition(s),this.changeCursor(t))};this.onMouseMove=xs(n,5),this.onWheel=s=>{s.preventDefault();const l=s.deltaY>0?Ie.WHEEL.DOWN:Ie.WHEEL.UP;this.updateBrushIdx(l),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:l}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()},this.onMouseLeave=()=>{this.clickBrushInsideX&&this.initEventState()};const o=()=>{this.initEventState()};this.onWheelDebounce=jo(o,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),o=n(Le.RIGHT)>n(Le.LEFT)?Le.LEFT:Le.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Le.LEFT)||s(Le.RIGHT),r=s(Le.LEFT)&&l(Le.RIGHT),c=t.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[o]&&t.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[o];return this.curBrushButtonType=c&&o,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),this.brushCanvas=null),this.evChartBrushContainer){const t=this.evChartBrushContainer;for(;t.hasChildNodes();)t.removeChild(t.firstChild)}}setEventListener(t){this.brushCanvas[t]("mousemove",this.onMouseMove),this.brushCanvas[t]("mousedown",this.onMouseDown),this.brushCanvas[t]("mouseup",this.onMouseUp),this.brushCanvas[t]("mouseleave",this.onMouseLeave),this.evChartBrushOptions.value.useWheelMove&&(this.brushCanvas[t]("wheel",this.onWheel),this.brushCanvas[t]("wheel",this.onWheelDebounce))}removeBrushWrapper(){if(this.evChartBrushRef.value){const t=this.evChartBrushRef.value.querySelector(".ev-chart-brush-wrapper");t&&this.evChartBrushRef.value.removeChild(t)}}removeBrushCanvas(){if(this.evChartBrushContainer){const t=this.evChartBrushContainer.querySelector(".brush-canvas");t&&this.evChartBrushContainer.removeChild(t)}}teleportBrush(t){const n=this.debounceBrushIdx??this.brushIdx,o=(n.end-n.start)/2;let s,l,a;o>.5?(n.end-n.start)%2===0?(a=Math.round(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(o),l=Math.floor(o)):(a=Math.ceil(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(o),l=Math.floor(o)):(a=Math.floor(t.offsetX/this.brushPosInfo.axesXInterval),t.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(o),l=Math.ceil(o)):(s=Math.ceil(o),l=Math.floor(o),o<1&&(a+=1))),a-s<=0?(n.start=0,n.end=l+s):a+l>=this.labelEndIdx?(n.start=this.labelEndIdx-l-s,n.end=this.labelEndIdx):(n.start=a-s,n.end=a+l),this.brushIdx.isUseScroll=!0}changeCursor(t){t.isOutsideBrush?this.brushCanvas.style.cursor="pointer":t.isInsideBrush&&(t.isInsideButton?this.brushCanvas.style.cursor="ew-resize":this.brushCanvas.style.cursor="grab")}mouseDownAndMove(t){const n=this.debounceBrushIdx?0:this.brushPosInfo.axesXInterval/3;let o;t.offsetX>this.beforeMouseXPos?this.clickBrushInsideX>0?this.clickBrushInsideX<t.offsetX-n&&(o=Ie.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(o=this.curBrushButtonType===Le.LEFT?Ie.BUTTON.DECREASE:Ie.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.clickBrushInsideX>0?this.clickBrushInsideX>t.offsetX+n&&(o=Ie.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(o=this.curBrushButtonType===Le.LEFT?Ie.BUTTON.INCREASE:Ie.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:o,offsetX:t.offsetX}):this.updateBrushIdx(o),this.beforeMouseXPos=t.offsetX}updateBrushIdx(t){const n=this.debounceBrushIdx??this.brushIdx;switch(t){case Ie.WHEEL.UP:case Ie.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case Ie.WHEEL.DOWN:case Ie.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case Ie.BUTTON.INCREASE:if(this.curBrushButtonType===Le.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case Ie.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Le.LEFT?n.start+=1:n.end-=1;break}}updateBrushIdxUseXPos(){if(!this.debounceBrushIdx)return;const t=()=>{let s,l;if(this.brushPosInfo){const{brushRectX:a,brushRectWidth:r,brushCanvasWidth:c,axesXInterval:d}=this.brushPosInfo;if(this.brushIdx.isUseButton||this.isUseBrushGrab){if(s=a/d,l=this.labelEndIdx-(c-(a+r))/d,this.curBrushButtonType===Le.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Le.RIGHT?(s=this.brushIdx.start,l=Math.round(l),s===l&&(l+=1)):(s=Math.round(s),l=Math.round(l)),l>this.labelEndIdx){const h=l-this.labelEndIdx;s-=h,l-=h}if(s<0){const h=Math.abs(s);s=0,l+=h}}}return{brushStartIdx:s,brushEndIdx:l}},{brushStartIdx:n,brushEndIdx:o}=t();this.brushIdx.start===n&&this.brushIdx.end===o&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=o??this.debounceBrushIdx.end}initEventState(){new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1)})}};const cS={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},dS=()=>({getNormalizedBrushOptions:t=>Fe({},t,cS)}),hS={name:"EvChartBrush",directives:{resize:wn},props:{options:{type:Object,default:()=>({})}},setup(e){let t=null,n=null;const o=i.ref(!1),s=i.inject("evChartClone",{data:[]}),l=i.inject("evChartInfo",{props:{options:[]}}),a=i.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=i.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=dS(),d=i.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:f,selectLabelInfo:u,selectSeriesInfo:m,getNormalizedData:p,getNormalizedOptions:g}=Vr(),x=i.computed(()=>p((s.data??[])[d.value.chartIdx])),b=i.computed(()=>{var k,B;const S=l.props.options[d.value.chartIdx],w={...S,brush:{use:!0,...d.value},height:d.value.height,zoom:{use:!1},dragSelection:{use:!1},title:{show:!1},tooltip:{use:!1},legend:{show:!1},selectLabel:{use:!1},selectSeries:{use:!1},axesX:[{...(k=S==null?void 0:S.axesX)==null?void 0:k[0],title:{use:!1}}],axesY:[{...(B=S==null?void 0:S.axesY)==null?void 0:B[0],title:{use:!1}}]};return g(w)}),{wrapper:y,wrapperStyle:M}=Pr(b.value);i.watch(()=>r.list,()=>{y.value&&r.chartIdx===d.value.chartIdx&&(t.seriesList=r.list[d.value.chartIdx],t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}}))}),i.watch(b,(S,w)=>{var k;S.brush.chartIdx<=((k=s.data)==null?void 0:k.length)-1?n&&!je(w.brush,S.brush)?n.removeBrushWrapper():t&&!je(S,w)&&(t.options=Se(S),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Se(x.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),i.watch(()=>s.data,S=>{if(t){const w=S[d.value.chartIdx];if(w){const k=!je(w.series,t.data.series),B=r.list[d.value.chartIdx];typeof B=="object"&&Object.keys(B).length&&Object.keys(w.series).forEach(D=>{var O;"show"in w.series[D]||(w.series[D].show=((O=B[D])==null?void 0:O.show)??!0)}),t.data=Se(w),t.update({updateSeries:k,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const E=()=>{let S;b.value.selectLabel.use?S=u:b.value.selectSeries.use&&(S=m),t=new Rr(y.value,x.value,b.value,h,f,S)},I=()=>{n=new rS(t,x,d,a,y)},T=()=>{t&&t.init()},V=S=>{n&&n.init(S)};i.watch(()=>[a.start,a.end],()=>{var S;y.value&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1&&V()}),i.onMounted(async()=>{d.value.show&&(await E(),await T(),I(),V()),o.value=!0}),i.onUpdated(async()=>{var S;if(d.value.show&&d.value.chartIdx<=((S=s.data)==null?void 0:S.length)-1){const w=r.list[d.value.chartIdx];typeof w=="object"&&Object.keys(w).length&&Object.keys(x.value.series).forEach(k=>{var B;"show"in x.value.series[k]||(x.value.series[k].show=((B=w[k])==null?void 0:B.show)??!0)}),await E(),await T(),I(),V()}}),i.onBeforeUnmount(()=>{t&&"destroy"in t&&t.destroy(),n&&n.destroy(),o.value=!1}),i.onDeactivated(()=>{t&&"hideTooltip"in t&&t.hideTooltip()});const C=jo(()=>{t&&"resize"in t&&new Promise(w=>t.resize(w)).then(w=>{w&&V(w)})},0);return i.onActivated(()=>{o.value&&C()}),{evChartBrushOptions:d,evChartBrushRef:y,evChartBrushStyle:M,onResize:C}}};function fS(e,t,n,o,s,l){const a=i.resolveDirective("resize");return o.evChartBrushOptions.show?i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:i.normalizeStyle(o.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,o.onResize]]):i.createCommentVNode("",!0)}const ao=le(hS,[["render",fS]]);ao.install=e=>{e.component(ao.name,ao)};const uS={name:"TreeGridNode",components:{GridOptionButton:Rs},props:{dataIndex:{type:Number,default:0},nodeData:{type:Object,default:()=>({})},selectedData:{type:Object,default:()=>({})},useCheckbox:{type:Object,default:()=>({})},orderedColumns:{type:[Array],default:()=>[]},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""},parentIcon:{type:String,default:""},childIcon:{type:String,default:""},customContextMenu:{type:[Array],default:()=>[]},menuRef:{type:Object,default:null},rowHeight:{type:Number,default:35},minWidth:{type:Number,default:40},borderStyle:{type:String,default:""},highlightIndex:{type:Number,default:-1}},emits:{"check-tree-data":null,"expand-tree-data":null,"click-tree-data":null,"dbl-click-tree-data":null,"context-menu":null},setup(e,{emit:t}){const n=(y,M)=>{t("check-tree-data",y,M)},o=y=>{t("expand-tree-data",y)},s=(y,M)=>{t("click-tree-data",y,M)},l=(y,M)=>{t("dbl-click-tree-data",y,M)},a=y=>{t("context-menu",y)},r=y=>{const M=e.expandIcon?e.expandIcon:"",E=e.expandIcon?e.collapseIcon:"";return y.expand?E:M},c=i.computed(()=>e.nodeData||{}),d=i.computed(()=>e.parentIcon||"tree-parent-icon"),h=i.computed(()=>e.childIcon||"tree-child-icon"),f=i.computed(()=>d.value!=="none"||h.value!=="none"),u=i.computed(()=>{const y=e.orderedColumns||[],M=y.findIndex(I=>I.expandColumn&&!I.hide&&!I.hiddenDisplay);if(M!==-1)return M;const E=y.findIndex(I=>!I.hide&&!I.hiddenDisplay);return E!==-1?E:0}),m=y=>({row:!0,"tree-row":!0,[`tree-row--level-${y==null?void 0:y.level}`]:!0,highlight:(y==null?void 0:y.index)===e.highlightIndex,selected:y.selected,"non-border":!!e.borderStyle&&e.borderStyle!=="rows"}),p=i.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!e.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:f,checkboxClass:p,expandColumnIdx:u,onCheck:n,onExpand:o,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:m,getColumnClass:(y,M)=>({cell:!0,"tree-td":M===0,[y.type]:y.type,[y.align]:y.align,[y.field]:y.field,"non-border":!!e.borderStyle}),getColumnStyle:(y,M)=>({width:`${y.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),getDepthStyle:y=>({"margin-left":`${y*13}px`})}}},mS=["data-index"],gS=["data-name","data-index"],pS={class:"td-content__wrapper"},yS=["title"],xS={class:"td-content"};function bS(e,t,n,o,s,l){var d;const a=i.resolveComponent("ev-checkbox"),r=i.resolveComponent("ev-icon"),c=i.resolveComponent("grid-option-button");return i.openBlock(),i.createElementBlock("tr",{"data-index":o.node.index,class:i.normalizeClass(o.getRowClass(o.node)),onClick:t[7]||(t[7]=h=>o.onClick(h,o.node)),onDblclick:t[8]||(t[8]=h=>o.onDblClick(h,o.node))},[n.useCheckbox.use?(i.openBlock(),i.createElementBlock("td",{key:0,class:i.normalizeClass(o.checkboxClass),style:i.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[i.createVNode(a,{modelValue:o.node.checked,"onUpdate:modelValue":t[0]||(t[0]=h=>o.node.checked=h),disabled:o.node.uncheckable,indeterminate:o.node.indeterminate,class:"row-checkbox-input",onChange:t[1]||(t[1]=h=>o.onCheck(h,o.node))},null,8,["modelValue","disabled","indeterminate"])],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.orderedColumns,(h,f)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:f},[!h.hide&&!h.hiddenDisplay?(i.openBlock(),i.createElementBlock("td",{key:0,"data-name":h.field,"data-index":o.node.index,class:i.normalizeClass(o.getColumnClass(h,f)),style:i.normalizeStyle(o.getColumnStyle(h,f))},[i.createElementVNode("div",pS,[f===o.expandColumnIdx?(i.openBlock(),i.createElementBlock("span",{key:0,style:i.normalizeStyle(o.getDepthStyle(o.node.level))},null,4)):i.createCommentVNode("",!0),f===o.expandColumnIdx?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass({expand:o.node.expand,"ev-tree-toggle":!0})},[o.node.hasChild?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o.expandIconClasses(o.node)?(i.openBlock(),i.createBlock(r,{key:0,icon:o.expandIconClasses(o.node),style:{display:"block"},onClick:t[2]||(t[2]=u=>o.onExpand(o.node))},null,8,["icon"])):(i.openBlock(),i.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:t[3]||(t[3]=i.withModifiers(u=>o.onExpand(o.node),["stop"]))},[...t[9]||(t[9]=[i.createElementVNode("i",null,null,-1)])]))],64)):i.createCommentVNode("",!0)],2)):i.createCommentVNode("",!0),f===o.expandColumnIdx&&o.isDataIcon?(i.openBlock(),i.createElementBlock("span",{key:2,title:o.node[h.field],class:i.normalizeClass({expand:o.node.expand,"ev-tree-toggle":!0})},[i.createElementVNode("span",{class:i.normalizeClass(o.node.hasChild?o.parentIconMV:o.childIconMV)},[...t[10]||(t[10]=[i.createElementVNode("i",null,null,-1)])],2)],10,yS)):i.createCommentVNode("",!0),i.createElementVNode("div",xS,[e.$slots[h.field+"Node"]?i.renderSlot(e.$slots,h.field+"Node",{key:0,item:{data:o.node.data}},void 0,!0):i.createCommentVNode("",!0)])])],14,gS)):i.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(i.openBlock(),i.createElementBlock("td",{key:1,class:i.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:i.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[e.$slots.contextmenuIconNode?(i.openBlock(),i.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[t[4]||(t[4]=h=>o.onContextMenu(h)),t[5]||(t[5]=i.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[i.renderSlot(e.$slots,"contextmenuIconNode",{},void 0,!0)])):(i.openBlock(),i.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[t[6]||(t[6]=h=>o.onContextMenu(h)),i.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):i.createCommentVNode("",!0)],42,mS)}const CS=le(uS,[["render",bS],["__scopeId","data-v-faab3696"]]),SS={name:"EvTreeGridToolbar"},wS={class:"tree-grid-toolbar"};function kS(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",wS,[i.renderSlot(e.$slots,"toolbarWrapper")])}const MS=le(SS,[["render",kS]]),IS=e=>{const{props:t}=i.getCurrentInstance(),{checkInfo:n}=e;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=m=>m.charAt(0).toUpperCase()+m.slice(1),f="Renderer";let u="";if(d.indexOf("_")!==-1){const m=d.split("_");for(let p=0;p<m.length;p++)u+=h(m[p])}else u=h(d);return u+f},getConvertValue:(d,h)=>{let f=d.type==="number"||d.type==="float"?Number(h):h;return d.type==="number"?(f=$t(h),f=f===!1?h:f):d.type==="float"&&(f=f.toFixed(d.decimal??3).replace(/\B(?=(\d{3})+(?!\d))/g,",")),f},getColumnIndex:d=>t.columns.findIndex(h=>h.field===d),setPixelUnit:d=>{let h=d;const f=h.toString().indexOf("px")>=0,u=h.toString().indexOf("%")>=0;return!f&&!u&&(h=`${h}px`),h},checkHeader:d=>{n.isHeaderChecked=!!d.length&&d.every(f=>f.checked);const h=d.filter(f=>f.uncheckable);if(h.length){const f=d.filter(m=>m.checked),u=d.every(m=>h.includes(m));n.isHeaderChecked=!u&&h.length+f.length===d.length,n.isHeaderUncheckable=u}n.isHeaderIndeterminate=!!d.length&&d.some(f=>f.checked||f.indeterminate)&&!n.isHeaderChecked}}},ri=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(o=>{const s=n.find(l=>l.index===o.index)??{};return{...o,...s}})},ES=e=>{const{scrollInfo:t,stores:n,elementInfo:o,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=e,d=u=>{let m=n.showTreeStore;l.isClientPaging&&(m=r());const p=o.body;if(p){const g=s.rowHeight,x=p.clientHeight>g?Math.ceil(p.clientHeight/g):m.length,b=m.length*g;let y=Math.floor(p.scrollTop/g);y>m.length-1&&(y=0);const M=y+x+1,E=Math.max(y,0),I=M,T=o.table;n.viewStore=m.slice(E,I),t.hasVerticalScrollBar=x<m.length||p.clientHeight<T.clientHeight,t.vScrollTopHeight=E*g,t.vScrollBottomHeight=b-n.viewStore.length*g-t.vScrollTopHeight,u&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(I/l.perPage)+1,l.startIndex=I,c({onScrollEnd:!0}))}},h=()=>{const u=o.header,m=o.body,p=o.table;u.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,t.hasHorizontalScrollBar=m.clientWidth<p.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const u=o.body,m=u.scrollTop,p=u.scrollLeft,g=t.lastScroll.top,x=t.lastScroll.left,b=p!==x;m!==g&&u.clientHeight&&d(!0),b&&h(),t.lastScroll.top=m,t.lastScroll.left=p}}},vS=e=>{const{props:t,emit:n}=i.getCurrentInstance(),{resizeInfo:o,elementInfo:s,checkInfo:l,stores:a,isRenderer:r,updateVScroll:c,updateHScroll:d,contextInfo:h}=e,f=()=>{a.viewStore=a.showTreeStore;const g=a.viewStore;let x=o.columnWidth;o.columnWidth>0&&(x=o.columnWidth),x=o.columnWidth;let b=0;if(o.adjust&&s.body){const y=s.body;let M=y.offsetWidth;const E=y.offsetHeight,I=a.orderedColumns.reduce((T,V)=>(V.hide||V.hiddenDisplay||(V.width?T.totalWidth+=V.width:T.emptyCount++),T),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(o.rowHeight*g.length>E-o.scrollWidth&&(M-=o.scrollWidth),l.useCheckbox.use&&(M-=o.minWidth),x=M-I.totalWidth,x>0){const T=I.emptyCount===0?0:Math.floor(x/I.emptyCount);b=x-T*I.emptyCount,x=I.emptyCount!==0?T:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(a.orderedColumns.forEach(y=>{const M=r(y)?o.rendererMinWidth:o.minWidth;y.width&&y.width<M&&(y.width=M),!y.width&&!y.hide&&(y.width=x)}),b&&a.orderedColumns.length){let y=a.orderedColumns.length-1,M=a.orderedColumns[y];for(;y>0&&M&&(M.hide||M.hiddenDisplay);)y-=1,M=a.orderedColumns[y];M&&(M.width+=b)}o.isResize=!o.isResize},u=()=>{i.nextTick(()=>{var g,x;o.adjust&&a.orderedColumns.forEach(b=>{var M;const y=b;return!((M=t.columns[b.index])!=null&&M.width)&&!y.resized&&(y.width=0),y},void 0),f(),(g=s.body)!=null&&g.clientHeight&&c(),(x=s.body)!=null&&x.clientWidth&&d()})};return{calculatedColumn:f,onResize:u,onShow:g=>{g&&u()},onColumnResize:(g,x)=>{const b=s.header,y=s.body,M=b.getBoundingClientRect().left,E=b.querySelector(`li[data-index="${g}"]`),I=r(a.orderedColumns[g])?o.rendererMinWidth:o.minWidth,T=E.getBoundingClientRect(),V=y.getBoundingClientRect().right-M,C=s.resizeLine,S=T.left-M+I,w=T.right-M,k=x.clientX,B=T.left-M;y.style.overflow="auto",C.style.left=`${w}px`,o.showResizeLine=!0;const D=L=>{const v=L.clientX-k,N=w+v;let R=Math.max(S,N);R=Math.min(V,R),C.style.left=`${R}px`},O=()=>{const v=parseInt(C.style.left,10)-B;a.orderedColumns[g]&&(a.orderedColumns[g].width=v,a.orderedColumns[g].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),u();const N=ri(a);n("resize-column",{column:a.orderedColumns[g],columns:N}),n("change-column-info",{type:"resize",columns:N})};document.addEventListener("mousemove",D),document.addEventListener("mouseup",O,{once:!0})}}},TS=e=>{const{emit:t}=i.getCurrentInstance(),n=e,o=(r,c)=>{var f;const d=r.target.tagName.toLowerCase();let h={};return r.target.offsetParent&&(d==="td"?h=r.target.dataset:h=((f=r.target.closest("td"))==null?void 0:f.dataset)??{}),{event:r,rowData:c,rowIndex:c.index,cellName:h.name,cellIndex:h.index}};let s=null;return{onRowClick:(r,c)=>{var d,h;return r.target&&r.target.parentElement&&(r.target.parentElement.classList.contains("row-checkbox-input")||(h=(d=r.target.closest("td"))==null?void 0:d.classList)!=null&&h.contains("row-contextmenu"))?!1:(clearTimeout(s),s=setTimeout(()=>{n.useSelect&&(c.selected?(c.selected=!1,n.multiple?r.ctrlKey?n.selectedRow=n.selectedRow.filter(f=>f.index!==c.index):n.selectedRow=[c]:n.selectedRow=[]):(c.selected=!0,r.ctrlKey&&n.multiple&&(!n.limitCount||n.limitCount>n.selectedRow.length)?n.selectedRow.push(c):n.selectedRow=[c]),t("update:selected",n.selectedRow),t("click-row",o(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),t("dblclick-row",o(r,c))}}},BS=e=>{const{checkInfo:t,stores:n,checkHeader:o,pageInfo:s,getPagingData:l}=e,{emit:a}=i.getCurrentInstance(),r=()=>t.useCheckbox.mode==="each",c=m=>{const p=n.treeStore.findIndex(g=>g.index===m.index);p!==-1&&(n.treeStore[p].checked=m.checked)},d=m=>{r()||m.hasChild&&m.children.forEach(p=>{const g=p;m.checked&&!g.checked&&!g.uncheckable&&t.checkedRows.push(g),m.checked||(t.checkedRows=t.checkedRows.filter(x=>x.index!==g.index)),g.checked=m.checked&&!g.uncheckable,g.hasChild&&d(g)})},h=m=>{if(r())return;const p=m.parent;if(p){const g=p.children.every(b=>b.checked);p.checked=g&&!p.uncheckable;const x=p.children.filter(b=>b.uncheckable);if(x.length){const b=p.children.filter(y=>y.checked);x.length+b.length===p.children.length&&(p.checked=!0)}p.indeterminate=!g&&p.children.some(b=>b.checked||b.indeterminate),p.checked?t.checkedRows.push(p):t.checkedRows=t.checkedRows.filter(b=>b.index!==p.index),p.parent&&h(p)}};return{onCheck:(m,p)=>{let g=n.store;s.isClientPaging&&(g=l());const x=()=>t.useCheckbox.mode==="single",b=()=>{t.isHeaderChecked&&(t.isHeaderChecked=!1)},y=()=>{x()&&t.checkedRows.length>0&&(t.prevCheckedRow.checked=!1,c(t.prevCheckedRow))},M=I=>{if(x()){t.checkedRows=[I];return}d(I),h(I),t.checkedRows.push(I),I.indeterminate=!1},E=I=>{if(x()){t.checkedRows=[];return}t.checkedRows=t.checkedRows.filter(T=>T.index!==I.index)};y(),p.checked?(M(p),o(g)):(b(),E(p),d(p),h(p)),t.prevCheckedRow=p,a("update:checked",t.checkedRows),a("check-row",m,p.index,p)},onCheckAll:m=>{var x;const p=t.isHeaderChecked;let g=(x=n.store)==null?void 0:x.filter(b=>b.isFilter);s.isClientPaging&&(g=l()),g.forEach(b=>{b.checked=p&&!b.uncheckable,b.checked?t.checkedRows.find(y=>y.index===b.index)||t.checkedRows.push(b):t.checkedRows=t.checkedRows.filter(y=>y.index!==b.index),b.indeterminate=!1}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",m,t.checkedRows)}}},DS=e=>{const{emit:t}=i.getCurrentInstance(),{contextInfo:n,stores:o,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=e,d=(m=!0)=>{const p=[];if(m&&n.customContextMenu.length){const g=s.selectedRow,x=n.customContextMenu.map(b=>{const y=b;return y.validate&&(y.disabled=!y.validate(y.itemId,g)),y.selectedRow=g??[],y});p.push(...x)}n.contextMenuItems=p};return{setContextMenu:d,onContextMenu:m=>{var x,b;const g=(b=(x=m.target.closest(".row"))==null?void 0:x.dataset)==null?void 0:b.index;if(g){const y=o.viewStore.findIndex(E=>E.index===Number(g)),M=o.viewStore[y];s.selectedRow=[M],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(m,p)=>{var g,x,b,y,M,E;if(m.target.className.includes("column-name")){const I=!!p.sortable;n.columnMenuItems=[{text:((g=n.columnMenuTextInfo)==null?void 0:g.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||o.orderedColumns.length===1||!!p.fixed,hidden:((x=n.hiddenColumnMenuItem)==null?void 0:x.hide)||!l.value,click:()=>{r(p.field),t("change-column-status",{columns:o.updatedColumns}),t("change-column-info",{type:"display",columns:o.updatedColumns})}},{text:((b=n.columnMenuTextInfo)==null?void 0:b.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!I,hidden:(y=n.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>c(p,"asc")},{text:((M=n.columnMenuTextInfo)==null?void 0:M.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!I,hidden:(E=n.hiddenColumnMenuItem)==null?void 0:E.descending,click:()=>c(p,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:p,columnSettingTextInfo:g}=a,x={text:(g==null?void 0:g.title)??"Column List",isShowMenu:!0,click:()=>{a.isShowColumnSetting=!0,n.isShowMenuOnClick=!0}};n.customGridSettingContextMenu.length&&(n.gridSettingContextMenuItems=[...n.customGridSettingContextMenu]),p&&n.gridSettingContextMenuItems.push(x),n.gridSettingMenu.show(m)}}},OS=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,onResize:o}=e,s=()=>{let r=0;const c=[];function d(f){const u={};return Object.keys(f).forEach(m=>{m!=="children"&&(u[m]=f[m])}),u}function h(f){const{node:u,level:m,isShow:p,parent:g,uncheckable:x}=f;u!==null&&typeof u=="object"&&(u.index=r++,u.level=m,Object.hasOwnProperty.call(u,"checked")||(u.checked=!1),Object.hasOwnProperty.call(u,"selected")||(u.selected=!1),Object.hasOwnProperty.call(u,"show")||(u.show=p),Object.hasOwnProperty.call(u,"expand")||(u.expand=!0),Object.hasOwnProperty.call(u,"isFilter")||(u.isFilter=!1),Object.hasOwnProperty.call(u,"uncheckable")||(u.uncheckable=x),Object.hasOwnProperty.call(u,"indeterminate")||(u.indeterminate=!1),Object.hasOwnProperty.call(u,"data")||(u.data=d(u)),c.push(u),Object.hasOwnProperty.call(u,"parent")||(u.parent=g),u.children&&(u.hasChild=!0,u.children.forEach(b=>h({node:b,level:m+1,isShow:u.show&&u.expand,parent:u,uncheckable:u.uncheckable}))))}return n.treeRows.forEach(f=>{h({node:f,level:0,isShow:!0,parent:void 0,uncheckable:!1})}),c},l=(r,c,d)=>{r.forEach(h=>{const f=h;f.show=d&&c?f.isFilter:c,f.hasChild&&l(f.children,f.show&&f.expand,f.isFilter)})};return{setTreeNodeStore:s,handleExpand:r=>{const c=!r.expand,d=r;d.expand=!d.expand,l(d.children,d.expand,d.isFilter),t("toggle-row",{row:d,isExpand:c}),o()}}},LS=e=>{const{stores:t,filterInfo:n,pageInfo:o,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=e,d=m=>{if(!(m!=null&&m.parent))return;const{parent:p}=m;p.show=!0,p.isFilter=!0,d(p)},h=m=>{if(!(m!=null&&m.children))return;const{children:p}=m;p.forEach(g=>{const x=g;x.parent.show&&x.parent.expand?x.show=!0:x.show=!1,x.isFilter=!0,x.hasChild&&h(x)})};let f=null;return{onSearch:m=>{f&&clearTimeout(f),f=setTimeout(()=>{n.isSearch=!1,n.searchWord=m;const p=t.treeStore;p.forEach(g=>{g.show=!1,g.isFilter=!1}),m?(p.filter(x=>{let b=!1;for(let y=0;y<t.orderedColumns.length;y++){const M=t.orderedColumns[y]||{};let E=x[M.field]??null;if(M.type=M.type||"string",E!==null&&!M.hide&&((M==null?void 0:M.searchable)===void 0||M!=null&&M.searchable)&&(E=s(M,E).toString(),b=E.toLowerCase().includes(m.toString().toLowerCase()),b))break}return b}).forEach(x=>{x.show=!0,x.parent&&!x.parent.expand&&(x.show=!1),x.isFilter=!0,d(x),h(x)}),n.isSearch=!0):(p.forEach(g=>{g.show=!0,g.isFilter=!1}),p.forEach(g=>{d(g),h(g)})),!m&&o.isClientPaging&&o.prevPage&&(o.currentPage=1,t.pagingStore=r()),c({onSearch:!0}),a(t.store),l()},500)}}},RS=e=>{const{emit:t}=i.getCurrentInstance(),{stores:n,pageInfo:o,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const f=(o.currentPage-1)*o.perPage,u=parseInt(f,10)+parseInt(o.perPage,10);return n.showTreeStore.slice(f,u)},d=f=>{t("page-change",{eventName:f,pageInfo:{currentPage:o.currentPage,prevPage:o.prevPage,startIndex:o.startIndex,total:o.pageTotal,perPage:o.perPage},sortInfo:{field:s.sortField,order:s.sortOrder},searchInfo:{searchWord:l.searchWord,searchColumns:n.orderedColumns.filter(u=>!u.hide&&((u==null?void 0:u.searchable)===void 0||(u==null?void 0:u.searchable))).map(u=>u.field)}}),o.isInfinite&&(f!=null&&f.onSearch||f!=null&&f.onSort)&&(o.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:f=>{if(o.isClientPaging)if(o.prevPage=f,n.showTreeStore.length<=o.perPage)n.pagingStore=n.showTreeStore;else{const u=(o.currentPage-1)*o.perPage,m=parseInt(u,10)+parseInt(o.perPage,10);n.pagingStore=n.showTreeStore.slice(u,m),a.body.scrollTop=0,o.startIndex=u}d({onChangePage:!0})}}},NS=({sortInfo:e,stores:t})=>{const{emit:n}=i.getCurrentInstance(),o=(f=!0)=>f?["asc","desc","init"]:["asc","desc"];function s(){this.orders=o(),this.dequeue=()=>this.orders.shift(),this.enqueue=f=>this.orders.push(f)}const l=(f,u="init")=>{t.orderedColumns.forEach(m=>{m.index===(f==null?void 0:f.index)&&u?m.sortOption={sortType:u}:m.sortOption={sortType:"init"}})},a=()=>{const f=t.originColumns.filter(u=>u.hiddenDisplay||u.hide);f.length&&f.forEach(u=>{u.sortOption={sortType:"init"}})},r=new s;return{onSort:(f,u)=>{if(f.sortable===void 0?!0:f.sortable){e.sortColumn=f,e.sortField!==(f==null?void 0:f.field)&&(r.orders=o(),e.sortField=f==null?void 0:f.field),u&&(r.orders=o(),u==="desc"&&(e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder))),e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder),a(),l(f,e.sortOrder);const p=ri(t);n("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:p}),n("change-column-info",{type:"sort",columns:p})}},setSortInfo:(f,u=!0)=>{const m=f==null?void 0:f.findIndex(x=>{var b;return(x==null?void 0:x.sortable)&&((b=x==null?void 0:x.sortOption)==null?void 0:b.sortType)&&x.sortOption.sortType!=="init"}),p=f[m];m>-1&&(p.index=m);const{sortType:g}=(p==null?void 0:p.sortOption)||{};e.sortColumn=p,e.sortField=p==null?void 0:p.field,e.isSorting=!!g,e.sortOrder=g,l(p,g),u&&n("change-column-info",{type:"sort",columns:ri(t)})},initSortInfo:f=>{e.isSorting=!1,e.sortOrder="init",f.forEach(u=>{var m;(m=u==null?void 0:u.sortOption)!=null&&m.sortType&&u.sortOption.sortType!=="init"&&(u.sortOption.sortType="init")})}}},VS={name:"EvTreeGrid",components:{TreeGridNode:CS,Toolbar:MS,GridPagination:mr,GridSummary:br,ColumnSetting:Cr,GridSortButton:Sr,GridOptionButton:Rs},directives:{observeVisibility:Xi,resize:wn},props:{columns:{type:[Array],default:()=>[]},rows:{type:[Array,Object],default:()=>null},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"100%"},selected:{type:[Array],default:()=>[]},checked:{type:[Array],default:()=>[]},option:{type:Object,default:()=>({})},expandIcon:{type:String,default:""},collapseIcon:{type:String,default:""}},emits:{"update:selected":null,"update:checked":null,"click-row":null,"dblclick-row":null,"check-row":null,"check-all":null,"page-change":null,"sort-column":null,"toggle-row":null,"resize-column":({column:e,columns:t})=>({column:e,columns:t}),"change-column-status":({columns:e})=>({columns:e}),"change-column-info":({type:e,columns:t})=>({type:e,columns:t})},setup(e){var ci,di,hi,fi,ui,mi,gi,qt,gn;const t=i.ref(null),n=i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useGridSetting)==null?void 0:ne.use)||!1}),o=i.computed(()=>{var $;return(($=e.option)==null?void 0:$.useSummary)||!1}),s=i.computed(()=>e.option.emptyText??"No records"),l=i.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=i.reactive({isSearch:!1,searchWord:""}),r=i.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useGridSetting)==null?void 0:ne.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((di=(ci=e.option)==null?void 0:ci.useGridSetting)==null?void 0:di.columnMenuText)??"Column List",search:((fi=(hi=e.option)==null?void 0:hi.useGridSetting)==null?void 0:fi.searchText)??"Search",empty:((mi=(ui=e.option)==null?void 0:ui.useGridSetting)==null?void 0:mi.emptyText)??"No records",ok:((qt=(gi=e.option)==null?void 0:gi.useGridSetting)==null?void 0:qt.okBtnText)??"OK"}}),c=i.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:i.computed(()=>c.treeStore.filter($=>$.show)),searchStore:i.computed(()=>c.treeStore.filter($=>$.isFilter)),store:i.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:i.computed(()=>e.columns.map(($,ne)=>{var he;return{index:ne,hiddenDisplay:!1,...$,width:isFinite($.width)?$.width:void 0,sortOption:{sortType:((he=$==null?void 0:$.sortOption)==null?void 0:he.sortType)||"init"}}})),orderedColumns:i.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:i.computed(()=>ri(c))}),d=i.reactive({usePage:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.use)||!1}),useClient:((gn=e.option.page)==null?void 0:gn.useClient)||!1,isInfinite:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.total)||0}),perPage:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.perPage)||20}),visiblePage:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.visiblePage)||8}),order:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.order)||"center"}),showPageInfo:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.showPageInfo)||!1}),isClientPaging:i.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=i.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:i.computed(()=>e.option.useCheckbox||{})}),{isRenderer:f,getComponentName:u,getConvertValue:m,getColumnIndex:p,setPixelUnit:g,checkHeader:x}=IS({checkInfo:h}),b=i.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),y=i.reactive({selectedRow:e.selected,useSelect:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useSelection)==null?void 0:ne.use)??!0}),limitCount:i.computed(()=>{var ne,he;let $=(he=(ne=e.option)==null?void 0:ne.useSelection)==null?void 0:he.limitCount;return $=$&&$>=2?$:0,$}),multiple:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useSelection)==null?void 0:ne.multiple)??!1})}),M=i.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),E=i.reactive({menu:null,contextMenuItems:[],contextMenuClass:e.option.customContextMenuClass||"",columnMenu:null,columnMenuItems:[],columnMenuTextInfo:e.option.columnMenuText||{},hiddenColumnMenuItem:e.option.hiddenColumnMenuItem||{},customContextMenu:e.option.customContextMenu||[],gridSettingMenu:null,gridSettingContextMenuItems:[],customGridSettingContextMenu:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useGridSetting)==null?void 0:ne.customContextMenu)||[]}),isShowMenuOnClick:!1}),I=i.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:i.computed(()=>e.option.rowHeight||35),gridWidth:i.computed(()=>e.width?g(e.width):"100%"),gridHeight:i.computed(()=>e.height?g(e.height):"100%"),isResize:!1}),T=i.reactive({showHeader:i.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.stripe)||!1}),borderStyle:i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.border)||""}),highlightIdx:i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.highlight)??-1})}),V=()=>{y.selectedRow.length=0,c.store.forEach($=>{$.selected=!1})},C=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach($=>{$.checked=!1,$.indeterminate=!1})},{getPagingData:S,updatePagingInfo:w,changePage:k}=RS({stores:c,pageInfo:d,sortInfo:M,filterInfo:a,elementInfo:l,clearCheckInfo:C}),B=i.ref(0),{updateVScroll:D,updateHScroll:O,onScroll:L}=ES({scrollInfo:b,stores:c,elementInfo:l,resizeInfo:I,pageInfo:d,summaryScroll:B,getPagingData:S,updatePagingInfo:w}),{onRowClick:v,onRowDblClick:N}=TS(y),{onCheck:R,onCheckAll:P}=BS({checkInfo:h,stores:c,checkHeader:x,pageInfo:d,getPagingData:S}),{calculatedColumn:_,onResize:A,onShow:z,onColumnResize:X}=vS({resizeInfo:I,elementInfo:l,checkInfo:h,stores:c,isRenderer:f,updateVScroll:D,updateHScroll:O,contextInfo:E}),{setTreeNodeStore:W,handleExpand:H}=OS({stores:c,onResize:A}),{onSort:U,initSortInfo:j,setSortInfo:K}=NS({sortInfo:M,stores:c}),{onSearch:q}=LS({stores:c,filterInfo:a,pageInfo:d,getConvertValue:m,onResize:A,checkHeader:x,getPagingData:S,updatePagingInfo:w}),{setPositionColumnSetting:ee,initColumnSettingInfo:J,onApplyColumn:te,setColumnHidden:G}=wr({stores:c,columnSettingInfo:r,contextInfo:E,onSearch:q,onResize:A}),{setContextMenu:oe,onContextMenu:Z,onColumnContextMenu:ae,onGridSettingContextMenu:me}=DS({contextInfo:E,stores:c,selectInfo:y,useGridSetting:n,columnSettingInfo:r,setColumnHidden:G,onSort:U}),re=$=>{E.gridSettingContextMenuItems.length=0,E.customGridSettingContextMenu.length?me($):r.isShowColumnSetting=!0},fe=$=>{var ne,he,xe,Me,Pe,Xe;$.type==="wheel"&&((ne=E.menu)==null||ne.hide($)),$.type==="scroll"&&!((he=$.target.classList)!=null&&he.contains("table-body"))&&!((Me=(xe=$.target.offsetParent)==null?void 0:xe.classList)!=null&&Me.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,E.isShowMenuOnClick=!1,(Pe=E.columnMenu)==null||Pe.hide($),(Xe=E.gridSettingMenu)==null||Xe.hide())};i.onMounted(()=>{var $;if(c.treeStore=W(),c.originStore=Se(c.treeStore),($=e.option)!=null&&$.useSort)K(e.columns,!1);else{const ne=E.hiddenColumnMenuItem;ne.ascending=!0,ne.descending=!0}document.addEventListener("wheel",fe,{capture:!1}),document.addEventListener("scroll",fe,{capture:!0})}),i.onUnmounted(()=>{document.removeEventListener("wheel",fe,{capture:!1}),document.removeEventListener("scroll",fe,{capture:!0})}),i.onActivated(()=>{A()}),i.watch(()=>{var $;return($=e.option)==null?void 0:$.useSort},$=>{const ne=e.option.hiddenColumnMenuItem,he=E.hiddenColumnMenuItem;$?(he.ascending=(ne==null?void 0:ne.ascending)??!1,he.descending=(ne==null?void 0:ne.descending)??!1,K(e.columns,!1)):(he.ascending=!0,he.descending=!0,j(e.columns))}),i.watch(()=>r.isShowColumnSetting,$=>{var ne;if(!$){(ne=E.gridSettingMenu)==null||ne.hide();return}ee(t.value)}),i.watch(()=>e.columns,()=>{J()},{deep:!0,immediate:!0}),i.watch(()=>e.checked,$=>{h.checkedRows=$}),i.watch(()=>h.checkedRows,$=>{h.isHeaderChecked=!1;let ne=c.store;d.isClientPaging&&(ne=S()),ne.length&&(ne.forEach(he=>{he.checked=!!$.find(xe=>xe.index===he.index)}),x(ne)),D()}),i.watch(()=>e.selected,$=>{y.useSelect&&(y.selectedRow=$)}),i.watch(()=>y.selectedRow,$=>{y.useSelect&&(c.store.forEach(ne=>{ne.selected=!!$.find(he=>he.index===ne.index)}),D())},{deep:!0}),i.watch(()=>T.highlightIdx,async $=>{await i.nextTick();const ne=xe=>{if(!(xe!=null&&xe.children))return;const{children:Me}=xe;Me.forEach(Pe=>{const Xe=Pe;Xe.parent.show&&Xe.parent.expand?Xe.show=!0:Xe.show=!1,Xe.isFilter=!0,Xe.hasChild&&ne(Xe)})},he=xe=>{if(!(xe!=null&&xe.parent)){ne(xe);return}const{parent:Me}=xe;Me.show=!0,Me.isFilter=!0,Me.expand=!0,ne(Me),he(Me)};if($>=0){const xe=c.store.find(Pe=>Pe.index===$);if(!xe)return;xe.show=!0,xe.isFilter=!0,he(xe);const Me=c.showTreeStore.map(Pe=>Pe.index).indexOf(xe.index);if(d.usePage&&!d.isInfinite){const Pe=Math.ceil(Me/d.perPage);if(d.highlightPage=Me===d.perPage?Pe+1:Pe||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=I.rowHeight*Me}}),i.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),i.watch(()=>y.useSelect,()=>{V()}),i.watch(()=>y.multiple,()=>{V()}),i.watch(()=>e.rows,$=>{c.treeRows=$,c.treeStore=W(),A()},{deep:!0}),i.watch(()=>c.treeStore.length,()=>{x(c.store)}),i.watch(()=>[e.width,e.height,e.option.columnWidth],()=>{e.option.columnWidth!=null&&(I.columnWidth=e.option.columnWidth),c.orderedColumns.map($=>{var he;const ne=$;return!((he=e.columns[$.index])!=null&&he.width)&&!ne.resized&&(ne.width=0),ne}),A()}),i.watch(()=>e.option.searchValue,$=>{i.nextTick(()=>{$!==void 0&&(q(($==null?void 0:$.value)??$),d.isClientPaging&&(C(),V()))})},{immediate:!0}),i.watch(()=>{var $;return($=e.option.page)==null?void 0:$.currentPage},$=>{var he;const ne=$||1;d.currentPage=(he=e.option.page)!=null&&he.isInfinite?1:ne},{immediate:!0}),i.watch(()=>d.currentPage,($,ne)=>{i.nextTick(()=>{if(k(ne),d.isClientPaging&&$!==ne&&(C(),V()),D(),$===d.highlightPage&&d.isHighlight){const he=c.pagingStore.map(xe=>xe.index).indexOf(T.highlightIdx);l.body.scrollTop=I.rowHeight*he,d.isHighlight=!d.isHighlight}})});const ke=()=>({"column-sort__icon":!0,"column-sort__icon--asc":M.sortOrder==="asc","column-sort__icon--desc":M.sortOrder==="desc"}),rt=i.computed(()=>({width:I.gridWidth,height:I.gridHeight})),ct=i.computed(()=>({"table-body":!0,stripe:T.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!T.borderStyle})),yt=i.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:I.adjust,"non-header":!T.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),ho=i.computed(()=>({"table-header":!0,"non-border":!!T.borderStyle})),fo=i.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!T.borderStyle})),uo=i.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Zt=$=>({column:!0,render:f($),"non-border":!!T.borderStyle,[$.field]:$.field}),_s=($,ne)=>{const he=f($);return{width:`${$.width}px`,"min-width":he?`${I.rendererMinWidth}px;`:`${I.minWidth}px`,"margin-right":c.orderedColumns.length-1===ne&&b.hasVerticalScrollBar&&b.hasHorizontalScrollBar?`${I.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===ne?"none":"1px solid #CFCFCF"}},As=$=>`${$}Node`;return{summaryScroll:B,gridStyle:rt,gridClass:yt,headerClass:ho,headerCheckboxClass:fo,isHeaderCheckbox:uo,bodyStyle:ct,useSummary:o,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...i.toRefs(T),...i.toRefs(l),...i.toRefs(c),...i.toRefs(a),...i.toRefs(b),...i.toRefs(I),...i.toRefs(y),...i.toRefs(h),...i.toRefs(M),...i.toRefs(E),...i.toRefs(d),...i.toRefs(r),isRenderer:f,getComponentName:u,getConvertValue:m,getColumnIndex:p,setPixelUnit:g,updateVScroll:D,updateHScroll:O,onScroll:L,calculatedColumn:_,onResize:A,onShow:z,onColumnResize:X,onRowClick:v,onRowDblClick:N,onCheck:R,onCheckAll:P,setContextMenu:oe,onContextMenu:Z,onSearch:q,handleExpand:H,getColumnClass:Zt,getColumnStyle:_s,getSlotName:As,setGridSetting:re,onApplyColumn:te,onColumnContextMenu:ae,onSort:U,sortIconClass:ke}}},PS={class:"column-list"},_S=["data-index"],AS=["title","onClick"],zS=["onClick"],FS=["onMousedown"],HS={ref:"table"},WS=["title"],$S={key:0},XS={class:"is-empty"},US={ref:"resizeLine",class:"table-resize-line"};function YS(e,t,n,o,s,l){var b;const a=i.resolveComponent("grid-option-button"),r=i.resolveComponent("toolbar"),c=i.resolveComponent("ev-checkbox"),d=i.resolveComponent("grid-sort-button"),h=i.resolveComponent("tree-grid-node"),f=i.resolveComponent("ev-context-menu"),u=i.resolveComponent("grid-summary"),m=i.resolveComponent("grid-pagination"),p=i.resolveComponent("column-setting"),g=i.resolveDirective("resize"),x=i.resolveDirective("observe-visibility");return i.openBlock(),i.createElementBlock(i.Fragment,null,[e.$slots.toolbar||o.useGridSetting?(i.openBlock(),i.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:i.normalizeStyle(`width: ${e.gridWidth};`)},[i.createVNode(r,null,{toolbarWrapper:i.withCtx(()=>[o.useGridSetting?(i.openBlock(),i.createBlock(a,{key:0,class:"grid-setting__icon",onClick:o.setGridSetting},null,8,["onClick"])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"toolbar",{item:{onSearch:o.onSearch}},void 0,!0)]),_:3})],4)):i.createCommentVNode("",!0),i.withDirectives((i.openBlock(),i.createElementBlock("div",{ref:"grid-wrapper",style:i.normalizeStyle(o.gridStyle)},[i.createElementVNode("div",{ref:"grid",class:i.normalizeClass(o.gridClass)},[i.withDirectives(i.createElementVNode("div",{ref:"header",class:i.normalizeClass(o.headerClass)},[i.createElementVNode("ul",PS,[e.useCheckbox.use?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(o.headerCheckboxClass),style:i.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[o.isHeaderCheckbox?(i.openBlock(),i.createBlock(c,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[0]||(t[0]=y=>e.isHeaderChecked=y),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:o.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):i.createCommentVNode("",!0)],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(y,M)=>{var E,I;return i.openBlock(),i.createElementBlock(i.Fragment,{key:M},[!y.hide&&!y.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":M,class:i.normalizeClass(o.getColumnClass(y)),style:i.normalizeStyle(o.getColumnStyle(y,M))},[y.customHeader&&e.$slots.customHeader?i.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:y.caption,class:i.normalizeClass(["column-name",{"column-name--click":o.useGridSetting}]),onClick:[T=>o.onColumnContextMenu(T,y),t[1]||(t[1]=i.withModifiers((...T)=>e.columnMenu.show&&e.columnMenu.show(...T),["prevent"]))]},[i.createTextVNode(i.toDisplayString(y.caption)+" ",1),i.createElementVNode("span",{onClick:i.withModifiers(T=>o.onSort(y),["stop"])},[e.$slots.sortIcon?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(E=e.$props.option)!=null&&E.useSort&&(y!=null&&y.sortable)?(i.openBlock(),i.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):i.createCommentVNode("",!0),e.sortField===y.field?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(o.sortIconClass(y)),style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[i.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[(I=e.$props.option)!=null&&I.useSort&&(y!=null&&y.sortable)?(i.openBlock(),i.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):i.createCommentVNode("",!0),e.sortField===y.field?(i.openBlock(),i.createBlock(d,{key:1,class:i.normalizeClass(o.sortIconClass(y)),icon:e.sortOrder,style:i.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?y.hidden:!0})},null,8,["class","icon","style"])):i.createCommentVNode("",!0)],64))],8,zS)],10,AS)),i.createElementVNode("span",{class:"column-resize",onMousedown:i.withModifiers(T=>o.onColumnResize(M,T),["stop","left"])},null,40,FS)],14,_S)):i.createCommentVNode("",!0)],64)}),128)),(b=e.$props.option.customContextMenu)!=null&&b.length?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({column:!0,"non-border":!!e.borderStyle}),style:i.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):i.createCommentVNode("",!0)])],2),[[i.vShow,e.showHeader]]),i.createElementVNode("div",{ref:"body",class:i.normalizeClass(o.bodyStyle),onScroll:t[2]||(t[2]=(...y)=>o.onScroll&&o.onScroll(...y)),onContextmenu:[t[3]||(t[3]=y=>o.onContextMenu(y)),t[4]||(t[4]=i.withModifiers((...y)=>e.menu.show&&e.menu.show(...y),["prevent"]))]},[i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),i.createElementVNode("table",HS,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(y,M)=>(i.openBlock(),i.createBlock(h,{key:M,"selected-data":e.selectedRow,"node-data":y,"use-checkbox":e.useCheckbox,"ordered-columns":e.orderedColumns,"expand-icon":n.option.expandIcon,"collapse-icon":n.option.collapseIcon,"parent-icon":n.option.parentIcon,"child-icon":n.option.childIcon,"custom-context-menu":e.customContextMenu,"menu-ref":e.menu,"is-resize":e.isResize,"row-height":e.rowHeight,"min-width":e.minWidth,"highlight-index":e.highlightIdx,"border-style":e.borderStyle,onCheckTreeData:o.onCheck,onExpandTreeData:o.handleExpand,onClickTreeData:o.onRowClick,onDblClickTreeData:o.onRowDblClick,onContextMenu:o.onContextMenu},i.createSlots({_:2},[i.renderList(e.orderedColumns,(E,I)=>({name:o.getSlotName(E.field),fn:i.withCtx(({item:T})=>[e.$slots[E.field]?i.renderSlot(e.$slots,E.field,{key:0,item:{data:T.data,fieldName:E.field}},void 0,!0):(i.openBlock(),i.createElementBlock("span",{key:1,title:o.getConvertValue(E,y[E.field])},i.toDisplayString(o.getConvertValue(E,y[E.field])),9,WS))])})),e.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:i.withCtx(()=>[i.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)]),key:"0"}:void 0]),1032,["selected-data","node-data","use-checkbox","ordered-columns","expand-icon","collapse-icon","parent-icon","child-icon","custom-context-menu","menu-ref","is-resize","row-height","min-width","highlight-index","border-style","onCheckTreeData","onExpandTreeData","onClickTreeData","onDblClickTreeData","onContextMenu"]))),128)),e.viewStore.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("tr",$S,[i.createElementVNode("td",XS,i.toDisplayString(o.emptyText),1)]))])],512),i.createElementVNode("div",{style:i.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),i.createVNode(f,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),i.createVNode(f,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),i.createVNode(f,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),i.withDirectives(i.createElementVNode("div",US,null,512),[[i.vShow,e.showResizeLine]])],2)],4)),[[g,o.onResize],[x,{callback:o.onShow,once:!0}]]),o.useSummary?(i.openBlock(),i.createBlock(u,{key:1,"is-tree":!0,"ordered-columns":e.orderedColumns,stores:o.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:e.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":o.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):i.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(i.openBlock(),i.createBlock(m,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[5]||(t[5]=y=>e.currentPage=y),total:e.showTreeStore.length,"per-page":e.perPage,"visible-page":e.visiblePage,"show-page-info":e.showPageInfo,order:e.order},null,8,["modelValue","total","per-page","visible-page","show-page-info","order"])):i.createCommentVNode("",!0),i.createVNode(p,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[6]||(t[6]=y=>e.isShowColumnSetting=y),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[7]||(t[7]=y=>e.isShowMenuOnClick=y),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:o.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const ro=le(VS,[["render",YS],["__scopeId","data-v-9ed705b7"]]);ro.install=e=>{e.component(ro.name,ro)};const jS={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},GS=["aria-current"];function ZS(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("span",i.mergeProps({class:{"is-current":n.page.isCurrent,"is-disabled":n.disabled||n.page.disabled,[n.page.class]:!0}},e.$attrs,{"aria-current":n.page.isCurrent,onClick:t[0]||(t[0]=i.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[i.renderSlot(e.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(n.page.number),1)])],16,GS)}const qS={name:"EvPagination",components:{EvIcon:hn,pageButton:le(jS,[["render",ZS]])},props:{total:{type:[Number,String],default:0},visiblePage:{type:[Number,String],default:8},perPage:{type:[Number,String],default:20},modelValue:{type:[Number,String],default:1},showPageInfo:{type:Boolean,default:!1},order:{type:String,default:"left",validator:e=>["left","right","center"].includes(e)},pagePerJump:{type:[Number,void 0],default:void 0}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=i.computed(()=>e.visiblePage>7?e.visiblePage:7),o=i.computed(()=>e.modelValue),s=i.computed(()=>e.total===0?1:Math.ceil(e.total/e.perPage)),l=i.computed(()=>o.value>1),a=i.computed(()=>o.value<s.value),r=i.computed(()=>Math.max(o.value-e.pagePerJump,1)),c=i.computed(()=>Math.min(o.value+e.pagePerJump,s.value)),d=i.computed(()=>{const g=o.value*e.perPage-e.perPage+1;return g>=0?g:0}),h=(g,x)=>{o.value===g||g<1||g>s.value||(t("update:modelValue",g),t("change",g),x&&x.target&&i.nextTick(()=>x.target.focus()))},f=(g,x={})=>({number:g,isCurrent:x.isCurrent??o.value===g,click:b=>h(g,b),input:(b,y)=>h(+y,b),disabled:x.disabled||!1,class:x.class||""}),u=(g,x)=>{const b=[],y=g>0?g:1;for(let M=y;M<=x;M++)b.push(f(M));return b},m=i.computed(()=>{const g=parseInt(n.value,10);if(g===0)return[];const x=Math.min(Math.max(0,g)||s.value,s.value);if(s.value<=x)return u(1,s.value);const b=x%2===0?1:0,y=Math.floor(x/2),M=s.value-y+1+b;if(o.value>y&&o.value<M){const I=s.value,T=o.value-y+2,V=o.value+y-2-b,C=T-1===2?2:-1,S=V+1===I-1?V+1:-1;return[f(1),f(C),...u(T,V),f(S),f(s.value)]}else if(o.value===y){const E=o.value+y-1-b;return[...u(1,E),f(-1),f(s.value)]}else if(o.value===M){const E=o.value-y+1;return[f(1),f(-1),...u(E,s.value)]}return[...u(1,y),f(-1),...u(M,s.value)]}),p=i.computed(()=>({"justify-content":e.order,flex:"3 1 0%"}));return i.watch(()=>s.value,g=>{o.value>g&&h(g)}),i.watch(()=>o.value,(g,x)=>{s.value<g&&h(x)}),{pageCount:s,pagesInRange:m,hasPrev:l,hasNext:a,listClasses:p,firstData:d,current:o,changePage:h,getPage:f,prevJumpPage:r,nextJumpPage:c}}},KS={class:"pagination"},JS={key:0,class:"pagination-info"},QS={key:0,class:"pagination-ellipsis"},ew=["onClick"];function tw(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("page-button");return i.openBlock(),i.createElementBlock("nav",KS,[n.showPageInfo?(i.openBlock(),i.createElementBlock("small",JS,[n.perPage===1?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(o.firstData)+" / "+i.toDisplayString(n.total),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(o.firstData)+" - "+i.toDisplayString(Math.min(o.current*n.perPage,n.total))+" / "+i.toDisplayString(n.total),1)],64))])):i.createCommentVNode("",!0),i.createElementVNode("ul",{class:"pagination-list",style:i.normalizeStyle(o.listClasses)},[e.$props.pagePerJump?(i.openBlock(),i.createElementBlock("li",{key:0,class:i.normalizeClass(["step-button",{"is-disabled":!o.hasPrev}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasPrev,page:o.getPage(o.prevJumpPage,{isCurrent:!1})},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):i.createCommentVNode("",!0),i.createElementVNode("li",{class:i.normalizeClass(["step-button",{"is-disabled":!o.hasPrev}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasPrev,page:o.getPage(o.current-1)},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.pagesInRange,(c,d)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:d},[c.number===-1?(i.openBlock(),i.createElementBlock("li",QS,[...t[0]||(t[0]=[i.createElementVNode("span",null,"…",-1)])])):(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[i.createVNode(r,{page:c},null,8,["page"])],10,ew))],64))),128)),i.createElementVNode("li",{class:i.normalizeClass(["step-button",{"is-disabled":!o.hasNext}])},[i.createVNode(r,{class:"pagination-next",disabled:!o.hasNext,page:o.getPage(o.current+1)},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),e.$props.pagePerJump?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass(["step-button",{"is-disabled":!o.hasNext}])},[i.createVNode(r,{class:"pagination-previous",disabled:!o.hasNext,page:o.getPage(o.nextJumpPage,{isCurrent:!1})},{default:i.withCtx(()=>[i.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):i.createCommentVNode("",!0)],4)])}const co=le(qS,[["render",tw]]);co.install=e=>{e.component(co.name,co)};const nw="3.5.5",ow=[kn,Mn,sn,In,ln,an,En,vn,Bn,Dn,On,Nn,Wn,hn,Un,Yn,jn,Gn,Zn,qn,Kn,Jn,Qn,eo,no,so,lo,ao,Jo,ei,ti,ro,co],iw={version:nw,install:e=>{e&&ow.forEach(t=>{e.use(t)})}};se.EvButton=sn,se.EvButtonGroup=In,se.EvCalendar=Un,se.EvChart=so,se.EvChartBrush=ao,se.EvChartGroup=lo,se.EvCheckbox=ln,se.EvCheckboxGroup=an,se.EvContextMenu=Gn,se.EvDatePicker=Yn,se.EvGrid=no,se.EvIcon=hn,se.EvInputNumber=Nn,se.EvLoading=qn,se.EvMenu=Jn,se.EvMessage=Jo,se.EvMessageBox=ti,se.EvNotification=ei,se.EvPagination=co,se.EvProgress=Kn,se.EvRadio=En,se.EvRadioGroup=vn,se.EvScheduler=jn,se.EvSelect=Bn,se.EvSlider=Wn,se.EvTabPanel=Mn,se.EvTabs=kn,se.EvTextField=On,se.EvTimePicker=eo,se.EvToggle=Dn,se.EvTree=Qn,se.EvTreeGrid=ro,se.EvWindow=Zn,se.default=iw,Object.defineProperties(se,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});