evui 3.9.3 → 3.11.0

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,17 +1,17 @@
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 Si=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const Us=()=>{},Zr=/^on[^a-z]/,qr=e=>Zr.test(e),et=Object.assign,Kr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Jr=Object.prototype.hasOwnProperty,yo=(e,t)=>Jr.call(e,t),pe=Array.isArray,Qt=e=>bo(e)==="[object Map]",Qr=e=>bo(e)==="[object Set]",Oe=e=>typeof e=="function",dt=e=>typeof e=="string",xo=e=>typeof e=="symbol",ze=e=>e!==null&&typeof e=="object",ec=e=>(ze(e)||Oe(e))&&Oe(e.then)&&Oe(e.catch),tc=Object.prototype.toString,bo=e=>tc.call(e),Ys=e=>bo(e).slice(8,-1),nc=e=>bo(e)==="[object Object]",Ci=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)),en=(e,t)=>!Object.is(e,t),ic=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let js;const wi=()=>js||(js=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ki(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],s=dt(o)?rc(o):ki(o);if(s)for(const l in s)t[l]=s[l]}return t}if(dt(e)||ze(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 Mi(e){let t="";if(dt(e))t=e;else if(pe(e))for(let n=0;n<e.length;n++){const o=Mi(e[n]);o&&(t+=o+" ")}else if(ze(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Gs(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let Zs;const Ei=e=>{const t=new Set(e);return t.w=0,t.n=0,t},qs=e=>(e.w&vt)>0,Ks=e=>(e.n&vt)>0,Ii=new WeakMap;let yn=0,vt=1;const vi=30;let Fe;const _t=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ti=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=Zs){l&&l.active&&l.effects.push(s)}(this,o)}run(){if(!this.active)return this.fn();let t=Fe,n=At;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Fe,Fe=this,At=!0,vt=1<<++yn,yn<=vi?(({deps:o})=>{if(o.length)for(let s=0;s<o.length;s++)o[s].w|=vt})(this):Js(this),this.fn()}finally{yn<=vi&&(o=>{const{deps:s}=o;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];qs(r)&&!Ks(r)?r.delete(o):s[l++]=r,r.w&=~vt,r.n&=~vt}s.length=l}})(this),vt=1<<--yn,Fe=this.parent,At=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Fe===this?this.deferStop=!0:this.active&&(Js(this),this.onStop&&this.onStop(),this.active=!1)}}function Js(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let At=!0;const Qs=[];function el(){Qs.push(At),At=!1}function tl(){const e=Qs.pop();At=e===void 0||e}function Ye(e,t,n){if(At&&Fe){let o=Ii.get(e);o||Ii.set(e,o=new Map);let s=o.get(n);s||o.set(n,s=Ei()),function(l,a){let r=!1;yn<=vi?Ks(l)||(l.n|=vt,r=!qs(l)):r=!l.has(Fe),r&&(l.add(Fe),Fe.deps.push(l),process.env.NODE_ENV!=="production"&&Fe.onTrack&&Fe.onTrack(et({effect:Fe},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Fe,target:e,type:t,key:n}:void 0)}}function Tt(e,t,n,o,s,l){const a=Ii.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"||!xo(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":pe(e)?Ci(n)&&r.push(a.get("length")):(r.push(a.get(_t)),Qt(e)&&r.push(a.get(Ti)));break;case"delete":pe(e)||(r.push(a.get(_t)),Qt(e)&&r.push(a.get(Ti)));break;case"set":Qt(e)&&r.push(a.get(_t))}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"?So(r[0],c):So(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?So(Ei(d),c):So(Ei(d))}}function So(e,t){const n=pe(e)?e:[...e];for(const o of n)o.computed&&nl(o,t);for(const o of n)o.computed||nl(o,t)}function nl(e,t){(e!==Fe||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(et({effect:e},t)),e.scheduler?e.scheduler():e.run())}const dc=Gr("__proto__,__v_isRef,__isVue"),ol=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xo)),il=hc();function hc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=me(this);for(let l=0,a=this.length;l<a;l++)Ye(o,"get",l+"");const s=o[t](...n);return s===-1||s===!1?o[t](...n.map(me)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){el();const o=me(this)[t].apply(this,n);return tl(),o}}),e}function uc(e){const t=me(this);return Ye(t,"has",e),t.hasOwnProperty(e)}class sl{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?ml:fl:l?Ec:ul).get(t))return t;const a=pe(t);if(!s){if(a&&yo(il,n))return Reflect.get(il,n,o);if(n==="hasOwnProperty")return uc}const r=Reflect.get(t,n,o);return(xo(n)?ol.has(n):dc(n))?r:(s||Ye(t,"get",n),l?r:He(r)?a&&Ci(n)?r:r.value:ze(r)?s?pl(r):gl(r):r)}}class fc extends sl{constructor(t=!1){super(!1,t)}set(t,n,o,s){let l=t[n];if(Ft(l)&&He(l)&&!He(o))return!1;if(!this._shallow&&(Oi(o)||Ft(o)||(l=me(l),o=me(o)),!pe(t)&&He(l)&&!He(o)))return l.value=o,!0;const a=pe(t)&&Ci(n)?Number(n)<t.length:yo(t,n),r=Reflect.set(t,n,o,s);return t===me(s)&&(a?en(o,l)&&Tt(t,"set",n,o,l):Tt(t,"add",n,o)),r}deleteProperty(t,n){const o=yo(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&o&&Tt(t,"delete",n,void 0,s),l}has(t,n){const o=Reflect.has(t,n);return xo(n)&&ol.has(n)||Ye(t,"has",n),o}ownKeys(t){return Ye(t,"iterate",pe(t)?"length":_t),Reflect.ownKeys(t)}}class ll extends sl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Gs(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Gs(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const mc=new fc,gc=new ll,pc=new ll(!0),Bi=e=>e,Co=e=>Reflect.getPrototypeOf(e);function wo(e,t,n=!1,o=!1){const s=me(e=e.__v_raw),l=me(t);n||(en(t,l)&&Ye(s,"get",t),Ye(s,"get",l));const{has:a}=Co(s),r=o?Bi:n?Vi:Ni;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function ko(e,t=!1){const n=this.__v_raw,o=me(n),s=me(e);return t||(en(e,s)&&Ye(o,"has",e),Ye(o,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function Mo(e,t=!1){return e=e.__v_raw,!t&&Ye(me(e),"iterate",_t),Reflect.get(e,"size",e)}function al(e){e=me(e);const t=me(this);return Co(t).has.call(t,e)||(t.add(e),Tt(t,"add",e,e)),this}function rl(e,t){t=me(t);const n=me(this),{has:o,get:s}=Co(n);let l=o.call(n,e);l?process.env.NODE_ENV!=="production"&&hl(n,o,e):(e=me(e),l=o.call(n,e));const a=s.call(n,e);return n.set(e,t),l?en(t,a)&&Tt(n,"set",e,t,a):Tt(n,"add",e,t),this}function cl(e){const t=me(this),{has:n,get:o}=Co(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&hl(t,n,e):(e=me(e),s=n.call(t,e));const l=o?o.call(t,e):void 0,a=t.delete(e);return s&&Tt(t,"delete",e,void 0,l),a}function dl(){const e=me(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?Qt(e)?new Map(e):new Set(e):void 0,o=e.clear();return t&&Tt(e,"clear",void 0,void 0,n),o}function Eo(e,t){return function(n,o){const s=this,l=s.__v_raw,a=me(l),r=t?Bi:e?Vi:Ni;return!e&&Ye(a,"iterate",_t),l.forEach((c,d)=>n.call(o,r(c),r(d),s))}}function Io(e,t,n){return function(...o){const s=this.__v_raw,l=me(s),a=Qt(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...o),h=n?Bi:t?Vi:Ni;return!t&&Ye(l,"iterate",c?Ti:_t),{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 Bt(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.`,me(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function yc(){const e={get(s){return wo(this,s)},get size(){return Mo(this)},has:ko,add:al,set:rl,delete:cl,clear:dl,forEach:Eo(!1,!1)},t={get(s){return wo(this,s,!1,!0)},get size(){return Mo(this)},has:ko,add:al,set:rl,delete:cl,clear:dl,forEach:Eo(!1,!0)},n={get(s){return wo(this,s,!0)},get size(){return Mo(this,!0)},has(s){return ko.call(this,s,!0)},add:Bt("add"),set:Bt("set"),delete:Bt("delete"),clear:Bt("clear"),forEach:Eo(!0,!1)},o={get(s){return wo(this,s,!0,!0)},get size(){return Mo(this,!0)},has(s){return ko.call(this,s,!0)},add:Bt("add"),set:Bt("set"),delete:Bt("delete"),clear:Bt("clear"),forEach:Eo(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Io(s,!1,!1),n[s]=Io(s,!0,!1),t[s]=Io(s,!1,!0),o[s]=Io(s,!0,!0)}),[e,n,t,o]}const[xc,bc,Sc,Cc]=yc();function Di(e,t){const n=t?e?Cc:Sc:e?bc:xc;return(o,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?o:Reflect.get(yo(n,s)&&s in o?n:o,s,l)}const wc={get:Di(!1,!1)},kc={get:Di(!0,!1)},Mc={get:Di(!0,!0)};function hl(e,t,n){const o=me(n);if(o!==n&&t.call(e,o)){const s=Ys(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 ul=new WeakMap,Ec=new WeakMap,fl=new WeakMap,ml=new WeakMap;function gl(e){return Ft(e)?e:Li(e,!1,mc,wc,ul)}function pl(e){return Li(e,!0,gc,kc,fl)}function vo(e){return Li(e,!0,pc,Mc,ml)}function Li(e,t,n,o,s){if(!ze(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}}(Ys(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?o:n);return s.set(e,c),c}function zt(e){return Ft(e)?zt(e.__v_raw):!(!e||!e.__v_isReactive)}function Ft(e){return!(!e||!e.__v_isReadonly)}function Oi(e){return!(!e||!e.__v_isShallow)}function Ri(e){return zt(e)||Ft(e)}function me(e){const t=e&&e.__v_raw;return t?me(t):e}const Ni=e=>ze(e)?gl(e):e,Vi=e=>ze(e)?pl(e):e;function He(e){return!(!e||e.__v_isRef!==!0)}const Ic={get:(e,t,n)=>{return He(o=Reflect.get(e,t,n))?o.value:o;var o},set:(e,t,n,o)=>{const s=e[t];return He(s)&&!He(n)?(s.value=n,!0):Reflect.set(e,t,n,o)}},Ht=[];function ht(e,...t){if(process.env.NODE_ENV==="production")return;el();const n=Ht.length?Ht[Ht.length-1].component:null,o=n&&n.appContext.config.warnHandler,s=function(){let l=Ht[Ht.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)Wt(o,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${Fl(n,l.type)}>`).join(`
1
+ (function(re,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(re=typeof globalThis<"u"?globalThis:re||self,o(re.evui={},re.Vue))})(this,function(re,o){"use strict";function uc(e,t){const n=Object.create(null),i=e.split(",");for(let s=0;s<i.length;s++)n[i[s]]=!0;return s=>!!n[s]}const Is=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV==="production"||Object.freeze([]);const tl=()=>{},fc=/^on[^a-z]/,mc=e=>fc.test(e),lt=Object.assign,pc=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},gc=Object.prototype.hasOwnProperty,wi=(e,t)=>gc.call(e,t),Se=Array.isArray,ln=e=>Li(e)==="[object Map]",bc=e=>Li(e)==="[object Set]",Pe=e=>typeof e=="function",pt=e=>typeof e=="string",Ii=e=>typeof e=="symbol",Fe=e=>e!==null&&typeof e=="object",yc=e=>(Fe(e)||Pe(e))&&Pe(e.then)&&Pe(e.catch),xc=Object.prototype.toString,Li=e=>xc.call(e),nl=e=>Li(e).slice(8,-1),Sc=e=>Li(e)==="[object Object]",Ls=e=>pt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cc=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),an=(e,t)=>!Object.is(e,t),kc=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})};let il;const Ts=()=>il||(il=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ms(e){if(Se(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],s=pt(i)?Tc(i):Ms(i);if(s)for(const l in s)t[l]=s[l]}return t}if(pt(e)||Fe(e))return e}const wc=/;(?![^(]*\))/g,Ic=/:([^]+)/,Lc=/\/\*[^]*?\*\//g;function Tc(e){const t={};return e.replace(Lc,"").split(wc).forEach(n=>{if(n){const i=n.split(Ic);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function vs(e){let t="";if(pt(e))t=e;else if(Se(e))for(let n=0;n<e.length;n++){const i=vs(e[n]);i&&(t+=i+" ")}else if(Fe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function sl(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ol;const Rs=e=>{const t=new Set(e);return t.w=0,t.n=0,t},ll=e=>(e.w&Gt)>0,al=e=>(e.n&Gt)>0,Vs=new WeakMap;let Ln=0,Gt=1;const Es=30;let Ae;const Ft=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Gs=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");class Mc{constructor(t,n=null,i){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,function(s,l=ol){l&&l.active&&l.effects.push(s)}(this,i)}run(){if(!this.active)return this.fn();let t=Ae,n=At;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Ae,Ae=this,At=!0,Gt=1<<++Ln,Ln<=Es?(({deps:i})=>{if(i.length)for(let s=0;s<i.length;s++)i[s].w|=Gt})(this):rl(this),this.fn()}finally{Ln<=Es&&(i=>{const{deps:s}=i;if(s.length){let l=0;for(let a=0;a<s.length;a++){const r=s[a];ll(r)&&!al(r)?r.delete(i):s[l++]=r,r.w&=~Gt,r.n&=~Gt}s.length=l}})(this),Gt=1<<--Ln,Ae=this.parent,At=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ae===this?this.deferStop=!0:this.active&&(rl(this),this.onStop&&this.onStop(),this.active=!1)}}function rl(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let At=!0;const cl=[];function dl(){cl.push(At),At=!1}function hl(){const e=cl.pop();At=e===void 0||e}function $e(e,t,n){if(At&&Ae){let i=Vs.get(e);i||Vs.set(e,i=new Map);let s=i.get(n);s||i.set(n,s=Rs()),function(l,a){let r=!1;Ln<=Es?al(l)||(l.n|=Gt,r=!ll(l)):r=!l.has(Ae),r&&(l.add(Ae),Ae.deps.push(l),process.env.NODE_ENV!=="production"&&Ae.onTrack&&Ae.onTrack(lt({effect:Ae},a)))}(s,process.env.NODE_ENV!=="production"?{effect:Ae,target:e,type:t,key:n}:void 0)}}function Wt(e,t,n,i,s,l){const a=Vs.get(e);if(!a)return;let r=[];if(t==="clear")r=[...a.values()];else if(n==="length"&&Se(e)){const d=Number(i);a.forEach((h,u)=>{(u==="length"||!Ii(u)&&u>=d)&&r.push(h)})}else switch(n!==void 0&&r.push(a.get(n)),t){case"add":Se(e)?Ls(n)&&r.push(a.get("length")):(r.push(a.get(Ft)),ln(e)&&r.push(a.get(Gs)));break;case"delete":Se(e)||(r.push(a.get(Ft)),ln(e)&&r.push(a.get(Gs)));break;case"set":ln(e)&&r.push(a.get(Ft))}const c=process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:i,oldValue:s,oldTarget:l}:void 0;if(r.length===1)r[0]&&(process.env.NODE_ENV!=="production"?Ti(r[0],c):Ti(r[0]));else{const d=[];for(const h of r)h&&d.push(...h);process.env.NODE_ENV!=="production"?Ti(Rs(d),c):Ti(Rs(d))}}function Ti(e,t){const n=Se(e)?e:[...e];for(const i of n)i.computed&&ul(i,t);for(const i of n)i.computed||ul(i,t)}function ul(e,t){(e!==Ae||e.allowRecurse)&&(process.env.NODE_ENV!=="production"&&e.onTrigger&&e.onTrigger(lt({effect:e},t)),e.scheduler?e.scheduler():e.run())}const vc=uc("__proto__,__v_isRef,__isVue"),fl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ii)),ml=Rc();function Rc(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const i=ye(this);for(let l=0,a=this.length;l<a;l++)$e(i,"get",l+"");const s=i[t](...n);return s===-1||s===!1?i[t](...n.map(ye)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){dl();const i=ye(this)[t].apply(this,n);return hl(),i}}),e}function Vc(e){const t=ye(this);return $e(t,"has",e),t.hasOwnProperty(e)}class pl{constructor(t=!1,n=!1){this._isReadonly=t,this._shallow=n}get(t,n,i){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"&&i===(s?l?Il:wl:l?zc:kl).get(t))return t;const a=Se(t);if(!s){if(a&&wi(ml,n))return Reflect.get(ml,n,i);if(n==="hasOwnProperty")return Vc}const r=Reflect.get(t,n,i);return(Ii(n)?fl.has(n):vc(n))?r:(s||$e(t,"get",n),l?r:Ke(r)?a&&Ls(n)?r:r.value:Fe(r)?s?Tl(r):Ll(r):r)}}class Ec extends pl{constructor(t=!1){super(!1,t)}set(t,n,i,s){let l=t[n];if(_t(l)&&Ke(l)&&!Ke(i))return!1;if(!this._shallow&&(Ns(i)||_t(i)||(l=ye(l),i=ye(i)),!Se(t)&&Ke(l)&&!Ke(i)))return l.value=i,!0;const a=Se(t)&&Ls(n)?Number(n)<t.length:wi(t,n),r=Reflect.set(t,n,i,s);return t===ye(s)&&(a?an(i,l)&&Wt(t,"set",n,i,l):Wt(t,"add",n,i)),r}deleteProperty(t,n){const i=wi(t,n),s=t[n],l=Reflect.deleteProperty(t,n);return l&&i&&Wt(t,"delete",n,void 0,s),l}has(t,n){const i=Reflect.has(t,n);return Ii(n)&&fl.has(n)||$e(t,"has",n),i}ownKeys(t){return $e(t,"iterate",Se(t)?"length":Ft),Reflect.ownKeys(t)}}class gl extends pl{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&sl(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&sl(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Gc=new Ec,Wc=new gl,Zc=new gl(!0),Ws=e=>e,Mi=e=>Reflect.getPrototypeOf(e);function vi(e,t,n=!1,i=!1){const s=ye(e=e.__v_raw),l=ye(t);n||(an(t,l)&&$e(s,"get",t),$e(s,"get",l));const{has:a}=Mi(s),r=i?Ws:n?Ds:Bs;return a.call(s,t)?r(e.get(t)):a.call(s,l)?r(e.get(l)):void(e!==s&&e.get(t))}function Ri(e,t=!1){const n=this.__v_raw,i=ye(n),s=ye(e);return t||(an(e,s)&&$e(i,"has",e),$e(i,"has",s)),e===s?n.has(e):n.has(e)||n.has(s)}function Vi(e,t=!1){return e=e.__v_raw,!t&&$e(ye(e),"iterate",Ft),Reflect.get(e,"size",e)}function bl(e){e=ye(e);const t=ye(this);return Mi(t).has.call(t,e)||(t.add(e),Wt(t,"add",e,e)),this}function yl(e,t){t=ye(t);const n=ye(this),{has:i,get:s}=Mi(n);let l=i.call(n,e);l?process.env.NODE_ENV!=="production"&&Cl(n,i,e):(e=ye(e),l=i.call(n,e));const a=s.call(n,e);return n.set(e,t),l?an(t,a)&&Wt(n,"set",e,t,a):Wt(n,"add",e,t),this}function xl(e){const t=ye(this),{has:n,get:i}=Mi(t);let s=n.call(t,e);s?process.env.NODE_ENV!=="production"&&Cl(t,n,e):(e=ye(e),s=n.call(t,e));const l=i?i.call(t,e):void 0,a=t.delete(e);return s&&Wt(t,"delete",e,void 0,l),a}function Sl(){const e=ye(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?ln(e)?new Map(e):new Set(e):void 0,i=e.clear();return t&&Wt(e,"clear",void 0,void 0,n),i}function Ei(e,t){return function(n,i){const s=this,l=s.__v_raw,a=ye(l),r=t?Ws:e?Ds:Bs;return!e&&$e(a,"iterate",Ft),l.forEach((c,d)=>n.call(i,r(c),r(d),s))}}function Gi(e,t,n){return function(...i){const s=this.__v_raw,l=ye(s),a=ln(l),r=e==="entries"||e===Symbol.iterator&&a,c=e==="keys"&&a,d=s[e](...i),h=n?Ws:t?Ds:Bs;return!t&&$e(l,"iterate",c?Gs:Ft),{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 Zt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";console.warn(`${Cc(e)} operation ${n}failed: target is readonly.`,ye(this))}return e!=="delete"&&(e==="clear"?void 0:this)}}function Xc(){const e={get(s){return vi(this,s)},get size(){return Vi(this)},has:Ri,add:bl,set:yl,delete:xl,clear:Sl,forEach:Ei(!1,!1)},t={get(s){return vi(this,s,!1,!0)},get size(){return Vi(this)},has:Ri,add:bl,set:yl,delete:xl,clear:Sl,forEach:Ei(!1,!0)},n={get(s){return vi(this,s,!0)},get size(){return Vi(this,!0)},has(s){return Ri.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ei(!0,!1)},i={get(s){return vi(this,s,!0,!0)},get size(){return Vi(this,!0)},has(s){return Ri.call(this,s,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ei(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(s=>{e[s]=Gi(s,!1,!1),n[s]=Gi(s,!0,!1),t[s]=Gi(s,!1,!0),i[s]=Gi(s,!0,!0)}),[e,n,t,i]}const[Nc,Pc,Bc,Dc]=Xc();function Zs(e,t){const n=t?e?Dc:Bc:e?Pc:Nc;return(i,s,l)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?i:Reflect.get(wi(n,s)&&s in i?n:i,s,l)}const Yc={get:Zs(!1,!1)},Oc={get:Zs(!0,!1)},Hc={get:Zs(!0,!0)};function Cl(e,t,n){const i=ye(n);if(i!==n&&t.call(e,i)){const s=nl(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 kl=new WeakMap,zc=new WeakMap,wl=new WeakMap,Il=new WeakMap;function Ll(e){return _t(e)?e:Xs(e,!1,Gc,Yc,kl)}function Tl(e){return Xs(e,!0,Wc,Oc,wl)}function Wi(e){return Xs(e,!0,Zc,Hc,Il)}function Xs(e,t,n,i,s){if(!Fe(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}}(nl(r));var r;if(a===0)return e;const c=new Proxy(e,a===2?i:n);return s.set(e,c),c}function Kt(e){return _t(e)?Kt(e.__v_raw):!(!e||!e.__v_isReactive)}function _t(e){return!(!e||!e.__v_isReadonly)}function Ns(e){return!(!e||!e.__v_isShallow)}function Ps(e){return Kt(e)||_t(e)}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}const Bs=e=>Fe(e)?Ll(e):e,Ds=e=>Fe(e)?Tl(e):e;function Ke(e){return!(!e||e.__v_isRef!==!0)}const Fc={get:(e,t,n)=>{return Ke(i=Reflect.get(e,t,n))?i.value:i;var i},set:(e,t,n,i)=>{const s=e[t];return Ke(s)&&!Ke(n)?(s.value=n,!0):Reflect.set(e,t,n,i)}},Ut=[];function gt(e,...t){if(process.env.NODE_ENV==="production")return;dl();const n=Ut.length?Ut[Ut.length-1].component:null,i=n&&n.appContext.config.warnHandler,s=function(){let l=Ut[Ut.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(i)Jt(i,n,11,[e+t.join(""),n&&n.proxy,s.map(({vnode:l})=>`at <${jl(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 <${Fl(h.component,h.type,g)}`,m=">"+f;return h.props?[p,...vc(h.props),m]:[p+m]}(c))}),r}(s)),console.warn(...l)}tl()}function vc(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...yl(o,e[o]))}),n.length>3&&t.push(" ..."),t}function yl(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}`]:He(t)?(t=yl(e,me(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Oe(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=me(t),n?t:[`${e}=`,t])}const xl={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 Wt(e,t,n,o){let s;try{s=o?e(...o):e()}catch(l){bl(l,t,n)}return s}function Pi(e,t,n,o){if(Oe(e)){const l=Wt(e,t,n,o);return l&&ec(l)&&l.catch(a=>{bl(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(Pi(e[l],t,n,o));return s}function bl(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"?xl[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 Wt(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=xl[a];if(r&&(d=r,Ht.push(d)),ht("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ht.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,o)}let To=!1,_i=!1;const tt=[];let Dt=0;const tn=[];let ut=null,Lt=0;const Sl=Promise.resolve();let Ai=null;const Tc=100;function Cl(e){const t=Ai||Sl;return e?t.then(this?e.bind(this):e):t}function zi(e){tt.length&&tt.includes(e,To&&e.allowRecurse?Dt+1:Dt)||(e.id==null?tt.push(e):tt.splice(function(t){let n=Dt+1,o=tt.length;for(;n<o;){const s=n+o>>>1,l=tt[s],a=xn(l);a<t||a===t&&l.pre?n=s+1:o=s}return n}(e.id),0,e),wl())}function wl(){To||_i||(_i=!0,Ai=Sl.then(Ml))}function kl(e){pe(e)?tn.push(...e):ut&&ut.includes(e,e.allowRecurse?Lt+1:Lt)||tn.push(e),wl()}const xn=e=>e.id==null?1/0:e.id,Bc=(e,t)=>{const n=xn(e)-xn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Ml(e){_i=!1,To=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),tt.sort(Bc);const t=process.env.NODE_ENV!=="production"?n=>El(e,n):Us;try{for(Dt=0;Dt<tt.length;Dt++){const n=tt[Dt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;Wt(n,null,14)}}}finally{Dt=0,tt.length=0,function(n){if(tn.length){const o=[...new Set(tn)];if(tn.length=0,ut)return void ut.push(...o);for(ut=o,process.env.NODE_ENV!=="production"&&(n=n||new Map),ut.sort((s,l)=>xn(s)-xn(l)),Lt=0;Lt<ut.length;Lt++)process.env.NODE_ENV!=="production"&&El(n,ut[Lt])||ut[Lt]();ut=null,Lt=0}}(e),To=!1,Ai=null,(tt.length||tn.length)&&Ml(e)}}function El(e,t){if(e.has(t)){const n=e.get(t);if(n>Tc){const o=t.ownerInstance,s=o&&zl(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 bn=new Set;process.env.NODE_ENV!=="production"&&(wi().__VUE_HMR_RUNTIME__={createRecord:Fi(function(e,t){return Bo.has(e)?!1:(Bo.set(e,{initialDef:Sn(t),instances:new Set}),!0)}),rerender:Fi(function(e,t){const n=Bo.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,Sn(o.type).render=t),o.renderCache=[],o.update()}))}),reload:Fi(function(e,t){const n=Bo.get(e);if(!n)return;t=Sn(t),Il(n.initialDef,t);const o=[...n.instances];for(const s of o){const l=Sn(s.type);bn.has(l)||(l!==n.initialDef&&Il(l,t),bn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(bn.add(l),s.ceReload(t.styles),bn.delete(l)):s.parent?zi(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.")}kl(()=>{for(const s of o)bn.delete(Sn(s.type))})})});const Bo=new Map;function Sn(e){return Hl(e)?e.__vccOpts:e}function Il(e,t){et(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function Fi(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 Lc=Symbol.for("v-ndc"),Do={};function Oc(e,t,{immediate:n,deep:o,flush:s,onTrack:l,onTrigger:a}=Si){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=k=>{ht("Invalid watch source: ",k,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=Zs===((r=sn)==null?void 0:r.scope)?sn:null;let h,u,f=!1,g=!1;if(He(e)?(h=()=>e.value,f=Oi(e)):zt(e)?(h=()=>e,o=!0):pe(e)?(g=!0,f=e.some(k=>zt(k)||Oi(k)),h=()=>e.map(k=>He(k)?k.value:zt(k)?nn(k):Oe(k)?Wt(k,d,2):void(process.env.NODE_ENV!=="production"&&c(k)))):Oe(e)?h=t?()=>Wt(e,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),Pi(e,d,3,[p])}:(h=Us,process.env.NODE_ENV!=="production"&&c(e)),t&&o){const k=h;h=()=>nn(k())}let p=k=>{u=y.onStop=()=>{Wt(k,d,4),u=y.onStop=void 0}},m=g?new Array(e.length).fill(Do):Do;const x=()=>{if(y.active)if(t){const k=y.run();(o||f||(g?k.some((I,E)=>en(I,m[E])):en(k,m)))&&(u&&u(),Pi(t,d,3,[k,m===Do?void 0:g&&m[0]===Do?[]:m,p]),m=k)}else y.run()};let b;x.allowRecurse=!!t,s==="sync"?b=x:s==="post"?b=()=>Ll(x,d&&d.suspense):(x.pre=!0,d&&(x.id=d.uid),b=()=>zi(x));const y=new cc(h,b);return process.env.NODE_ENV!=="production"&&(y.onTrack=l,y.onTrigger=a),t?n?x():m=y.run():s==="post"?Ll(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 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=sn;Al(this);const r=Oc(s,l.bind(o),n);return a?Al(a):zc(),r}function nn(e,t){if(!ze(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),He(e))nn(e.value,t);else if(pe(e))for(let n=0;n<e.length;n++)nn(e[n],t);else if(Qr(e)||Qt(e))e.forEach(n=>{nn(n,t)});else if(nc(e))for(const n in e)nn(e[n],t);return e}const Hi=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),zt(n=o)?n:new Proxy(n,Ic)),{get:(s,l)=>l in s?s[l]:l in Wi?Wi[l](t):void 0,has:(s,l)=>l in s||l in Wi}));var n,o}(e)||e.proxy:Hi(e.parent):null,Wi=et(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?vo(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?vo(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?vo(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?vo(e.refs):e.refs,$parent:e=>Hi(e.parent),$root:e=>Hi(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=>Lo(d,h,r,!0)),Lo(d,n,r)):d=n,ze(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>zi(e.update)),$nextTick:e=>e.n||(e.n=Cl.bind(e.proxy)),$watch:e=>Rc.bind(e)});function vl(e){return pe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function Lo(e,t,n,o=!1){const{mixins:s,extends:l}=t;l&&Lo(e,l,n,!0),s&&s.forEach(a=>Lo(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:Tl,props:Dl,emits:Dl,methods:wn,computed:wn,beforeCreate:Ve,created:Ve,beforeMount:Ve,mounted:Ve,beforeUpdate:Ve,updated:Ve,beforeDestroy:Ve,beforeUnmount:Ve,destroyed:Ve,unmounted:Ve,activated:Ve,deactivated:Ve,errorCaptured:Ve,serverPrefetch:Ve,components:wn,directives:wn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=et(Object.create(null),e);for(const o in t)n[o]=Ve(e[o],t[o]);return n},provide:Tl,inject:function(e,t){return wn(Bl(e),Bl(t))}};function Tl(e,t){return t?e?function(){return et(Oe(e)?e.call(this,this):e,Oe(t)?t.call(this,this):t)}:t:e}function Bl(e){if(pe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ve(e,t){return e?[...new Set([].concat(e,t))]:t}function wn(e,t){return e?et(Object.create(null),e,t):t}function Dl(e,t){return e?pe(e)&&pe(t)?[...new Set([...e,...t])]:et(Object.create(null),vl(e),vl(t??{})):t}const Ll=function(e,t){t&&t.pendingBranch?pe(e)?t.effects.push(...e):t.effects.push(e):kl(e)},Ol=Symbol.for("v-fgt"),Vc=Symbol.for("v-txt"),Pc=Symbol.for("v-cmt"),Rl="__vInternal",Nl=({key:e})=>e??null,Oo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?dt(e)||He(e)||Oe(e)?{i:Cn,r:e,k:t,f:!!n}:e:null),_c=process.env.NODE_ENV!=="production"?(...e)=>Vl(...e):Vl;function Vl(e,t=null,n=null,o=0,s=null,l=!1){if(e&&e!==Lc||(process.env.NODE_ENV==="production"||e||ht(`Invalid vnode type when creating vnode: ${e}.`),e=Pc),(a=e)&&a.__v_isVNode===!0){const c=Ro(e,t,!0);return n&&$i(c,n),c.patchFlag|=-2,c}var a;if(Hl(e)&&(e=e.__vccOpts),t){t=function(h){return h?Ri(h)||Rl in h?et({},h):h:null}(t);let{class:c,style:d}=t;c&&!dt(c)&&(t.class=Mi(c)),ze(d)&&(Ri(d)&&!pe(d)&&(d=et({},d)),t.style=ki(d))}const r=dt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:ze(e)?4:Oe(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Ri(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=me(e)),function(c,d=null,h=null,u=0,f=null,g=c===Ol?0:1,p=!1,m=!1){const x={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Nl(d),ref:d&&Oo(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:g,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Cn};return m?($i(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 Ro(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=Mi([d.class,u.class]));else if(f==="style")d.style=ki([d.style,u.style]);else if(qr(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&&Nl(r),ref:t&&t.ref?n&&s?pe(s)?s.concat(Oo(t)):[s,Oo(t)]:Oo(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&pe(a)?a.map(Pl):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ol?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&&Ro(e.ssContent),ssFallback:e.ssFallback&&Ro(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Pl(e){const t=Ro(e);return pe(e.children)&&(t.children=e.children.map(Pl)),t}function Ac(e=" ",t=0){return _c(Vc,null,e,t)}function $i(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),$i(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||Rl 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 Xi,on,sn=null,_l="__VUE_INSTANCE_SETTERS__";(on=wi()[_l])||(on=wi()[_l]=[]),on.push(e=>sn=e),Xi=e=>{on.length>1?on.forEach(t=>t(e)):on[0](e)};const Al=e=>{Xi(e),e.scope.on()},zc=()=>{sn&&sn.scope.off(),Xi(null)},Fc=/(?:^|[-_])(\w)/g,Hc=e=>e.replace(Fc,t=>t.toUpperCase()).replace(/[-_]/g,"");function zl(e,t=!0){return Oe(e)?e.displayName||e.name:e.name||t&&e.__name}function Fl(e,t,n=!1){let o=zl(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 Hl(e){return Oe(e)&&"__vccOpts"in e}function Ui(e){return!(!e||!e.__v_isShallow)}function Wl(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 $l(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!$l(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=>ze(u)?u.__isVue?["div",e,"VueInstance"]:He(u)?["div",{},["span",e,h(u)],"<",r(u.value),">"]:zt(u)?["div",{},["span",e,Ui(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(Ft(u)?" (readonly)":"")]:Ft(u)?["div",{},["span",e,Ui(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",me(u.props))),u.setupState!==Si&&f.push(a("setup",u.setupState)),u.data!==Si&&f.push(a("data",me(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=et({},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]:ze(u)?["object",{object:f?me(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)||ze(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 Ui(u)?"ShallowRef":u.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 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,Wl([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,Wl([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),Cl(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}(),Yi={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(!$l(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 kn={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)}},re=(e,t)=>{const n=e.__vccOpts||e;for(const[o,s]of t)n[o]=s;return n},$c={name:"EvTabs",directives:{observeVisibility:Yi,resize:kn},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:S=>{t("update:modelValue",S),t("change",S)}});i.provide("evTabs",s);const l=i.computed({get:()=>e.panels,set:S=>t("update:panels",S)}),a=i.computed(()=>!e.draggable||!n.value?l.value:o.value),r=l.value.map(S=>S.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 S=c.value.offsetWidth,C=d.value.offsetWidth;if(h.value=S<C,h.value){const M=S-C;M>u.x&&(u.x=M)}else u.x=0};i.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let S,C;r.length>l.value.length?(S=r,C=l.value.map(w=>w.value)):(S=l.value.map(w=>w.value),C=r);const M=S.filter(w=>!C.includes(w))[0];if(s.value===M){const w=r.findIndex(T=>T===M);w===0?s.value=l.value[0].value:s.value=l.value[w-1].value}}});const p=S=>{s.value=S},m=S=>{if(l.value.length<2)return;const C=l.value.findIndex(M=>M.value===S);if(C<0){s.value=l.value[0].value;return}S===s.value&&(C===0?s.value=l.value[1].value:s.value=l.value[C-1].value),l.value.splice(C,1),i.nextTick(()=>{r.splice(C,1)}),i.triggerRef(l)},x=(S,C=100)=>{const M=c.value.offsetWidth,w=d.value.offsetWidth,T=M-w;S==="next"&&u.x!==T?T>=u.x-C?u.x=T:u.x-=C:S==="prev"&&u.x!==0&&(C*-1<=u.x?u.x=0:u.x+=C)},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:(S,C)=>{e.draggable&&(o.value=[...l.value],b.item=S,b.idx=C,n.value=!0)},dragoverTab:S=>{var w;if(!e.draggable||((w=b.item)==null?void 0:w.value)===S)return;const C=o.value.findIndex(T=>{var D;return T.value===((D=b.item)==null?void 0:D.value)}),M=o.value.findIndex(T=>T.value===S);o.value.splice(C,1),o.value.splice(M,0,b.item)},dragendTab:()=>{e.draggable&&(l.value=[...o.value],b.item={},b.idx=null,n.value=!1,o.value.splice(0))},dragSelectCls:S=>{var C;return e.draggable&&((C=b.item)==null?void 0:C.value)===S},selectIdxCls:S=>e.draggable&&b.idx===S,onResize:()=>{g()}}}},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 Mn=re($c,[["render",qc]]);Mn.install=e=>{e.component(Mn.name,Mn)};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 En=re(Kc,[["render",Qc]]);En.install=e=>{e.component(En.name,En)};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 ln=re(ed,[["render",nd]]);ln.install=e=>{e.component(ln.name,ln)};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=re(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 an=re(ld,[["render",cd]]);an.install=e=>{e.component(an.name,an)};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 rn=re(dd,[["render",hd]]);rn.install=e=>{e.component(rn.name,rn)};const ud={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}}},fd=["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,fd),[[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 vn=re(ud,[["render",gd]]);vn.install=e=>{e.component(vn.name,vn)};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 Tn=re(pd,[["render",yd]]);Tn.install=e=>{e.component(Tn.name,Tn)};const No={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 cn(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 Vo=44032,Bn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Pe=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ie=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Rt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},ji={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},Xl=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],Ul=[["ㄱ","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 Yl(e){var t="",n="",o="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Bn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-Vo;a=r%Ie.length,l=(r-a)/Ie.length%Pe.length,s=((r-a)/Ie.length-l)/Pe.length,t=Bn[s],n=Pe[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 cn(cn([],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=Yl(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]&&Xl.indexOf(d)===-1?Rt[d]:d,Rt[h]&&Xl.indexOf(h)===-1?Rt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var $t=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))},{}),jl=function(e){return typeof e<"u"};function Cd(e){var t=e.findIndex(function(d){return Pe.indexOf(d)!==-1}),n=t!==-1&&Pe.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=Bn.indexOf($t[o]||o),r=Pe.indexOf($t[s]||s),c=Ie.indexOf($t[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Vo+a*(Pe.length*Ie.length)+r*Ie.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&&Pe.indexOf(r[a-1])!==-1&&Pe.indexOf(l)!==-1&&$t["".concat(r[a-1]).concat(l)]?t[t.length-1]=$t["".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)):Pe.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);$t["".concat(g).concat(p)]&&(l.finales=cn([$t["".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=cn([g],p,!0),g=""),u.filter(jl).forEach(function(m){return s.push([m])}),s.push([f,c,g].filter(Boolean)),p.filter(jl).forEach(function(m){return s.push([m])})}}),s.map(Cd).join("")}var kd=Object.values(Ul).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[s]=o,n))},{});function Gl(e){return wd(e.split("").map(function(t){return kd[t]||t}).join(""))}var Zl=/[\\^$.*+?()[\]{}|]/g,Md=RegExp(Zl.source);function Gi(e){return e&&Md.test(e)?e.replace(Zl,"\\$&"):e||""}var Po=function(e,t){t===void 0&&(t=!1);var n=Bn.indexOf(e);if(n!==-1){var o=n*Pe.length*Ie.length+Vo;return"[".concat(t?e:"").concat(String.fromCharCode(o),"-").concat(String.fromCharCode(o+Pe.length*Ie.length-1),"]")}return e},ql="__".concat(parseInt("fuzzy",36),"__"),Kl="__".concat(parseInt("ignorespace",36),"__"),Zi=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,k=s.nonCaptureGroup,I=k===void 0?!1:k,E=s.engToKor,B=E===void 0?!1:E;if(e===n)return t;var V=n,S=[];if(B&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var C=Gl(n.trim());C.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(V=C,S.push(Gi(n.trim())))}var M=V.split(""),w=M.slice(-1)[0],T="",D=Yl(w||"");if(D.initialOffset!==-1){M=M.slice(0,-1);var L=D.initial,O=D.medial,v=D.finale,N=D.initialOffset,R=D.medialOffset,P=N*Pe.length*Ie.length+Vo,_=[];switch(!0){case v!=="":{_.push(w),Bn.includes(v)&&_.push("".concat(String.fromCharCode(P+R*Ie.length)).concat(Po(v))),Rt[v]&&_.push("".concat(String.fromCharCode(P+R*Ie.length+Ie.join("").search(Rt[v][0])+1)).concat(Po(Rt[v][1])));break}case O!=="":{var z=void 0,W=void 0;ji[O]?(z=P+Pe.join("").search(ji[O][0])*Ie.length,W=P+Pe.join("").search(ji[O][1])*Ie.length+Ie.length-1):(z=P+R*Ie.length,W=z+Ie.length-1),_.push("[".concat(String.fromCharCode(z),"-").concat(String.fromCharCode(W),"]"));break}case L!=="":{_.push(Po(L,!0));break}}T=_.length>1?I?"(?:".concat(_.join("|"),")"):"(".concat(_.join("|"),")"):_[0]}var A=y?ql:f?Kl:"",F=a?M.map(function(q){return q.search(/[ㄱ-ㅎ]/)!==-1?Po(q,!0):Gi(q)}).join(A):Gi(M.join(A)),H=F.trim()!==""&&T.trim()!=="",U=H?"".concat(F).concat(A).concat(T):"".concat(F).concat(T),j=(c?"^":"")+U+(h?"$":"");return A&&(j=j.replace(RegExp(ql,"g"),".*").replace(RegExp(Kl,"g"),"\\s*")),S.length>0&&(j=cn(cn([],S,!0),[j],!1).map(function(q){return"(".concat(q,")")}).join("|")),t=RegExp(j,(x?"g":"")+(p?"i":"")),t}}(),Ed=Object.values(Ul).reduce(function(e,t){var n,o=t[0],s=t[1];return Ot(Ot({},e),(n={},n[o]=s,n))},{});function Id(e){return e.split("").map(function(t){return Sd(t,{grouped:!1}).map(function(n){return Ed[n]||n})}).flat().join("")}const vd=()=>{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}},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%"),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(),L=Gl(D),O=Id(D);return t.items.filter(({name:N})=>N.search(Zi(D))>-1||N.search(Zi(L))>-1||N.search(Zi(O))>-1)}),p=D=>{var L;l.value=(L=D==null?void 0:D.target)==null?void 0:L.value},m=async()=>{var N,R,P;await i.nextTick();const D=(N=r.value)==null?void 0:N.getBoundingClientRect().height,L=(R=r.value)==null?void 0:R.getBoundingClientRect().y,O=(P=c.value)==null?void 0:P.getBoundingClientRect().height;document.documentElement.clientHeight<L+D+O?f.top=`-${O}px`:f.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",L=d.value.children[0].children,O=d.value.offsetTop;let v=null;for(let _=0;_<L.length;_++)if(v=L[_],v.classList.contains(D)){if(!v.offsetTop)return;d.value.scrollTop=v.offsetTop-O;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 L=0;D.forEach(F=>{const H=F.scrollWidth;H>L&&(L=H)});const{borderLeftWidth:O,borderRightWidth:v}=window.getComputedStyle(c.value),N=parseInt(O)+parseInt(v),R=d.value.offsetWidth-d.value.clientWidth;L+=R+N;const P=window.innerWidth,z=c.value.getBoundingClientRect().left,W=P-z-20,A=Math.max(Math.min(L,W),u.value);h.value=`${A}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())},k=()=>{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(L=>!L.disabled).map(L=>L.value):n.value=[]},B=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 L=n.value.indexOf(D);n.value.splice(L,1)}I.value=n.value.length===g.value.filter(L=>!L.disabled).length,n.value=[...n.value],o()},S=t.multiple?V:B,C=D=>D===n.value,M=D=>n.value.includes(D),w=t.multiple?M:C;i.watch(()=>n.value,D=>{t.multiple&&t.checkable&&(D.length===0?I.value=!1:I.value=D.length===g.value.filter(L=>!L.disabled).length,m())});const T=()=>{s.value&&(b(),m())};return i.onMounted(()=>{window.addEventListener("resize",T)}),i.onUnmounted(()=>{window.removeEventListener("resize",T)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:g,clickSelectInput:y,clickOutsideDropbox:k,changeFilterText:p,changeDropboxPosition:m,clickItem:S,selectedItemClass:w,allCheck:I,changeAllCheck:E,dropboxWidth:h}},Bd={name:"EvSelect",components:{EvCheckbox:an,EvCheckboxGroup:rn},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:u,dropboxPosition:f,filterTextRef:g,filteredItems:p,clickSelectInput:m,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:k,selectedItemClass:I,allCheck:E,changeAllCheck:B,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:u,dropboxPosition:f,filterTextRef:g,filteredItems:p,clickSelectInput:m,clickOutsideDropbox:x,changeFilterText:b,changeDropboxPosition:y,clickItem:k,selectedItemClass:I,allCheck:E,changeAllCheck:B,dropboxWidth:V}}},Dd={ref:"selectWrapper",class:"ev-select__wrapper"},Ld=["placeholder","disabled"],Od={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",Od,[!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,Ld),[[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(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,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(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,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(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,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 Dn=re(Bd,[["render",eh]]);Dn.install=e=>{e.component(Dn.name,Dn)};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 Ln=re(th,[["render",nh]]);Ln.install=e=>{e.component(Ln.name,Ln)};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"},modelModifiers:{type:Object,default:()=>({})}},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=>{if(e.modelModifiers.trim&&typeof m.target.value=="string"){const x=m.target.value.trim();x!==m.target.value&&(n.value=x,m.target.value=x)}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}}},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=re(oh,[["render",hh]]);On.install=e=>{e.component(On.name,On)};function Jl(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 $e(e,t){const n=e/t*100;return!ft(e,t,n)||e===0||t===0?0:n.toFixed(2)}function uh(e){return ft(e)?1e6*e:0}function fh(e){return ft(e)?1e9*e:0}function mh(e){return ft(e)?1e12*e:0}function gh(e){return ft(e)?1e15*e:0}function Xt(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 qi(e){return e==null}function ph(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function Nn(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 yh(){const{props:e,emit:t}=i.getCurrentInstance(),n=i.ref(e.modelValue),o=i.ref(e.modelValue),s=d=>{if(e.precision&&(d||d===0)){const h=Number(d).toFixed(e.precision);return e.trimTrailingZero?String(parseFloat(h)):h}return 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=Nn(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(Rn(r),Rn(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)&&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)},trimTrailingZero:{type:Boolean,default:!1}},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}}},Ch={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",Ch,[(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 Vn=re(Sh,[["render",Mh]]);Vn.install=e=>{e.component(Vn.name,Vn)};var Ql=typeof global=="object"&&global&&global.Object===Object&&global,Eh=typeof self=="object"&&self&&self.Object===Object&&self,nt=Ql||Eh||Function("return this")(),mt=nt.Symbol,ea=Object.prototype,Ih=ea.hasOwnProperty,vh=ea.toString,Pn=mt?mt.toStringTag:void 0;function Th(e){var t=Ih.call(e,Pn),n=e[Pn];try{e[Pn]=void 0;var o=!0}catch{}var s=vh.call(e);return o&&(t?e[Pn]=n:delete e[Pn]),s}var Bh=Object.prototype,Dh=Bh.toString;function Lh(e){return Dh.call(e)}var Oh="[object Null]",Rh="[object Undefined]",ta=mt?mt.toStringTag:void 0;function Nt(e){return e==null?e===void 0?Rh:Oh:ta&&ta in Object(e)?Th(e):Lh(e)}function ot(e){return e!=null&&typeof e=="object"}var Nh="[object Symbol]";function _o(e){return typeof e=="symbol"||ot(e)&&Nt(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 je=Array.isArray,na=mt?mt.prototype:void 0,oa=na?na.toString:void 0;function ia(e){if(typeof e=="string")return e;if(je(e))return Vh(e,ia)+"";if(_o(e))return oa?oa.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 _e(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var sa=NaN,Fh=/^[-+]0x[0-9a-f]+$/i,Hh=/^0b[01]+$/i,Wh=/^0o[0-7]+$/i,$h=parseInt;function Ao(e){if(typeof e=="number")return e;if(_o(e))return sa;if(_e(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=_e(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)?sa:+e}var la=1/0,Xh=17976931348623157e292;function aa(e){if(!e)return e===0?e:0;if(e=Ao(e),e===la||e===-la){var t=e<0?-1:1;return t*Xh}return e===e?e:0}function Ki(e){return e}var Uh="[object AsyncFunction]",Yh="[object Function]",jh="[object GeneratorFunction]",Gh="[object Proxy]";function Ji(e){if(!_e(e))return!1;var t=Nt(e);return t==Yh||t==jh||t==Uh||t==Gh}var Qi=nt["__core-js_shared__"],ra=function(){var e=/[^.]+$/.exec(Qi&&Qi.keys&&Qi.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Zh(e){return!!ra&&ra in e}var qh=Function.prototype,Kh=qh.toString;function Ut(e){if(e!=null){try{return Kh.call(e)}catch{}try{return e+""}catch{}}return""}var Jh=/[\\^$.*+?()[\]{}|]/g,Qh=/^\[object .+?Constructor\]$/,eu=Function.prototype,tu=Object.prototype,nu=eu.toString,ou=tu.hasOwnProperty,iu=RegExp("^"+nu.call(ou).replace(Jh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function su(e){if(!_e(e)||Zh(e))return!1;var t=Ji(e)?iu:Qh;return t.test(Ut(e))}function lu(e,t){return e==null?void 0:e[t]}function Yt(e,t){var n=lu(e,t);return su(n)?n:void 0}var es=Yt(nt,"WeakMap"),ca=Object.create,au=function(){function e(){}return function(t){if(!_e(t))return{};if(ca)return ca(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function da(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 ru(){}function cu(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}var du=800,hu=16,uu=Date.now;function fu(e){var t=0,n=0;return function(){var o=uu(),s=hu-(o-n);if(n=o,s>0){if(++t>=du)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function mu(e){return function(){return e}}var zo=function(){try{var e=Yt(Object,"defineProperty");return e({},"",{}),e}catch{}}(),gu=zo?function(e,t){return zo(e,"toString",{configurable:!0,enumerable:!1,value:mu(t),writable:!0})}:Ki,pu=fu(gu);function yu(e,t){for(var n=-1,o=e==null?0:e.length;++n<o&&t(e[n],n,e)!==!1;);return e}function xu(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 bu(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 Cu(e,t,n){return t===t?Su(e,t,n):xu(e,bu,n)}function wu(e,t){var n=e==null?0:e.length;return!!n&&Cu(e,t,0)>-1}var ku=9007199254740991,Mu=/^(?:0|[1-9]\d*)$/;function ts(e,t){var n=typeof e;return t=t??ku,!!t&&(n=="number"||n!="symbol"&&Mu.test(e))&&e>-1&&e%1==0&&e<t}function ns(e,t,n){t=="__proto__"&&zo?zo(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function _n(e,t){return e===t||e!==e&&t!==t}var Eu=Object.prototype,Iu=Eu.hasOwnProperty;function ha(e,t,n){var o=e[t];(!(Iu.call(e,t)&&_n(o,n))||n===void 0&&!(t in e))&&ns(e,t,n)}function vu(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?ns(n,r,c):ha(n,r,c)}return n}var ua=Math.max;function Tu(e,t,n){return t=ua(t===void 0?e.length-1:t,0),function(){for(var o=arguments,s=-1,l=ua(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),da(e,this,r)}}function fa(e,t){return pu(Tu(e,t,Ki),e+"")}var Bu=9007199254740991;function os(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Bu}function Fo(e){return e!=null&&os(e.length)&&!Ji(e)}function Du(e,t,n){if(!_e(n))return!1;var o=typeof t;return(o=="number"?Fo(n)&&ts(t,n.length):o=="string"&&t in n)?_n(n[t],e):!1}function ma(e){return fa(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&&Du(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 Lu=Object.prototype;function is(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Lu;return e===n}function Ou(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}var Ru="[object Arguments]";function ga(e){return ot(e)&&Nt(e)==Ru}var pa=Object.prototype,Nu=pa.hasOwnProperty,Vu=pa.propertyIsEnumerable,Ho=ga(function(){return arguments}())?ga:function(e){return ot(e)&&Nu.call(e,"callee")&&!Vu.call(e,"callee")};function Pu(){return!1}var ya=typeof se=="object"&&se&&!se.nodeType&&se,xa=ya&&typeof module=="object"&&module&&!module.nodeType&&module,_u=xa&&xa.exports===ya,ba=_u?nt.Buffer:void 0,Au=ba?ba.isBuffer:void 0,An=Au||Pu,zu="[object Arguments]",Fu="[object Array]",Hu="[object Boolean]",Wu="[object Date]",$u="[object Error]",Xu="[object Function]",Uu="[object Map]",Yu="[object Number]",ju="[object Object]",Gu="[object RegExp]",Zu="[object Set]",qu="[object String]",Ku="[object WeakMap]",Ju="[object ArrayBuffer]",Qu="[object DataView]",ef="[object Float32Array]",tf="[object Float64Array]",nf="[object Int8Array]",of="[object Int16Array]",sf="[object Int32Array]",lf="[object Uint8Array]",af="[object Uint8ClampedArray]",rf="[object Uint16Array]",cf="[object Uint32Array]",ye={};ye[ef]=ye[tf]=ye[nf]=ye[of]=ye[sf]=ye[lf]=ye[af]=ye[rf]=ye[cf]=!0,ye[zu]=ye[Fu]=ye[Ju]=ye[Hu]=ye[Qu]=ye[Wu]=ye[$u]=ye[Xu]=ye[Uu]=ye[Yu]=ye[ju]=ye[Gu]=ye[Zu]=ye[qu]=ye[Ku]=!1;function df(e){return ot(e)&&os(e.length)&&!!ye[Nt(e)]}function ss(e){return function(t){return e(t)}}var Sa=typeof se=="object"&&se&&!se.nodeType&&se,zn=Sa&&typeof module=="object"&&module&&!module.nodeType&&module,hf=zn&&zn.exports===Sa,ls=hf&&Ql.process,dn=function(){try{var e=zn&&zn.require&&zn.require("util").types;return e||ls&&ls.binding&&ls.binding("util")}catch{}}(),Ca=dn&&dn.isTypedArray,as=Ca?ss(Ca):df,uf=Object.prototype,ff=uf.hasOwnProperty;function wa(e,t){var n=je(e),o=!n&&Ho(e),s=!n&&!o&&An(e),l=!n&&!o&&!s&&as(e),a=n||o||s||l,r=a?Ou(e.length,String):[],c=r.length;for(var d in e)(t||ff.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ts(d,c)))&&r.push(d);return r}function ka(e,t){return function(n){return e(t(n))}}var mf=ka(Object.keys,Object),gf=Object.prototype,pf=gf.hasOwnProperty;function yf(e){if(!is(e))return mf(e);var t=[];for(var n in Object(e))pf.call(e,n)&&n!="constructor"&&t.push(n);return t}function Ma(e){return Fo(e)?wa(e):yf(e)}function xf(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var bf=Object.prototype,Sf=bf.hasOwnProperty;function Cf(e){if(!_e(e))return xf(e);var t=is(e),n=[];for(var o in e)o=="constructor"&&(t||!Sf.call(e,o))||n.push(o);return n}function Ea(e){return Fo(e)?wa(e,!0):Cf(e)}var wf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kf=/^\w*$/;function rs(e,t){if(je(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||_o(e)?!0:kf.test(e)||!wf.test(e)||t!=null&&e in Object(t)}var Fn=Yt(Object,"create");function Mf(){this.__data__=Fn?Fn(null):{},this.size=0}function Ef(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var If="__lodash_hash_undefined__",vf=Object.prototype,Tf=vf.hasOwnProperty;function Bf(e){var t=this.__data__;if(Fn){var n=t[e];return n===If?void 0:n}return Tf.call(t,e)?t[e]:void 0}var Df=Object.prototype,Lf=Df.hasOwnProperty;function Of(e){var t=this.__data__;return Fn?t[e]!==void 0:Lf.call(t,e)}var Rf="__lodash_hash_undefined__";function Nf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Fn&&t===void 0?Rf:t,this}function jt(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])}}jt.prototype.clear=Mf,jt.prototype.delete=Ef,jt.prototype.get=Bf,jt.prototype.has=Of,jt.prototype.set=Nf;function Vf(){this.__data__=[],this.size=0}function Wo(e,t){for(var n=e.length;n--;)if(_n(e[n][0],t))return n;return-1}var Pf=Array.prototype,_f=Pf.splice;function Af(e){var t=this.__data__,n=Wo(t,e);if(n<0)return!1;var o=t.length-1;return n==o?t.pop():_f.call(t,n,1),--this.size,!0}function zf(e){var t=this.__data__,n=Wo(t,e);return n<0?void 0:t[n][1]}function Ff(e){return Wo(this.__data__,e)>-1}function Hf(e,t){var n=this.__data__,o=Wo(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}function St(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])}}St.prototype.clear=Vf,St.prototype.delete=Af,St.prototype.get=zf,St.prototype.has=Ff,St.prototype.set=Hf;var Hn=Yt(nt,"Map");function Wf(){this.size=0,this.__data__={hash:new jt,map:new(Hn||St),string:new jt}}function $f(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function $o(e,t){var n=e.__data__;return $f(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Xf(e){var t=$o(this,e).delete(e);return this.size-=t?1:0,t}function Uf(e){return $o(this,e).get(e)}function Yf(e){return $o(this,e).has(e)}function jf(e,t){var n=$o(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=Wf,Ct.prototype.delete=Xf,Ct.prototype.get=Uf,Ct.prototype.has=Yf,Ct.prototype.set=jf;var Gf="Expected a function";function cs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Gf);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(cs.Cache||Ct),n}cs.Cache=Ct;var Zf=500;function qf(e){var t=cs(e,function(o){return n.size===Zf&&n.clear(),o}),n=t.cache;return t}var Kf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jf=/\\(\\)?/g,Qf=qf(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Kf,function(n,o,s,l){t.push(s?l.replace(Jf,"$1"):o||n)}),t});function em(e){return e==null?"":ia(e)}function Ia(e,t){return je(e)?e:rs(e,t)?[e]:Qf(em(e))}function Xo(e){if(typeof e=="string"||_o(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function va(e,t){t=Ia(t,e);for(var n=0,o=t.length;e!=null&&n<o;)e=e[Xo(t[n++])];return n&&n==o?e:void 0}function tm(e,t,n){var o=e==null?void 0:va(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 Ta=ka(Object.getPrototypeOf,Object),om="[object Object]",im=Function.prototype,sm=Object.prototype,Ba=im.toString,lm=sm.hasOwnProperty,am=Ba.call(Object);function rm(e){if(!ot(e)||Nt(e)!=om)return!1;var t=Ta(e);if(t===null)return!0;var n=lm.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ba.call(n)==am}function cm(){this.__data__=new St,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 um(e){return this.__data__.has(e)}var fm=200;function mm(e,t){var n=this.__data__;if(n instanceof St){var o=n.__data__;if(!Hn||o.length<fm-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 it(e){var t=this.__data__=new St(e);this.size=t.size}it.prototype.clear=cm,it.prototype.delete=dm,it.prototype.get=hm,it.prototype.has=um,it.prototype.set=mm;var Da=typeof se=="object"&&se&&!se.nodeType&&se,La=Da&&typeof module=="object"&&module&&!module.nodeType&&module,gm=La&&La.exports===Da,Oa=gm?nt.Buffer:void 0,Ra=Oa?Oa.allocUnsafe:void 0;function Na(e,t){if(t)return e.slice();var n=e.length,o=Ra?Ra(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,Va=Object.getOwnPropertySymbols,Sm=Va?function(e){return e==null?[]:(e=Object(e),pm(Va(e),function(t){return bm.call(e,t)}))}:ym;function Cm(e,t,n){var o=t(e);return je(e)?o:nm(o,n(e))}function ds(e){return Cm(e,Ma,Sm)}var hs=Yt(nt,"DataView"),us=Yt(nt,"Promise"),hn=Yt(nt,"Set"),Pa="[object Map]",wm="[object Object]",_a="[object Promise]",Aa="[object Set]",za="[object WeakMap]",Fa="[object DataView]",km=Ut(hs),Mm=Ut(Hn),Em=Ut(us),Im=Ut(hn),vm=Ut(es),st=Nt;(hs&&st(new hs(new ArrayBuffer(1)))!=Fa||Hn&&st(new Hn)!=Pa||us&&st(us.resolve())!=_a||hn&&st(new hn)!=Aa||es&&st(new es)!=za)&&(st=function(e){var t=Nt(e),n=t==wm?e.constructor:void 0,o=n?Ut(n):"";if(o)switch(o){case km:return Fa;case Mm:return Pa;case Em:return _a;case Im:return Aa;case vm:return za}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 Uo=nt.Uint8Array;function fs(e){var t=new e.constructor(e.byteLength);return new Uo(t).set(new Uo(e)),t}function Lm(e,t){var n=fs(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Om=/\w*$/;function Rm(e){var t=new e.constructor(e.source,Om.exec(e));return t.lastIndex=e.lastIndex,t}var Ha=mt?mt.prototype:void 0,Wa=Ha?Ha.valueOf:void 0;function Nm(e){return Wa?Object(Wa.call(e)):{}}function $a(e,t){var n=t?fs(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 fs(e);case Vm:case Pm:return new o(+e);case Xm:return Lm(e);case Um:case Ym:case jm:case Gm:case Zm:case qm:case Km:case Jm:case Qm:return $a(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 Xa(e){return typeof e.constructor=="function"&&!is(e)?au(Ta(e)):{}}var tg="[object Map]";function ng(e){return ot(e)&&st(e)==tg}var Ua=dn&&dn.isMap,og=Ua?ss(Ua):ng,ig="[object Set]";function sg(e){return ot(e)&&st(e)==ig}var Ya=dn&&dn.isSet,lg=Ya?ss(Ya):sg,ag=1,ja="[object Arguments]",rg="[object Array]",cg="[object Boolean]",dg="[object Date]",hg="[object Error]",Ga="[object Function]",ug="[object GeneratorFunction]",fg="[object Map]",mg="[object Number]",Za="[object Object]",gg="[object RegExp]",pg="[object Set]",yg="[object String]",xg="[object Symbol]",bg="[object WeakMap]",Sg="[object ArrayBuffer]",Cg="[object DataView]",wg="[object Float32Array]",kg="[object Float64Array]",Mg="[object Int8Array]",Eg="[object Int16Array]",Ig="[object Int32Array]",vg="[object Uint8Array]",Tg="[object Uint8ClampedArray]",Bg="[object Uint16Array]",Dg="[object Uint32Array]",ge={};ge[ja]=ge[rg]=ge[Sg]=ge[Cg]=ge[cg]=ge[dg]=ge[wg]=ge[kg]=ge[Mg]=ge[Eg]=ge[Ig]=ge[fg]=ge[mg]=ge[Za]=ge[gg]=ge[pg]=ge[yg]=ge[xg]=ge[vg]=ge[Tg]=ge[Bg]=ge[Dg]=!0,ge[hg]=ge[Ga]=ge[bg]=!1;function Yo(e,t,n,o,s,l){var a,r=t&ag;if(a!==void 0)return a;if(!_e(e))return e;var c=je(e);if(c)a=Dm(e);else{var d=st(e),h=d==Ga||d==ug;if(An(e))return Na(e,r);if(d==Za||d==ja||h&&!s)a=h?{}:Xa(e);else{if(!ge[d])return s?e:{};a=eg(e,d,r)}}l||(l=new it);var u=l.get(e);if(u)return u;l.set(e,a),lg(e)?e.forEach(function(p){a.add(Yo(p,t,n,p,e,l))}):og(e)&&e.forEach(function(p,m){a.set(m,Yo(p,t,n,m,e,l))});var f=ds,g=c?void 0:f(e);return yu(g||e,function(p,m){g&&(m=p,p=e[m]),ha(a,m,Yo(p,t,n,m,e,l))}),a}var Lg=1,Og=4;function Ce(e){return Yo(e,Lg|Og)}var Rg="__lodash_hash_undefined__";function Ng(e){return this.__data__.set(e,Rg),this}function Vg(e){return this.__data__.has(e)}function Wn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Ct;++t<n;)this.add(e[t])}Wn.prototype.add=Wn.prototype.push=Ng,Wn.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 qa(e,t){return e.has(t)}var _g=1,Ag=2;function Ka(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 u=-1,f=!0,g=n&Ag?new Wn: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(!Pg(t,function(b,y){if(!qa(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 zg(e){var t=-1,n=Array(e.size);return e.forEach(function(o,s){n[++t]=[s,o]}),n}function ms(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]",Ja=mt?mt.prototype:void 0,gs=Ja?Ja.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 Uo(e),new Uo(t)));case Wg:case $g:case Yg:return _n(+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=ms),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=Ka(r(e),r(t),o,s,l,a);return a.delete(e),h;case qg:if(gs)return gs.call(e)==gs.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=ds(e),c=r.length,d=ds(t),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in t:np.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 k=a?o(y,b,f,t,e,l):o(b,y,f,e,t,l);if(!(k===void 0?b===y||s(b,y,n,o,l):k)){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 ip=1,Qa="[object Arguments]",er="[object Array]",jo="[object Object]",sp=Object.prototype,tr=sp.hasOwnProperty;function lp(e,t,n,o,s,l){var a=je(e),r=je(t),c=a?er:st(e),d=r?er:st(t);c=c==Qa?jo:c,d=d==Qa?jo:d;var h=c==jo,u=d==jo,f=c==d;if(f&&An(e)){if(!An(t))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new it),a||as(e)?Ka(e,t,n,o,s,l):Qg(e,t,c,n,o,s,l);if(!(n&ip)){var g=h&&tr.call(e,"__wrapped__"),p=u&&tr.call(t,"__wrapped__");if(g||p){var m=g?e.value():e,x=p?t.value():t;return l||(l=new it),s(m,x,n,o,l)}}return f?(l||(l=new it),op(e,t,n,o,s,l)):!1}function Go(e,t,n,o,s){return e===t?!0:e==null||t==null||!ot(e)&&!ot(t)?e!==e&&t!==t:lp(e,t,n,o,Go,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 it,u;if(!(u===void 0?Go(d,c,ap|rp,o,h):u))return!1}}return!0}function nr(e){return e===e&&!_e(e)}function dp(e){for(var t=Ma(e),n=t.length;n--;){var o=t[n],s=e[o];t[n]=[o,s,nr(s)]}return t}function or(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]?or(t[0][0],t[0][1]):function(n){return n===e||cp(n,e,t)}}function up(e,t){return e!=null&&t in Object(e)}function fp(e,t,n){t=Ia(t,e);for(var o=-1,s=t.length,l=!1;++o<s;){var a=Xo(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&&os(s)&&ts(a,s)&&(je(e)||Ho(e)))}function mp(e,t){return e!=null&&fp(e,t,up)}var gp=1,pp=2;function yp(e,t){return rs(e)&&nr(t)?or(Xo(e),t):function(n){var o=tm(n,e);return o===void 0&&o===t?mp(n,e):Go(t,o,gp|pp)}}function xp(e){return function(t){return t==null?void 0:t[e]}}function bp(e){return function(t){return va(t,e)}}function Sp(e){return rs(e)?xp(Xo(e)):bp(e)}function Cp(e){return typeof e=="function"?e:e==null?Ki:typeof e=="object"?je(e)?yp(e[0],e[1]):hp(e):Sp(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(),ps=function(){return nt.Date.now()},Mp="Expected a function",Ep=Math.max,Ip=Math.min;function Zo(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(Mp);t=Ao(t)||0,_e(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Ep(Ao(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f);function g(B){var V=o,S=s;return o=s=void 0,d=B,a=e.apply(S,V),a}function p(B){return d=B,r=setTimeout(b,t),h?g(B):a}function m(B){var V=B-c,S=B-d,C=t-V;return u?Ip(C,l-S):C}function x(B){var V=B-c,S=B-d;return c===void 0||V>=t||V<0||u&&S>=l}function b(){var B=ps();if(x(B))return y(B);r=setTimeout(b,m(B))}function y(B){return r=void 0,f&&o?g(B):(o=s=void 0,a)}function k(){r!==void 0&&clearTimeout(r),d=0,o=c=s=r=void 0}function I(){return r===void 0?a:y(ps())}function E(){var B=ps(),V=x(B);if(o=arguments,s=this,c=B,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=k,E.flush=I,E}function ys(e,t,n){(n!==void 0&&!_n(e[t],n)||n===void 0&&!(t in e))&&ns(e,t,n)}function vp(e){return ot(e)&&Fo(e)}function xs(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Tp(e){return vu(e,Ea(e))}function Bp(e,t,n,o,s,l,a){var r=xs(e,n),c=xs(t,n),d=a.get(c);if(d){ys(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,u=h===void 0;if(u){var f=je(c),g=!f&&An(c),p=!f&&!g&&as(c);h=c,f||g||p?je(r)?h=r:vp(r)?h=cu(r):g?(u=!1,h=Na(c,!0)):p?(u=!1,h=$a(c,!0)):h=[]:rm(c)||Ho(c)?(h=r,Ho(r)?h=Tp(r):(!_e(r)||Ji(r))&&(h=Xa(c))):u=!1}u&&(a.set(c,h),s(h,c,o,l,a),a.delete(c)),ys(e,n,h)}function qo(e,t,n,o,s){e!==t&&kp(t,function(l,a){if(s||(s=new it),_e(l))Bp(e,t,a,n,qo,o,s);else{var r=o?o(xs(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),ys(e,a,r)}},Ea)}function ir(e,t,n,o,s,l){return _e(e)&&_e(t)&&(l.set(t,e),qo(e,t,void 0,ir,l),l.delete(t)),e}var Dp=ma(function(e,t,n,o){qo(e,t,n,o)}),Re=fa(function(e){return e.push(void 0,ir),da(Dp,void 0,e)}),Lp=Math.max,Op=Math.min;function Rp(e,t,n){return e>=Op(t,n)&&e<Lp(t,n)}function gt(e,t,n){return t=aa(t),n===void 0?(n=t,t=0):n=aa(n),e=Ao(e),Rp(e,t,n)}function Ge(e,t){return Go(e,t)}var Np="[object Number]";function Vp(e){return typeof e=="number"||ot(e)&&Nt(e)==Np}function pt(e){return e==null}function Pp(e){return e===void 0}var bs=ma(function(e,t,n){qo(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 Ko(e,t,n){var o=!0,s=!0;if(typeof e!="function")throw new TypeError(Fp);return _e(n)&&(o="leading"in n?!!n.leading:o,s="trailing"in n?!!n.trailing:s),Zo(e,t,{leading:o,maxWait:t,trailing:s})}var Hp=1/0,Wp=hn&&1/ms(new hn([,-0]))[1]==Hp?function(e){return new hn(e)}:ru,$p=200;function Xp(e,t,n){var o=-1,s=wu,l=e.length,a=!0,r=[],c=r;if(l>=$p){var d=t?null:Wp(e);if(d)return ms(d);a=!1,s=qa,c=new Wn}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 Up(e,t){return e&&e.length?Xp(e,Cp(t)):[]}const Yp=()=>{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=$e(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 k;for(let I=0;I<b.length;I++)k=+b[I],isNaN(k)||y.push({posX:m==="value"?$e(k,e.max-e.min):k,label:p[k],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=Nn(p,g),l.rightValue=Nn(m,g)):(p=e.min,m=typeof f=="number"&&!isNaN(f)?f:e.min,l.leftValue=Nn(p,g),l.rightValue=Nn(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)=>{Vp(f)&&f>=0&&!Ge(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}},jp=e=>{const{props:t}=i.getCurrentInstance(),{state:n,slider:o}=e,s="transparent",l=i.computed(()=>({left:o.valueRange>0?`${$e(n.leftValue-t.min,o.valueRange)}%`:0})),a=i.computed(()=>({left:o.valueRange>0?`${$e(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?$e(+(f-t.min).toFixed(2),o.valueRange):0,x=p>0?$e(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:`${$e(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=$e(+(f-t.min).toFixed(2),o.valueRange),p=$e(+(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}},Gp=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)}}},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,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()})},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:u,leftThumbStyle:f,rightThumbStyle:g}=jp({state:t,slider:n}),{startDrag:p,clickSlider:m,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:u,leftThumbStyle:f,rightThumbStyle:g,sliderLine:s,...i.toRefs(t),...i.toRefs(n),formatValue:o,startDrag:p,clickSlider:m,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 $n=re(qp,[["render",iy]]);$n.install=e=>{e.component($n.name,$n)};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 un=re(sy,[["render",ly]]);un.install=e=>{e.component(un.name,un)};const Ss=6,Cs=7,ws=4,ks=3,Ms=5,Es=4,Xe=12,ay=24,ry=60,cy=60,lt=12,sr=4,Is=20,vs={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:["일","월","화","수","목","금","토"]},Ze={DATE:"date",MONTH:"month",YEAR:"year"},Jo=864e5,Qo=+new Date("1970-01-01 00:00:00"),lr=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),ar=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)),uy=(e,t)=>new Date(`${e}-${t}-1`).getDay(),Ts=(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},Xn=({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},rr=(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},Un=(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(Un(e,t,"hour")),o=Te(Un(e,t,"min")),s=Te(Un(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${o}:${s}`},ei=(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()},mn=e=>new Date(`${e}`).getTime(),cr=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}},fy=()=>{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&&lr.exec((x=e.modelValue)==null?void 0:x.toString())||e.modelValue.length===19&&ar.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&&lr.exec(y)||y.length===19&&ar.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)?mn(`${e.modelValue[0]} 00:00:00`)>mn(`${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)?mn(e.modelValue[0])>mn(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")/lt)+1||1,min:Math.floor(Be(a,"min")/lt)+1||1,sec:Math.floor(Be(a,"sec")/lt)+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")/lt)+1||1,r.min=Math.floor(Be(y,"min")/lt)+1||1,r.sec=Math.floor(Be(y,"sec")/lt)+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(()=>cr(c.main.year)),expanded:i.computed(()=>cr(c.expanded.year))}),h=i.computed(()=>vs[e.monthNotation][c.main.month-1]),u=i.computed(()=>vs[e.monthNotation][c.expanded.month-1]),f=i.reactive({main:h,expanded:u}),g=i.computed(()=>dy[e.dayOfTheWeekNotation]),p=i.reactive({main:Ze.DATE,expanded:Ze.DATE});return i.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:o,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:g,selectedListType:p}},my=e=>{const{props:t}=i.getCurrentInstance(),{selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:s}=e,l=i.reactive({main:fn(Ms,Es),expanded:fn(Ms,Es)}),a=i.reactive({main:fn(ws,ks),expanded:fn(ws,ks)}),r=i.reactive({main:fn(Ss,Cs),expanded:fn(Ss,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=Xn({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),k=(Xe+m.month-1)%Xe||Xe,I=(m.month+1)%Xe||Xe,E=m.month===1?m.year-1:m.year,B=m.month===12?m.year+1:m.year,V=uy(m.year,m.month),S=Ts(m.month===1?m.year-1:m.year,(Xe+m.month-1)%Xe||Xe),C=Ts(m.year,m.month);let M="";t.mode.includes("Time")&&(t.mode==="dateTime"?M=n.value:M=p==="main"?n.value[0]:n.value[1]);let w=0,T=0,D=0,L=0,O="";const v=(N,R,P)=>{var U,j,q;O=Xn({year:T,month:D,date:L});const _=(M==null?void 0:M.split(" ")[1])??"",z=b&&!x&&ei(t.mode,p,O,n.value)||+new Date(`${O} ${_}`)<Qo,W=x&&x(new Date(`${O} ${_}`))||z,A=+(p!=="main"),F=b&&n.value.length>A&&((j=(U=n.value)==null?void 0:U[A])==null?void 0:j.includes(O)),H=!W&&(b?F:(q=n.value)==null?void 0:q.includes(O));r[p][R][P]={monthType:`${N}${W?" disabled":""}`,isToday:y===O,isSelected:H,year:T,month:D,date:L}};for(let N=0;N<Ss;N++)for(let R=0;R<Cs;R++)N===0?V!==0?R<V?(T=E,D=k,L=S-V+1+R,v("prev",N,R)):(w++,T=m.year,D=m.month,L=w,v("",N,R)):(T=E,D=k,L=S-6+R,v("prev",N,R)):C<=w?(w++,T=B,D=I,L=w-C,v("next",N,R)):(w++,T=m.year,D=m.month,L=w,v("",N,R))},setCalendarMonth:p=>{let m=0;const x=new Date().getFullYear(),b=new Date().getMonth()+1,{year:y,month:k}=o[p];for(let I=0;I<ws;I++)for(let E=0;E<ks;E++)a[p][I][E]={label:vs.abbrName[m++],value:m,today:y===x&&m===b,isSelected:m===k}},setCalendarYear:p=>{let m=s[p].start;const x=new Date().getFullYear(),b=new Date(Qo).getFullYear();for(let y=0;y<Ms;y++)for(let k=0;k<Es;k++)l[p][y][k]={label:m,value:m,today:m===x,isSelected:m===o[p].year,disabled:m<b},m++},setHmsTime:()=>{var V,S;const p=(V=t.options)==null?void 0:V.timeFormat,m=(S=t.options)==null?void 0:S.disabledDate,x=Array.isArray(p)?p[0]:p,b=Array.isArray(p)?p[1]:"",y=t.mode==="dateTimeRange"?n.value[0]:n.value,k=t.mode==="dateTimeRange"?n.value[1]:"",I=Array.isArray(m)?m[0]:m,E=Array.isArray(m)?m[1]:m,B=(C,M,w)=>{const T=C==="main"?y:k,D=C==="main"?I:E;if(!T)return!1;const L=T.split(" ")[0];let O=Be(T,"hour"),v=Be(T,"min"),N=Be(T,"sec");M==="hour"?O=w:M==="min"?v=w:M==="sec"&&(N=w);const R=`${L} ${Te(O)}:${Te(v)}:${Te(N)}`;return D&&D(new Date(R))?!0:!D&&ei(t.mode,C,R,n.value)};["hour","min","sec"].forEach(C=>{let M=cy;C==="hour"?M=ay:C==="min"&&(M=ry);const w=y&&y.length>0?Un(x,y,C):-1,T=k&&k.length>0?Un(b,k,C):-1;for(let D=0;D<M;D++){let L=t.mode==="dateTimeRange"&&B("main",C,D);c.main[C][D]={timeType:C,num:D,isSelected:!L&&w===D,isDisabled:L},t.mode==="dateTimeRange"&&(L=B("expanded",C,D),c.expanded[C][D]={timeType:C,num:D,isSelected:!L&&T===D,isDisabled:L})}})},getTimeInfo:(p,m,x,b)=>{const y=o[b],k=c[b],I=y[p]-1,E=m-1,B=x-1,V=I*lt+E*sr+B;return k[p][V]}}},gy=e=>{var O;const{props:t,emit:n}=i.getCurrentInstance(),o=(O=t.options)==null?void 0:O.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 R=l[v],{year:P,month:_,hour:z,min:W,sec:A}=N;P&&(R.year=P),_&&(R.month=_),z&&(R.hour=z),W&&(R.min=W),A&&(R.sec=A)},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")/lt)+1,min:Math.floor(Be(N,"min")/lt)+1,sec:Math.floor(Be(N,"sec")/lt)+1}),r(P)})},k=(v,N)=>{const R=u[v]===Ze.MONTH?1:20,P=N==="prev"?-R:R,_=new Date(Qo).getFullYear(),z=l[v].year+P;l[v].year=z<_?_:z},I=(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},E=(v,N)=>{switch(u[v]){case Ze.DATE:{I(v,N),r(v);break}case Ze.MONTH:k(v,N),c(v);break;case Ze.YEAR:k(v,N),d(v);break}},B=(v,N)=>{N===Ze.DATE?r(v):N===Ze.MONTH?c(v):N===Ze.YEAR&&d(v),u[v]=N},V=(v,N)=>{const{value:R}=N;N.disabled||(u[v]===Ze.YEAR?(l[v].year=R,u[v]=Ze.MONTH,c(v)):(l[v].month=R,u[v]=Ze.DATE,r(v)))},S=(v,N)=>{var K,te,G,Q;const{year:R,month:P,date:_,monthType:z}=N,W=Xn({year:R,month:P,date:_}),A=t.modelValue?(Array.isArray(t.modelValue)?((K=t.modelValue)==null?void 0:K.map(J=>J==null?void 0:J.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(W):!1;let F=t.options.disabledDate;if(F&&Array.isArray(F)&&(F=v==="main"?F[0]:F[1]),F&&F(new Date(W))&&!A)return;if(!F&&["dateRange","dateTimeRange"].includes(t.mode)&&ei(t.mode,v,W,s.value))return;const H=l[v],U=(Xe+H.month-1)%Xe||Xe,j=H.month===1?H.year-1:H.year,q=(H.month+1)%Xe||Xe,Z=H.month===12?H.year+1:H.year,ee=()=>{z.includes("prev")?(H.year=j,H.month=U):z.includes("next")&&(H.year=Z,H.month=q)};switch(t.mode){case"date":n("update:modelValue",W);break;case"dateTime":{const le=!!((te=s.value)!=null&&te.split(" ")[1])?(G=s.value)==null?void 0:G.split(" ")[1]:"00:00:00",he=we(o,`${W} ${le}`);n("update:modelValue",he);break}case"dateMulti":{const J=t.options.multiType,le=t.options.multiDayLimit;if(J==="date"){const he=s.value.indexOf(W);he>-1?(s.value.splice(he,1),n("update:modelValue",[...s.value])):s.value.length<le&&(s.value.push(W),ee(),n("update:modelValue",[...s.value]))}else if(J==="week"||J==="weekday"){const he=J==="week"?7:5,ae=J==="week"?6:5,fe=new Date(`${W} 00:00:00`),Me=fe.getDay(),rt=ae-Me,ct=fe.getTime()+Jo*rt;for(let xt=0;xt<he;xt++){const fo=new Date(ct-xt*Jo).getFullYear(),mo=new Date(ct-xt*Jo).getMonth()+1,go=new Date(ct-xt*Jo).getDate(),qt=`${fo}-${Te(mo)}-${Te(go)}`;if(xt===0)if(s.value.includes(qt)){s.value.splice(0);break}else s.value.splice(0),ee();(!F||!F(new Date(qt)))&&s.value.unshift(qt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let J=[...s.value];if(!s.value.length)J=[W,W];else{const le=+(v==="expanded");J[le]=W}n("update:modelValue",J);break}case"dateTimeRange":{let J=[...s.value];if(J.length){const le=+(v==="expanded"),he=((Q=J[le])==null?void 0:Q.split(" ")[1])||"00:00:00";let ae=`${W} ${he}`;o&&o.length&&(ae=we(o[le],ae)),J[le]=ae}else{let le=`${W} 00:00:00`,he=`${W} 00:00:00`;o&&o.length&&(le=we(o[0],le),he=we(o[1],he)),J=[le,he]}n("update:modelValue",J);break}}},C=(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--)},M=(v,N,R,P)=>{var te;if(x[v][N])return;const _=l[v],z=a[v],W=_[N]-1,A=R-1,F=P-1,H=W*lt+A*sr+F;if((te=z[N][H])!=null&&te.isDisabled)return;const U=new Date,j={year:U.getFullYear(),month:U.getMonth()+1,date:U.getDate()};let q=!0,Z=[];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)}`),`${Xn(j)} ${G}`},K=G=>{let ae=11;return N==="min"?ae=14:N==="sec"&&(ae=17),`${G==null?void 0:G.substr(0,ae)}${Te(H)}${G==null?void 0:G.substr(ae+2)}`};if(t.mode==="dateTime"){let G;t.modelValue?G=we(o,K(t.modelValue)):(q=!1,G=we(o,ee())),n("update:modelValue",G),Z.push(G)}else{const G=v!=="main"|0;let Q=[...s.value];if(t.modelValue.length){let J=K(t.modelValue[G]);o&&o.length&&(J=we(o[G],J)),Q[G]=J}else{const J=ee();Q=[J,J],o&&o.length&&(Q=[...Q.map((le,he)=>we(o[he],le))]),q=!1,Z=Q}n("update:modelValue",Q)}h(),q||y(Z)},w=(v,N)=>{E(v,N.deltaY>0?"next":"prev")},T=(v,N,R)=>{x[v][N]||C(v,N,R.deltaY>0?"down":"up")},D=Ko((v,N)=>{const R=N.target.tagName==="TD"?N.target:N.target.parentElement,P=R.classList.contains("disabled"),_=R.classList.contains("prev"),z=R.classList.contains("next");if(R.classList.length>0&&!P){const W=l[v];let A={year:+W.year,month:+W.month,date:N.target.innerText};_?A={...A,...rr("prev",A.year,A.month)}:z&&(A={...A,...rr("next",A.year,A.month)});const F=f.value,H=Xn({year:A.year,month:A.month,date:A.date});mn(H)<mn(F)?(s.value[0]=H,s.value[1]=F):(s.value[0]=F,s.value[1]=H),r("main"),r("expanded")}},10),L=v=>{const N=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),R=t.options.disabledDate;if(N){const[P,_]=s.value;let[z,W]=[R,R];if(R&&Array.isArray(R)&&([z,W]=R),v[0]&&v[0]!==P&&z&&z(new Date(v[0])))return!0;if(v[1]&&v[1]!==_&&W&&W(new Date(v[1])))return!0;if(!R&&ei(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(L(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:B,clickPrevNextBtn:E,clickDate:S,clickYearMonth:V,clickHmsBtn:C,clickTime:M,wheelMonth:w,wheelTime:T,calendarEventName:g,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}=fy(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:g,setCalendarYear:p,setHmsTime:m,getTimeInfo:x}=my({selectedValue:n,calendarPageInfo:o,calendarYearRangeInfo:a}),{clickPrevNextBtn:b,clickYearMonthBtn:y,clickDate:k,clickYearMonth:I,clickHmsBtn:E,clickTime:B,wheelMonth:V,wheelTime:S,calendarEventName:C,onMousemoveDate:M,preventTimeEventType:w}=gy({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:k,clickYearMonth:I,clickHmsBtn:E,clickTime:B,wheelMonth:V,wheelTime:S,calendarEventName:C,onMousemoveDate:M,preventTimeEventType:w}}},yy={class:"ev-calendar-wrapper"},xy={class:"ev-calendar-date-area"},by={class:"ev-calendar-header"},Sy=["onClick"],Cy={class:"ev-calendar-year-month-wrapper"},wy={key:0,class:"ev-calendar-year-range"},ky=["onClick"],My=["onClick"],Ey=["onClick"],Iy={class:"ev-calendar-body"},vy=["onWheel"],Ty=["onClick"],By=["onWheel"],Dy=["onClick"],Ly={key:2,class:"ev-calendar-selector-btn-wrapper"},Oy={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,Sy),i.createElementVNode("div",Cy,[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,Ey)]),i.createElementVNode("div",Iy,[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",Ly,[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",Oy,[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:u=>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 Yn=re(py,[["render",Fy]]);Yn.install=e=>{e.component(Yn.name,Yn)};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 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&&Hy.exec(y)),m=y=>!!(y.length===19&&Wy.exec(y)),x=y=>{const k=y.split(" ")[0],I=+k.split("-")[0],E=+k.split("-")[1],B=+k.split("-")[2],V=Ts(I,E);return+B<=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]}}}},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 k,I;await i.nextTick();const h=(k=o.value)==null?void 0:k.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}},Uy=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,[k,I]=n.value;let E;t.mode==="dateTimeRange"&&(y!=null&&y.length)?E=l.find(({shortcutDate:B})=>{const[V,S]=B(),[C,M]=y,w=we(C,h(V)),T=we(M,h(S)),D=w===h(k),L=T===h(I);return D&&L}):E=l.find(({shortcutDate:B})=>{const[V,S]=B(),C=t.mode==="dateTimeRange"?h:d,M=C(V)===C(k),w=C(S)===C(I);return M&&w}),m=E==null?void 0:E.key}else{const y=t.mode==="dateTime"?h:d,k=y(n.value),I=l.find(({shortcutDate:E})=>y(E())===k);m=I==null?void 0:I.key}m&&r(m)},f=p=>{var k;const m=["dateRange","dateTimeRange"].includes(t.mode),x=l.find(({key:I})=>I===p);if(!x)return;const b=x.shortcutDate,y=(k=t.options)==null?void 0:k.timeFormat;if(m){const[I,E]=b();if(t.mode==="dateTimeRange")if(y!=null&&y.length){const[B,V]=y;n.value=[we(B,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}},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:u,dropboxPosition:f,clickSelectInput:g,clickOutsideDropbox:p,changeDropboxPosition:m}=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:u,dropboxPosition:f,clickSelectInput:g,clickOutsideDropbox:p,changeDropboxPosition:m,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,u)=>(i.openBlock(),i.createElementBlock("div",{key:`${h}_${u}`,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(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,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: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",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 jn=re(Yy,[["render",sx]]);jn.install=e=>{e.component(jn.name,jn)};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=re(lx,[["render",dx]]),ux=i.defineComponent(hx),dr="ev-message-modal",hr=document.createElement("div");hr.id=dr;const ti=(e={})=>{document.getElementById(dr)||document.body.appendChild(hr);const n=document.createElement("div"),o=()=>i.render(null,n),s=typeof e=="string"?{message:e,unmount:o}:{...e,unmount:o},l=i.h(ux,s);return i.render(l,n),l.component.exposed};ti.install=e=>{const t=e.config.globalProperties;t.$message=ti};const fx={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 Sx=re(fx,[["render",bx]]),Cx=i.defineComponent(Sx),ur="ev-notification-modal",ni=document.createElement("div");ni.id=ur;const wx=["top-left","top-right","bottom-left","bottom-right"],oi=(e={})=>{const t=e.position||"top-right";if(!wx.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(ur)||document.body.appendChild(ni);let o=ni.getElementsByClassName(`modal-${t}`);o.length?o=o[0]:(o=document.createElement("div"),o.classList.add(`modal-${t}`),ni.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(Cx,r);i.render(c,l),o.appendChild(c.el)};oi.install=e=>{const t=e.config.globalProperties;t.$notify=oi};const kx={name:"EvMessageBox",components:{EvButton:ln},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"},Ex={class:"ev-message-box-content"},Ix={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",Ex,[n.title?(i.openBlock(),i.createElementBlock("p",Ix,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 Lx=re(kx,[["render",Dx]]),Ox=i.defineComponent(Lx),ii=(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(Ox,o);i.render(s,t)};ii.install=e=>{const t=e.config.globalProperties;t.$messagebox=ii};const fr=(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?fr(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=[...fr(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,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]}}},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 Gn=re(Vx,[["render",Fx]]);Gn.install=e=>{e.component(Gn.name,Gn)};const Hx=()=>{const e=i.defineComponent(mr),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 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)}}},$x=()=>{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 w,T,D;const g=document.documentElement.clientWidth,p=document.documentElement.clientHeight,m=20,x=(w=f.target.parentElement)==null?void 0:w.getBoundingClientRect(),{x:b,y,width:k,height:I}=x,E=(D=(T=a.value)==null?void 0:T.$el)==null?void 0:D.children[0].getBoundingClientRect(),{width:B,height:V}=E,S=f.target.offsetTop,C=p<y+S+V,M=g<b+k+B+m;C?r.top=`${I-V}px`:r.top=`${S}px`,M?r.left=`${0-B}px`:r.left=`${k}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}},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 mr=re(Xx,[["render",qx]]),Kx={name:"EvContextMenu",directives:{clickoutside:No},components:{MenuList:mr},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 Zn=re(Kx,[["render",Jx]]);Zn.install=e=>{e.component(Zn.name,Zn)};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 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 k=x==="horizontal"?window.innerWidth:window.innerHeight;b=Math.floor(k*+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 k=Qx();b.style.paddingRight=`${k}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}},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({}),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=(w,T)=>{if(w==null||T==null)return!1;const D=o.value.getBoundingClientRect(),L=+w-D.left,O=+T-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,z=_+s.value.offsetHeight;return L>R&&L<P&&O>_&&O<z},x=w=>{if(w===null||typeof w!="object")return;let T,D,L,O,v,N;const R=o.value,P=Object.prototype.hasOwnProperty;P.call(w,"top")?T=w.top:T=u.top,P.call(w,"left")?D=w.left:D=u.left,P.call(w,"width")?L=w.width:L=R.offsetWidth,P.call(w,"height")?O=w.height:O=R.offsetHeight,P.call(w,"minWidth")?v=w.minWidth:v=t.minWidth,P.call(w,"minHeight")?N=w.minHeight:N=t.minHeight,L=r(L,"horizontal")>r(v,"horizontal")?L:v,O=r(O,"vertical")>r(N,"vertical")?O:N,h.top=a(T),h.left=a(D),h.width=a(L),h.height=a(O),h.minWidth=a(v),h.minHeight=a(N)},b=w=>{if(!(!o.value||u.pressedSpot))if(t.resizable){const T=o.value.getBoundingClientRect(),D=w.clientX-T.left,L=w.clientY-T.top,O=L<d,v=D<d,N=D>=T.width-d,R=L>=T.height-d;O&&v||R&&N?o.value.style.cursor="nwse-resize":O&&N||R&&v?o.value.style.cursor="nesw-resize":N||v?o.value.style.cursor="ew-resize":R||O?o.value.style.cursor="ns-resize":t.draggable&&m(w.clientX,w.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"}else t.draggable&&m(w.clientX,w.clientY)?o.value.style.cursor="move":o.value.style.cursor="default"},y=w=>{const T=window.innerWidth,D=window.innerHeight,L=g.top,O=g.left,v=g.right,N=g.bottom,R=r(t.minWidth,"horizontal"),P=r(t.minHeight,"vertical"),_=w.clientX>=T?T:w.clientX;let z=w.clientY>=D?D:w.clientY;z=w.clientY>0?z:0;const W=_-u.clientX,A=z-u.clientY;let F=u.top,H=u.left,U=u.width,j=u.height;const q=F+u.height-P,Z=H+u.width-R;L&&(F=u.top+A,j=u.height-A,F>q&&(F=q)),O&&(H=u.left+W,U=u.width-W,H>Z&&(H=Z)),v&&(U=u.width+W),N&&(j=u.height+A),U=Math.min(Math.max(U,R),T),j=Math.min(Math.max(j,P),D);const ee={top:F,left:H,width:U,height:j};x(ee),n("resize",w,{...ee})},k=(w,T)=>{let D=T;return D<0?D=0:D>w-c&&(D=Math.floor(w-c)),D},I=(w,T)=>{let D=T;return D<-(u.width-c)?D=-Math.floor(u.width-c):D>w-c&&(D=Math.floor(w-c)),D},E=w=>{if(w.preventDefault(),u.state="mousedown-mousemove",t.draggable&&u.pressedSpot==="header"){const T=document.documentElement.clientWidth,D=document.documentElement.clientHeight,L=w.clientY-u.clientY,O=w.clientX-u.clientX;let v=u.top+L,N=u.left+O;v=k(D,v),N=I(T,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(w);n("mousedown-mousemove",w)},B=w=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",w),window.removeEventListener("mousemove",E),window.removeEventListener("mouseup",B)},V=w=>{if(!o.value||!t.resizable&&!t.draggable)return;let T="";if(t.resizable){const D=o.value.getBoundingClientRect(),L=w.clientX-D.left,O=w.clientY-D.top,v=O<d,N=L<d,R=L>=D.width-d,P=O>=D.height-d;g.top=v,g.left=N,g.right=R,g.bottom=P,(v||N||R||P)&&(T="border")}if(T!=="border"&&m(w.clientX,w.clientY)&&(T="header"),!T||!t.draggable&&T==="header"||!t.resizable&&T==="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=w.clientX,u.clientY=w.clientY,n("mousedown",{...u,ref:o.value});return}u.state="mousedown",u.pressedSpot=T,u.top=o.value.offsetTop,u.left=o.value.offsetLeft,u.width=o.value.offsetWidth,u.height=o.value.offsetHeight,u.clientX=w.clientX,u.clientY=w.clientY,n("mousedown",{...u,ref:o.value}),window.addEventListener("mousemove",E),window.addEventListener("mouseup",B)},S=w=>{!t.draggable&&!t.resizable||b(w)},C=()=>{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})})},M=()=>{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(w=>{delete h[w]})};return i.watch(()=>t.visible,w=>{w||M()}),{dragStyle:h,startDrag:V,moveMouse:S,clickExpandBtn:C}},wt=(()=>{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}}})(),kt=(()=>{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)},Bs=()=>{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(wt.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=()=>wt.add({sequence:o,closeWin:e,elem:t.value,escClose:n.escClose}),a=x=>{wt.remove(x)},r=x=>{if(wt.isEmpty())return;const{code:b}=x;if(b!=="Escape")return;const y=Bs(),k=y[y.length-1];k.escClose&&k.closeWin()},c=()=>{o=l(),t.value.dataset.sequence=o,wt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const x=wt.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=()=>{wt.windows.length===1&&kt.resetToLower();const x=kt.getNext();h({elem:t.value,zIndex:x})},f=x=>String(x.sequence)===t.value.dataset.sequence,g=()=>{const x=Bs();if(wt.windows.length>kt.getAllocableCount()){const y=x.reverse();let k=0;y.forEach(E=>{if(f(E))return;const B=kt.getPrevFrom(k++);h({elem:E.elem,zIndex:B})});const I=kt.getNextOverLimit();h({elem:t.value,zIndex:I})}else{kt.resetToLower(),x.forEach(k=>{if(f(k))return;const I=kt.getNext();h({elem:k.elem,zIndex:I})});const y=kt.getNext();h({elem:t.value,zIndex:y})}},p=()=>{kt.isUpperLimitClose()?g():u()},m=()=>{if(!t.value||!n.focusable)return;const x=Bs(),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=wt.getWindowBySequence(o);b&&(b.escClose=x)}),{setFocus:m}},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:u}=tb({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=ob({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}}},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 qn=re(ib,[["render",hb]]);qn.install=e=>{e.component(qn.name,qn)};const ub={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)}}},fb={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",fb,[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 Kn=re(ub,[["render",gb]]);Kn.install=e=>{e.component(Kn.name,Kn)};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 Sb(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 Jn=re(pb,[["render",Sb]]);Jn.install=e=>{e.component(Jn.name,Jn)};const Cb={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 gr=re(Cb,[["render",kb]]),Mb={name:"EvMenu",components:{MenuItem:gr},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:gr}}},Eb={class:"ev-menu"};function Ib(e,t,n,o,s,l){const a=i.resolveComponent("menu-item");return i.openBlock(),i.createElementBlock("ul",Eb,[(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 Qn=re(Mb,[["render",Ib]]);Qn.install=e=>{e.component(Qn.name,Qn)};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 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)}}}},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 pr=re(vb,[["render",Db]]),Lb={name:"EvTree",components:{TreeNode:pr},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=pr;function r(S){const C=o[S].parent;if(typeof C>"u")return;const M=o[S].node,w=o[C].node;if(!(M.checked===w.checked&&M.indeterminate===w.indeterminate)){if(M.checked)w.checked=w.children.every(T=>T.checked),w.indeterminate=!w.checked;else{const T=D=>D.checked||M.indeterminate;w.checked=!1,w.indeterminate=w.children.some(T)}r(C)}}function c(S,C={}){const M=Object.keys(C);for(let w=0;w<M.length;w++)S[M[w]]=C[M[w]];S.children&&S.children.forEach(w=>{c(w,C)})}function d(){let S=0;const C=[],M=[];function w(T,D){const L=T;L.nodeKey=S++,Object.hasOwnProperty.call(L,"selected")||(L.selected=!1),Object.hasOwnProperty.call(L,"visible")||(L.visible=!0),"value"in L&&M.includes(L.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),L.value+=L.nodeKey):"value"in L||(L.value=L.title+L.nodeKey),M.push(L.value),C[L.nodeKey]={node:L,nodeKey:L.nodeKey},typeof D<"u"&&(C[L.nodeKey].parent=D.nodeKey,C[D.nodeKey].children.push(L.nodeKey)),L.children&&(C[L.nodeKey].children=[],L.children.forEach(O=>w(O,L)))}return n.value.length&&w(n.value[0]),C}o=d();function h(){return o.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(C=>{c(C,{checked:!0});const M=o[C.nodeKey].parent;if(!M&&M!==0)return;const w=o[M].node;typeof C.checked<"u"&&C.checked&&w.checked!==C.checked&&r(C.nodeKey)})}function f({nodeKey:S,isChecked:C}){const M=o[S].node;M.checked=C,M.indeterminate=!1,r(S),c(M,{checked:C,indeterminate:!1});const w=h();t("check",w),u()}function g(S){const C=o[S].node;for(let M=0;M<o.length;M++)o[M].node.nodeKey!==S&&(o[M].node.selected=!1);t("click-node",{title:C.title,value:C.value})}function p(S){const C=o[S].node;t("dblclick-node",{title:C.title,value:C.value})}const m=S=>{e.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},x=(S,C)=>{l=S,m(C)},b=(S,C)=>S.toLowerCase().includes(C.toLowerCase()),y=S=>{var C;if(S.children){const M=!!((C=S.children.filter(w=>b(w.title,e.searchWord)))!=null&&C.length);S.children.forEach(w=>{y(w),w.visible=M&&b(w.title,e.searchWord)||!M})}};function k(S){S.children&&S.children.forEach(C=>{C.visible=!1,k(C)})}function I(S){if(!S&&S!==0)return;const C=o[S];C.node.visible=!0,C.parent!==void 0&&I(C.parent)}function E(S){o.forEach(M=>{const w=M.node;w.visible=!1}),o.filter(M=>b(M.node.title,S)).forEach(M=>{const w=M.node;w.visible=!0,e.searchIncludeChildren?y(w):k(w);const T=o[w.nodeKey].parent;I(T)})}const B=i.computed(()=>!n.value.length||n.value.every(S=>!S.visible));i.watch(()=>e.data,S=>{n.value=S,o=d()},{deep:!0});let V;return i.watch(()=>e.searchWord,S=>{V&&clearTimeout(V),V=setTimeout(()=>{S?E(S):o.forEach(C=>{const M=C.node;M.visible=!0})},200)}),i.onMounted(()=>{u();const S=h();S.length&&t("check",S)}),i.onBeforeUnmount(()=>{V&&clearTimeout(V)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:B,updateCheckedInfo:f,clickContent:g,dblClickContent:p,showContextMenu:m,getContextMenuFlag:x}}},Ob={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",Ob,[(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 eo=re(Lb,[["render",Nb]]);eo.install=e=>{e.component(eo.name,eo)};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:E=>{if(e.type==="range"){if(Array.isArray(E)){const B=E[0]>E[1]?"00:00":E[0],V=B.value>E[1]?"23:59":E[1];t("update:modelValue",[B,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}}},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 to=re(Vb,[["render",Wb]]);to.install=e=>{e.component(to.name,to)};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=re($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 yr=re(jb,[["render",Zb],["__scopeId","data-v-2e265290"]]);var qb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ds=Math.ceil,qe=Math.floor,We="[BigNumber Error] ",xr=We+"Number primitive has more than 15 significant digits: ",at=1e14,ce=14,Ls=9007199254740991,Os=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Vt=1e7,De=1e9;function br(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(S,C){var M,w,T,D,L,O,v,N,R=this;if(!(R instanceof y))return new y(S,C);if(C==null){if(S&&S._isBigNumber===!0){R.s=S.s,!S.c||S.e>u?R.c=R.e=null:S.e<h?R.c=[R.e=0]:(R.e=S.e,R.c=S.c.slice());return}if((O=typeof S=="number")&&S*0==0){if(R.s=1/S<0?(S=-S,-1):1,S===~~S){for(D=0,L=S;L>=10;L/=10,D++);D>u?R.c=R.e=null:(R.e=D,R.c=[S]);return}N=String(S)}else{if(!qb.test(N=String(S)))return o(R,N,O);R.s=N.charCodeAt(0)==45?(N=N.slice(1),-1):1}(D=N.indexOf("."))>-1&&(N=N.replace(".","")),(L=N.search(/e/i))>0?(D<0&&(D=L),D+=+N.slice(L+1),N=N.substring(0,L)):D<0&&(D=N.length)}else{if(be(C,2,x.length,"Base"),C==10&&b)return R=new y(S),B(R,a+R.e+1,r);if(N=String(S),O=typeof S=="number"){if(S*0!=0)return o(R,N,O,C);if(R.s=1/S<0?(N=N.slice(1),-1):1,y.DEBUG&&N.replace(/^0\.0*|\./,"").length>15)throw Error(xr+S)}else R.s=N.charCodeAt(0)===45?(N=N.slice(1),-1):1;for(M=x.slice(0,C),D=L=0,v=N.length;L<v;L++)if(M.indexOf(w=N.charAt(L))<0){if(w=="."){if(L>D){D=v;continue}}else if(!T&&(N==N.toUpperCase()&&(N=N.toLowerCase())||N==N.toLowerCase()&&(N=N.toUpperCase()))){T=!0,L=-1,D=0;continue}return o(R,String(S),O,C)}O=!1,N=n(N,C,10,R.s),(D=N.indexOf("."))>-1?N=N.replace(".",""):D=N.length}for(L=0;N.charCodeAt(L)===48;L++);for(v=N.length;N.charCodeAt(--v)===48;);if(N=N.slice(L,++v)){if(v-=L,O&&y.DEBUG&&v>15&&(S>Ls||S!==qe(S)))throw Error(xr+R.s*S);if((D=D-L-1)>u)R.c=R.e=null;else if(D<h)R.c=[R.e=0];else{if(R.e=D,R.c=[],L=(D+1)%ce,D<0&&(L+=ce),L<v){for(L&&R.c.push(+N.slice(0,L)),v-=ce;L<v;)R.c.push(+N.slice(L,L+=ce));L=ce-(N=N.slice(L)).length}else L-=v;for(;L--;N+="0");R.c.push(+N)}}else R.c=[R.e=0]}y.clone=br,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(S){var C,M;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(C="DECIMAL_PLACES")&&(M=S[C],be(M,0,De,C),a=M),S.hasOwnProperty(C="ROUNDING_MODE")&&(M=S[C],be(M,0,8,C),r=M),S.hasOwnProperty(C="EXPONENTIAL_AT")&&(M=S[C],M&&M.pop?(be(M[0],-De,0,C),be(M[1],0,De,C),c=M[0],d=M[1]):(be(M,-De,De,C),c=-(d=M<0?-M:M))),S.hasOwnProperty(C="RANGE"))if(M=S[C],M&&M.pop)be(M[0],-De,-1,C),be(M[1],1,De,C),h=M[0],u=M[1];else if(be(M,-De,De,C),M)h=-(u=M<0?-M:M);else throw Error(We+C+" cannot be zero: "+M);if(S.hasOwnProperty(C="CRYPTO"))if(M=S[C],M===!!M)if(M)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=M;else throw f=!M,Error(We+"crypto unavailable");else f=M;else throw Error(We+C+" not true or false: "+M);if(S.hasOwnProperty(C="MODULO_MODE")&&(M=S[C],be(M,0,9,C),g=M),S.hasOwnProperty(C="POW_PRECISION")&&(M=S[C],be(M,0,De,C),p=M),S.hasOwnProperty(C="FORMAT"))if(M=S[C],typeof M=="object")m=M;else throw Error(We+C+" not an object: "+M);if(S.hasOwnProperty(C="ALPHABET"))if(M=S[C],typeof M=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(M))b=M.slice(0,10)=="0123456789",x=M;else throw Error(We+C+" invalid: "+M)}else throw Error(We+"Object expected: "+S);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(S){if(!S||S._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var C,M,w=S.c,T=S.e,D=S.s;e:if({}.toString.call(w)=="[object Array]"){if((D===1||D===-1)&&T>=-De&&T<=De&&T===qe(T)){if(w[0]===0){if(T===0&&w.length===1)return!0;break e}if(C=(T+1)%ce,C<1&&(C+=ce),String(w[0]).length==C){for(C=0;C<w.length;C++)if(M=w[C],M<0||M>=at||M!==qe(M))break e;if(M!==0)return!0}}}else if(w===null&&T===null&&(D===null||D===1||D===-1))return!0;throw Error(We+"Invalid BigNumber: "+S)},y.maximum=y.max=function(){return I(arguments,-1)},y.minimum=y.min=function(){return I(arguments,1)},y.random=function(){var S=9007199254740992,C=Math.random()*S&2097151?function(){return qe(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(M){var w,T,D,L,O,v=0,N=[],R=new y(l);if(M==null?M=a:be(M,0,De),L=Ds(M/ce),f)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(L*=2));v<L;)O=w[v]*131072+(w[v+1]>>>11),O>=9e15?(T=crypto.getRandomValues(new Uint32Array(2)),w[v]=T[0],w[v+1]=T[1]):(N.push(O%1e14),v+=2);v=L/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(L*=7);v<L;)O=(w[v]&31)*281474976710656+w[v+1]*1099511627776+w[v+2]*4294967296+w[v+3]*16777216+(w[v+4]<<16)+(w[v+5]<<8)+w[v+6],O>=9e15?crypto.randomBytes(7).copy(w,v):(N.push(O%1e14),v+=7);v=L/7}else throw f=!1,Error(We+"crypto unavailable");if(!f)for(;v<L;)O=C(),O<9e15&&(N[v++]=O%1e14);for(L=N[--v],M%=ce,L&&M&&(O=Os[ce-M],N[v]=qe(L/O)*O);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,O=N[0];O>=10;O/=10,v++);v<ce&&(D-=ce-v)}return R.e=D,R.c=N,R}}(),y.sum=function(){for(var S=1,C=arguments,M=new y(C[0]);S<C.length;)M=M.plus(C[S++]);return M},n=function(){var S="0123456789";function C(M,w,T,D){for(var L,O=[0],v,N=0,R=M.length;N<R;){for(v=O.length;v--;O[v]*=w);for(O[0]+=D.indexOf(M.charAt(N++)),L=0;L<O.length;L++)O[L]>T-1&&(O[L+1]==null&&(O[L+1]=0),O[L+1]+=O[L]/T|0,O[L]%=T)}return O.reverse()}return function(M,w,T,D,L){var O,v,N,R,P,_,z,W,A=M.indexOf("."),F=a,H=r;for(A>=0&&(R=p,p=0,M=M.replace(".",""),W=new y(w),_=W.pow(M.length-A),p=R,W.c=C(Mt(Je(_.c),_.e,"0"),10,T,S),W.e=W.c.length),z=C(M,w,T,L?(O=x,S):(O=S,x)),N=R=z.length;z[--R]==0;z.pop());if(!z[0])return O.charAt(0);if(A<0?--N:(_.c=z,_.e=N,_.s=D,_=t(_,W,F,H,T),z=_.c,P=_.r,N=_.e),v=N+F+1,A=z[v],R=T/2,P=P||v<0||z[v+1]!=null,P=H<4?(A!=null||P)&&(H==0||H==(_.s<0?3:2)):A>R||A==R&&(H==4||P||H==6&&z[v-1]&1||H==(_.s<0?8:7)),v<1||!z[0])M=P?Mt(O.charAt(1),-F,O.charAt(0)):O.charAt(0);else{if(z.length=v,P)for(--T;++z[--v]>T;)z[v]=0,v||(++N,z=[1].concat(z));for(R=z.length;!z[--R];);for(A=0,M="";A<=R;M+=O.charAt(z[A++]));M=Mt(M,N,O.charAt(0))}return M}}(),t=function(){function S(w,T,D){var L,O,v,N,R=0,P=w.length,_=T%Vt,z=T/Vt|0;for(w=w.slice();P--;)v=w[P]%Vt,N=w[P]/Vt|0,L=z*v+N*_,O=_*v+L%Vt*Vt+R,R=(O/D|0)+(L/Vt|0)+z*N,w[P]=O%D;return R&&(w=[R].concat(w)),w}function C(w,T,D,L){var O,v;if(D!=L)v=D>L?1:-1;else for(O=v=0;O<D;O++)if(w[O]!=T[O]){v=w[O]>T[O]?1:-1;break}return v}function M(w,T,D,L){for(var O=0;D--;)w[D]-=O,O=w[D]<T[D]?1:0,w[D]=O*L+w[D]-T[D];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,T,D,L,O){var v,N,R,P,_,z,W,A,F,H,U,j,q,Z,ee,K,te,G=w.s==T.s?1:-1,Q=w.c,J=T.c;if(!Q||!Q[0]||!J||!J[0])return new y(!w.s||!T.s||(Q?J&&Q[0]==J[0]:!J)?NaN:Q&&Q[0]==0||!J?G*0:G/0);for(A=new y(G),F=A.c=[],N=w.e-T.e,G=D+N+1,O||(O=at,N=Ke(w.e/ce)-Ke(T.e/ce),G=G/ce|0),R=0;J[R]==(Q[R]||0);R++);if(J[R]>(Q[R]||0)&&N--,G<0)F.push(1),P=!0;else{for(Z=Q.length,K=J.length,R=0,G+=2,_=qe(O/(J[0]+1)),_>1&&(J=S(J,_,O),Q=S(Q,_,O),K=J.length,Z=Q.length),q=K,H=Q.slice(0,K),U=H.length;U<K;H[U++]=0);te=J.slice(),te=[0].concat(te),ee=J[0],J[1]>=O/2&&ee++;do{if(_=0,v=C(J,H,K,U),v<0){if(j=H[0],K!=U&&(j=j*O+(H[1]||0)),_=qe(j/ee),_>1)for(_>=O&&(_=O-1),z=S(J,_,O),W=z.length,U=H.length;C(z,H,W,U)==1;)_--,M(z,K<W?te:J,W,O),W=z.length,v=1;else _==0&&(v=_=1),z=J.slice(),W=z.length;if(W<U&&(z=[0].concat(z)),M(H,z,U,O),U=H.length,v==-1)for(;C(J,H,K,U)<1;)_++,M(H,K<U?te:J,U,O),U=H.length}else v===0&&(_++,H=[0]);F[R++]=_,H[0]?H[U++]=Q[q]||0:(H=[Q[q]],U=1)}while((q++<Z||H[0]!=null)&&G--);P=H[0]!=null,F[0]||F.splice(0,1)}if(O==at){for(R=1,G=F[0];G>=10;G/=10,R++);B(A,D+(A.e=R+N*ce-1)+1,L,P)}else A.e=N,A.r=+P;return A}}();function k(S,C,M,w){var T,D,L,O,v;if(M==null?M=r:be(M,0,8),!S.c)return S.toString();if(T=S.c[0],L=S.e,C==null)v=Je(S.c),v=w==1||w==2&&(L<=c||L>=d)?li(v,L):Mt(v,L,"0");else if(S=B(new y(S),C,M),D=S.e,v=Je(S.c),O=v.length,w==1||w==2&&(C<=D||D<=c)){for(;O<C;v+="0",O++);v=li(v,D)}else if(C-=L+(w===2&&D>L),v=Mt(v,D,"0"),D+1>O){if(--C>0)for(v+=".";C--;v+="0");}else if(C+=D-O,C>0)for(D+1==O&&(v+=".");C--;v+="0");return S.s<0&&T?"-"+v:v}function I(S,C){for(var M,w,T=1,D=new y(S[0]);T<S.length;T++)w=new y(S[T]),(!w.s||(M=Gt(D,w))===C||M===0&&D.s===C)&&(D=w);return D}function E(S,C,M){for(var w=1,T=C.length;!C[--T];C.pop());for(T=C[0];T>=10;T/=10,w++);return(M=w+M*ce-1)>u?S.c=S.e=null:M<h?S.c=[S.e=0]:(S.e=M,S.c=C),S}o=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,M=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(D,L,O,v){var N,R=O?L:L.replace(T,"");if(w.test(R))D.s=isNaN(R)?null:R<0?-1:1;else{if(!O&&(R=R.replace(S,function(P,_,z){return N=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!v||v==N?_:P}),v&&(N=v,R=R.replace(C,"$1").replace(M,"0.$1")),L!=R))return new y(R,N);if(y.DEBUG)throw Error(We+"Not a"+(v?" base "+v:"")+" number: "+L);D.s=null}D.c=D.e=null}}();function B(S,C,M,w){var T,D,L,O,v,N,R,P=S.c,_=Os;if(P){e:{for(T=1,O=P[0];O>=10;O/=10,T++);if(D=C-T,D<0)D+=ce,L=C,v=P[N=0],R=qe(v/_[T-L-1]%10);else if(N=Ds((D+1)/ce),N>=P.length)if(w){for(;P.length<=N;P.push(0));v=R=0,T=1,D%=ce,L=D-ce+1}else break e;else{for(v=O=P[N],T=1;O>=10;O/=10,T++);D%=ce,L=D-ce+T,R=L<0?0:qe(v/_[T-L-1]%10)}if(w=w||C<0||P[N+1]!=null||(L<0?v:v%_[T-L-1]),w=M<4?(R||w)&&(M==0||M==(S.s<0?3:2)):R>5||R==5&&(M==4||w||M==6&&(D>0?L>0?v/_[T-L]:0:P[N-1])%10&1||M==(S.s<0?8:7)),C<1||!P[0])return P.length=0,w?(C-=S.e+1,P[0]=_[(ce-C%ce)%ce],S.e=-C||0):P[0]=S.e=0,S;if(D==0?(P.length=N,O=1,N--):(P.length=N+1,O=_[ce-D],P[N]=L>0?qe(v/_[T-L]%_[L])*O:0),w)for(;;)if(N==0){for(D=1,L=P[0];L>=10;L/=10,D++);for(L=P[0]+=O,O=1;L>=10;L/=10,O++);D!=O&&(S.e++,P[0]==at&&(P[0]=1));break}else{if(P[N]+=O,P[N]!=at)break;P[N--]=0,O=1}for(D=P.length;P[--D]===0;P.pop());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function V(S){var C,M=S.e;return M===null?S.toString():(C=Je(S.c),C=M<=c||M>=d?li(C,M):Mt(C,M,"0"),S.s<0?"-"+C:C)}return s.absoluteValue=s.abs=function(){var S=new y(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,C){return Gt(this,new y(S,C))},s.decimalPlaces=s.dp=function(S,C){var M,w,T,D=this;if(S!=null)return be(S,0,De),C==null?C=r:be(C,0,8),B(new y(D),S+D.e+1,C);if(!(M=D.c))return null;if(w=((T=M.length-1)-Ke(this.e/ce))*ce,T=M[T])for(;T%10==0;T/=10,w--);return w<0&&(w=0),w},s.dividedBy=s.div=function(S,C){return t(this,new y(S,C),a,r)},s.dividedToIntegerBy=s.idiv=function(S,C){return t(this,new y(S,C),0,1)},s.exponentiatedBy=s.pow=function(S,C){var M,w,T,D,L,O,v,N,R,P=this;if(S=new y(S),S.c&&!S.isInteger())throw Error(We+"Exponent not an integer: "+V(S));if(C!=null&&(C=new y(C)),O=S.e>14,!P.c||!P.c[0]||P.c[0]==1&&!P.e&&P.c.length==1||!S.c||!S.c[0])return R=new y(Math.pow(+V(P),O?S.s*(2-si(S)):+V(S))),C?R.mod(C):R;if(v=S.s<0,C){if(C.c?!C.c[0]:!C.s)return new y(NaN);w=!v&&P.isInteger()&&C.isInteger(),w&&(P=P.mod(C))}else{if(S.e>9&&(P.e>0||P.e<-1||(P.e==0?P.c[0]>1||O&&P.c[1]>=24e7:P.c[0]<8e13||O&&P.c[0]<=9999975e7)))return D=P.s<0&&si(S)?-0:0,P.e>-1&&(D=1/D),new y(v?1/D:D);p&&(D=Ds(p/ce+2))}for(O?(M=new y(.5),v&&(S.s=1),N=si(S)):(T=Math.abs(+V(S)),N=T%2),R=new y(l);;){if(N){if(R=R.times(P),!R.c)break;D?R.c.length>D&&(R.c.length=D):w&&(R=R.mod(C))}if(T){if(T=qe(T/2),T===0)break;N=T%2}else if(S=S.times(M),B(S,S.e+1,1),S.e>14)N=si(S);else{if(T=+V(S),T===0)break;N=T%2}P=P.times(P),D?P.c&&P.c.length>D&&(P.c.length=D):w&&(P=P.mod(C))}return w?R:(v&&(R=l.div(R)),C?R.mod(C):D?B(R,p,r,L):R)},s.integerValue=function(S){var C=new y(this);return S==null?S=r:be(S,0,8),B(C,C.e+1,S)},s.isEqualTo=s.eq=function(S,C){return Gt(this,new y(S,C))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,C){return Gt(this,new y(S,C))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,C){return(C=Gt(this,new y(S,C)))===1||C===0},s.isInteger=function(){return!!this.c&&Ke(this.e/ce)>this.c.length-2},s.isLessThan=s.lt=function(S,C){return Gt(this,new y(S,C))<0},s.isLessThanOrEqualTo=s.lte=function(S,C){return(C=Gt(this,new y(S,C)))===-1||C===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(S,C){var M,w,T,D,L=this,O=L.s;if(S=new y(S,C),C=S.s,!O||!C)return new y(NaN);if(O!=C)return S.s=-C,L.plus(S);var v=L.e/ce,N=S.e/ce,R=L.c,P=S.c;if(!v||!N){if(!R||!P)return R?(S.s=-C,S):new y(P?L:NaN);if(!R[0]||!P[0])return P[0]?(S.s=-C,S):new y(R[0]?L:r==3?-0:0)}if(v=Ke(v),N=Ke(N),R=R.slice(),O=v-N){for((D=O<0)?(O=-O,T=R):(N=v,T=P),T.reverse(),C=O;C--;T.push(0));T.reverse()}else for(w=(D=(O=R.length)<(C=P.length))?O:C,O=C=0;C<w;C++)if(R[C]!=P[C]){D=R[C]<P[C];break}if(D&&(T=R,R=P,P=T,S.s=-S.s),C=(w=P.length)-(M=R.length),C>0)for(;C--;R[M++]=0);for(C=at-1;w>O;){if(R[--w]<P[w]){for(M=w;M&&!R[--M];R[M]=C);--R[M],R[w]+=at}R[w]-=P[w]}for(;R[0]==0;R.splice(0,1),--N);return R[0]?E(S,R,N):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,C){var M,w,T=this;return S=new y(S,C),!T.c||!S.s||S.c&&!S.c[0]?new y(NaN):!S.c||T.c&&!T.c[0]?new y(T):(g==9?(w=S.s,S.s=1,M=t(T,S,0,3),S.s=w,M.s*=w):M=t(T,S,0,g),S=T.minus(M.times(S)),!S.c[0]&&g==1&&(S.s=T.s),S)},s.multipliedBy=s.times=function(S,C){var M,w,T,D,L,O,v,N,R,P,_,z,W,A,F,H=this,U=H.c,j=(S=new y(S,C)).c;if(!U||!j||!U[0]||!j[0])return!H.s||!S.s||U&&!U[0]&&!j||j&&!j[0]&&!U?S.c=S.e=S.s=null:(S.s*=H.s,!U||!j?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(w=Ke(H.e/ce)+Ke(S.e/ce),S.s*=H.s,v=U.length,P=j.length,v<P&&(W=U,U=j,j=W,T=v,v=P,P=T),T=v+P,W=[];T--;W.push(0));for(A=at,F=Vt,T=P;--T>=0;){for(M=0,_=j[T]%F,z=j[T]/F|0,L=v,D=T+L;D>T;)N=U[--L]%F,R=U[L]/F|0,O=z*N+R*_,N=_*N+O%F*F+W[D]+M,M=(N/A|0)+(O/F|0)+z*R,W[D--]=N%A;W[D]=M}return M?++w:W.splice(0,1),E(S,W,w)},s.negated=function(){var S=new y(this);return S.s=-S.s||null,S},s.plus=function(S,C){var M,w=this,T=w.s;if(S=new y(S,C),C=S.s,!T||!C)return new y(NaN);if(T!=C)return S.s=-C,w.minus(S);var D=w.e/ce,L=S.e/ce,O=w.c,v=S.c;if(!D||!L){if(!O||!v)return new y(T/0);if(!O[0]||!v[0])return v[0]?S:new y(O[0]?w:T*0)}if(D=Ke(D),L=Ke(L),O=O.slice(),T=D-L){for(T>0?(L=D,M=v):(T=-T,M=O),M.reverse();T--;M.push(0));M.reverse()}for(T=O.length,C=v.length,T-C<0&&(M=v,v=O,O=M,C=T),T=0;C;)T=(O[--C]=O[C]+v[C]+T)/at|0,O[C]=at===O[C]?0:O[C]%at;return T&&(O=[T].concat(O),++L),E(S,O,L)},s.precision=s.sd=function(S,C){var M,w,T,D=this;if(S!=null&&S!==!!S)return be(S,1,De),C==null?C=r:be(C,0,8),B(new y(D),S,C);if(!(M=D.c))return null;if(T=M.length-1,w=T*ce+1,T=M[T]){for(;T%10==0;T/=10,w--);for(T=M[0];T>=10;T/=10,w++);}return S&&D.e+1>w&&(w=D.e+1),w},s.shiftedBy=function(S){return be(S,-Ls,Ls),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,C,M,w,T,D=this,L=D.c,O=D.s,v=D.e,N=a+4,R=new y("0.5");if(O!==1||!L||!L[0])return new y(!O||O<0&&(!L||L[0])?NaN:L?D:1/0);if(O=Math.sqrt(+V(D)),O==0||O==1/0?(C=Je(L),(C.length+v)%2==0&&(C+="0"),O=Math.sqrt(+C),v=Ke((v+1)/2)-(v<0||v%2),O==1/0?C="5e"+v:(C=O.toExponential(),C=C.slice(0,C.indexOf("e")+1)+v),M=new y(C)):M=new y(O+""),M.c[0]){for(v=M.e,O=v+N,O<3&&(O=0);;)if(T=M,M=R.times(T.plus(t(D,T,N,1))),Je(T.c).slice(0,O)===(C=Je(M.c)).slice(0,O))if(M.e<v&&--O,C=C.slice(O-3,O+1),C=="9999"||!w&&C=="4999"){if(!w&&(B(T,T.e+a+2,0),T.times(T).eq(D))){M=T;break}N+=4,O+=4,w=1}else{(!+C||!+C.slice(1)&&C.charAt(0)=="5")&&(B(M,M.e+a+2,1),S=!M.times(M).eq(D));break}}return B(M,M.e+a+1,r,S)},s.toExponential=function(S,C){return S!=null&&(be(S,0,De),S++),k(this,S,C,1)},s.toFixed=function(S,C){return S!=null&&(be(S,0,De),S=S+this.e+1),k(this,S,C)},s.toFormat=function(S,C,M){var w,T=this;if(M==null)S!=null&&C&&typeof C=="object"?(M=C,C=null):S&&typeof S=="object"?(M=S,S=C=null):M=m;else if(typeof M!="object")throw Error(We+"Argument not an object: "+M);if(w=T.toFixed(S,C),T.c){var D,L=w.split("."),O=+M.groupSize,v=+M.secondaryGroupSize,N=M.groupSeparator||"",R=L[0],P=L[1],_=T.s<0,z=_?R.slice(1):R,W=z.length;if(v&&(D=O,O=v,v=D,W-=D),O>0&&W>0){for(D=W%O||O,R=z.substr(0,D);D<W;D+=O)R+=N+z.substr(D,O);v>0&&(R+=N+z.slice(D)),_&&(R="-"+R)}w=P?R+(M.decimalSeparator||"")+((v=+M.fractionGroupSize)?P.replace(new RegExp("\\d{"+v+"}\\B","g"),"$&"+(M.fractionGroupSeparator||"")):P):R}return(M.prefix||"")+w+(M.suffix||"")},s.toFraction=function(S){var C,M,w,T,D,L,O,v,N,R,P,_,z=this,W=z.c;if(S!=null&&(O=new y(S),!O.isInteger()&&(O.c||O.s!==1)||O.lt(l)))throw Error(We+"Argument "+(O.isInteger()?"out of range: ":"not an integer: ")+V(O));if(!W)return new y(z);for(C=new y(l),N=M=new y(l),w=v=new y(l),_=Je(W),D=C.e=_.length-z.e-1,C.c[0]=Os[(L=D%ce)<0?ce+L:L],S=!S||O.comparedTo(C)>0?D>0?C:N:O,L=u,u=1/0,O=new y(_),v.c[0]=0;R=t(O,C,0,1),T=M.plus(R.times(w)),T.comparedTo(S)!=1;)M=w,w=T,N=v.plus(R.times(T=N)),v=T,C=O.minus(R.times(T=C)),O=T;return T=t(S.minus(M),w,0,1),v=v.plus(T.times(N)),M=M.plus(T.times(w)),v.s=N.s=z.s,D=D*2,P=t(N,w,D,r).minus(z).abs().comparedTo(t(v,M,D,r).minus(z).abs())<1?[N,w]:[v,M],u=L,P},s.toNumber=function(){return+V(this)},s.toPrecision=function(S,C){return S!=null&&be(S,1,De),k(this,S,C,2)},s.toString=function(S){var C,M=this,w=M.s,T=M.e;return T===null?w?(C="Infinity",w<0&&(C="-"+C)):C="NaN":(S==null?C=T<=c||T>=d?li(Je(M.c),T):Mt(Je(M.c),T,"0"):S===10&&b?(M=B(new y(M),a+T+1,r),C=Mt(Je(M.c),M.e,"0")):(be(S,2,x.length,"Base"),C=n(Mt(Je(M.c),T,"0"),10,S,w,!0)),w<0&&M.c[0]&&(C="-"+C)),C},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 Ke(e){var t=e|0;return e>0||e===t?t:t-1}function Je(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 Gt(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!==qe(e))throw Error(We+(o||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function si(e){var t=e.c.length-1;return Ke(e.e/ce)==t&&e.c[t]%2!=0}function li(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Mt(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 Sr=br();function Zt(e){return new Sr(e)}function Rs(e,t){return Zt(e).plus(Zt(t)).toNumber()}function Kb(e,t){return Zt(e).minus(Zt(t)).toNumber()}function Jb(e,t){return Zt(e).dividedBy(Zt(t)).toNumber()}function Cr(e,t){return Zt(e).decimalPlaces(t,Sr.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=Xt(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 k="";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((B,V)=>{var S,C;return y?V.parent||B.push((S=V.data)==null?void 0:S[m]):B.push((C=V.data)==null?void 0:C[m]),B},[]):E=s.value.store.map(B=>B[o][I]),x){case"sum":{const B=E.reduce((V,S)=>{const C=Number(S);return Number.isNaN(C)?V:Rs(V,C)},0);k=B&&Cr(B,c(b??t.default));break}case"average":{const B=E.reduce((V,S)=>{const C=Number(S);return Number.isNaN(C)?V:Rs(V,C)},0);k=B&&Cr(Jb(B,E.length),c(b??t.default));break}case"max":{const B=E.filter(V=>V!=null);k=B.length?Math.max(...B):"";break}case"min":{const B=E.filter(V=>V!=null);k=B.length?Math.min(...B):"";break}}k=d(g,k)}}return k},f=g=>{const p=g.summaryRenderer,m=g.summaryData?g.summaryData:[],x=[g.field,...m];let b=p;return x.forEach((y,k)=>{const I=h(y);if(I>=0){const E=u(s.value.orderedColumns[I]);b=b.replace(`{${k}}`,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 wr=re(Qb,[["render",o0],["__scopeId","data-v-4b9bef37"]]),i0={name:"EVGridColumnSetting",directives:{clickoutside:No},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:w=>t("update:isShow",w)}),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:w=>t("update:isShowMenuOnClick",w)}),x=w=>{var T;(w==null?void 0:w.length)===1?g=w[0]:(w==null?void 0:w.length)<1&&(g==null&&(g=(T=r.value[0])==null?void 0:T.text),a.value.push(g))},b=w=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,w){const T=w.toString().toLowerCase();c.value=r.value.filter(D=>D.label.toString().toLowerCase().includes(T)),l.value=!0}},500)},y=()=>{s.value="",l.value=!1,c.value.length=0},k=()=>{const w=d.value.length?d.value:r.value;a.value=w.filter(T=>T.originChecked).map(T=>T.text),y()},I=()=>{d.value=r.value.filter(T=>a.value.includes(T.text));const w=d.value.map(T=>T.text);t("apply-column",w),n.value=!1,m.value=!1},E=i.ref(),B=i.ref(),V=()=>{B.value=Ce(a.value),r.value=e.columns.filter(w=>!w.hide&&w.caption).map(w=>{var L,O;const T=(L=E.value)==null?void 0:L.find(v=>v.field===w.field);let D=!1;return T?D=(T==null?void 0:T.hiddenDisplay)!==(w==null?void 0:w.hiddenDisplay)||!((O=B.value)!=null&&O.length)?!(w!=null&&w.hiddenDisplay):B.value.includes(w.field):D=!w.hiddenDisplay,{label:w.caption,text:w.field,originChecked:!w.hiddenDisplay,checked:D,fixed:w.fixed}}),a.value=r.value.filter(w=>w.checked).map(w=>w.text),d.value.length=0,E.value=Ce(e.columns)},S=()=>{n.value=!1,m.value=!1},C=()=>{const w=document.createElement("div");w.id="ev-grid-column-setting-modal",w.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(w)},M=async()=>{var z;await i.nextTick();const w=document.documentElement.clientWidth,T=document.documentElement.clientHeight,D=(z=o.value)==null?void 0:z.getBoundingClientRect(),L=D==null?void 0:D.width,O=D==null?void 0:D.height,{top:v,left:N,columnListMenuWidth:R}=e.position;let P;R?(P=N,w<N+L&&(P=N-L-R)):P=N-L;const _=T-O;p.top=`${Math.min(v,_)+document.documentElement.scrollTop}px`,p.left=`${P+document.documentElement.scrollLeft}px`};return i.onBeforeMount(()=>C()),i.watch(()=>e.columns,()=>{V()},{immediate:!0,deep:!0}),i.watch(()=>n.value,async()=>{k(),n.value&&await M()}),i.watch(()=>e.hiddenColumn,w=>{const T=d.value.length?d.value.filter(D=>D.text!==w):r.value.filter(D=>D.text!==w&&D.checked);d.value=T,a.value=T.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:S}}},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 kr=re(i0,[["render",d0]]),h0={name:"EVGridFilterSetting",directives:{clickoutside:No},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=[],B=Ce(e.items);I&&o.value.field&&((V=B[o.value.field])!=null&&V.length?B[o.value.field].forEach(S=>{E.push(S)}):E.push({comparison:"=",operator:"and",value:"",caption:o.value.caption}),n.value=E)});const b=(I,E)=>{var B;return((B=I.find(V=>V.value===E))==null?void 0:B.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=re(h0,[["render",y0]]),b0={name:"GridSortButton",props:{icon:{type:String,default:""}}},S0={key:0},C0={key:1},w0={key:2};function k0(e,t,n,o,s,l){return n.icon==="basic"?(i.openBlock(),i.createElementBlock("span",S0,[...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:u}){const f=u>0?`... (${u} recursive calls)`:"",p=!!h.component&&h.component.parent==null,g=` at <${jl(h.component,h.type,p)}`,m=">"+f;return h.props?[g,...Ac(h.props),m]:[g+m]}(c))}),r}(s)),console.warn(...l)}hl()}function Ac(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(i=>{t.push(...Ml(i,e[i]))}),n.length>3&&t.push(" ..."),t}function Ml(e,t,n){return pt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ke(t)?(t=Ml(e,ye(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Pe(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ye(t),n?t:[`${e}=`,t])}const vl={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 Jt(e,t,n,i){let s;try{s=i?e(...i):e()}catch(l){Rl(l,t,n)}return s}function Ys(e,t,n,i){if(Pe(e)){const l=Jt(e,t,n,i);return l&&yc(l)&&l.catch(a=>{Rl(a,t,n)}),l}const s=[];for(let l=0;l<e.length;l++)s.push(Ys(e[l],t,n,i));return s}function Rl(e,t,n,i=!0){const s=t?t.vnode:null;if(t){let l=t.parent;const a=t.proxy,r=process.env.NODE_ENV!=="production"?vl[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 Jt(c,null,10,[e,a,r])}(function(l,a,r,c=!0){if(process.env.NODE_ENV!=="production"){const h=vl[a];if(r&&(d=r,Ut.push(d)),gt("Unhandled error"+(h?` during execution of ${h}`:"")),r&&Ut.pop(),c)throw l;console.error(l)}else console.error(l);var d})(e,n,s,i)}let Zi=!1,Os=!1;const at=[];let Xt=0;const rn=[];let bt=null,Nt=0;const Vl=Promise.resolve();let Hs=null;const Kc=100;function El(e){const t=Hs||Vl;return e?t.then(this?e.bind(this):e):t}function zs(e){at.length&&at.includes(e,Zi&&e.allowRecurse?Xt+1:Xt)||(e.id==null?at.push(e):at.splice(function(t){let n=Xt+1,i=at.length;for(;n<i;){const s=n+i>>>1,l=at[s],a=Tn(l);a<t||a===t&&l.pre?n=s+1:i=s}return n}(e.id),0,e),Gl())}function Gl(){Zi||Os||(Os=!0,Hs=Vl.then(Zl))}function Wl(e){Se(e)?rn.push(...e):bt&&bt.includes(e,e.allowRecurse?Nt+1:Nt)||rn.push(e),Gl()}const Tn=e=>e.id==null?1/0:e.id,_c=(e,t)=>{const n=Tn(e)-Tn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Zl(e){Os=!1,Zi=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),at.sort(_c);const t=process.env.NODE_ENV!=="production"?n=>Xl(e,n):tl;try{for(Xt=0;Xt<at.length;Xt++){const n=at[Xt];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;Jt(n,null,14)}}}finally{Xt=0,at.length=0,function(n){if(rn.length){const i=[...new Set(rn)];if(rn.length=0,bt)return void bt.push(...i);for(bt=i,process.env.NODE_ENV!=="production"&&(n=n||new Map),bt.sort((s,l)=>Tn(s)-Tn(l)),Nt=0;Nt<bt.length;Nt++)process.env.NODE_ENV!=="production"&&Xl(n,bt[Nt])||bt[Nt]();bt=null,Nt=0}}(e),Zi=!1,Hs=null,(at.length||rn.length)&&Zl(e)}}function Xl(e,t){if(e.has(t)){const n=e.get(t);if(n>Kc){const i=t.ownerInstance,s=i&&Jl(i.type);return gt(`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 Mn=new Set;process.env.NODE_ENV!=="production"&&(Ts().__VUE_HMR_RUNTIME__={createRecord:Fs(function(e,t){return Xi.has(e)?!1:(Xi.set(e,{initialDef:vn(t),instances:new Set}),!0)}),rerender:Fs(function(e,t){const n=Xi.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(i=>{t&&(i.render=t,vn(i.type).render=t),i.renderCache=[],i.update()}))}),reload:Fs(function(e,t){const n=Xi.get(e);if(!n)return;t=vn(t),Nl(n.initialDef,t);const i=[...n.instances];for(const s of i){const l=vn(s.type);Mn.has(l)||(l!==n.initialDef&&Nl(l,t),Mn.add(l)),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(Mn.add(l),s.ceReload(t.styles),Mn.delete(l)):s.parent?zs(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.")}Wl(()=>{for(const s of i)Mn.delete(vn(s.type))})})});const Xi=new Map;function vn(e){return Ql(e)?e.__vccOpts:e}function Nl(e,t){lt(e,t);for(const n in e)n==="__file"||n in t||delete e[n]}function Fs(e){return(t,n)=>{try{return e(t,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Rn=null,Uc=null;const Jc=Symbol.for("v-ndc"),Ni={};function jc(e,t,{immediate:n,deep:i,flush:s,onTrack:l,onTrigger:a}=Is){var r;process.env.NODE_ENV==="production"||t||(n!==void 0&&gt('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&gt('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'));const c=w=>{gt("Invalid watch source: ",w,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},d=ol===((r=hn)==null?void 0:r.scope)?hn:null;let h,u,f=!1,p=!1;if(Ke(e)?(h=()=>e.value,f=Ns(e)):Kt(e)?(h=()=>e,i=!0):Se(e)?(p=!0,f=e.some(w=>Kt(w)||Ns(w)),h=()=>e.map(w=>Ke(w)?w.value:Kt(w)?cn(w):Pe(w)?Jt(w,d,2):void(process.env.NODE_ENV!=="production"&&c(w)))):Pe(e)?h=t?()=>Jt(e,d,2):()=>{if(!d||!d.isUnmounted)return u&&u(),Ys(e,d,3,[g])}:(h=tl,process.env.NODE_ENV!=="production"&&c(e)),t&&i){const w=h;h=()=>cn(w())}let g=w=>{u=y.onStop=()=>{Jt(w,d,4),u=y.onStop=void 0}},m=p?new Array(e.length).fill(Ni):Ni;const b=()=>{if(y.active)if(t){const w=y.run();(i||f||(p?w.some((T,k)=>an(T,m[k])):an(w,m)))&&(u&&u(),Ys(t,d,3,[w,m===Ni?void 0:p&&m[0]===Ni?[]:m,g]),m=w)}else y.run()};let C;b.allowRecurse=!!t,s==="sync"?C=b:s==="post"?C=()=>Ol(b,d&&d.suspense):(b.pre=!0,d&&(b.id=d.uid),C=()=>zs(b));const y=new Mc(h,C);return process.env.NODE_ENV!=="production"&&(y.onTrack=l,y.onTrigger=a),t?n?b():m=y.run():s==="post"?Ol(y.run.bind(y),d&&d.suspense):y.run(),()=>{y.stop(),d&&d.scope&&pc(d.scope.effects,y)}}function Qc(e,t,n){const i=this.proxy,s=pt(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}}(i,e):()=>i[e]:e.bind(i,i);let l;Pe(t)?l=t:(l=t.handler,n=t);const a=hn;Ul(this);const r=jc(s,l.bind(i),n);return a?Ul(a):id(),r}function cn(e,t){if(!Fe(e)||e.__v_skip||(t=t||new Set).has(e))return e;if(t.add(e),Ke(e))cn(e.value,t);else if(Se(e))for(let n=0;n<e.length;n++)cn(e[n],t);else if(bc(e)||ln(e))e.forEach(n=>{cn(n,t)});else if(Sc(e))for(const n in e)cn(e[n],t);return e}const As=e=>e?4&e.vnode.shapeFlag?function(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy((i=t.exposed,kc(i,"__v_skip",!0),Kt(n=i)?n:new Proxy(n,Fc)),{get:(s,l)=>l in s?s[l]:l in Ks?Ks[l](t):void 0,has:(s,l)=>l in s||l in Ks}));var n,i}(e)||e.proxy:As(e.parent):null,Ks=lt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Wi(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Wi(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Wi(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Wi(e.refs):e.refs,$parent:e=>As(e.parent),$root:e=>As(e.root),$emit:e=>e.emit,$options:e=>function(t){const n=t.type,{mixins:i,extends:s}=n,{mixins:l,optionsCache:a,config:{optionMergeStrategies:r}}=t.appContext,c=a.get(n);let d;return c?d=c:l.length||i||s?(d={},l.length&&l.forEach(h=>Pi(d,h,r,!0)),Pi(d,n,r)):d=n,Fe(n)&&a.set(n,d),d}(e),$forceUpdate:e=>e.f||(e.f=()=>zs(e.update)),$nextTick:e=>e.n||(e.n=El.bind(e.proxy)),$watch:e=>Qc.bind(e)});function Pl(e){return Se(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}process.env.NODE_ENV;function Pi(e,t,n,i=!1){const{mixins:s,extends:l}=t;l&&Pi(e,l,n,!0),s&&s.forEach(a=>Pi(e,a,n,!0));for(const a in t)if(i&&a==="expose")process.env.NODE_ENV!=="production"&&gt('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const r=$c[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const $c={data:Bl,props:Yl,emits:Yl,methods:Vn,computed:Vn,beforeCreate:De,created:De,beforeMount:De,mounted:De,beforeUpdate:De,updated:De,beforeDestroy:De,beforeUnmount:De,destroyed:De,unmounted:De,activated:De,deactivated:De,errorCaptured:De,serverPrefetch:De,components:Vn,directives:Vn,watch:function(e,t){if(!e)return t;if(!t)return e;const n=lt(Object.create(null),e);for(const i in t)n[i]=De(e[i],t[i]);return n},provide:Bl,inject:function(e,t){return Vn(Dl(e),Dl(t))}};function Bl(e,t){return t?e?function(){return lt(Pe(e)?e.call(this,this):e,Pe(t)?t.call(this,this):t)}:t:e}function Dl(e){if(Se(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function De(e,t){return e?[...new Set([].concat(e,t))]:t}function Vn(e,t){return e?lt(Object.create(null),e,t):t}function Yl(e,t){return e?Se(e)&&Se(t)?[...new Set([...e,...t])]:lt(Object.create(null),Pl(e),Pl(t??{})):t}const Ol=function(e,t){t&&t.pendingBranch?Se(e)?t.effects.push(...e):t.effects.push(e):Wl(e)},Hl=Symbol.for("v-fgt"),qc=Symbol.for("v-txt"),ed=Symbol.for("v-cmt"),zl="__vInternal",Fl=({key:e})=>e??null,Bi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?pt(e)||Ke(e)||Pe(e)?{i:Rn,r:e,k:t,f:!!n}:e:null),td=process.env.NODE_ENV!=="production"?(...e)=>Al(...e):Al;function Al(e,t=null,n=null,i=0,s=null,l=!1){if(e&&e!==Jc||(process.env.NODE_ENV==="production"||e||gt(`Invalid vnode type when creating vnode: ${e}.`),e=ed),(a=e)&&a.__v_isVNode===!0){const c=Di(e,t,!0);return n&&_s(c,n),c.patchFlag|=-2,c}var a;if(Ql(e)&&(e=e.__vccOpts),t){t=function(h){return h?Ps(h)||zl in h?lt({},h):h:null}(t);let{class:c,style:d}=t;c&&!pt(c)&&(t.class=vs(c)),Fe(d)&&(Ps(d)&&!Se(d)&&(d=lt({},d)),t.style=Ms(d))}const r=pt(e)?1:(c=>c.__isSuspense)(e)?128:(c=>c.__isTeleport)(e)?64:Fe(e)?4:Pe(e)?2:0;return process.env.NODE_ENV!=="production"&&4&r&&Ps(e)&&gt("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=ye(e)),function(c,d=null,h=null,u=0,f=null,p=c===Hl?0:1,g=!1,m=!1){const b={__v_isVNode:!0,__v_skip:!0,type:c,props:d,key:d&&Fl(d),ref:d&&Bi(d),scopeId:Uc,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:p,patchFlag:u,dynamicProps:f,dynamicChildren:null,appContext:null,ctx:Rn};return m?(_s(b,h),128&p&&c.normalize(b)):h&&(b.shapeFlag|=pt(h)?8:16),process.env.NODE_ENV!=="production"&&b.key!=b.key&&gt("VNode created with invalid key (NaN). VNode type:",b.type),b}(e,t,n,i,s,r,l,!0)}function Di(e,t,n=!1){const{props:i,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=vs([d.class,u.class]));else if(f==="style")d.style=Ms([d.style,u.style]);else if(mc(f)){const p=d[f],g=u[f];!g||p===g||Se(p)&&p.includes(g)||(d[f]=p?[].concat(p,g):g)}else f!==""&&(d[f]=u[f])}return d}(i||{},t):i;return{__v_isVNode:!0,__v_skip:!0,type:e.type,props:r,key:r&&Fl(r),ref:t&&t.ref?n&&s?Se(s)?s.concat(Bi(t)):[s,Bi(t)]:Bi(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&Se(a)?a.map(Kl):a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Hl?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&&Di(e.ssContent),ssFallback:e.ssFallback&&Di(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce}}function Kl(e){const t=Di(e);return Se(e.children)&&(t.children=e.children.map(Kl)),t}function nd(e=" ",t=0){return td(qc,null,e,t)}function _s(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(Se(t))n=16;else if(typeof t=="object"){if(65&i){const s=t.default;return void(s&&(s._c&&(s._d=!1),_s(e,s()),s._c&&(s._d=!0)))}{n=32;const s=t._;s||zl in t||(t._ctx=Rn)}}else Pe(t)?(t={default:t,_ctx:Rn},n=32):(t=String(t),64&i?(n=16,t=[nd(t)]):n=8);e.children=t,e.shapeFlag|=n}let Us,dn,hn=null,_l="__VUE_INSTANCE_SETTERS__";(dn=Ts()[_l])||(dn=Ts()[_l]=[]),dn.push(e=>hn=e),Us=e=>{dn.length>1?dn.forEach(t=>t(e)):dn[0](e)};const Ul=e=>{Us(e),e.scope.on()},id=()=>{hn&&hn.scope.off(),Us(null)},sd=/(?:^|[-_])(\w)/g,od=e=>e.replace(sd,t=>t.toUpperCase()).replace(/[-_]/g,"");function Jl(e,t=!0){return Pe(e)?e.displayName||e.name:e.name||t&&e.__name}function jl(e,t,n=!1){let i=Jl(t);if(!i&&t.__file){const s=t.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&e&&e.parent){const s=l=>{for(const a in l)if(l[a]===t)return a};i=s(e.components||e.parent.type.components)||s(e.appContext.components)}return i?od(i):n?"App":"Anonymous"}function Ql(e){return Pe(e)&&"__vccOpts"in e}function Js(e){return!(!e||!e.__v_isShallow)}function $l(e,t,n){if(arguments.length===2)for(var i,s=0,l=t.length;s<l;s++)!i&&s in t||(i||(i=Array.prototype.slice.call(t,0,s)),i[s]=t[s]);return e.concat(i||Array.prototype.slice.call(t))}function ql(e,t){if(e===t)return!0;if(typeof e=="object"){for(var n in e)if(!ql(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"},i={style:"color:#9d288c"},s={header:u=>Fe(u)?u.__isVue?["div",e,"VueInstance"]:Ke(u)?["div",{},["span",e,h(u)],"<",r(u.value),">"]:Kt(u)?["div",{},["span",e,Js(u)?"ShallowReactive":"Reactive"],"<",r(u),">"+(_t(u)?" (readonly)":"")]:_t(u)?["div",{},["span",e,Js(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",ye(u.props))),u.setupState!==Is&&f.push(a("setup",u.setupState)),u.data!==Is&&f.push(a("data",ye(u.data)));const p=c(u,"computed");p&&f.push(a("computed",p));const g=c(u,"inject");return g&&f.push(a("injected",g)),f.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:u}]]),f}function a(u,f){return f=lt({},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(p=>["div",{},["span",i,p+": "],r(f[p],!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",i,u]:Fe(u)?["object",{object:f?ye(u):u}]:["span",n,String(u)]}function c(u,f){const p=u.type;if(Pe(p))return;const g={};for(const m in u.ctx)d(p,m,f)&&(g[m]=u.ctx[m]);return g}function d(u,f,p){const g=u[p];return!!(Se(g)&&g.includes(f)||Fe(g)&&f in g)||!(!u.extends||!d(u.extends,f,p))||!(!u.mixins||!u.mixins.some(m=>d(m,f,p)))||void 0}function h(u){return Js(u)?"ShallowRef":u.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(s):window.devtoolsFormatters=[s]}(),typeof SuppressedError=="function"&&SuppressedError;var ld=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 i;if(this.options=typeof(i=t)=="function"?{callback:i}:i,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 p=[],g=1;g<arguments.length;g++)p[g-1]=arguments[g];if(h=p,!c||f!==d){var m=r.leading;typeof m=="function"&&(m=m(f,d)),c&&f===d||!m||l.apply(void 0,$l([f],h,!1)),d=f,clearTimeout(c),c=setTimeout(function(){l.apply(void 0,$l([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),El(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}(),js={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 ld(e,n))},updated:function(e,t){var n=t.value;if(!ql(n,t.oldValue)){var i=e._vue_visibilityState;n&&i&&i.createObserver(n)}},unmounted:function(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}};const En={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 i=new ResizeObserver(s=>{for(const l of s){const{width:a,height:r}=l.contentRect;n({width:a,height:r})}});i.observe(e),e.__resizeObserver__=i},unmounted(e){const t=e.__resizeObserver__;t&&(t.disconnect(),e.__resizeObserver__=null)}},de=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},ad={name:"EvTabs",directives:{observeVisibility:js,resize:En},props:{modelValue:{type:[String,Number],default:null},panels:{type:Array,default:()=>[],validator:e=>{const t=e.map(i=>i.value),n=[...new Set(t)];return e.length!==n.length?(console.warn("[EVUI][Tabs] TabPanel 'value' attribute is duplicate values."),!1):e.every(i=>Object.hasOwnProperty.call(i,"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=o.ref(!1),i=o.ref([]),s=o.computed({get:()=>e.modelValue,set:S=>{t("update:modelValue",S),t("change",S)}});o.provide("evTabs",s);const l=o.computed({get:()=>e.panels,set:S=>t("update:panels",S)}),a=o.computed(()=>!e.draggable||!n.value?l.value:i.value),r=l.value.map(S=>S.value),c=o.ref(null),d=o.ref(null),h=o.ref(!1),u=o.reactive({x:0}),f=o.computed(()=>({transform:`translateX(${u.x}px)`})),p=()=>{const S=c.value.offsetWidth,x=d.value.offsetWidth;if(h.value=S<x,h.value){const L=S-x;L>u.x&&(u.x=L)}else u.x=0};o.onBeforeUpdate(()=>{if(r.length===l.value.length+1){let S,x;r.length>l.value.length?(S=r,x=l.value.map(I=>I.value)):(S=l.value.map(I=>I.value),x=r);const L=S.filter(I=>!x.includes(I))[0];if(s.value===L){const I=r.findIndex(V=>V===L);I===0?s.value=l.value[0].value:s.value=l.value[I-1].value}}});const g=S=>{s.value=S},m=S=>{if(l.value.length<2)return;const x=l.value.findIndex(L=>L.value===S);if(x<0){s.value=l.value[0].value;return}S===s.value&&(x===0?s.value=l.value[1].value:s.value=l.value[x-1].value),l.value.splice(x,1),o.nextTick(()=>{r.splice(x,1)}),o.triggerRef(l)},b=(S,x=100)=>{const L=c.value.offsetWidth,I=d.value.offsetWidth,V=L-I;S==="next"&&u.x!==V?V>=u.x-x?u.x=V:u.x-=x:S==="prev"&&u.x!==0&&(x*-1<=u.x?u.x=0:u.x+=x)},C=o.reactive({item:{},idx:null});return{mv:s,computedTabList:a,clickTab:g,removeTab:m,listWrapperRef:c,listRef:d,hasScroll:h,listRefStyle:f,scrollTab:b,dragstartTab:(S,x)=>{e.draggable&&(i.value=[...l.value],C.item=S,C.idx=x,n.value=!0)},dragoverTab:S=>{var I;if(!e.draggable||((I=C.item)==null?void 0:I.value)===S)return;const x=i.value.findIndex(V=>{var v;return V.value===((v=C.item)==null?void 0:v.value)}),L=i.value.findIndex(V=>V.value===S);i.value.splice(x,1),i.value.splice(L,0,C.item)},dragendTab:()=>{e.draggable&&(l.value=[...i.value],C.item={},C.idx=null,n.value=!1,i.value.splice(0))},dragSelectCls:S=>{var x;return e.draggable&&((x=C.item)==null?void 0:x.value)===S},selectIdxCls:S=>e.draggable&&C.idx===S,onResize:()=>{p()}}}},rd={class:"ev-tabs-header"},cd={ref:"listWrapperRef",class:"ev-tabs-list-wrapper"},dd=["onClick","onDragstart","onDragover"],hd=["title"],ud=["onClick"],fd={class:"ev-tabs-body"};function md(e,t,n,i,s,l){const a=o.resolveDirective("resize"),r=o.resolveDirective("observe-visibility");return o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:o.normalizeClass(["ev-tabs",{closable:n.closable,stretch:n.stretch}])},[o.createElementVNode("div",rd,[o.createElementVNode("div",{class:o.normalizeClass(["ev-tabs-nav-wrapper",{"has-scroll":i.hasScroll}])},[i.hasScroll?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"ev-tabs-arrow prev",onClick:t[0]||(t[0]=c=>i.scrollTab("prev"))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left"},null,-1)])]),o.createElementVNode("span",{class:"ev-tabs-arrow next",onClick:t[1]||(t[1]=c=>i.scrollTab("next"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right"},null,-1)])])],64)):o.createCommentVNode("",!0),o.createElementVNode("div",cd,[o.createElementVNode("ul",{ref:"listRef",class:"ev-tabs-list",style:o.normalizeStyle(i.listRefStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.computedTabList,(c,d)=>(o.openBlock(),o.createElementBlock("li",o.mergeProps({key:`${c.value}_${d}`,class:"ev-tabs-title"},{ref_for:!0},{draggable:n.draggable},{class:{active:c.value===i.mv,"has-icon":c.iconClass,"drag-select":i.dragSelectCls(c.value),"select-idx":i.selectIdxCls(d)},onClick:h=>i.clickTab(c.value),onDragstart:o.withModifiers(h=>i.dragstartTab(c,d),["stop"]),onDragover:o.withModifiers(h=>i.dragoverTab(c.value),["prevent"]),onDragend:t[2]||(t[2]=o.withModifiers((...h)=>i.dragendTab&&i.dragendTab(...h),["prevent"]))}),[c.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-tabs-icon",c.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"text",title:c.text},o.toDisplayString(c.text),9,hd),n.closable?(o.openBlock(),o.createElementBlock("span",{key:1,class:"close-icon",onClick:o.withModifiers(h=>i.removeTab(c.value),["stop"])},[...t[5]||(t[5]=[o.createElementVNode("i",{class:"ev-icon-s-close"},null,-1)])],8,ud)):o.createCommentVNode("",!0)],16,dd))),128))],4)],512)],2)]),o.createElementVNode("div",fd,[o.renderSlot(e.$slots,"default")])],2)),[[a,i.onResize],[r,{callback:i.onResize,once:!0}]])}const Gn=de(ad,[["render",md]]);Gn.install=e=>{e.component(Gn.name,Gn)};const pd={name:"EvTabPanel",props:{text:{type:[String,Number],default:null},value:{type:[String,Number],default:null,required:!0},disabled:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1}},emits:{},setup(e){const t=o.inject("evTabs",null),n=o.computed(()=>e.value===t.value),i=o.ref(n.value);return o.watch(n,s=>{s&&(i.value=!0)}),{isSelected:n,hasBeenSelected:i}}},gd={key:0,class:"ev-tab-panel"};function bd(e,t,n,i,s,l){return!n.lazy||i.hasBeenSelected?o.withDirectives((o.openBlock(),o.createElementBlock("article",gd,[o.renderSlot(e.$slots,"default")],512)),[[o.vShow,i.isSelected]]):o.createCommentVNode("",!0)}const Wn=de(pd,[["render",bd]]);Wn.install=e=>{e.component(Wn.name,Wn)};const yd={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=o.ref(null);return o.onMounted(()=>{e.autoFocus&&t.value.focus()}),{buttonRef:t}}},xd=["type","disabled","autofocus"];function Sd(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("button",{ref:"buttonRef",class:o.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))},[o.renderSlot(e.$slots,"default")],10,xd)}const un=de(yd,[["render",Sd]]);un.install=e=>{e.component(un.name,un)};const Cd={name:"EvButtonGroup"},kd={class:"ev-button-group"};function wd(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",kd,[o.renderSlot(e.$slots,"default")])}const Zn=de(Cd,[["render",wd]]);Zn.install=e=>{e.component(Zn.name,Zn)};const Id={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=o.ref();o.onMounted(()=>{n.value&&e.tooltipTitle&&(n.value.title=e.tooltipTitle)});const i=o.ref(null),s=o.inject("EvCheckboxGroupMv",o.computed({get:()=>e.modelValue,set:c=>{c&&!i.value.indeterminate&&t("update:indeterminate",!1),t("update:modelValue",c)}})),l=o.computed(()=>e.label),a=o.computed(()=>Array.isArray(s.value)?s.value.includes(l.value):s.value),r=o.inject("EvCheckboxGroupChange",async c=>{await o.nextTick(),t("change",s.value,c)});return o.watch(()=>e.indeterminate,c=>{o.nextTick(()=>{i.value&&(i.value.indeterminate=c)})},{immediate:!0}),{mv:s,checkboxLabel:n,checkbox:i,checked:a,changeMv:r}}},Ld=["disabled","value","readonly"],Td={ref:"checkboxLabel",class:"ev-checkbox-label"};function Md(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-checkbox",[{disabled:n.disabled},{checked:i.checked}]])},[o.withDirectives(o.createElementVNode("input",{ref:"checkbox","onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"checkbox",class:"ev-checkbox-input",disabled:n.disabled,value:n.label,readonly:n.readonly,onChange:t[1]||(t[1]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,Ld),[[o.vModelCheckbox,i.mv]]),o.createElementVNode("span",Td,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))],512)],2)}const fn=de(Id,[["render",Md]]);fn.install=e=>{e.component(fn.name,fn)};const vd={name:"EvCheckboxGroup",props:{modelValue:{type:Array,default:()=>[]},type:{type:String,default:"checkbox"}},emits:{"update:modelValue":null,change:null},setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvCheckboxGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvCheckboxGroupChange",i)}};function Rd(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-checkbox-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const mn=de(vd,[["render",Rd]]);mn.install=e=>{e.component(mn.name,mn)};const Vd={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=o.inject("EvRadioGroupMv",o.computed({get:()=>e.modelValue,set:l=>t("update:modelValue",l)})),i=o.inject("EvRadioGroupChange",async l=>{await o.nextTick(),t("change",n.value,l)}),s=o.computed(()=>n.value===e.label);return{mv:n,checked:s,changeMv:i}}},Ed=["value","disabled"],Gd={class:"ev-radio-label"};function Wd(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("label",{class:o.normalizeClass(["ev-radio",[{disabled:n.disabled,checked:i.checked},n.size]])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.mv=a),type:"radio",class:"ev-radio-input",value:n.label,disabled:n.disabled,onChange:t[1]||(t[1]=o.withModifiers((...a)=>i.changeMv&&i.changeMv(...a),["stop"]))},null,40,Ed),[[o.vModelRadio,i.mv]]),o.createElementVNode("span",Gd,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.label),1)],64))])],2)}const Xn=de(Vd,[["render",Wd]]);Xn.install=e=>{e.component(Xn.name,Xn)};const Zd={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=o.computed({get:()=>e.modelValue,set:s=>t("update:modelValue",s)});o.provide("EvRadioGroupMv",n);const i=async s=>{await o.nextTick(),t("change",n.value,s)};o.provide("EvRadioGroupChange",i)}};function Xd(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-radio-group",{"type-button":n.type==="button"}]),role:"group"},[o.renderSlot(e.$slots,"default")],2)}const Nn=de(Zd,[["render",Xd]]);Nn.install=e=>{e.component(Nn.name,Nn)};const Yi={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=l=>{(i||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}},Nd={mounted(e,t){const n=e;let i=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(i=l[h],i!==d.target&&!i.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}},Pd={mounted(e,t){const n=e,i=t.modifiers.bubbles,s=document.body.getElementsByClassName("ev-date-picker-dropdown"),l=a=>{(!s&&(i||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 Pt=function(){return Pt=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Pt.apply(this,arguments)};function pn(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,l;i<s;i++)(l||!(i in t))&&(l||(l=Array.prototype.slice.call(t,0,i)),l[i]=t[i]);return e.concat(l||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Oi=44032,Pn=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Ye=["ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅘ","ㅙ","ㅚ","ㅛ","ㅜ","ㅝ","ㅞ","ㅟ","ㅠ","ㅡ","ㅢ","ㅣ"],Ee=["","ㄱ","ㄲ","ㄳ","ㄴ","ㄵ","ㄶ","ㄷ","ㄹ","ㄺ","ㄻ","ㄼ","ㄽ","ㄾ","ㄿ","ㅀ","ㅁ","ㅂ","ㅄ","ㅅ","ㅆ","ㅇ","ㅈ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ"],Bt={ㄲ:["ㄱ","ㄱ"],ㄳ:["ㄱ","ㅅ"],ㄵ:["ㄴ","ㅈ"],ㄶ:["ㄴ","ㅎ"],ㄺ:["ㄹ","ㄱ"],ㄻ:["ㄹ","ㅁ"],ㄼ:["ㄹ","ㅂ"],ㄽ:["ㄹ","ㅅ"],ㄾ:["ㄹ","ㅌ"],ㄿ:["ㄹ","ㅍ"],ㅀ:["ㄹ","ㅎ"],ㅄ:["ㅂ","ㅅ"],ㅆ:["ㅅ","ㅅ"],ㅘ:["ㅗ","ㅏ"],ㅙ:["ㅗ","ㅐ"],ㅚ:["ㅗ","ㅣ"],ㅝ:["ㅜ","ㅓ"],ㅞ:["ㅜ","ㅔ"],ㅟ:["ㅜ","ㅣ"],ㅢ:["ㅡ","ㅣ"]},Qs={ㅗ:["ㅗ","ㅚ"],ㅜ:["ㅜ","ㅟ"],ㅡ:["ㅡ","ㅢ"]},ea=["ㄱ","ㄲ","ㄴ","ㄷ","ㄸ","ㄹ","ㅁ","ㅂ","ㅃ","ㅅ","ㅆ","ㅇ","ㅈ","ㅉ","ㅊ","ㅋ","ㅌ","ㅍ","ㅎ","ㅏ","ㅐ","ㅑ","ㅒ","ㅓ","ㅔ","ㅕ","ㅖ","ㅗ","ㅛ","ㅜ","ㅠ","ㅡ","ㅣ"],ta=[["ㄱ","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 na(e){var t="",n="",i="",s=-1,l=-1,a=-1;if(e.match(/[ㄱ-ㅎ]/))t=e,s=Pn.join("").search(e);else if(e.match(/[가-힣]/)){var r=e.charCodeAt(0)-Oi;a=r%Ee.length,l=(r-a)/Ee.length%Ye.length,s=((r-a)/Ee.length-l)/Ye.length,t=Pn[s],n=Ye[l],i=Ee[a]}return{initial:t,medial:n,finale:i,initialOffset:s,medialOffset:l,finaleOffset:a}}[["은","는"],["이","가"],["을","를"],["과","와"]].reduce(function(e,t){var n=t[0],i=t[1];return pn(pn([],e,!0),[[RegExp(`([가-힣]['" ]{0,1})`.concat(n,"\\(").concat(i,"\\)(\\s+)"),"g"),n,i],[RegExp(`([가-힣]['" ]{0,1})`.concat(i,"\\(").concat(n,"\\)(\\s+)"),"g"),n,i]],!1)},[]);function Bd(e,t){var n=t===void 0?{}:t,i=n.grouped,s=i===void 0?!1:i,l=[];return e.split("").forEach(function(a){var r=na(a),c=r.initial,d=r.medial,h=r.finale,u=r.initialOffset,f=r.medialOffset,p=r.finaleOffset;l.push((u!==-1||f!==-1||p!==-1?[c,Bt[d]&&ea.indexOf(d)===-1?Bt[d]:d,Bt[h]&&ea.indexOf(h)===-1?Bt[h]:h].filter(Boolean):[a]).flat())}),s?l:l.flat()}var jt=Object.entries(Bt).reduce(function(e,t){var n,i=t[0],s=t[1];return Pt(Pt({},e),(n={},n[s.join("")]=i,n))},{}),ia=function(e){return typeof e<"u"};function Dd(e){var t=e.findIndex(function(d){return Ye.indexOf(d)!==-1}),n=t!==-1&&Ye.indexOf(e[t+1])!==-1?t+1:t,i=e.slice(0,t).join(""),s=e.slice(t,n+1).join(""),l=e.slice(n+1).join(""),a=Pn.indexOf(jt[i]||i),r=Ye.indexOf(jt[s]||s),c=Ee.indexOf(jt[l]||l);return a!==-1&&r!==-1?String.fromCharCode(Oi+a*(Ye.length*Ee.length)+r*Ee.length+c):e.join("")}function Yd(e){var t=[];(typeof e=="string"?e.split(""):e).forEach(function(l,a,r){typeof l=="string"&&t.length>0&&Ye.indexOf(r[a-1])!==-1&&Ye.indexOf(l)!==-1&&jt["".concat(r[a-1]).concat(l)]?t[t.length-1]=jt["".concat(r[a-1]).concat(l)]:t.push(l)});var n={medial:null,finales:[]},i=[n];t.forEach(function(l){Array.isArray(l)?(n={medial:null,finales:[]},i.push({grouped:l,finales:[]}),i.push(n)):Ye.indexOf(l)!==-1?(n={medial:l,finales:[]},i.push(n)):n.finales.push(l)}),i.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===i.length-1&&l.finales.length>1){var f=l.finales,p=f[0],g=f[1],m=f.slice(2);jt["".concat(p).concat(g)]&&(l.finales=pn([jt["".concat(p).concat(g)]],m,!0))}}});var s=[];return i.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(),p=d[0],g=d.slice(1);Ee.indexOf(p)===-1&&(g=pn([p],g,!0),p=""),u.filter(ia).forEach(function(m){return s.push([m])}),s.push([f,c,p].filter(Boolean)),g.filter(ia).forEach(function(m){return s.push([m])})}}),s.map(Dd).join("")}var Od=Object.values(ta).reduce(function(e,t){var n,i=t[0],s=t[1];return Pt(Pt({},e),(n={},n[s]=i,n))},{});function sa(e){return Yd(e.split("").map(function(t){return Od[t]||t}).join(""))}var oa=/[\\^$.*+?()[\]{}|]/g,Hd=RegExp(oa.source);function $s(e){return e&&Hd.test(e)?e.replace(oa,"\\$&"):e||""}var Hi=function(e,t){t===void 0&&(t=!1);var n=Pn.indexOf(e);if(n!==-1){var i=n*Ye.length*Ee.length+Oi;return"[".concat(t?e:"").concat(String.fromCharCode(i),"-").concat(String.fromCharCode(i+Ye.length*Ee.length-1),"]")}return e},la="__".concat(parseInt("fuzzy",36),"__"),aa="__".concat(parseInt("ignorespace",36),"__"),qs=function(){var e,t;return function(n,i){var s=i===void 0?{}:i,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,p=s.ignoreCase,g=p===void 0?!0:p,m=s.global,b=m===void 0?!1:m,C=s.fuzzy,y=C===void 0?!1:C,w=s.nonCaptureGroup,T=w===void 0?!1:w,k=s.engToKor,M=k===void 0?!1:k;if(e===n)return t;var Z=n,S=[];if(M&&n.trim().match(/^([a-zA-Z0-9\s]{2,})$/)){var x=sa(n.trim());x.match(/^[가-힣ㄱ-ㅎ0-9]/)&&(Z=x,S.push($s(n.trim())))}var L=Z.split(""),I=L.slice(-1)[0],V="",v=na(I||"");if(v.initialOffset!==-1){L=L.slice(0,-1);var E=v.initial,G=v.medial,R=v.finale,X=v.initialOffset,W=v.medialOffset,N=X*Ye.length*Ee.length+Oi,P=[];switch(!0){case R!=="":{P.push(I),Pn.includes(R)&&P.push("".concat(String.fromCharCode(N+W*Ee.length)).concat(Hi(R))),Bt[R]&&P.push("".concat(String.fromCharCode(N+W*Ee.length+Ee.join("").search(Bt[R][0])+1)).concat(Hi(Bt[R][1])));break}case G!=="":{var D=void 0,H=void 0;Qs[G]?(D=N+Ye.join("").search(Qs[G][0])*Ee.length,H=N+Ye.join("").search(Qs[G][1])*Ee.length+Ee.length-1):(D=N+W*Ee.length,H=D+Ee.length-1),P.push("[".concat(String.fromCharCode(D),"-").concat(String.fromCharCode(H),"]"));break}case E!=="":{P.push(Hi(E,!0));break}}V=P.length>1?T?"(?:".concat(P.join("|"),")"):"(".concat(P.join("|"),")"):P[0]}var B=y?la:f?aa:"",Y=a?L.map(function(Q){return Q.search(/[ㄱ-ㅎ]/)!==-1?Hi(Q,!0):$s(Q)}).join(B):$s(L.join(B)),O=Y.trim()!==""&&V.trim()!=="",_=O?"".concat(Y).concat(B).concat(V):"".concat(Y).concat(V),A=(c?"^":"")+_+(h?"$":"");return B&&(A=A.replace(RegExp(la,"g"),".*").replace(RegExp(aa,"g"),"\\s*")),S.length>0&&(A=pn(pn([],S,!0),[A],!1).map(function(Q){return"(".concat(Q,")")}).join("|")),t=RegExp(A,(b?"g":"")+(g?"i":"")),t}}(),zd=Object.values(ta).reduce(function(e,t){var n,i=t[0],s=t[1];return Pt(Pt({},e),(n={},n[i]=s,n))},{});function Fd(e){return e.split("").map(function(t){return Bd(t,{grouped:!1}).map(function(n){return zd[n]||n})}).flat().join("")}const Ad=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n={get:()=>e.items.some(m=>m.value===e.modelValue)?e.modelValue:null,set:m=>t("update:modelValue",m)},i={get:()=>Array.isArray(e.modelValue)?e.modelValue:[],set:m=>t("update:modelValue",m)},s=o.computed(e.multiple?i:n),l=()=>{var m;return(m=e.items.find(b=>b.value===s.value))==null?void 0:m.name},a=()=>e.items.filter(m=>e.modelValue.includes(m.value)),r=o.computed(e.multiple?a:l),c=o.computed(()=>e.multiple&&s.value.length?null:e.placeholder),d=()=>s.value,h=()=>s.value.length,u=o.computed(e.multiple?h:d),f=()=>{e.disabled||(e.multiple?(s.value.splice(0),s.value=[...s.value]):s.value=null)},p=async()=>{await o.nextTick(),t("change",s.value)};return{mv:s,selectedModel:r,computedPlaceholder:c,isClearableIcon:u,removeAllMv:f,removeMv:async m=>{if(!e.disabled){const b=s.value.indexOf(m);s.value.splice(b,1),s.value=[...s.value],await p()}},changeMv:p}},Kd=e=>{const{props:t}=o.getCurrentInstance(),{mv:n,changeMv:i}=e,s=o.ref(!1),l=o.ref(t.filterText),a=o.ref(null),r=o.ref(null),c=o.ref(null),d=o.ref(null),h=o.ref("100%"),u=o.ref(null),f=o.reactive({top:0}),p=o.computed(()=>{var R;if(!l.value||!t.filterable)return t.items;const v=(R=l.value)==null?void 0:R.trim(),E=sa(v),G=Fd(v);return t.items.filter(({name:X})=>X.search(qs(v))>-1||X.search(qs(E))>-1||X.search(qs(G))>-1)}),g=v=>{var E;l.value=(E=v==null?void 0:v.target)==null?void 0:E.value},m=async()=>{var X,W,N;await o.nextTick();const v=(X=r.value)==null?void 0:X.getBoundingClientRect().height,E=(W=r.value)==null?void 0:W.getBoundingClientRect().y,G=(N=c.value)==null?void 0:N.getBoundingClientRect().height;document.documentElement.clientHeight<E+v+G?f.top=`-${G}px`:f.top=`${v}px`},b=()=>{var X,W,N;if(!((N=(W=(X=d.value)==null?void 0:X.children[0])==null?void 0:W.children)!=null&&N.length))return;const v="selected",E=d.value.children[0].children,G=d.value.offsetTop;let R=null;for(let P=0;P<E.length;P++)if(R=E[P],R.classList.contains(v)){if(!R.offsetTop)return;d.value.scrollTop=R.offsetTop-G;break}},C=async()=>{if(d.value&&c.value){await o.nextTick(),(u.value===null||u.value!==r.value.offsetWidth)&&(u.value=r.value.offsetWidth);const v=d.value.querySelectorAll(".ev-select-dropbox-item");let E=0;v.forEach(Y=>{const O=Y.scrollWidth;O>E&&(E=O)});const{borderLeftWidth:G,borderRightWidth:R}=window.getComputedStyle(c.value),X=parseInt(G)+parseInt(R),W=d.value.offsetWidth-d.value.clientWidth;E+=W+X;const N=window.innerWidth,D=c.value.getBoundingClientRect().left,H=N-D-20,B=Math.max(Math.min(E,H),u.value);h.value=`${B}px`}else h.value="100%"};o.watch(()=>s.value,async v=>{v&&(await b(),await C())}),o.watch(()=>p.value,async()=>{await m()}),t.filterable&&o.watch(()=>p.value,()=>m());const y=async()=>{t.items.length&&!t.disabled&&(s.value=!s.value,s.value&&await m())},w=()=>{t.filterable&&(l.value=""),s.value=!1},T=o.ref(!1),k=v=>{v||(T.value=!T.value),T.value?n.value=p.value.filter(E=>!E.disabled).map(E=>E.value):n.value=[]},M=v=>{t.filterable&&(l.value=""),s.value=!1,n.value!==v&&(n.value=v,i())},Z=v=>{if(t.filterable&&(l.value=""),!n.value.includes(v))n.value.push(v);else{const E=n.value.indexOf(v);n.value.splice(E,1)}T.value=n.value.length===p.value.filter(E=>!E.disabled).length,n.value=[...n.value],i()},S=t.multiple?Z:M,x=v=>v===n.value,L=v=>n.value.includes(v),I=t.multiple?L:x;o.watch(()=>n.value,v=>{t.multiple&&t.checkable&&(v.length===0?T.value=!1:T.value=v.length===p.value.filter(E=>!E.disabled).length,m())});const V=()=>{s.value&&(C(),m())};return o.onMounted(()=>{window.addEventListener("resize",V)}),o.onUnmounted(()=>{window.removeEventListener("resize",V)}),{select:a,selectWrapper:r,dropbox:c,itemWrapper:d,isDropbox:s,dropboxPosition:f,filterTextRef:l,filteredItems:p,clickSelectInput:y,clickOutsideDropbox:w,changeFilterText:g,changeDropboxPosition:m,clickItem:S,selectedItemClass:I,allCheck:T,changeAllCheck:k,dropboxWidth:h}},_d={name:"EvSelect",components:{EvCheckbox:fn,EvCheckboxGroup:mn},directives:{clickoutside:Nd},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:i,changeMv:s,removeMv:l,removeAllMv:a}=Ad(),{select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:p,filteredItems:g,clickSelectInput:m,clickOutsideDropbox:b,changeFilterText:C,changeDropboxPosition:y,clickItem:w,selectedItemClass:T,allCheck:k,changeAllCheck:M,dropboxWidth:Z}=Kd({mv:e,changeMv:s});return{mv:e,selectedModel:t,computedPlaceholder:n,isClearableIcon:i,changeMv:s,removeMv:l,removeAllMv:a,select:r,selectWrapper:c,dropbox:d,itemWrapper:h,isDropbox:u,dropboxPosition:f,filterTextRef:p,filteredItems:g,clickSelectInput:m,clickOutsideDropbox:b,changeFilterText:C,changeDropboxPosition:y,clickItem:w,selectedItemClass:T,allCheck:k,changeAllCheck:M,dropboxWidth:Z}}},Ud={ref:"selectWrapper",class:"ev-select__wrapper"},Jd=["placeholder","disabled"],jd={key:1,class:"ev-select-tag-wrapper"},Qd=["placeholder","disabled"],$d={class:"ev-tag-name"},qd=["onClick"],eh={key:0,class:"ev-select-tag"},th={class:"ev-tag-name"},nh={key:1,class:"ev-select-tag num"},ih={class:"ev-tag-name"},sh={class:"ev-select-dropbox-wrapper"},oh=["placeholder","value"],lh={ref:"itemWrapper",class:"ev-select-dropbox-list"},ah={key:0,class:"ev-select-dropbox-ul"},rh=["title","onClick"],ch={key:1},dh={class:"ev-select-dropbox-item disabled"},hh={key:0,class:"ev-select-dropbox-ul"},uh=["title","onClick"],fh={key:2,ref:"itemWrapper",class:"ev-select-dropbox-list"},mh={key:0,class:"ev-select-dropbox-ul"},ph=["title","onClick"],gh={key:1},bh={class:"ev-select-dropbox-item disabled"};function yh(e,t,n,i,s,l){const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-checkbox-group"),c=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"select",class:o.normalizeClass(["ev-select",{selected:i.isDropbox,disabled:n.disabled}])},[o.createElementVNode("div",Ud,[n.multiple?(o.openBlock(),o.createElementBlock("div",jd,[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[3]||(t[3]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"text",class:"ev-input multiple",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[4]||(t[4]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,Qd),n.collapseTags?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[i.selectedModel.length?(o.openBlock(),o.createElementBlock("div",eh,[o.createElementVNode("span",th,o.toDisplayString(i.selectedModel[0].name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:t[5]||(t[5]=o.withModifiers(d=>[i.removeMv(i.selectedModel[0].value),i.changeDropboxPosition()],["stop"]))},[...t[13]||(t[13]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])])])):o.createCommentVNode("",!0),i.selectedModel.length>1?(o.openBlock(),o.createElementBlock("div",nh,[o.createElementVNode("span",ih," + "+o.toDisplayString(i.selectedModel.length-1),1)])):o.createCommentVNode("",!0)],64)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(i.selectedModel,d=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"ev-select-tag"},[o.createElementVNode("span",$d,o.toDisplayString(d.name),1),o.createElementVNode("span",{class:"ev-tag-suffix",onClick:o.withModifiers(h=>[i.removeMv(d.value),i.changeDropboxPosition()],["stop"])},[...t[12]||(t[12]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,qd)]))),128))])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[!n.clearable||!i.isClearableIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-input-suffix",onClick:t[0]||(t[0]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},[o.createElementVNode("i",{class:o.normalizeClass(["ev-input-suffix-arrow ev-icon-s-arrow-down",{selected:i.isDropbox}])},null,2)])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=d=>i.selectedModel=d),type:"text",class:"ev-input",readonly:"",placeholder:i.computedPlaceholder,disabled:n.disabled,onClick:t[2]||(t[2]=(...d)=>i.clickSelectInput&&i.clickSelectInput(...d))},null,8,Jd),[[o.vModelText,i.selectedModel]])],64)),n.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-input-suffix",onClick:t[6]||(t[6]=o.withModifiers(d=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[14]||(t[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",sh,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:"ev-select-dropbox",style:o.normalizeStyle([i.dropboxPosition,{width:i.dropboxWidth}])},[n.filterable?o.renderSlot(e.$slots,"search-filter",{key:0,item:{value:i.filterTextRef,onInput:i.changeFilterText,class:"ev-input-query",placeholder:n.searchPlaceholder}},()=>[o.createElementVNode("input",{type:"text",class:"ev-input-query",placeholder:n.searchPlaceholder,value:i.filterTextRef,onInput:t[7]||(t[7]=(...d)=>i.changeFilterText&&i.changeFilterText(...d))},null,40,oh)]):o.createCommentVNode("",!0),n.checkable?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.multiple?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-select-dropbox-item all-check",{selected:i.allCheck}]),onClick:t[10]||(t[10]=o.withModifiers(d=>[i.changeAllCheck(!1),i.changeDropboxPosition()],["self","prevent"]))},[o.createVNode(a,{modelValue:i.allCheck,"onUpdate:modelValue":t[8]||(t[8]=d=>i.allCheck=d),label:n.allCheckLabel,onChange:t[9]||(t[9]=d=>[i.changeAllCheck(!0),i.changeDropboxPosition()])},null,8,["modelValue","label"])],2)):o.createCommentVNode("",!0),o.createElementVNode("div",lh,[n.multiple?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.mv,"onUpdate:modelValue":t[11]||(t[11]=d=>i.mv=d)},{default:o.withCtx(()=>[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",ah,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["self","prevent"])},[o.createVNode(a,{label:d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["label","disabled"])],10,rh))),128))])):(o.openBlock(),o.createElementBlock("ul",ch,[o.createElementVNode("li",dh,o.toDisplayString(n.noMatchingText),1)]))]),_:1},8,["modelValue"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",hh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[o.createVNode(a,{"model-value":i.mv===d.value,disabled:d.disabled},{default:o.withCtx(()=>[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)]),_:2},1032,["model-value","disabled"])],10,uh))),128))])):o.createCommentVNode("",!0)],64))],512)],64)):(o.openBlock(),o.createElementBlock("div",fh,[i.filteredItems.length?(o.openBlock(),o.createElementBlock("ul",mh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteredItems,(d,h)=>(o.openBlock(),o.createElementBlock("li",{key:`${d.value}_${h}`,class:o.normalizeClass(["ev-select-dropbox-item",{selected:i.selectedItemClass(d.value),disabled:d.disabled}]),title:d.name,onClick:o.withModifiers(u=>d.disabled?[]:[i.clickItem(d.value),i.changeDropboxPosition()],["stop","prevent"])},[d.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(d.iconClass)},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(d.name),1)],10,ph))),128))])):(o.openBlock(),o.createElementBlock("ul",gh,[o.createElementVNode("li",bh,o.toDisplayString(n.noMatchingText),1)]))],512))],4)):o.createCommentVNode("",!0)])],512)],2)),[[c,i.clickOutsideDropbox]])}const Bn=de(_d,[["render",yh]]);Bn.install=e=>{e.component(Bn.name,Bn)};const xh={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=o.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 Sh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-toggle",{checked:n.modelValue,disabled:n.disabled,readonly:n.readonly}]),style:o.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)=>i.clickMv&&i.clickMv(...a))},null,6)}const Dn=de(xh,[["render",Sh]]);Dn.install=e=>{e.component(Dn.name,Dn)};const Ch={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"},modelModifiers:{type:Object,default:()=>({})}},emits:["update:modelValue","focus","blur","input","change","search"],setup(e,{emit:t}){const n=o.computed({get:()=>e.modelValue,set:m=>t("update:modelValue",m)}),i=o.ref(!1),s=()=>{e.type==="password"&&(i.value=!i.value)},l=o.computed(()=>e.type==="password"?i.value?"text":"password":e.type==="search"?"text":e.type);o.watch(()=>e.type,m=>{m!=="password"&&(i.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=>{if(e.modelModifiers.trim&&typeof m.target.value=="string"){const b=m.target.value.trim();b!==m.target.value&&(n.value=b,m.target.value=b)}t("blur",m)},u=m=>new TextEncoder().encode(m).length,f=o.computed(()=>e.maxUnit==="byte"?u(n.value||""):(n.value||"").length);return{mv:n,inputType:l,isPasswordVisible:i,clearValue:a,changePasswordVisible:s,searchValue:r,keyupInput:c,focusInput:d,blurInput:h,inputMv:m=>{let b=m.target.value;if(e.maxLength&&e.maxUnit==="byte"){for(;u(b)>e.maxLength;)b=b.slice(0,-1);m.target.value=b}n.value=b,t("input",b,m)},changeMv:m=>t("change",n.value,m),currentLength:f}}},kh={class:"ev-text-field-wrapper"},wh=["placeholder","disabled","readonly","autocomplete","maxlength"],Ih=["type","placeholder","disabled","readonly","autocomplete","maxlength"],Lh={key:3,class:"ev-text-field-icon icon-suffix"},Th={key:4,class:"ev-text-field-icon icon-prefix"},Mh={key:0,class:"ev-text-field-error"},vh={class:"curr-length"};function Rh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.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"]}])},[o.createElementVNode("div",kh,[n.type==="textarea"?o.withDirectives((o.openBlock(),o.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=a=>i.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)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[3]||(t[3]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[4]||(t[4]=(...a)=>i.changeMv&&i.changeMv(...a))},null,40,wh)),[[o.vModelText,i.mv]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=a=>i.mv=a),class:"ev-input",type:i.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)=>i.focusInput&&i.focusInput(...a)),onBlur:t[7]||(t[7]=(...a)=>i.blurInput&&i.blurInput(...a)),onInput:t[8]||(t[8]=(...a)=>i.inputMv&&i.inputMv(...a)),onChange:t[9]||(t[9]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeyup:t[10]||(t[10]=(...a)=>i.keyupInput&&i.keyupInput(...a))},null,40,Ih),[[o.vModelDynamic,i.mv]]),n.type==="text"&&n.clearable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-text-field-icon icon-clear",onClick:t[11]||(t[11]=(...a)=>i.clearValue&&i.clearValue(...a))},[...t[14]||(t[14]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])])):o.createCommentVNode("",!0),n.type==="password"&&n.showPassword?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["ev-text-field-icon icon-password",{on:i.isPasswordVisible}]),onClick:t[12]||(t[12]=(...a)=>i.changePasswordVisible&&i.changePasswordVisible(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.isPasswordVisible?"ev-icon-visibility":"ev-icon-visibility-off")},null,2)],2)):o.createCommentVNode("",!0),n.type==="search"?(o.openBlock(),o.createElementBlock("span",{key:2,class:"ev-text-field-icon icon-search",onClick:t[13]||(t[13]=(...a)=>i.searchValue&&i.searchValue(...a))},[...t[15]||(t[15]=[o.createElementVNode("i",{class:"ev-icon-search"},null,-1)])])):o.createCommentVNode("",!0),e.$slots["icon-suffix"]?(o.openBlock(),o.createElementBlock("span",Lh,[o.renderSlot(e.$slots,"icon-suffix")])):o.createCommentVNode("",!0),e.$slots["icon-prefix"]?(o.openBlock(),o.createElementBlock("span",Th,[o.renderSlot(e.$slots,"icon-prefix")])):o.createCommentVNode("",!0)],64))]),n.errorMsg?(o.openBlock(),o.createElementBlock("div",Mh,o.toDisplayString(n.errorMsg),1)):o.createCommentVNode("",!0),n.maxLength&&n.showMaxLength?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["ev-text-field-maxlength",{max:i.currentLength>n.maxLength}])},[o.createElementVNode("span",vh,o.toDisplayString(i.currentLength),1),o.createTextVNode(" / "+o.toDisplayString(n.maxLength)+o.toDisplayString(n.maxUnit==="byte"?" Bytes":""),1)],2)):o.createCommentVNode("",!0)],2)}const Yn=de(Ch,[["render",Rh]]);Yn.install=e=>{e.component(Yn.name,Yn)};const gn=globalThis.console,eo={log(...e){gn.log(...e)},warn(...e){gn.warn(...e)},info(...e){gn.info(...e)},error(...e){gn.error(...e)},debug(...e){gn.debug(...e)},dir(e,t){gn.dir(e,t)}};function ra(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 yt(...e){return e.every(ve)}function Je(e,t){const n=e/t*100;return!yt(e,t,n)||e===0||t===0?0:n.toFixed(2)}function Vh(e){return yt(e)?1e6*e:0}function Eh(e){return yt(e)?1e9*e:0}function Gh(e){return yt(e)?1e12*e:0}function Wh(e){return yt(e)?1e15*e:0}function Qt(e){const t=/\B(?=(\d{3})+(?!\d))/g;if(yt(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 On(e){const t=(e==null?void 0:e.toString().split(".")[1])||0;return t?t.length:0}function to(e){return e==null}function Zh(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||"ontouchstart"in window}function Hn(e,{min:t,max:n,step:i}){const s=Math.floor((e-t)/i),l=(e-t)%i,a=Math.floor((n-t)/i),r=Math.max(On(i),On(t));let c=!1,d;if(r){let h=+parseFloat(i*s).toFixed(r);d=+(h+t).toFixed(r),c=s===a&&+(n-d).toFixed(r)!==i,l>i/2&&!c&&(d=+(d+i).toFixed(r)),d>n?(h=+parseFloat(i*a).toFixed(r),d=+(h+t).toFixed(r)):d<t&&(d=t)}else d=i*s+t,c=s===a&&n-d!==i,l>i/2&&!c&&(d+=i),d>n?d=i*a+t:d<t&&(d=t);return d}function Xh(){const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=o.ref(e.modelValue),s=d=>{if(e.precision&&(d||d===0)){const h=Number(d).toFixed(e.precision);return e.trimTrailingZero?String(parseFloat(h)):h}return d},l=d=>{let h=d;!d&&d!==0?h=e.stepStrictly?i.value:null:isNaN(d)?h=i.value:e.stepStrictly?(e.min===-1/0&&(e.min=0),h=Hn(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),i.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 o.watch(()=>e.modelValue,(d,h)=>{d!==h&&(n.value=s(d))}),{currentValue:n,validateValue:l,focusInput:a,blurInput:r,changeMv:c}}function Nh(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=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(On(r),On(t.step));a=(Math.round(r*h)+Math.round(c*h))/h}a>=t.min&&a<=t.max&&i(a)}}}function Ph(e){const{props:t}=o.getCurrentInstance(),{currentValue:n,validateValue:i}=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)&&On(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)),i(c)};o.onBeforeMount(()=>{a(),r()})}const Bh={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)},trimTrailingZero:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur","input","change"],setup(){const{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s}=Xh(),{stepValue:l}=Nh({currentValue:e,validateValue:t});return Ph({currentValue:e,validateValue:t}),{currentValue:e,validateValue:t,focusInput:n,blurInput:i,changeMv:s,stepValue:l}}},Dh={class:"ev-input-number__wrapper"},Yh=["onClick"],Oh=["placeholder","disabled","readonly"];function Hh(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-input-number",{disabled:n.disabled,readonly:n.readonly}])},[o.createElementVNode("div",Dh,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],a=>o.createElementVNode("span",{key:`step-arrow-${a}`,class:o.normalizeClass(["ev-input-number-icon",`step-${a}`]),onClick:r=>i.stepValue(a)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-s-arrow-${a}`)},null,2)],10,Yh)),64)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>i.currentValue=a),class:"ev-input",type:"text",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,onFocus:t[1]||(t[1]=(...a)=>i.focusInput&&i.focusInput(...a)),onBlur:t[2]||(t[2]=(...a)=>i.blurInput&&i.blurInput(...a)),onChange:t[3]||(t[3]=(...a)=>i.changeMv&&i.changeMv(...a)),onKeydown:[t[4]||(t[4]=o.withKeys(o.withModifiers(a=>i.stepValue("up"),["prevent"]),["up"])),t[5]||(t[5]=o.withKeys(o.withModifiers(a=>i.stepValue("down"),["prevent"]),["down"])),t[6]||(t[6]=o.withKeys(o.withModifiers(a=>i.validateValue(i.currentValue),["prevent"]),["enter"]))]},null,40,Oh),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])])],2)}const zn=de(Bh,[["render",Hh]]);zn.install=e=>{e.component(zn.name,zn)};var ca=typeof global=="object"&&global&&global.Object===Object&&global,zh=typeof self=="object"&&self&&self.Object===Object&&self,rt=ca||zh||Function("return this")(),xt=rt.Symbol,da=Object.prototype,Fh=da.hasOwnProperty,Ah=da.toString,Fn=xt?xt.toStringTag:void 0;function Kh(e){var t=Fh.call(e,Fn),n=e[Fn];try{e[Fn]=void 0;var i=!0}catch{}var s=Ah.call(e);return i&&(t?e[Fn]=n:delete e[Fn]),s}var _h=Object.prototype,Uh=_h.toString;function Jh(e){return Uh.call(e)}var jh="[object Null]",Qh="[object Undefined]",ha=xt?xt.toStringTag:void 0;function Dt(e){return e==null?e===void 0?Qh:jh:ha&&ha in Object(e)?Kh(e):Jh(e)}function ct(e){return e!=null&&typeof e=="object"}var $h="[object Symbol]";function zi(e){return typeof e=="symbol"||ct(e)&&Dt(e)==$h}function qh(e,t){for(var n=-1,i=e==null?0:e.length,s=Array(i);++n<i;)s[n]=t(e[n],n,e);return s}var qe=Array.isArray,ua=xt?xt.prototype:void 0,fa=ua?ua.toString:void 0;function ma(e){if(typeof e=="string")return e;if(qe(e))return qh(e,ma)+"";if(zi(e))return fa?fa.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var eu=/\s/;function tu(e){for(var t=e.length;t--&&eu.test(e.charAt(t)););return t}var nu=/^\s+/;function iu(e){return e&&e.slice(0,tu(e)+1).replace(nu,"")}function Oe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pa=NaN,su=/^[-+]0x[0-9a-f]+$/i,ou=/^0b[01]+$/i,lu=/^0o[0-7]+$/i,au=parseInt;function Fi(e){if(typeof e=="number")return e;if(zi(e))return pa;if(Oe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Oe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=iu(e);var n=ou.test(e);return n||lu.test(e)?au(e.slice(2),n?2:8):su.test(e)?pa:+e}var ga=1/0,ru=17976931348623157e292;function ba(e){if(!e)return e===0?e:0;if(e=Fi(e),e===ga||e===-ga){var t=e<0?-1:1;return t*ru}return e===e?e:0}function no(e){return e}var cu="[object AsyncFunction]",du="[object Function]",hu="[object GeneratorFunction]",uu="[object Proxy]";function io(e){if(!Oe(e))return!1;var t=Dt(e);return t==du||t==hu||t==cu||t==uu}var so=rt["__core-js_shared__"],ya=function(){var e=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fu(e){return!!ya&&ya in e}var mu=Function.prototype,pu=mu.toString;function $t(e){if(e!=null){try{return pu.call(e)}catch{}try{return e+""}catch{}}return""}var gu=/[\\^$.*+?()[\]{}|]/g,bu=/^\[object .+?Constructor\]$/,yu=Function.prototype,xu=Object.prototype,Su=yu.toString,Cu=xu.hasOwnProperty,ku=RegExp("^"+Su.call(Cu).replace(gu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function wu(e){if(!Oe(e)||fu(e))return!1;var t=io(e)?ku:bu;return t.test($t(e))}function Iu(e,t){return e==null?void 0:e[t]}function qt(e,t){var n=Iu(e,t);return wu(n)?n:void 0}var oo=qt(rt,"WeakMap"),xa=Object.create,Lu=function(){function e(){}return function(t){if(!Oe(t))return{};if(xa)return xa(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Sa(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 Tu(){}function Mu(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}var vu=800,Ru=16,Vu=Date.now;function Eu(e){var t=0,n=0;return function(){var i=Vu(),s=Ru-(i-n);if(n=i,s>0){if(++t>=vu)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Gu(e){return function(){return e}}var Ai=function(){try{var e=qt(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Wu=Ai?function(e,t){return Ai(e,"toString",{configurable:!0,enumerable:!1,value:Gu(t),writable:!0})}:no,Zu=Eu(Wu);function Xu(e,t){for(var n=-1,i=e==null?0:e.length;++n<i&&t(e[n],n,e)!==!1;);return e}function Nu(e,t,n,i){for(var s=e.length,l=n+-1;++l<s;)if(t(e[l],l,e))return l;return-1}function Pu(e){return e!==e}function Bu(e,t,n){for(var i=n-1,s=e.length;++i<s;)if(e[i]===t)return i;return-1}function Du(e,t,n){return t===t?Bu(e,t,n):Nu(e,Pu,n)}function Yu(e,t){var n=e==null?0:e.length;return!!n&&Du(e,t,0)>-1}var Ou=9007199254740991,Hu=/^(?:0|[1-9]\d*)$/;function lo(e,t){var n=typeof e;return t=t??Ou,!!t&&(n=="number"||n!="symbol"&&Hu.test(e))&&e>-1&&e%1==0&&e<t}function ao(e,t,n){t=="__proto__"&&Ai?Ai(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function bn(e,t){return e===t||e!==e&&t!==t}var zu=Object.prototype,Fu=zu.hasOwnProperty;function Ca(e,t,n){var i=e[t];(!(Fu.call(e,t)&&bn(i,n))||n===void 0&&!(t in e))&&ao(e,t,n)}function Au(e,t,n,i){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?ao(n,r,c):Ca(n,r,c)}return n}var ka=Math.max;function Ku(e,t,n){return t=ka(t===void 0?e.length-1:t,0),function(){for(var i=arguments,s=-1,l=ka(i.length-t,0),a=Array(l);++s<l;)a[s]=i[t+s];s=-1;for(var r=Array(t+1);++s<t;)r[s]=i[s];return r[t]=n(a),Sa(e,this,r)}}function ro(e,t){return Zu(Ku(e,t,no),e+"")}var _u=9007199254740991;function co(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=_u}function Ki(e){return e!=null&&co(e.length)&&!io(e)}function wa(e,t,n){if(!Oe(n))return!1;var i=typeof t;return(i=="number"?Ki(n)&&lo(t,n.length):i=="string"&&t in n)?bn(n[t],e):!1}function Ia(e){return ro(function(t,n){var i=-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&&wa(n[0],n[1],a)&&(l=s<3?void 0:l,s=1),t=Object(t);++i<s;){var r=n[i];r&&e(t,r,i,l)}return t})}var Uu=Object.prototype;function ho(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Uu;return e===n}function Ju(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}var ju="[object Arguments]";function La(e){return ct(e)&&Dt(e)==ju}var Ta=Object.prototype,Qu=Ta.hasOwnProperty,$u=Ta.propertyIsEnumerable,_i=La(function(){return arguments}())?La:function(e){return ct(e)&&Qu.call(e,"callee")&&!$u.call(e,"callee")};function qu(){return!1}var Ma=typeof re=="object"&&re&&!re.nodeType&&re,va=Ma&&typeof module=="object"&&module&&!module.nodeType&&module,ef=va&&va.exports===Ma,Ra=ef?rt.Buffer:void 0,tf=Ra?Ra.isBuffer:void 0,An=tf||qu,nf="[object Arguments]",sf="[object Array]",of="[object Boolean]",lf="[object Date]",af="[object Error]",rf="[object Function]",cf="[object Map]",df="[object Number]",hf="[object Object]",uf="[object RegExp]",ff="[object Set]",mf="[object String]",pf="[object WeakMap]",gf="[object ArrayBuffer]",bf="[object DataView]",yf="[object Float32Array]",xf="[object Float64Array]",Sf="[object Int8Array]",Cf="[object Int16Array]",kf="[object Int32Array]",wf="[object Uint8Array]",If="[object Uint8ClampedArray]",Lf="[object Uint16Array]",Tf="[object Uint32Array]",Ce={};Ce[yf]=Ce[xf]=Ce[Sf]=Ce[Cf]=Ce[kf]=Ce[wf]=Ce[If]=Ce[Lf]=Ce[Tf]=!0,Ce[nf]=Ce[sf]=Ce[gf]=Ce[of]=Ce[bf]=Ce[lf]=Ce[af]=Ce[rf]=Ce[cf]=Ce[df]=Ce[hf]=Ce[uf]=Ce[ff]=Ce[mf]=Ce[pf]=!1;function Mf(e){return ct(e)&&co(e.length)&&!!Ce[Dt(e)]}function uo(e){return function(t){return e(t)}}var Va=typeof re=="object"&&re&&!re.nodeType&&re,Kn=Va&&typeof module=="object"&&module&&!module.nodeType&&module,vf=Kn&&Kn.exports===Va,fo=vf&&ca.process,yn=function(){try{var e=Kn&&Kn.require&&Kn.require("util").types;return e||fo&&fo.binding&&fo.binding("util")}catch{}}(),Ea=yn&&yn.isTypedArray,mo=Ea?uo(Ea):Mf,Rf=Object.prototype,Vf=Rf.hasOwnProperty;function Ga(e,t){var n=qe(e),i=!n&&_i(e),s=!n&&!i&&An(e),l=!n&&!i&&!s&&mo(e),a=n||i||s||l,r=a?Ju(e.length,String):[],c=r.length;for(var d in e)(t||Vf.call(e,d))&&!(a&&(d=="length"||s&&(d=="offset"||d=="parent")||l&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lo(d,c)))&&r.push(d);return r}function Wa(e,t){return function(n){return e(t(n))}}var Ef=Wa(Object.keys,Object),Gf=Object.prototype,Wf=Gf.hasOwnProperty;function Zf(e){if(!ho(e))return Ef(e);var t=[];for(var n in Object(e))Wf.call(e,n)&&n!="constructor"&&t.push(n);return t}function Za(e){return Ki(e)?Ga(e):Zf(e)}function Xf(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Nf=Object.prototype,Pf=Nf.hasOwnProperty;function Bf(e){if(!Oe(e))return Xf(e);var t=ho(e),n=[];for(var i in e)i=="constructor"&&(t||!Pf.call(e,i))||n.push(i);return n}function po(e){return Ki(e)?Ga(e,!0):Bf(e)}var Df=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yf=/^\w*$/;function go(e,t){if(qe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||zi(e)?!0:Yf.test(e)||!Df.test(e)||t!=null&&e in Object(t)}var _n=qt(Object,"create");function Of(){this.__data__=_n?_n(null):{},this.size=0}function Hf(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var zf="__lodash_hash_undefined__",Ff=Object.prototype,Af=Ff.hasOwnProperty;function Kf(e){var t=this.__data__;if(_n){var n=t[e];return n===zf?void 0:n}return Af.call(t,e)?t[e]:void 0}var _f=Object.prototype,Uf=_f.hasOwnProperty;function Jf(e){var t=this.__data__;return _n?t[e]!==void 0:Uf.call(t,e)}var jf="__lodash_hash_undefined__";function Qf(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=_n&&t===void 0?jf:t,this}function en(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}en.prototype.clear=Of,en.prototype.delete=Hf,en.prototype.get=Kf,en.prototype.has=Jf,en.prototype.set=Qf;function $f(){this.__data__=[],this.size=0}function Ui(e,t){for(var n=e.length;n--;)if(bn(e[n][0],t))return n;return-1}var qf=Array.prototype,em=qf.splice;function tm(e){var t=this.__data__,n=Ui(t,e);if(n<0)return!1;var i=t.length-1;return n==i?t.pop():em.call(t,n,1),--this.size,!0}function nm(e){var t=this.__data__,n=Ui(t,e);return n<0?void 0:t[n][1]}function im(e){return Ui(this.__data__,e)>-1}function sm(e,t){var n=this.__data__,i=Ui(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function It(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}It.prototype.clear=$f,It.prototype.delete=tm,It.prototype.get=nm,It.prototype.has=im,It.prototype.set=sm;var Un=qt(rt,"Map");function om(){this.size=0,this.__data__={hash:new en,map:new(Un||It),string:new en}}function lm(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ji(e,t){var n=e.__data__;return lm(t)?n[typeof t=="string"?"string":"hash"]:n.map}function am(e){var t=Ji(this,e).delete(e);return this.size-=t?1:0,t}function rm(e){return Ji(this,e).get(e)}function cm(e){return Ji(this,e).has(e)}function dm(e,t){var n=Ji(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function Lt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}Lt.prototype.clear=om,Lt.prototype.delete=am,Lt.prototype.get=rm,Lt.prototype.has=cm,Lt.prototype.set=dm;var hm="Expected a function";function bo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(hm);var n=function(){var i=arguments,s=t?t.apply(this,i):i[0],l=n.cache;if(l.has(s))return l.get(s);var a=e.apply(this,i);return n.cache=l.set(s,a)||l,a};return n.cache=new(bo.Cache||Lt),n}bo.Cache=Lt;var um=500;function fm(e){var t=bo(e,function(i){return n.size===um&&n.clear(),i}),n=t.cache;return t}var mm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pm=/\\(\\)?/g,gm=fm(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(mm,function(n,i,s,l){t.push(s?l.replace(pm,"$1"):i||n)}),t});function bm(e){return e==null?"":ma(e)}function Xa(e,t){return qe(e)?e:go(e,t)?[e]:gm(bm(e))}function ji(e){if(typeof e=="string"||zi(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Na(e,t){t=Xa(t,e);for(var n=0,i=t.length;e!=null&&n<i;)e=e[ji(t[n++])];return n&&n==i?e:void 0}function ym(e,t,n){var i=e==null?void 0:Na(e,t);return i===void 0?n:i}function xm(e,t){for(var n=-1,i=t.length,s=e.length;++n<i;)e[s+n]=t[n];return e}var Pa=Wa(Object.getPrototypeOf,Object),Sm="[object Object]",Cm=Function.prototype,km=Object.prototype,Ba=Cm.toString,wm=km.hasOwnProperty,Im=Ba.call(Object);function Lm(e){if(!ct(e)||Dt(e)!=Sm)return!1;var t=Pa(e);if(t===null)return!0;var n=wm.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Ba.call(n)==Im}function Tm(){this.__data__=new It,this.size=0}function Mm(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function vm(e){return this.__data__.get(e)}function Rm(e){return this.__data__.has(e)}var Vm=200;function Em(e,t){var n=this.__data__;if(n instanceof It){var i=n.__data__;if(!Un||i.length<Vm-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Lt(i)}return n.set(e,t),this.size=n.size,this}function dt(e){var t=this.__data__=new It(e);this.size=t.size}dt.prototype.clear=Tm,dt.prototype.delete=Mm,dt.prototype.get=vm,dt.prototype.has=Rm,dt.prototype.set=Em;var Da=typeof re=="object"&&re&&!re.nodeType&&re,Ya=Da&&typeof module=="object"&&module&&!module.nodeType&&module,Gm=Ya&&Ya.exports===Da,Oa=Gm?rt.Buffer:void 0,Ha=Oa?Oa.allocUnsafe:void 0;function za(e,t){if(t)return e.slice();var n=e.length,i=Ha?Ha(n):new e.constructor(n);return e.copy(i),i}function Wm(e,t){for(var n=-1,i=e==null?0:e.length,s=0,l=[];++n<i;){var a=e[n];t(a,n,e)&&(l[s++]=a)}return l}function Zm(){return[]}var Xm=Object.prototype,Nm=Xm.propertyIsEnumerable,Fa=Object.getOwnPropertySymbols,Pm=Fa?function(e){return e==null?[]:(e=Object(e),Wm(Fa(e),function(t){return Nm.call(e,t)}))}:Zm;function Bm(e,t,n){var i=t(e);return qe(e)?i:xm(i,n(e))}function yo(e){return Bm(e,Za,Pm)}var xo=qt(rt,"DataView"),So=qt(rt,"Promise"),xn=qt(rt,"Set"),Aa="[object Map]",Dm="[object Object]",Ka="[object Promise]",_a="[object Set]",Ua="[object WeakMap]",Ja="[object DataView]",Ym=$t(xo),Om=$t(Un),Hm=$t(So),zm=$t(xn),Fm=$t(oo),ht=Dt;(xo&&ht(new xo(new ArrayBuffer(1)))!=Ja||Un&&ht(new Un)!=Aa||So&&ht(So.resolve())!=Ka||xn&&ht(new xn)!=_a||oo&&ht(new oo)!=Ua)&&(ht=function(e){var t=Dt(e),n=t==Dm?e.constructor:void 0,i=n?$t(n):"";if(i)switch(i){case Ym:return Ja;case Om:return Aa;case Hm:return Ka;case zm:return _a;case Fm:return Ua}return t});var Am=Object.prototype,Km=Am.hasOwnProperty;function _m(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Km.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Qi=rt.Uint8Array;function Co(e){var t=new e.constructor(e.byteLength);return new Qi(t).set(new Qi(e)),t}function Um(e,t){var n=Co(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Jm=/\w*$/;function jm(e){var t=new e.constructor(e.source,Jm.exec(e));return t.lastIndex=e.lastIndex,t}var ja=xt?xt.prototype:void 0,Qa=ja?ja.valueOf:void 0;function Qm(e){return Qa?Object(Qa.call(e)):{}}function $a(e,t){var n=t?Co(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var $m="[object Boolean]",qm="[object Date]",ep="[object Map]",tp="[object Number]",np="[object RegExp]",ip="[object Set]",sp="[object String]",op="[object Symbol]",lp="[object ArrayBuffer]",ap="[object DataView]",rp="[object Float32Array]",cp="[object Float64Array]",dp="[object Int8Array]",hp="[object Int16Array]",up="[object Int32Array]",fp="[object Uint8Array]",mp="[object Uint8ClampedArray]",pp="[object Uint16Array]",gp="[object Uint32Array]";function bp(e,t,n){var i=e.constructor;switch(t){case lp:return Co(e);case $m:case qm:return new i(+e);case ap:return Um(e);case rp:case cp:case dp:case hp:case up:case fp:case mp:case pp:case gp:return $a(e,n);case ep:return new i;case tp:case sp:return new i(e);case np:return jm(e);case ip:return new i;case op:return Qm(e)}}function qa(e){return typeof e.constructor=="function"&&!ho(e)?Lu(Pa(e)):{}}var yp="[object Map]";function xp(e){return ct(e)&&ht(e)==yp}var er=yn&&yn.isMap,Sp=er?uo(er):xp,Cp="[object Set]";function kp(e){return ct(e)&&ht(e)==Cp}var tr=yn&&yn.isSet,wp=tr?uo(tr):kp,Ip=1,nr="[object Arguments]",Lp="[object Array]",Tp="[object Boolean]",Mp="[object Date]",vp="[object Error]",ir="[object Function]",Rp="[object GeneratorFunction]",Vp="[object Map]",Ep="[object Number]",sr="[object Object]",Gp="[object RegExp]",Wp="[object Set]",Zp="[object String]",Xp="[object Symbol]",Np="[object WeakMap]",Pp="[object ArrayBuffer]",Bp="[object DataView]",Dp="[object Float32Array]",Yp="[object Float64Array]",Op="[object Int8Array]",Hp="[object Int16Array]",zp="[object Int32Array]",Fp="[object Uint8Array]",Ap="[object Uint8ClampedArray]",Kp="[object Uint16Array]",_p="[object Uint32Array]",xe={};xe[nr]=xe[Lp]=xe[Pp]=xe[Bp]=xe[Tp]=xe[Mp]=xe[Dp]=xe[Yp]=xe[Op]=xe[Hp]=xe[zp]=xe[Vp]=xe[Ep]=xe[sr]=xe[Gp]=xe[Wp]=xe[Zp]=xe[Xp]=xe[Fp]=xe[Ap]=xe[Kp]=xe[_p]=!0,xe[vp]=xe[ir]=xe[Np]=!1;function Jn(e,t,n,i,s,l){var a,r=t&Ip;if(n&&(a=s?n(e,i,s,l):n(e)),a!==void 0)return a;if(!Oe(e))return e;var c=qe(e);if(c)a=_m(e);else{var d=ht(e),h=d==ir||d==Rp;if(An(e))return za(e,r);if(d==sr||d==nr||h&&!s)a=h?{}:qa(e);else{if(!xe[d])return s?e:{};a=bp(e,d,r)}}l||(l=new dt);var u=l.get(e);if(u)return u;l.set(e,a),wp(e)?e.forEach(function(g){a.add(Jn(g,t,n,g,e,l))}):Sp(e)&&e.forEach(function(g,m){a.set(m,Jn(g,t,n,m,e,l))});var f=yo,p=c?void 0:f(e);return Xu(p||e,function(g,m){p&&(m=g,g=e[m]),Ca(a,m,Jn(g,t,n,m,e,l))}),a}var Up=1,Jp=4;function Ze(e){return Jn(e,Up|Jp)}var jp=1,Qp=4;function or(e,t){return t=typeof t=="function"?t:void 0,Jn(e,jp|Qp,t)}var $p="__lodash_hash_undefined__";function qp(e){return this.__data__.set(e,$p),this}function eg(e){return this.__data__.has(e)}function jn(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Lt;++t<n;)this.add(e[t])}jn.prototype.add=jn.prototype.push=qp,jn.prototype.has=eg;function tg(e,t){for(var n=-1,i=e==null?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function lr(e,t){return e.has(t)}var ng=1,ig=2;function ar(e,t,n,i,s,l){var a=n&ng,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,p=n&ig?new jn:void 0;for(l.set(e,t),l.set(t,e);++u<r;){var g=e[u],m=t[u];if(i)var b=a?i(m,g,u,t,e,l):i(g,m,u,e,t,l);if(b!==void 0){if(b)continue;f=!1;break}if(p){if(!tg(t,function(C,y){if(!lr(p,y)&&(g===C||s(g,C,n,i,l)))return p.push(y)})){f=!1;break}}else if(!(g===m||s(g,m,n,i,l))){f=!1;break}}return l.delete(e),l.delete(t),f}function sg(e){var t=-1,n=Array(e.size);return e.forEach(function(i,s){n[++t]=[s,i]}),n}function ko(e){var t=-1,n=Array(e.size);return e.forEach(function(i){n[++t]=i}),n}var og=1,lg=2,ag="[object Boolean]",rg="[object Date]",cg="[object Error]",dg="[object Map]",hg="[object Number]",ug="[object RegExp]",fg="[object Set]",mg="[object String]",pg="[object Symbol]",gg="[object ArrayBuffer]",bg="[object DataView]",rr=xt?xt.prototype:void 0,wo=rr?rr.valueOf:void 0;function yg(e,t,n,i,s,l,a){switch(n){case bg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case gg:return!(e.byteLength!=t.byteLength||!l(new Qi(e),new Qi(t)));case ag:case rg:case hg:return bn(+e,+t);case cg:return e.name==t.name&&e.message==t.message;case ug:case mg:return e==t+"";case dg:var r=sg;case fg:var c=i&og;if(r||(r=ko),e.size!=t.size&&!c)return!1;var d=a.get(e);if(d)return d==t;i|=lg,a.set(e,t);var h=ar(r(e),r(t),i,s,l,a);return a.delete(e),h;case pg:if(wo)return wo.call(e)==wo.call(t)}return!1}var xg=1,Sg=Object.prototype,Cg=Sg.hasOwnProperty;function kg(e,t,n,i,s,l){var a=n&xg,r=yo(e),c=r.length,d=yo(t),h=d.length;if(c!=h&&!a)return!1;for(var u=c;u--;){var f=r[u];if(!(a?f in t:Cg.call(t,f)))return!1}var p=l.get(e),g=l.get(t);if(p&&g)return p==t&&g==e;var m=!0;l.set(e,t),l.set(t,e);for(var b=a;++u<c;){f=r[u];var C=e[f],y=t[f];if(i)var w=a?i(y,C,f,t,e,l):i(C,y,f,e,t,l);if(!(w===void 0?C===y||s(C,y,n,i,l):w)){m=!1;break}b||(b=f=="constructor")}if(m&&!b){var T=e.constructor,k=t.constructor;T!=k&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof k=="function"&&k instanceof k)&&(m=!1)}return l.delete(e),l.delete(t),m}var wg=1,cr="[object Arguments]",dr="[object Array]",$i="[object Object]",Ig=Object.prototype,hr=Ig.hasOwnProperty;function Lg(e,t,n,i,s,l){var a=qe(e),r=qe(t),c=a?dr:ht(e),d=r?dr:ht(t);c=c==cr?$i:c,d=d==cr?$i:d;var h=c==$i,u=d==$i,f=c==d;if(f&&An(e)){if(!An(t))return!1;a=!0,h=!1}if(f&&!h)return l||(l=new dt),a||mo(e)?ar(e,t,n,i,s,l):yg(e,t,c,n,i,s,l);if(!(n&wg)){var p=h&&hr.call(e,"__wrapped__"),g=u&&hr.call(t,"__wrapped__");if(p||g){var m=p?e.value():e,b=g?t.value():t;return l||(l=new dt),s(m,b,n,i,l)}}return f?(l||(l=new dt),kg(e,t,n,i,s,l)):!1}function qi(e,t,n,i,s){return e===t?!0:e==null||t==null||!ct(e)&&!ct(t)?e!==e&&t!==t:Lg(e,t,n,i,qi,s)}var Tg=1,Mg=2;function vg(e,t,n,i){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 dt,u;if(!(u===void 0?qi(d,c,Tg|Mg,i,h):u))return!1}}return!0}function ur(e){return e===e&&!Oe(e)}function Rg(e){for(var t=Za(e),n=t.length;n--;){var i=t[n],s=e[i];t[n]=[i,s,ur(s)]}return t}function fr(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Vg(e){var t=Rg(e);return t.length==1&&t[0][2]?fr(t[0][0],t[0][1]):function(n){return n===e||vg(n,e,t)}}function Eg(e,t){return e!=null&&t in Object(e)}function Gg(e,t,n){t=Xa(t,e);for(var i=-1,s=t.length,l=!1;++i<s;){var a=ji(t[i]);if(!(l=e!=null&&n(e,a)))break;e=e[a]}return l||++i!=s?l:(s=e==null?0:e.length,!!s&&co(s)&&lo(a,s)&&(qe(e)||_i(e)))}function Wg(e,t){return e!=null&&Gg(e,t,Eg)}var Zg=1,Xg=2;function Ng(e,t){return go(e)&&ur(t)?fr(ji(e),t):function(n){var i=ym(n,e);return i===void 0&&i===t?Wg(n,e):qi(t,i,Zg|Xg)}}function Pg(e){return function(t){return t==null?void 0:t[e]}}function Bg(e){return function(t){return Na(t,e)}}function Dg(e){return go(e)?Pg(ji(e)):Bg(e)}function Yg(e){return typeof e=="function"?e:e==null?no:typeof e=="object"?qe(e)?Ng(e[0],e[1]):Vg(e):Dg(e)}function Og(e){return function(t,n,i){for(var s=-1,l=Object(t),a=i(t),r=a.length;r--;){var c=a[++s];if(n(l[c],c,l)===!1)break}return t}}var Hg=Og(),Io=function(){return rt.Date.now()},zg="Expected a function",Fg=Math.max,Ag=Math.min;function es(e,t,n){var i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;if(typeof e!="function")throw new TypeError(zg);t=Fi(t)||0,Oe(n)&&(h=!!n.leading,u="maxWait"in n,l=u?Fg(Fi(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f);function p(M){var Z=i,S=s;return i=s=void 0,d=M,a=e.apply(S,Z),a}function g(M){return d=M,r=setTimeout(C,t),h?p(M):a}function m(M){var Z=M-c,S=M-d,x=t-Z;return u?Ag(x,l-S):x}function b(M){var Z=M-c,S=M-d;return c===void 0||Z>=t||Z<0||u&&S>=l}function C(){var M=Io();if(b(M))return y(M);r=setTimeout(C,m(M))}function y(M){return r=void 0,f&&i?p(M):(i=s=void 0,a)}function w(){r!==void 0&&clearTimeout(r),d=0,i=c=s=r=void 0}function T(){return r===void 0?a:y(Io())}function k(){var M=Io(),Z=b(M);if(i=arguments,s=this,c=M,Z){if(r===void 0)return g(c);if(u)return clearTimeout(r),r=setTimeout(C,t),p(c)}return r===void 0&&(r=setTimeout(C,t)),a}return k.cancel=w,k.flush=T,k}var mr=Object.prototype,Kg=mr.hasOwnProperty,_g=ro(function(e,t){e=Object(e);var n=-1,i=t.length,s=i>2?t[2]:void 0;for(s&&wa(t[0],t[1],s)&&(i=1);++n<i;)for(var l=t[n],a=po(l),r=-1,c=a.length;++r<c;){var d=a[r],h=e[d];(h===void 0||bn(h,mr[d])&&!Kg.call(e,d))&&(e[d]=l[d])}return e});function Lo(e,t,n){(n!==void 0&&!bn(e[t],n)||n===void 0&&!(t in e))&&ao(e,t,n)}function Ug(e){return ct(e)&&Ki(e)}function To(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function Jg(e){return Au(e,po(e))}function jg(e,t,n,i,s,l,a){var r=To(e,n),c=To(t,n),d=a.get(c);if(d){Lo(e,n,d);return}var h=l?l(r,c,n+"",e,t,a):void 0,u=h===void 0;if(u){var f=qe(c),p=!f&&An(c),g=!f&&!p&&mo(c);h=c,f||p||g?qe(r)?h=r:Ug(r)?h=Mu(r):p?(u=!1,h=za(c,!0)):g?(u=!1,h=$a(c,!0)):h=[]:Lm(c)||_i(c)?(h=r,_i(r)?h=Jg(r):(!Oe(r)||io(r))&&(h=qa(c))):u=!1}u&&(a.set(c,h),s(h,c,i,l,a),a.delete(c)),Lo(e,n,h)}function ts(e,t,n,i,s){e!==t&&Hg(t,function(l,a){if(s||(s=new dt),Oe(l))jg(e,t,a,n,ts,i,s);else{var r=i?i(To(e,a),l,a+"",e,t,s):void 0;r===void 0&&(r=l),Lo(e,a,r)}},po)}function pr(e,t,n,i,s,l){return Oe(e)&&Oe(t)&&(l.set(t,e),ts(e,t,void 0,pr,l),l.delete(t)),e}var Qg=Ia(function(e,t,n,i){ts(e,t,n,i)}),He=ro(function(e){return e.push(void 0,pr),Sa(Qg,void 0,e)}),$g=Math.max,qg=Math.min;function eb(e,t,n){return e>=qg(t,n)&&e<$g(t,n)}function St(e,t,n){return t=ba(t),n===void 0?(n=t,t=0):n=ba(n),e=Fi(e),eb(e,t,n)}function _e(e,t){return qi(e,t)}var tb="[object Number]";function nb(e){return typeof e=="number"||ct(e)&&Dt(e)==tb}function Yt(e){return e==null}function ib(e){return e===void 0}var Mo=Ia(function(e,t,n){ts(e,t,n)}),sb=Array.prototype,ob=sb.reverse;function lb(e){return e==null?e:ob.call(e)}var ab="Expected a function";function ns(e,t,n){var i=!0,s=!0;if(typeof e!="function")throw new TypeError(ab);return Oe(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),es(e,t,{leading:i,maxWait:t,trailing:s})}var rb=1/0,cb=xn&&1/ko(new xn([,-0]))[1]==rb?function(e){return new xn(e)}:Tu,db=200;function hb(e,t,n){var i=-1,s=Yu,l=e.length,a=!0,r=[],c=r;if(l>=db){var d=t?null:cb(e);if(d)return ko(d);a=!1,s=lr,c=new jn}else c=t?[]:r;e:for(;++i<l;){var h=e[i],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 ub(e,t){return e&&e.length?hb(e,Yg(t)):[]}const fb=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(e.modelValue),i=()=>{if(!e.showStep)return[];const f=e.max-e.min,p=f/e.step,g=Je(e.step,f),m=[];for(let b=1;b<p;b++)m.push(b*g);return m},s=()=>{if(!e.mark||!Object.keys(e.mark).length)return[];const f=(g,m="value")=>{if(!g)return[];const b=e.mark.style&&typeof e.mark.style=="object"?e.mark.style:{},C=Object.keys(g),y=[];let w;for(let T=0;T<C.length;T++)w=+C[T],isNaN(w)||y.push({posX:m==="value"?Je(w,e.max-e.min):w,label:g[w],style:b});return y};return e.mark.value||e.mark.percent?[...f(e.mark.value),...f(e.mark.percent,"percent")]:[...f(e.mark)]},l=o.reactive({isInit:!1,dragging:!1,handleType:null,leftValue:null,rightValue:null}),a=o.reactive({valueRange:0,stepList:o.computed(i),markList:o.computed(s),offset:{left:0,width:0}}),r=o.ref(),c=o.computed(()=>{const f=e.tooltipFormat,p=f instanceof Function;return{left:p?f(l.leftValue):l.leftValue,right:p?f(l.rightValue):l.rightValue}}),d=f=>{const p={min:e.min,max:e.max,step:e.step};let g,m;e.range&&Array.isArray(f)?(g=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=Hn(g,p),l.rightValue=Hn(m,p)):(g=e.min,m=typeof f=="number"&&!isNaN(f)?f:e.min,l.leftValue=Hn(g,p),l.rightValue=Hn(m,p))},h=f=>{if(a.valueRange<=0)return;d(f);let p;if(e.range&&Array.isArray(f)){const g=Math.min(l.leftValue,l.rightValue),m=Math.max(l.leftValue,l.rightValue);p=[g,m]}else p=l.rightValue;n.value=p,t("update:modelValue",p),t("change",p)},u=()=>{const f=r.value.getBoundingClientRect();a.offset.left=f.left,a.offset.width=f.width,a.valueRange=e.max-e.min};return o.watch(()=>e.modelValue,(f,p)=>{nb(f)&&f>=0&&!_e(f,p)&&!l.dragging&&(d(f),n.value=f)}),o.watch(()=>e.step,()=>{h(n.value)}),{currentValue:n,state:l,slider:a,formatValue:c,sliderLine:r,updateSliderInfo:u,setSliderValue:h}},mb=e=>{const{props:t}=o.getCurrentInstance(),{state:n,slider:i}=e,s="transparent",l=o.computed(()=>({left:i.valueRange>0?`${Je(n.leftValue-t.min,i.valueRange)}%`:0})),a=o.computed(()=>({left:i.valueRange>0?`${Je(n.rightValue-t.min,i.valueRange)}%`:0})),r=o.computed(()=>!t.color||Array.isArray(t.color)&&t.color.length!==1?{}:{borderColor:(typeof t.color=="string"?t.color:t.color[0])||s}),c=o.computed(()=>t.color&&Array.isArray(t.color)),d=o.computed(()=>{const f=Math.min(n.leftValue,n.rightValue),g=+(Math.max(n.leftValue,n.rightValue)-f).toFixed(2),m=i.valueRange>0&&t.range?Je(+(f-t.min).toFixed(2),i.valueRange):0,b=g>0?Je(g,i.valueRange):0,C={};return t.color&&(typeof t.color=="string"||Array.isArray(t.color)&&t.color.length===1?C.backgroundColor=(typeof t.color=="string"?t.color:t.color[0])||s:Array.isArray(t.color)&&t.color.length>1&&(C.backgroundColor=(t.range?t.color[1]:t.color[0])||s)),{left:`${m}%`,width:`${b}%`,...C}}),h=o.computed(()=>{if(!c.value||t.color.length<2||!t.range)return{};const f=Math.min(n.leftValue,n.rightValue);return{width:`${Je(Math.abs(f-t.min),i.valueRange)}%`,backgroundColor:t.color[0]||s}}),u=o.computed(()=>{if(!c.value||t.color.length<2)return{};const f=Math.max(n.leftValue,n.rightValue),p=Je(+(f-t.min).toFixed(2),i.valueRange),g=Je(+(t.max-f).toFixed(2),i.valueRange),m=t.range?2:t.color.length-1;return{left:`${p}%`,width:`${g}%`,backgroundColor:t.color[m]||s}});return{isColorArray:c,leftHandleStyle:l,rightHandleStyle:a,handleBtnStyle:r,rangeThumbStyle:d,leftThumbStyle:h,rightThumbStyle:u}},pb=e=>{const{props:t}=o.getCurrentInstance(),{currentValue:n,state:i,slider:s,updateSliderInfo:l,setSliderValue:a}=e,r=p=>{i.dragging||l();const g=p.type.indexOf("touch")!==-1?p.touches[0].clientX:p.clientX,{valueRange:m,offset:b}=s;let C=t.min+(g-b.left)*m/b.width;return C<t.min?C=t.min:C>t.max&&(C=t.max),C},c=p=>{if(t.readonly||t.disabled||i.dragging)return;const g=r(p);let m;if(t.range){const C=Math.min(i.leftValue,i.rightValue)+Math.abs((i.rightValue-i.leftValue)/2),y=i.leftValue>i.rightValue;g<C?i.handleType=y?"right":"left":i.handleType=y?"left":"right",m=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]}else i.handleType="right",m=g;a(m)},d=p=>{const g=r(p);i.dragging=!0;let m;t.range?m=i.handleType==="left"?[g,i.rightValue]:[i.leftValue,g]:m=g,a(m)},h=()=>{i.handleType=null,i.dragging=!1,document.body.style.cursor="",window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h)};return{startDrag:p=>{t.readonly||t.disabled||(i.handleType=p,document.body.style.cursor="grabbing",window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),window.addEventListener("mouseup",h),window.addEventListener("touchend",h))},clickSlider:c,changeInput:(p,g)=>{if(t.showInput&&!i.dragging&&i.isInit)if(t.range&&Array.isArray(n.value)){const m=g==="left"?[p,n.value[1]]:[n.value[0],p];a(m)}else t.range||a(p)}}},gb=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{currentValue:i,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&&(i.value=t.range?[t.min,t.min]:t.min,n("update:modelValue",i.value)),r(i.value),s.isInit=!0};o.onMounted(()=>{c(),d()})},bb={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:i,sliderLine:s,updateSliderInfo:l,setSliderValue:a}=fb(),{isColorArray:r,leftHandleStyle:c,rightHandleStyle:d,handleBtnStyle:h,rangeThumbStyle:u,leftThumbStyle:f,rightThumbStyle:p}=mb({state:t,slider:n}),{startDrag:g,clickSlider:m,changeInput:b}=pb({currentValue:e,state:t,slider:n,updateSliderInfo:l,setSliderValue:a});return gb({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:p,sliderLine:s,...o.toRefs(t),...o.toRefs(n),formatValue:i,startDrag:g,clickSlider:m,changeInput:b}}},yb={class:"ev-slider-wrapper"},xb={ref:"sliderLine",class:"ev-slider-line"},Sb={key:0,class:"ev-slider-step-wrapper"},Cb={key:2,class:"ev-slider-mark-wrapper"},kb={class:"ev-slider-mark-label"},wb=["innerHTML"],Ib=["innerHTML"];function Lb(e,t,n,i,s,l){const a=o.resolveComponent("ev-input-number");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["ev-slider",{readonly:n.readonly,disabled:n.disabled,"hide-tooltip":!n.showTooltip,"show-input":n.showInput,"color-range":i.isColorArray,"show-mark":e.markList.length}])},[o.createElementVNode("div",yb,[o.createElementVNode("div",xb,[n.showStep&&n.step?(o.openBlock(),o.createElementBlock("div",Sb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.stepList,(r,c)=>(o.openBlock(),o.createElementBlock("span",{key:`slider-step-${c}`,style:o.normalizeStyle({left:`${r}%`}),class:"ev-slider-step"},null,4))),128))])):o.createCommentVNode("",!0),i.isColorArray&&n.color.length>1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.range?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle(i.leftThumbStyle),class:"ev-slider-thumb left"},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{style:o.normalizeStyle(i.rightThumbStyle),class:"ev-slider-thumb right"},null,4)],64)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"ev-slider-thumb",style:o.normalizeStyle(i.rangeThumbStyle)},null,4),e.markList.length>0?(o.openBlock(),o.createElementBlock("div",Cb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.markList,(r,c)=>(o.openBlock(),o.createElementBlock("div",{key:`slider-step-${c}`,style:o.normalizeStyle({...r.style,left:`${r.posX}%`}),class:"ev-slider-mark"},[o.createElementVNode("span",kb,o.toDisplayString(r.label),1)],4))),128))])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-slider-line-layer",onClick:t[0]||(t[0]=(...r)=>i.clickSlider&&i.clickSlider(...r))})],512),n.range?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="left"}]),style:o.normalizeStyle(i.leftHandleStyle),onMousedown:t[1]||(t[1]=o.withModifiers(r=>i.startDrag("left"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.left},null,8,wb)],38)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["ev-slider-handle",{dragging:e.dragging&&e.handleType==="right"}]),style:o.normalizeStyle(i.rightHandleStyle),onMousedown:t[2]||(t[2]=o.withModifiers(r=>i.startDrag("right"),["stop","prevent"]))},[o.createElementVNode("span",{style:o.normalizeStyle(i.handleBtnStyle),class:"ev-slider-handle-btn"},null,4),o.createElementVNode("div",{class:"ev-slider-tooltip",innerHTML:i.formatValue.right},null,8,Ib)],38)]),n.showInput&&!n.range?(o.openBlock(),o.createBlock(a,{key:0,modelValue:i.currentValue,"onUpdate:modelValue":t[3]||(t[3]=r=>i.currentValue=r),step:n.step,min:n.min,max:n.max,"step-strictly":"",onChange:i.changeInput},null,8,["modelValue","step","min","max","onChange"])):n.showInput&&n.range&&Array.isArray(n.modelValue)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createVNode(a,{modelValue:i.currentValue[0],"onUpdate:modelValue":t[4]||(t[4]=r=>i.currentValue[0]=r),step:n.step,min:n.min,max:i.currentValue[1],"step-strictly":"",onChange:t[5]||(t[5]=r=>i.changeInput(r,"left"))},null,8,["modelValue","step","min","max"]),o.createVNode(a,{modelValue:i.currentValue[1],"onUpdate:modelValue":t[6]||(t[6]=r=>i.currentValue[1]=r),step:n.step,min:i.currentValue[0],max:n.max,"step-strictly":"",onChange:t[7]||(t[7]=r=>i.changeInput(r,"right"))},null,8,["modelValue","step","min","max"])],64)):o.createCommentVNode("",!0)],2)}const Qn=de(bb,[["render",Lb]]);Qn.install=e=>{e.component(Qn.name,Qn)};const Tb={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 Mb(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("i",{class:o.normalizeClass([n.icon,{[`ev-icon-${n.size}`]:!!n.size}]),style:o.normalizeStyle({color:n.color}),onClick:t[0]||(t[0]=(...a)=>i.onClick&&i.onClick(...a)),"on:dblClick":t[1]||(t[1]=(...a)=>i.onDblClick&&i.onDblClick(...a)),onContextmenu:t[2]||(t[2]=(...a)=>i.onContextMenu&&i.onContextMenu(...a))},null,38)}const Sn=de(Tb,[["render",Mb]]);Sn.install=e=>{e.component(Sn.name,Sn)};const vo=6,Ro=7,Vo=4,Eo=3,Go=5,Wo=4,je=12,vb=24,Rb=60,Vb=60,ut=12,gr=4,Zo=20,Xo={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월"]},Eb={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:["일","월","화","수","목","금","토"]},et={DATE:"date",MONTH:"month",YEAR:"year"},is=864e5,ss=+new Date("1970-01-01 00:00:00"),br=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),yr=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]/),Gb=(e,t)=>e.length?e.reduce((n,i)=>new Date(n).getTime()>new Date(i).getTime()?n:i):"",Ge=e=>e===null?"00":+e<10?`0${e}`:e,Cn=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),Wb=(e,t)=>new Date(`${e}-${t}-1`).getDay(),No=(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:i,min:s,sec:l})=>i!==void 0&&s!==void 0&&l!==void 0?`${e}-${Ge(t)}-${Ge(n)} ${Ge(i)}:${Ge(s)}:${Ge(l)}`:`${e}-${Ge(t)}-${Ge(n)}`,We=(e,t)=>{var s,l,a,r,c,d;let n=o.unref(e);Array.isArray(n)&&(n=Gb(e));const i={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"?i.year:t==="month"?i.month:t==="date"?i.date:t==="hour"?i.hour:t==="min"?i.min:t==="sec"?i.sec:i},xr=(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},qn=(e,t,n)=>{const i=We(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"?i:+s;if(n==="min")return l==="mm"?i:+l;if(n==="sec")return a==="ss"?i:+a}return i},Te=(e,t)=>{if(!t)return"";const n=Ge(qn(e,t,"hour")),i=Ge(qn(e,t,"min")),s=Ge(qn(e,t,"sec"));return`${t.split(" ")[0]} ${n}:${i}:${s}`},os=(e,t,n,i)=>{if(!i.length)return!1;let s=t==="main"?n:i[0],l=t==="expanded"?n:i[1],a=s,r=l;if(!n.split(" ")[1])if(e==="dateTimeRange"){s=s.split(" ")[0],l=l.split(" ")[0];const c=i[0].split(" ")[1],d=i[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()},kn=e=>new Date(`${e}`).getTime(),Sr=e=>{const t=10**(e.toString().length-1),n=Math.floor(e/t),i=Math.floor(e%(t*n)),s=n*t+Math.floor(i/Zo)*Zo,l=s+Zo-1;return{start:s,end:l}},Zb=()=>{var m,b,C;const{props:e}=o.getCurrentInstance(),t=(m=e.options)==null?void 0:m.timeFormat,n=o.computed(()=>["dateRange","dateTimeRange"].includes(e.mode)?["main","expanded"]:["main"]);let i;if(e.mode!=="dateMulti"&&e.mode!=="dateRange"&&e.mode!=="dateTimeRange")if(e.modelValue&&(e.modelValue.length===10&&br.exec((b=e.modelValue)==null?void 0:b.toString())||e.modelValue.length===19&&yr.exec((C=e.modelValue)==null?void 0:C.toString())))if(e.mode==="dateTime"&&t){const y=Te(t,e.modelValue);i=o.ref(y)}else i=o.ref(e.modelValue);else i=o.ref("");else if(Array.isArray(e.modelValue)&&e.modelValue.every(y=>!y||y.length===10&&br.exec(y)||y.length===19&&yr.exec(y)))if(e.mode==="dateTimeRange"&&e.modelValue.length===2&&t){const y=[];y.push(Te(t[0],e.modelValue[0])),y.push(Te(t[1],e.modelValue[1])),i=o.ref([...y])}else i=o.ref([...e.modelValue]);else i=o.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)?kn(`${e.modelValue[0]} 00:00:00`)>kn(`${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)?kn(e.modelValue[0])>kn(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)?i.value[0]:i.value;a!=null&&a.length?l={year:We(a,"year"),month:We(a,"month"),hour:Math.floor(We(a,"hour")/ut)+1||1,min:Math.floor(We(a,"min")/ut)+1||1,sec:Math.floor(We(a,"sec")/ut)+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(i.value)&&i.value[1]){const y=i.value[1];r={year:We(y,"year"),month:We(y,"month")},e.mode==="dateTimeRange"&&(r.hour=Math.floor(We(y,"hour")/ut)+1||1,r.min=Math.floor(We(y,"min")/ut)+1||1,r.sec=Math.floor(We(y,"sec")/ut)+1||1)}else r={year:new Date().getFullYear(),month:new Date().getMonth()+1,hour:1,min:1,sec:1};const c=o.reactive({main:l,expanded:r}),d=o.reactive({main:o.computed(()=>Sr(c.main.year)),expanded:o.computed(()=>Sr(c.expanded.year))}),h=o.computed(()=>Xo[e.monthNotation][c.main.month-1]),u=o.computed(()=>Xo[e.monthNotation][c.expanded.month-1]),f=o.reactive({main:h,expanded:u}),p=o.computed(()=>Eb[e.dayOfTheWeekNotation]),g=o.reactive({main:et.DATE,expanded:et.DATE});return o.onBeforeMount(()=>{s()}),{calendarList:n,selectedValue:i,calendarPageInfo:c,calendarYearRangeInfo:d,calendarMonth:f,dayOfTheWeekList:p,selectedListType:g}},Xb=e=>{const{props:t}=o.getCurrentInstance(),{selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:s}=e,l=o.reactive({main:Cn(Go,Wo),expanded:Cn(Go,Wo)}),a=o.reactive({main:Cn(Vo,Eo),expanded:Cn(Vo,Eo)}),r=o.reactive({main:Cn(vo,Ro),expanded:Cn(vo,Ro)}),c=o.reactive({main:{hour:[],min:[],sec:[]},expanded:{hour:[],min:[],sec:[]}});return{calendarTableInfo:r,calendarMonthTableInfo:a,calendarYearTableInfo:l,calendarTimeTableInfo:c,setCalendarDate:g=>{const m=i[g];let b=t.options.disabledDate;b&&Array.isArray(b)&&(b=g==="main"?b[0]:b[1]);const C=["dateRange","dateTimeRange"].includes(t.mode),y=$n({year:new Date().getFullYear(),month:new Date().getMonth()+1,date:new Date().getDate()}),w=(je+m.month-1)%je||je,T=(m.month+1)%je||je,k=m.month===1?m.year-1:m.year,M=m.month===12?m.year+1:m.year,Z=Wb(m.year,m.month),S=No(m.month===1?m.year-1:m.year,(je+m.month-1)%je||je),x=No(m.year,m.month);let L="";t.mode.includes("Time")&&(t.mode==="dateTime"?L=n.value:L=g==="main"?n.value[0]:n.value[1]);let I=0,V=0,v=0,E=0,G="";const R=(X,W,N)=>{var _,A,Q;G=$n({year:V,month:v,date:E});const P=(L==null?void 0:L.split(" ")[1])??"",D=C&&!b&&os(t.mode,g,G,n.value)||+new Date(`${G} ${P}`)<ss,H=b&&b(new Date(`${G} ${P}`))||D,B=+(g!=="main"),Y=C&&n.value.length>B&&((A=(_=n.value)==null?void 0:_[B])==null?void 0:A.includes(G)),O=!H&&(C?Y:(Q=n.value)==null?void 0:Q.includes(G));r[g][W][N]={monthType:`${X}${H?" disabled":""}`,isToday:y===G,isSelected:O,year:V,month:v,date:E}};for(let X=0;X<vo;X++)for(let W=0;W<Ro;W++)X===0?Z!==0?W<Z?(V=k,v=w,E=S-Z+1+W,R("prev",X,W)):(I++,V=m.year,v=m.month,E=I,R("",X,W)):(V=k,v=w,E=S-6+W,R("prev",X,W)):x<=I?(I++,V=M,v=T,E=I-x,R("next",X,W)):(I++,V=m.year,v=m.month,E=I,R("",X,W))},setCalendarMonth:g=>{let m=0;const b=new Date().getFullYear(),C=new Date().getMonth()+1,{year:y,month:w}=i[g];for(let T=0;T<Vo;T++)for(let k=0;k<Eo;k++)a[g][T][k]={label:Xo.abbrName[m++],value:m,today:y===b&&m===C,isSelected:m===w}},setCalendarYear:g=>{let m=s[g].start;const b=new Date().getFullYear(),C=new Date(ss).getFullYear();for(let y=0;y<Go;y++)for(let w=0;w<Wo;w++)l[g][y][w]={label:m,value:m,today:m===b,isSelected:m===i[g].year,disabled:m<C},m++},setHmsTime:()=>{var Z,S;const g=(Z=t.options)==null?void 0:Z.timeFormat,m=(S=t.options)==null?void 0:S.disabledDate,b=Array.isArray(g)?g[0]:g,C=Array.isArray(g)?g[1]:"",y=t.mode==="dateTimeRange"?n.value[0]:n.value,w=t.mode==="dateTimeRange"?n.value[1]:"",T=Array.isArray(m)?m[0]:m,k=Array.isArray(m)?m[1]:m,M=(x,L,I)=>{const V=x==="main"?y:w,v=x==="main"?T:k;if(!V)return!1;const E=V.split(" ")[0];let G=We(V,"hour"),R=We(V,"min"),X=We(V,"sec");L==="hour"?G=I:L==="min"?R=I:L==="sec"&&(X=I);const W=`${E} ${Ge(G)}:${Ge(R)}:${Ge(X)}`;return v&&v(new Date(W))?!0:!v&&os(t.mode,x,W,n.value)};["hour","min","sec"].forEach(x=>{let L=Vb;x==="hour"?L=vb:x==="min"&&(L=Rb);const I=y&&y.length>0?qn(b,y,x):-1,V=w&&w.length>0?qn(C,w,x):-1;for(let v=0;v<L;v++){let E=t.mode==="dateTimeRange"&&M("main",x,v);c.main[x][v]={timeType:x,num:v,isSelected:!E&&I===v,isDisabled:E},t.mode==="dateTimeRange"&&(E=M("expanded",x,v),c.expanded[x][v]={timeType:x,num:v,isSelected:!E&&V===v,isDisabled:E})}})},getTimeInfo:(g,m,b,C)=>{const y=i[C],w=c[C],T=y[g]-1,k=m-1,M=b-1,Z=T*ut+k*gr+M;return w[g][Z]}}},Nb=e=>{var G;const{props:t,emit:n}=o.getCurrentInstance(),i=(G=t.options)==null?void 0:G.timeFormat,{selectedValue:s,calendarPageInfo:l,calendarTimeTableInfo:a,setCalendarDate:r,setCalendarMonth:c,setCalendarYear:d,setHmsTime:h,selectedListType:u}=e,f=o.ref(""),p=o.ref(null),g=Array.isArray(i)?i[0]:i,m=Array.isArray(i)?i[1]:"",b={main:{hour:g&&g.split(":")[0]!=="HH",min:g&&g.split(":")[1]!=="mm",sec:g&&g.split(":")[2]!=="ss"},expanded:{hour:m&&m.split(":")[0]!=="HH",min:m&&m.split(":")[1]!=="mm",sec:m&&m.split(":")[2]!=="ss"}},C=(R,X)=>{const W=l[R],{year:N,month:P,hour:D,min:H,sec:B}=X;N&&(W.year=N),P&&(W.month=P),D&&(W.hour=D),H&&(W.min=H),B&&(W.sec=B)},y=R=>{R==null||R.forEach((X,W)=>{const N=W===0?"main":"expanded";C(N,{year:We(X,"year"),month:We(X,"month"),hour:Math.floor(We(X,"hour")/ut)+1,min:Math.floor(We(X,"min")/ut)+1,sec:Math.floor(We(X,"sec")/ut)+1}),r(N)})},w=(R,X)=>{const W=u[R]===et.MONTH?1:20,N=X==="prev"?-W:W,P=new Date(ss).getFullYear(),D=l[R].year+N;l[R].year=D<P?P:D},T=(R,X)=>{const W=l[R];if(X==="prev"){const N=new Date(ss).getFullYear();if(W.year===N&&W.month===1)return;W.month===1?(W.year-=1,W.month=12):W.month-=1}else W.month===12?(W.year+=1,W.month=1):W.month+=1},k=(R,X)=>{switch(u[R]){case et.DATE:{T(R,X),r(R);break}case et.MONTH:w(R,X),c(R);break;case et.YEAR:w(R,X),d(R);break}},M=(R,X)=>{X===et.DATE?r(R):X===et.MONTH?c(R):X===et.YEAR&&d(R),u[R]=X},Z=(R,X)=>{const{value:W}=X;X.disabled||(u[R]===et.YEAR?(l[R].year=W,u[R]=et.MONTH,c(R)):(l[R].month=W,u[R]=et.DATE,r(R)))},S=(R,X)=>{var $,te,J,q;const{year:W,month:N,date:P,monthType:D}=X,H=$n({year:W,month:N,date:P}),B=t.modelValue?(Array.isArray(t.modelValue)?(($=t.modelValue)==null?void 0:$.map(j=>j==null?void 0:j.split(" ")[0]))??[]:t.modelValue.split(" ")[0]).includes(H):!1;let Y=t.options.disabledDate;if(Y&&Array.isArray(Y)&&(Y=R==="main"?Y[0]:Y[1]),Y&&Y(new Date(H))&&!B)return;if(!Y&&["dateRange","dateTimeRange"].includes(t.mode)&&os(t.mode,R,H,s.value))return;const O=l[R],_=(je+O.month-1)%je||je,A=O.month===1?O.year-1:O.year,Q=(O.month+1)%je||je,U=O.month===12?O.year+1:O.year,ee=()=>{D.includes("prev")?(O.year=A,O.month=_):D.includes("next")&&(O.year=U,O.month=Q)};switch(t.mode){case"date":n("update:modelValue",H);break;case"dateTime":{const ae=!!((te=s.value)!=null&&te.split(" ")[1])?(J=s.value)==null?void 0:J.split(" ")[1]:"00:00:00",he=Te(i,`${H} ${ae}`);n("update:modelValue",he);break}case"dateMulti":{const j=t.options.multiType,ae=t.options.multiDayLimit;if(j==="date"){const he=s.value.indexOf(H);he>-1?(s.value.splice(he,1),n("update:modelValue",[...s.value])):s.value.length<ae&&(s.value.push(H),ee(),n("update:modelValue",[...s.value]))}else if(j==="week"||j==="weekday"){const he=j==="week"?7:5,se=j==="week"?6:5,fe=new Date(`${H} 00:00:00`),ge=fe.getDay(),le=se-ge,ce=fe.getTime()+is*le;for(let be=0;be<he;be++){const Ie=new Date(ce-be*is).getFullYear(),Ve=new Date(ce-be*is).getMonth()+1,kt=new Date(ce-be*is).getDate(),Vt=`${Ie}-${Ge(Ve)}-${Ge(kt)}`;if(be===0)if(s.value.includes(Vt)){s.value.splice(0);break}else s.value.splice(0),ee();(!Y||!Y(new Date(Vt)))&&s.value.unshift(Vt)}n("update:modelValue",[...s.value])}r("main");break}case"dateRange":{let j=[...s.value];if(!s.value.length)j=[H,H];else{const ae=+(R==="expanded");j[ae]=H}n("update:modelValue",j);break}case"dateTimeRange":{let j=[...s.value];if(j.length){const ae=+(R==="expanded"),he=((q=j[ae])==null?void 0:q.split(" ")[1])||"00:00:00";let se=`${H} ${he}`;i&&i.length&&(se=Te(i[ae],se)),j[ae]=se}else{let ae=`${H} 00:00:00`,he=`${H} 00:00:00`;i&&i.length&&(ae=Te(i[0],ae),he=Te(i[1],he)),j=[ae,he]}n("update:modelValue",j);break}}},x=(R,X,W)=>{if(b[R][X])return;const N=l[R],P=1;X==="hour"?W==="down"&&N.hour<2?N.hour++:W==="up"&&N.hour>P&&N.hour--:X==="min"?W==="down"&&N.min<5?N.min++:W==="up"&&N.min>P&&N.min--:X==="sec"&&(W==="down"&&N.sec<5?N.sec++:W==="up"&&N.sec>P&&N.sec--)},L=(R,X,W,N)=>{var te;if(b[R][X])return;const P=l[R],D=a[R],H=P[X]-1,B=W-1,Y=N-1,O=H*ut+B*gr+Y;if((te=D[X][O])!=null&&te.isDisabled)return;const _=new Date,A={year:_.getFullYear(),month:_.getMonth()+1,date:_.getDate()};let Q=!0,U=[];const ee=()=>{let J;return X==="hour"?J=`${Ge(O)}:00:00'`:X==="min"?J=`00:${Ge(O)}:00`:X==="sec"&&(J=`00:00:${Ge(O)}`),`${$n(A)} ${J}`},$=J=>{let se=11;return X==="min"?se=14:X==="sec"&&(se=17),`${J==null?void 0:J.substr(0,se)}${Ge(O)}${J==null?void 0:J.substr(se+2)}`};if(t.mode==="dateTime"){let J;t.modelValue?J=Te(i,$(t.modelValue)):(Q=!1,J=Te(i,ee())),n("update:modelValue",J),U.push(J)}else{const J=R!=="main"|0;let q=[...s.value];if(t.modelValue.length){let j=$(t.modelValue[J]);i&&i.length&&(j=Te(i[J],j)),q[J]=j}else{const j=ee();q=[j,j],i&&i.length&&(q=[...q.map((ae,he)=>Te(i[he],ae))]),Q=!1,U=q}n("update:modelValue",q)}h(),Q||y(U)},I=(R,X)=>{k(R,X.deltaY>0?"next":"prev")},V=(R,X,W)=>{b[R][X]||x(R,X,W.deltaY>0?"down":"up")},v=ns((R,X)=>{const W=X.target.tagName==="TD"?X.target:X.target.parentElement,N=W.classList.contains("disabled"),P=W.classList.contains("prev"),D=W.classList.contains("next");if(W.classList.length>0&&!N){const H=l[R];let B={year:+H.year,month:+H.month,date:X.target.innerText};P?B={...B,...xr("prev",B.year,B.month)}:D&&(B={...B,...xr("next",B.year,B.month)});const Y=f.value,O=$n({year:B.year,month:B.month,date:B.date});kn(O)<kn(Y)?(s.value[0]=O,s.value[1]=Y):(s.value[0]=Y,s.value[1]=O),r("main"),r("expanded")}},10),E=R=>{const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode),W=t.options.disabledDate;if(X){const[N,P]=s.value;let[D,H]=[W,W];if(W&&Array.isArray(W)&&([D,H]=W),R[0]&&R[0]!==N&&D&&D(new Date(R[0])))return!0;if(R[1]&&R[1]!==P&&H&&H(new Date(R[1])))return!0;if(!W&&os(t.mode,"main",R[0],R))return!0}else{if(t.mode==="dateMulti")return R.some(N=>W&&W(new Date(N)));if(W&&W(new Date(R)))return!0}return!1};return o.watch(()=>t.modelValue,R=>{if(E(R)){n("update:modelValue",s.value);return}const X=["dateRange","dateMulti","dateTimeRange"].includes(t.mode);if(s.value=X?[...R]:R,t.mode==="dateRange")y(R);else if(t.mode.includes("Time")){let W=[];t.mode==="dateTime"?W=[R]:t.mode==="dateTimeRange"&&(W=R),y(W),h()}else t.mode==="date"&&y([R])}),{clickYearMonthBtn:M,clickPrevNextBtn:k,clickDate:S,clickYearMonth:Z,clickHmsBtn:x,clickTime:L,wheelMonth:I,wheelTime:V,calendarEventName:p,onMousemoveDate:v,preventTimeEventType:b}},Pb={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(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!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:i})=>{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(i)?i.every(l=>!!(!l||s.exec(l))):!!(!i||s.exec(i))}}},emits:{"update:modelValue":[Array,String]},setup(e){const{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r}=Zb(),{calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,setCalendarDate:f,setCalendarMonth:p,setCalendarYear:g,setHmsTime:m,getTimeInfo:b}=Xb({selectedValue:n,calendarPageInfo:i,calendarYearRangeInfo:a}),{clickPrevNextBtn:C,clickYearMonthBtn:y,clickDate:w,clickYearMonth:T,clickHmsBtn:k,clickTime:M,wheelMonth:Z,wheelTime:S,calendarEventName:x,onMousemoveDate:L,preventTimeEventType:I}=Nb({selectedValue:n,calendarPageInfo:i,calendarTimeTableInfo:u,selectedListType:r,setCalendarDate:f,setCalendarMonth:p,setCalendarYear:g,setHmsTime:m});return f("main"),["dateRange","dateTimeRange"].includes(e.mode)&&f("expanded"),["dateTime","dateTimeRange"].includes(e.mode)&&m(),{calendarList:t,selectedValue:n,calendarPageInfo:i,calendarMonth:s,dayOfTheWeekList:l,calendarYearRangeInfo:a,selectedListType:r,calendarTableInfo:c,calendarMonthTableInfo:d,calendarYearTableInfo:h,calendarTimeTableInfo:u,getTimeInfo:b,clickPrevNextBtn:C,clickYearMonthBtn:y,clickDate:w,clickYearMonth:T,clickHmsBtn:k,clickTime:M,wheelMonth:Z,wheelTime:S,calendarEventName:x,onMousemoveDate:L,preventTimeEventType:I}}},Bb={class:"ev-calendar-wrapper"},Db={class:"ev-calendar-date-area"},Yb={class:"ev-calendar-header"},Ob=["onClick"],Hb={class:"ev-calendar-year-month-wrapper"},zb={key:0,class:"ev-calendar-year-range"},Fb=["onClick"],Ab=["onClick"],Kb=["onClick"],_b={class:"ev-calendar-body"},Ub=["onWheel"],Jb=["onClick"],jb=["onWheel"],Qb=["onClick"],$b={key:2,class:"ev-calendar-selector-btn-wrapper"},qb={key:0,class:"ev-calendar-time-area"},ey={key:0,class:"ev-calendar-time-area-disabled"},ty={class:"ev-calendar-time-side"},ny={class:"ev-calendar-time-center"},iy=["onWheel"],sy=["onClick"],oy={class:"ev-calendar-time-side"},ly=["onClick"];function ay(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createElementBlock("div",Bb,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarList,r=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:r},[o.createElementVNode("div",Db,[o.createElementVNode("div",Yb,[o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"prev")},[...t[0]||(t[0]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-left move-month-arrow-icon"},null,-1)])],8,Ob),o.createElementVNode("div",Hb,[i.selectedListType[r]==="year"?(o.openBlock(),o.createElementBlock("span",zb,o.toDisplayString(i.calendarYearRangeInfo[r].start+" - "+i.calendarYearRangeInfo[r].end),1)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("span",{class:"ev-calendar-year",onClick:c=>i.clickYearMonthBtn(r,"year")},o.toDisplayString(i.calendarPageInfo[r].year),9,Fb),i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-calendar-month",onClick:c=>i.clickYearMonthBtn(r,"month")},o.toDisplayString(i.calendarMonth[r]),9,Ab)):o.createCommentVNode("",!0)],64))]),o.createElementVNode("div",{class:"move-month-arrow",onClick:c=>i.clickPrevNextBtn(r,"next")},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-right move-month-arrow-icon"},null,-1)])],8,Kb)]),o.createElementVNode("div",_b,[i.selectedListType[r]==="date"?(o.openBlock(),o.createElementBlock("table",{key:`${r}_calendar_table`,class:"ev-calendar-table"},[o.createElementVNode("thead",null,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.dayOfTheWeekList,c=>(o.openBlock(),o.createElementBlock("th",{key:c},o.toDisplayString(c),1))),128))])]),o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.calendarTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:d,class:["ev-calendar-date-td",{[d.monthType]:!!d.monthType},{today:d.isToday},{selected:d.isSelected}],onClick:h=>i.clickDate(r,d)},{[o.toHandlerKey(`${i.calendarEventName}`)]:h=>i.onMousemoveDate(r,h)}),[o.createElementVNode("div",null,[o.createElementVNode("span",null,o.toDisplayString(d.date),1)])],16,Jb))),128))]))),128))],40,Ub)])):(o.openBlock(),o.createElementBlock("table",{key:1,class:o.normalizeClass(["ev-calendar-selector-table",`ev-calendar-selector-table--${i.selectedListType[r]}`])},[o.createElementVNode("tbody",{onWheel:o.withModifiers(c=>i.wheelMonth(r,c),["prevent"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.selectedListType[r]==="month"?i.calendarMonthTableInfo[r]:i.calendarYearTableInfo[r],c=>(o.openBlock(),o.createElementBlock("tr",{key:c},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,d=>(o.openBlock(),o.createElementBlock("td",{key:d.value,onClick:h=>i.clickYearMonth(r,d)},[o.createElementVNode("div",{class:o.normalizeClass(["ev-calendar-selector",{selected:d.isSelected},{today:d.today},{disabled:d.disabled}])},o.toDisplayString(d.label),3)],8,Qb))),128))]))),128))],40,jb)],2)),i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",$b,[o.createVNode(a,{onClick:c=>i.clickYearMonthBtn(r,"date")},{default:o.withCtx(()=>[...t[2]||(t[2]=[o.createTextVNode(" Done ",-1)])]),_:1},8,["onClick"])])):o.createCommentVNode("",!0)])]),["dateTime","dateTimeRange"].includes(n.mode)?(o.openBlock(),o.createElementBlock("div",qb,[i.selectedListType[r]!=="date"?(o.openBlock(),o.createElementBlock("div",ey)):o.createCommentVNode("",!0),o.createElementVNode("div",ty,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["HOUR","MIN","SEC"],c=>o.createElementVNode("div",{key:`${c}_label`,class:"ev-calendar-time-side--label"},o.toDisplayString(c),1)),64))]),o.createElementVNode("div",ny,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>o.createElementVNode("table",{key:`${c}_table`,class:"ev-calendar-time-table"},[o.createElementVNode("tbody",{onWheel:o.withModifiers(d=>i.wheelTime(r,c,d),["prevent"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,d=>o.createElementVNode("tr",{key:`${c}_${d}_tr`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(4,h=>o.createElementVNode("td",{key:`${c}_${d}_${h}_td`,class:o.normalizeClass(["ev-calendar-time-td",{selected:i.getTimeInfo(c,d,h,r).isSelected},{disabled:i.preventTimeEventType[r][c]||i.getTimeInfo(c,d,h,r).isDisabled}]),onClick:u=>i.clickTime(r,c,d,h)},[o.createElementVNode("div",null,o.toDisplayString(i.getTimeInfo(c,d,h,r).num),1)],10,sy)),64))])),64))],40,iy)])),64))]),o.createElementVNode("div",oy,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["hour","min","sec"],c=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${c}_btn_area`},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["up","down"],d=>o.createElementVNode("div",{key:`${c}_${d}_btn`,class:o.normalizeClass(["ev-calendar-time-side--btn",`arrow-${c}`,{disabled:i.preventTimeEventType[r][c]}]),onClick:h=>i.clickHmsBtn(r,c,d)},[o.createElementVNode("i",{class:o.normalizeClass(`ev-icon-arrow-${d}`)},null,2)],10,ly)),64))],64))),64))])])):o.createCommentVNode("",!0)],64))),128))])}const ei=de(Pb,[["render",ay]]);ei.install=e=>{e.component(ei.name,ei)};const ry=new RegExp(/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/),cy=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]/),dy=()=>{var f;const{props:e,emit:t}=o.getCurrentInstance(),n=(f=e.options)==null?void 0:f.timeFormat,i=["dateTimeRange","dateRange","dateMulti"].includes(e.mode),s=p=>{let g;if(e.mode==="dateTime")g=Te(n,p);else if(e.modelValue.length){const[m,b]=n;g=[Te(m,p[0]),Te(b,p[1])]}return g},l=o.computed({get:()=>e.modelValue?["dateTime","dateTimeRange"].includes(e.mode)&&n?s(e.modelValue):i?[...e.modelValue]:e.modelValue:e.mode==="date"||e.mode==="dateTime"?"":[],set:p=>{if(["dateTime","dateTimeRange"].includes(e.mode)&&n){t("update:modelValue",s(p));return}t("update:modelValue",p)}});let a;if(["dateTimeRange","dateTime"].includes(e.mode)&&n)if(e.mode==="dateTimeRange"&&Array.isArray(e.modelValue)&&e.modelValue.length===2){const[p,g]=e.modelValue,[m,b]=n;e.modelValue=[Te(m,p),Te(b,g)],a=o.ref([...e.modelValue])}else e.mode==="dateTime"&&e.modelValue?a=o.ref(Te(n,e.modelValue)):a=o.ref(e.modelValue);else a=o.ref(i?[...e.modelValue]:e.modelValue);const r=p=>{const g=y=>!!(y.length===10&&ry.exec(y)),m=y=>!!(y.length===19&&cy.exec(y)),b=y=>{const w=y.split(" ")[0],T=+w.split("-")[0],k=+w.split("-")[1],M=+w.split("-")[2],Z=No(T,k);return+M<=Z&&T>=new Date(0).getFullYear()};let C=!0;e.mode==="date"?C=g(p)&&b(p):e.mode==="dateTime"?C=m(p)&&b(p):e.mode==="dateRange"?C=p.every(y=>g(y)&&b(y)):e.mode==="dateTimeRange"&&(C=p.every(y=>m(y)&&b(y))),C&&(l.value=i?[...p]:p),a.value=i?[...l.value]:l.value},c=o.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 p=>{await o.nextTick(),t("change",l.value,p)},removeMv:p=>{if(!e.disabled){const g=l.value.indexOf(p);l.value.splice(g,1),l.value=[...l.value]}}}},hy=()=>{const{props:e}=o.getCurrentInstance(),t=o.ref(!1),n=o.ref(null),i=o.ref(null),s=o.ref(null),l=o.ref(null),a=o.reactive({top:null,right:null,left:null}),r=async()=>{var w,T;await o.nextTick();const h=(w=i.value)==null?void 0:w.getBoundingClientRect(),u=(T=s.value)==null?void 0:T.getBoundingClientRect(),f=h.height,p=h.y,g=h.x,m=u.height,b=u.width,C=document.documentElement.clientHeight,y=document.documentElement.clientWidth;C<p+f+m?(a.top=`-${m}px`,y<g+b?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto")):(a.top=`${f}px`,y<g+b?(a.left="auto",a.right="0px"):(a.left="0px",a.right="auto"))};return{isDropbox:t,datePicker:n,datePickerWrapper:i,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 p;const{props:t}=o.getCurrentInstance(),{mv:n,currentValue:i,clickOutsideDropbox:s}=e,l=o.reactive([]);(p=t.shortcuts)==null||p.forEach(({value:g,label:m,shortcutDate:b})=>{l.push({key:g,label:m,shortcutDate:b,isActive:!1})});const a=()=>{const g=l.find(m=>m.isActive);g&&(g.isActive=!1)},r=g=>{const m=l.find(b=>b.key===g);m&&(m.isActive=!0)},c=g=>g===null?"00":+g<10?`0${g}`:g,d=g=>{const m=g?new Date(g):new Date,b=m.getFullYear(),C=m.getMonth()+1,y=m.getDate();return`${b}-${c(C)}-${c(y)}`},h=g=>{const m=g?new Date(g):new Date,b=m.getHours(),C=m.getMinutes(),y=m.getSeconds();return`${d(m)} ${c(b)}:${c(C)}:${c(y)}`},u=()=>{var b,C;a();const g=["dateRange","dateTimeRange"].includes(t.mode);if(!l.length||t.mode==="dateMulti"&&((b=t.options)==null?void 0:b.multiType)!=="date"||g&&!n.value.length||!g&&!n.value)return;let m;if(g){const y=(C=t.options)==null?void 0:C.timeFormat,[w,T]=n.value;let k;t.mode==="dateTimeRange"&&(y!=null&&y.length)?k=l.find(({shortcutDate:M})=>{const[Z,S]=M(),[x,L]=y,I=Te(x,h(Z)),V=Te(L,h(S)),v=I===h(w),E=V===h(T);return v&&E}):k=l.find(({shortcutDate:M})=>{const[Z,S]=M(),x=t.mode==="dateTimeRange"?h:d,L=x(Z)===x(w),I=x(S)===x(T);return L&&I}),m=k==null?void 0:k.key}else{const y=t.mode==="dateTime"?h:d,w=y(n.value),T=l.find(({shortcutDate:k})=>y(k())===w);m=T==null?void 0:T.key}m&&r(m)},f=g=>{var w;const m=["dateRange","dateTimeRange"].includes(t.mode),b=l.find(({key:T})=>T===g);if(!b)return;const C=b.shortcutDate,y=(w=t.options)==null?void 0:w.timeFormat;if(m){const[T,k]=C();if(t.mode==="dateTimeRange")if(y!=null&&y.length){const[M,Z]=y;n.value=[Te(M,h(T)),Te(Z,h(k))]}else n.value=[h(T),h(k)];else n.value=[d(T),d(k)]}else{const T=C();n.value=t.mode==="dateTime"?Te(y,h(T)):d(T)}a(),r(g)};return o.watch(()=>t.modelValue,g=>{var m,b;if(u(),!(t.mode==="dateMulti"&&((m=t==null?void 0:t.options)==null?void 0:m.multiType)==="date"&&((b=t==null?void 0:t.options)==null?void 0:b.multiDayLimit)>g.length)){if(t.mode==="dateRange"||t.mode==="dateTimeRange"){i.value=[...g];return}else if(t.mode==="dateTime"){i.value=g;return}i.value=g,s()}}),{usedShortcuts:l,clickShortcut:f,setActiveShortcut:u}},fy={name:"EvDatePicker",directives:{clickoutside:Pd},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(i=>!!(!i||i.length===10&&t.exec(i))||i.length===19&&n.exec(i)):!!(!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:i,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))&&(i===void 0||typeof i=="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(i=>i 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:i,removeAllMv:s,changeMv:l,removeMv:a}=dy(),{isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:p,clickOutsideDropbox:g,changeDropboxPosition:m}=hy(),{usedShortcuts:b,clickShortcut:C,setActiveShortcut:y}=uy({mv:e,currentValue:t,clickOutsideDropbox:g});return y(),{mv:e,currentValue:t,isClearableIcon:n,validateValue:i,removeAllMv:s,changeMv:l,removeMv:a,isDropbox:r,datePicker:c,datePickerWrapper:d,dropbox:h,itemWrapper:u,dropboxPosition:f,clickSelectInput:p,clickOutsideDropbox:g,changeDropboxPosition:m,usedShortcuts:b,clickShortcut:C}}},my={ref:"datePickerWrapper",class:"ev-date-picker__wrapper"},py=["placeholder","readonly","disabled"],gy=["placeholder","disabled"],by={class:"ev-tag-name"},yy=["onClick"],xy={key:0,class:"ev-select-tag num"},Sy={class:"ev-tag-name"},Cy={class:"ev-select-tag num"},ky={class:"ev-tag-name"},wy={class:"ev-date-picker-dropbox-wrapper"},Iy={key:0,class:"ev-date-picker-dropbox__button-layout"},Ly={key:1,class:"ev-date-picker-dropbox__divider"};function Ty(e,t,n,i,s,l){const a=o.resolveComponent("ev-button"),r=o.resolveComponent("ev-button-group"),c=o.resolveComponent("ev-calendar"),d=o.resolveDirective("clickoutside");return o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"datePicker",class:o.normalizeClass(["ev-date-picker",{disabled:e.$props.disabled}])},[o.createElementVNode("div",my,[e.$props.mode==="date"||e.$props.mode==="dateTime"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[15]||(t[15]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=h=>i.currentValue=h),type:"text",class:o.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)=>i.clickSelectInput&&i.clickSelectInput(...h)),onKeydown:t[2]||(t[2]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[3]||(t[3]=h=>i.validateValue(i.currentValue))},null,42,py),[[o.vModelText,i.currentValue,void 0,{trim:!0}]])],64)):e.$props.mode==="dateMulti"||!e.$props.enableTextInput?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-date-picker-tag-wrapper",onClick:t[4]||(t[4]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[18]||(t[18]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.createElementVNode("input",{type:"text",class:"ev-input readonly",readonly:"",placeholder:e.$props.placeholder,disabled:e.$props.disabled},null,8,gy),e.$props.mode==="dateMulti"&&(e.$props.options.multiType==="date"||!e.$props.options.tagShorten)?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.mv,(h,u)=>(o.openBlock(),o.createElementBlock("div",{key:`${h}_${u}`,class:o.normalizeClass(["ev-select-tag",{num:e.$props.options.multiType!=="date"}])},[o.createElementVNode("span",by,o.toDisplayString(h),1),e.$props.options.multiType==="date"?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-tag-suffix",onClick:o.withModifiers(f=>[i.removeMv(h),i.changeDropboxPosition()],["stop"])},[...t[16]||(t[16]=[o.createElementVNode("i",{class:"ev-tag-suffix-close ev-icon-error"},null,-1)])],8,yy)):o.createCommentVNode("",!0)],2))),128)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[i.mv[0]?(o.openBlock(),o.createElementBlock("div",xy,[o.createElementVNode("span",Sy,o.toDisplayString(i.mv[0]),1)])):o.createCommentVNode("",!0),i.mv[i.mv.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t[17]||(t[17]=o.createElementVNode("div",{class:"ev-select-tag num"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.createElementVNode("div",Cy,[o.createElementVNode("span",ky,o.toDisplayString(i.mv[i.mv.length-1]),1)])],64)):o.createCommentVNode("",!0)],64))])):(o.openBlock(),o.createElementBlock("div",{key:2,class:"ev-date-picker-input-wrapper",onClick:t[11]||(t[11]=(...h)=>i.clickSelectInput&&i.clickSelectInput(...h))},[t[20]||(t[20]=o.createElementVNode("span",{class:"ev-date-picker-prefix-icon"},[o.createElementVNode("i",{class:"ev-icon-calendar"})],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[5]||(t[5]=h=>i.currentValue[0]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[6]||(t[6]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[7]||(t[7]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[0],void 0,{trim:!0}]]),i.currentValue[i.currentValue.length-1]?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t[19]||(t[19]=o.createElementVNode("div",{class:"ev-date-picker-range-separator"},[o.createElementVNode("span",{class:"ev-tag-name"}," ~ ")],-1)),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=h=>i.currentValue[i.currentValue.length-1]=h),type:"text",class:"ev-date-picker-range-input",onKeydown:t[9]||(t[9]=o.withKeys(o.withModifiers(h=>i.validateValue(i.currentValue),["prevent"]),["enter"])),onChange:t[10]||(t[10]=h=>i.validateValue(i.currentValue))},null,544),[[o.vModelText,i.currentValue[i.currentValue.length-1],void 0,{trim:!0}]])],64)):o.createCommentVNode("",!0)])),e.$props.clearable?o.withDirectives((o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-input-suffix",onClick:t[12]||(t[12]=o.withModifiers(h=>[i.removeAllMv(),i.clickOutsideDropbox()],["stop"]))},[...t[21]||(t[21]=[o.createElementVNode("i",{class:"ev-icon-error"},null,-1)])],512)),[[o.vShow,i.isClearableIcon]]):o.createCommentVNode("",!0),o.createElementVNode("div",wy,[i.isDropbox?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"dropbox",class:o.normalizeClass(["ev-date-picker-dropdown",e.$props.mode]),style:o.normalizeStyle(i.dropboxPosition)},[i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",Iy,[i.usedShortcuts.length===1?(o.openBlock(),o.createBlock(a,{key:0,type:i.usedShortcuts[0].isActive?"primary":"default",onClick:t[13]||(t[13]=h=>i.clickShortcut(i.usedShortcuts[0].key))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.usedShortcuts[0].label),1)]),_:1},8,["type"])):(o.openBlock(),o.createBlock(r,{key:1},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.usedShortcuts,h=>(o.openBlock(),o.createBlock(a,{key:h.key,type:h.isActive?"primary":"default",onClick:u=>i.clickShortcut(h.key)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.label),1)]),_:2},1032,["type","onClick"]))),128))]),_:1}))])):o.createCommentVNode("",!0),i.usedShortcuts.length?(o.openBlock(),o.createElementBlock("div",Ly)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass({"ev-date-picker-dropbox__calendar":i.usedShortcuts.length})},[o.createVNode(c,{key:"fromCalendar",modelValue:i.mv,"onUpdate:modelValue":t[14]||(t[14]=h=>i.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)):o.createCommentVNode("",!0)])],512)],2)),[[d,i.clickOutsideDropbox]])}const ti=de(fy,[["render",Ty]]);ti.install=e=>{e.component(ti.name,ti)};const My={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=o.reactive({timer:null,isShow:!0}),i=()=>{clearTimeout(n.timer),n.timer=null},s=()=>{n.isShow=!1,e.onClose&&e.onClose(),i(),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 o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),i()}),t.expose({hide:r}),{startTimer:l,clearTimer:i,closeMsg:s,...o.toRefs(n),hide:r}}},vy={key:0,class:"ev-message-icon"},Ry=["innerHTML"],Vy={key:2,class:"ev-message-content"};function Ey(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-message-modal"},[o.createVNode(o.Transition,{name:"ev-message-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{ref:"msgRef",class:o.normalizeClass(["ev-message",{[`type-${n.type}`]:!!n.type,"show-close":n.showClose,"has-icon":!!n.iconClass}]),onMouseenter:t[1]||(t[1]=(...a)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",vy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("div",{key:1,class:"ev-message-content",innerHTML:n.message},null,8,Ry)):(o.openBlock(),o.createElementBlock("div",Vy,o.toDisplayString(n.message),1)),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:3,class:"ev-message-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[3]||(t[3]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})])}const Gy=de(My,[["render",Ey]]),Wy=o.defineComponent(Gy),Cr="ev-message-modal",kr=document.createElement("div");kr.id=Cr;const ls=(e={})=>{document.getElementById(Cr)||document.body.appendChild(kr);const n=document.createElement("div"),i=()=>o.render(null,n),s=typeof e=="string"?{message:e,unmount:i}:{...e,unmount:i},l=o.h(Wy,s);return o.render(l,n),l.component.exposed};ls.install=e=>{const t=e.config.globalProperties;t.$message=ls};const Zy={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=o.reactive({timer:null,isShow:!0}),n=()=>{clearTimeout(t.timer),t.timer=null},i=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 o.onMounted(()=>{l(),document.addEventListener("keydown",a)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",a),n()}),{startTimer:l,clearTimer:n,clickMsg:i,closeMsg:s,...o.toRefs(t)}}},Xy={key:0,class:"ev-notification-icon"},Ny={class:"ev-notification-content"},Py={key:0,class:"title"},By=["innerHTML"],Dy={key:2,class:"message"};function Yy(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Transition,{name:"ev-notification-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.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)=>i.clearTimer&&i.clearTimer(...a)),onMouseleave:t[2]||(t[2]=(...a)=>i.startTimer&&i.startTimer(...a)),onClick:t[3]||(t[3]=(...a)=>i.clickMsg&&i.clickMsg(...a))},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Xy,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ny,[n.title?(o.openBlock(),o.createElementBlock("p",Py,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"message",innerHTML:n.message},null,8,By)):(o.openBlock(),o.createElementBlock("p",Dy,o.toDisplayString(n.message),1))]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-notification-close",onClick:t[0]||(t[0]=(...a)=>i.closeMsg&&i.closeMsg(...a))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],34),[[o.vShow,e.isShow]])]),_:1})}const Oy=de(Zy,[["render",Yy]]),Hy=o.defineComponent(Oy),wr="ev-notification-modal",as=document.createElement("div");as.id=wr;const zy=["top-left","top-right","bottom-left","bottom-right"],rs=(e={})=>{const t=e.position||"top-right";if(!zy.includes(t)){console.warn("[EVUI][Notification] The position value is incorrectly entered.");return}document.getElementById(wr)||document.body.appendChild(as);let i=as.getElementsByClassName(`modal-${t}`);i.length?i=i[0]:(i=document.createElement("div"),i.classList.add(`modal-${t}`),as.appendChild(i));const l=document.createElement("div"),a=()=>o.render(null,l),r=typeof e=="string"?{message:e,unmount:a}:{...e,unmount:a},c=o.h(Hy,r);o.render(c,l),i.appendChild(c.el)};rs.install=e=>{const t=e.config.globalProperties;t.$notify=rs};const Fy={name:"EvMessageBox",components:{EvButton:un},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=o.ref(null),n=o.reactive({isShow:!0,iconClass:""}),i=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&&i()},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 o.onMounted(()=>{a(),document.addEventListener("keydown",s),r("messagebox")&&t.value.focus()}),o.watch(()=>n.isShow,c=>{c||document.removeEventListener("keydown",s)}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",s)}),{closeMsg:i,...o.toRefs(n),msgRef:t,hasFocus:r}}},Ay={key:0,class:"ev-message-box-icon"},Ky={class:"ev-message-box-content"},_y={key:0,class:"ev-message-box-title"},Uy=["innerHTML"],Jy={key:2,class:"ev-message-box-message"},jy={class:"ev-message-box-btn"};function Qy(e,t,n,i,s,l){const a=o.resolveComponent("ev-button");return o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{name:"ev-message-box-fade",appear:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{id:"ev-message-box-modal",onClick:t[3]||(t[3]=o.withModifiers(r=>i.closeMsg("modal"),["self"])),onWheel:o.withModifiers(()=>{},["stop","prevent"])},[o.createElementVNode("div",{ref:"msgRef",class:o.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?(o.openBlock(),o.createElementBlock("span",Ay,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ky,[n.title?(o.openBlock(),o.createElementBlock("p",_y,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0),n.useHTML?(o.openBlock(),o.createElementBlock("p",{key:1,class:"ev-message-box-message",innerHTML:n.message},null,8,Uy)):(o.openBlock(),o.createElementBlock("p",Jy,o.toDisplayString(n.message),1))]),o.createElementVNode("div",jy,[n.showCancelBtn?(o.openBlock(),o.createBlock(a,{key:0,size:"small",class:"ev-message-box-cancel","auto-focus":i.hasFocus("cancelBtn"),onClick:t[0]||(t[0]=r=>i.closeMsg("cancel"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.cancelBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0),n.showConfirmBtn?(o.openBlock(),o.createBlock(a,{key:1,type:"primary",size:"small",class:"ev-message-box-confirm","auto-focus":i.hasFocus("confirmBtn"),onClick:t[1]||(t[1]=r=>i.closeMsg("ok"))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.confirmBtnText),1)]),_:1},8,["auto-focus"])):o.createCommentVNode("",!0)]),n.showClose?(o.openBlock(),o.createElementBlock("span",{key:1,class:"ev-message-box-close",onClick:t[2]||(t[2]=r=>i.closeMsg("cancel"))},[...t[4]||(t[4]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])):o.createCommentVNode("",!0)],2)],544),[[o.vShow,e.isShow]])]),_:1})])}const $y=de(Fy,[["render",Qy]]),qy=o.defineComponent($y),cs=(e={})=>{const t=document.createElement("div"),n=()=>o.render(null,t),i=typeof e=="string"?{message:e,unmount:n}:{...e,unmount:n},s=o.h(qy,i);o.render(s,t)};cs.install=e=>{const t=e.config.globalProperties;t.$messagebox=cs};const Ir=(e,t)=>Array.from(Array(e),()=>Array(t).fill(!1)),ex=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.modelValue.length!==e.rowLabels.length||!e.modelValue[0]||e.modelValue[0].length!==e.colLabels.length?Ir(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=[...Ir(e.rowLabels.length,e.colLabels.length)])}}},tx=e=>{const{mv:t}=e,n=o.reactive({startRow:null,startCol:null,dragRow:null,dragCol:null,endRow:null,endCol:null,dragEventName:null}),i=(h,u)=>{if(n.dragCol===null||n.dragRow===null)return{};const f=n.startRow<n.dragRow?n.startRow:n.dragRow,p=n.startRow>n.dragRow?n.startRow:n.dragRow,g=n.startCol<n.dragCol?n.startCol:n.dragCol,m=n.startCol>n.dragCol?n.startCol:n.dragCol;if(f>h||p<h||g>u||m<u)return{};const b="2px solid #5292F7";let C={};return h===f&&(C={...C,"border-top":b}),h===p&&(C={...C,"border-bottom":b}),u===g&&(C={...C,"border-left":b}),u===m&&(C={...C,"border-right":b}),C},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],p=n.startRow<n.endRow?n.startRow:n.endRow,g=n.startRow>n.endRow?n.startRow:n.endRow,m=n.startCol<n.endCol?n.startCol:n.endCol,b=n.startCol>n.endCol?n.startCol:n.endCol;for(let C=p;C<=g;C++)for(let y=m;y<=b;y++)f[C][y]=!f[C][y];t.value=[...f],n.dragRow=null,n.dragCol=null};return{mousePos:n,selectionStyle:i,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 p=0;p<u.length;p++)u[p][h]=!f;t.value=[...u]},selectRow:h=>{const u=[...t.value],f=u[h][0];for(let p=0;p<u[0].length;p++)u[h][p]=!f;t.value=[...u]}}},nx={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}=ex();t();const{mousePos:n,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d}=tx({mv:e});return{mv:e,selectionStyle:i,mousedownBox:s,mouseupBox:l,mousemoveBox:a,mouseleaveBoxArea:r,selectColumn:c,selectRow:d,...o.toRefs(n)}}},ix={class:"ev-scheduler-header"},sx=["onClick","innerHTML"],ox=["onClick","innerHTML"],lx=["onMousedown","onMouseup"];function ax(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("table",{class:o.normalizeClass(["ev-scheduler",{draggable:!!e.dragEventName}])},[o.createElementVNode("thead",null,[o.createElementVNode("tr",ix,[t[1]||(t[1]=o.createElementVNode("td",null,null,-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_header`,class:"ev-scheduler-header-label",onClick:c=>i.selectColumn(r),innerHTML:n.colLabels[r]},null,8,sx))),128))])]),o.createElementVNode("tbody",{onMouseleave:t[0]||(t[0]=(...a)=>i.mouseleaveBoxArea&&i.mouseleaveBoxArea(...a))},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.rowLabels.length,(a,r)=>(o.openBlock(),o.createElementBlock("tr",{key:`${a}_${r}_body`,class:"ev-scheduler-body"},[(o.openBlock(),o.createElementBlock("td",{key:`${a}_${r}_${n.rowLabels[r]}`,class:"ev-scheduler-body-label",onClick:c=>i.selectRow(r),innerHTML:n.rowLabels[r]},null,8,ox)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colLabels.length,(c,d)=>(o.openBlock(),o.createElementBlock("td",o.mergeProps({key:`${c}_${r}_${d}_body`,class:["ev-scheduler-body-box",{selected:i.mv[r][d]}],style:i.selectionStyle(r,d),onMousedown:o.withModifiers(h=>i.mousedownBox(r,d,h),["stop","prevent"]),onMouseup:o.withModifiers(h=>i.mouseupBox(r,d),["stop","prevent"])},{[o.toHandlerKey(`${e.dragEventName}`)]:h=>i.mousemoveBox(r,d)}),null,16,lx))),128))]))),128))],32)],2)}const ni=de(nx,[["render",ax]]);ni.install=e=>{e.component(ni.name,ni)};const rx=()=>{const e=o.defineComponent(Lr),t=o.ref([]);return{comp:e,childrenItems:t,initWrapperDiv:()=>{const i=document.createElement("div");i.id="ev-context-menu-modal",i.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-context-menu-modal")||document.body.appendChild(i)}}},cx=()=>{const{props:e}=o.getCurrentInstance(),t=o.computed(()=>e.isShowMenuOnClick),n=o.ref(!1),i=o.ref(null),s=o.reactive({top:null,left:null,right:null,pageY:null,pageX:null,clientX:null});return{isShow:n,rootMenuList:i,menuStyle:s,show:async r=>{var d,h;n.value=!0,await o.nextTick();const c=(h=(d=i.value)==null?void 0:d.$el)==null?void 0:h.children[0].getBoundingClientRect();if(c){const u=c.height,f=c.width,p=document.documentElement.clientHeight,g=document.documentElement.clientWidth,m=20;s.pageX=r.pageX,s.pageY=r.pageY,s.clientX=r.clientX,p<r.clientY+u?s.top=`${r.pageY-u}px`:s.top=`${r.pageY}px`,g<r.clientX+f+m?s.left=`${r.pageX-f}px`:s.left=`${r.pageX}px`}},hide:async()=>{await o.nextTick(),!t.value&&(n.value=!1)}}},dx=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.computed({get:()=>e.isShow,set:f=>t("update:isShow",f)}),i=o.computed(()=>!!e.items.some(f=>f.children)),s=o.ref([]),l=o.ref(!1),a=o.ref(null),r=o.reactive({top:null,left:null,right:null}),c=f=>{f||(n.value=!1)},d=f=>{var I,V,v;const p=document.documentElement.clientWidth,g=document.documentElement.clientHeight,m=20,b=(I=f.target.parentElement)==null?void 0:I.getBoundingClientRect(),{x:C,y,width:w,height:T}=b,k=(v=(V=a.value)==null?void 0:V.$el)==null?void 0:v.children[0].getBoundingClientRect(),{width:M,height:Z}=k,S=f.target.offsetTop,x=g<y+S+Z,L=p<C+w+M+m;x?r.top=`${T-Z}px`:r.top=`${S}px`,L?r.left=`${0-M}px`:r.left=`${w}px`};return{computedIsShow:n,isExistChild:i,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,p)=>{!p.children||!Array.isArray(p.children)||p.disabled?l.value=!1:(l.value=!0,s.value=p.children,await o.nextTick(),d(f))},hideAll:c}},hx={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:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}=dx();return{isExistChild:e,computedIsShow:t,isShowChild:n,childMenu:i,menuStyle:s,childrenItems:l,handleItemClick:a,handleMouseEnter:r,hideAll:c}}},ux={class:"ev-menu-list"},fx={class:"ev-menu-ul"},mx=["onClick","onMouseenter"],px={class:"ev-menu-li-text"},gx={key:1,class:"ev-menu-li-suffix ev-icon-arrow-right2"};function bx(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",ux,[o.createElementVNode("ul",fx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(a,r)=>o.withDirectives((o.openBlock(),o.createElementBlock("li",{key:`${a.value}_${r}`,class:o.normalizeClass(["ev-menu-li",{disabled:a.disabled,[a.itemClass]:a.itemClass}]),onClick:c=>i.handleItemClick(a),onMouseenter:c=>i.handleMouseEnter(c,a)},[a.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["ev-menu-li-prefix",a.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",px,[a.slotKey?o.renderSlot(e.$slots,a.slotKey,{key:0,item:a},()=>[o.createTextVNode(o.toDisplayString(a.text),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(a.text),1)],64))]),a.children||a.isShowMenu?(o.openBlock(),o.createElementBlock("i",gx)):o.createCommentVNode("",!0)],42,mx)),[[o.vShow,!a.hidden]])),128))]),i.isExistChild?o.withDirectives((o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.comp),{key:0,ref:"childMenu",isShow:i.computedIsShow,"onUpdate:isShow":t[0]||(t[0]=a=>i.computedIsShow=a),comp:n.comp,items:i.childrenItems,style:o.normalizeStyle(i.menuStyle)},o.createSlots({_:2},[o.renderList(e.$slots,(a,r)=>({name:r,fn:o.withCtx(c=>[o.renderSlot(e.$slots,r,o.normalizeProps(o.guardReactiveProps(c)))])}))]),1064,["isShow","comp","items","style"])),[[o.vShow,i.childrenItems.length&&i.isShowChild]]):o.createCommentVNode("",!0)])}const Lr=de(hx,[["render",bx]]),yx={name:"EvContextMenu",directives:{clickoutside:Yi},components:{MenuList:Lr},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}=rx(),{isShow:n,rootMenuList:i,menuStyle:s,show:l,hide:a}=cx();return o.onBeforeMount(()=>t()),{isShow:n,rootMenuList:i,menuStyle:s,comp:e,show:l,hide:a}}};function xx(e,t,n,i,s,l){const a=o.resolveComponent("menu-list"),r=o.resolveDirective("clickoutside");return i.isShow&&n.items.length?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-context-menu-modal"},[o.withDirectives((o.openBlock(),o.createBlock(a,{ref:"rootMenuList",isShow:i.isShow,"onUpdate:isShow":t[0]||(t[0]=c=>i.isShow=c),class:o.normalizeClass(n.customClass),items:n.items,style:o.normalizeStyle(i.menuStyle),comp:i.comp},o.createSlots({_:2},[o.renderList(e.$slots,(c,d)=>({name:d,fn:o.withCtx(h=>[o.renderSlot(e.$slots,d,o.normalizeProps(o.guardReactiveProps(h)))])}))]),1032,["isShow","class","items","style","comp"])),[[r,i.hide]])])):o.createCommentVNode("",!0)}const ii=de(yx,[["render",xx]]);ii.install=e=>{e.component(ii.name,ii)};const Sx=()=>window.innerWidth-document.documentElement.clientWidth,Cx=()=>{const{props:e,emit:t}=o.getCurrentInstance(),n=o.ref(),i=o.ref(),s=o.ref(!1),l=o.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 b,C;if(typeof m=="string"||typeof m=="number"){const y=/^(normal|(-*\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(m);b=y?{value:+y[2],unit:y[3]||void 0}:void 0}else b=void 0;return b==null?C=void 0:b.unit?C=`${b.value}${b.unit}`:C=`${b.value}px`,C},d=(m,b="horizontal")=>{if(typeof m=="number")return m;if(!m)return 0;let C=0;const y=/^(normal|(\d+(?:\.\d+)?)(px|%|vw|vh)?)$/.exec(m);if(b&&["%","vw","vh"].includes(y[3])&&y[2]){const w=b==="horizontal"?window.innerWidth:window.innerHeight;C=Math.floor(w*+y[2]/100)}else y[2]&&(C=+y[2]);return C},h=o.reactive({}),u=o.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"),b=d(e.minWidth,"horizontal");m<b?(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 C=d(e.height,"vertical"),y=d(e.minHeight,"vertical");C<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)},p=m=>{m==="layer"&&!e.closeOnClickModal||t("update:visible",!1)},g=m=>{var y;const b=(y=a==null?void 0:a.getElementsByClassName("scroll-lock"))==null?void 0:y.length,C=document.body;if(m){if(e.hideScroll){if(!b){const w=Sx();C.style.paddingRight=`${w}px`}C.classList.add("ev-window-scroll-lock")}}else e.hideScroll&&b===1&&(C.style.removeProperty("padding-right"),C.classList.remove("ev-window-scroll-lock"))};return f(),o.watch(()=>e.visible,async m=>{g(m),m&&await o.nextTick(()=>{f()})}),{windowRef:n,headerRef:i,isFullExpandWindow:s,maximizableIcon:l,baseStyle:u,closeWin:p,numberToUnit:c,removeUnit:d}},kx=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{windowRef:i,headerRef:s,isFullExpandWindow:l,numberToUnit:a,removeUnit:r}=e,c=50,d=5,h=o.reactive({}),u=o.reactive({state:"",pressedSpot:"",top:0,left:0,width:0,height:0,clientX:0,clientY:0}),f=o.reactive({top:0,left:0}),p=o.reactive({top:!1,right:!1,left:!1,bottom:!1}),g=o.reactive({width:null,height:null,top:null,left:null}),m=(I,V)=>{if(I==null||V==null)return!1;const v=i.value.getBoundingClientRect(),E=+I-v.left,G=+V-v.top,R=s.value.style,X={top:r(R.paddingTop,"vertical"),left:r(R.paddingLeft,"horizontal"),right:r(R.paddingRight,"horizontal")},W=X.left,N=v.width-X.right,P=X.top,D=P+s.value.offsetHeight;return E>W&&E<N&&G>P&&G<D},b=I=>{if(I===null||typeof I!="object")return;let V,v,E,G,R,X;const W=i.value,N=Object.prototype.hasOwnProperty;N.call(I,"top")?V=I.top:V=u.top,N.call(I,"left")?v=I.left:v=u.left,N.call(I,"width")?E=I.width:E=W.offsetWidth,N.call(I,"height")?G=I.height:G=W.offsetHeight,N.call(I,"minWidth")?R=I.minWidth:R=t.minWidth,N.call(I,"minHeight")?X=I.minHeight:X=t.minHeight,E=r(E,"horizontal")>r(R,"horizontal")?E:R,G=r(G,"vertical")>r(X,"vertical")?G:X,h.top=a(V),h.left=a(v),h.width=a(E),h.height=a(G),h.minWidth=a(R),h.minHeight=a(X)},C=I=>{if(!(!i.value||u.pressedSpot))if(t.resizable){const V=i.value.getBoundingClientRect(),v=I.clientX-V.left,E=I.clientY-V.top,G=E<d,R=v<d,X=v>=V.width-d,W=E>=V.height-d;G&&R||W&&X?i.value.style.cursor="nwse-resize":G&&X||W&&R?i.value.style.cursor="nesw-resize":X||R?i.value.style.cursor="ew-resize":W||G?i.value.style.cursor="ns-resize":t.draggable&&m(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"}else t.draggable&&m(I.clientX,I.clientY)?i.value.style.cursor="move":i.value.style.cursor="default"},y=I=>{const V=window.innerWidth,v=window.innerHeight,E=p.top,G=p.left,R=p.right,X=p.bottom,W=r(t.minWidth,"horizontal"),N=r(t.minHeight,"vertical"),P=I.clientX>=V?V:I.clientX;let D=I.clientY>=v?v:I.clientY;D=I.clientY>0?D:0;const H=P-u.clientX,B=D-u.clientY;let Y=u.top,O=u.left,_=u.width,A=u.height;const Q=Y+u.height-N,U=O+u.width-W;E&&(Y=u.top+B,A=u.height-B,Y>Q&&(Y=Q)),G&&(O=u.left+H,_=u.width-H,O>U&&(O=U)),R&&(_=u.width+H),X&&(A=u.height+B),_=Math.min(Math.max(_,W),V),A=Math.min(Math.max(A,N),v);const ee={top:Y,left:O,width:_,height:A};b(ee),n("resize",I,{...ee})},w=(I,V)=>{let v=V;return v<0?v=0:v>I-c&&(v=Math.floor(I-c)),v},T=(I,V)=>{let v=V;return v<-(u.width-c)?v=-Math.floor(u.width-c):v>I-c&&(v=Math.floor(I-c)),v},k=I=>{if(I.preventDefault(),u.state="mousedown-mousemove",t.draggable&&u.pressedSpot==="header"){const V=document.documentElement.clientWidth,v=document.documentElement.clientHeight,E=I.clientY-u.clientY,G=I.clientX-u.clientX;let R=u.top+E,X=u.left+G;R=w(v,R),X=T(V,X),b({top:`${R}px`,left:`${X}px`,width:h.width??t.width,height:h.height??t.height})}else t.resizable&&u.pressedSpot==="border"&&y(I);n("mousedown-mousemove",I)},M=I=>{u.state="",u.pressedSpot="",n("mousedown-mouseup",I),window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",M)},Z=I=>{if(!i.value||!t.resizable&&!t.draggable)return;let V="";if(t.resizable){const v=i.value.getBoundingClientRect(),E=I.clientX-v.left,G=I.clientY-v.top,R=G<d,X=E<d,W=E>=v.width-d,N=G>=v.height-d;p.top=R,p.left=X,p.right=W,p.bottom=N,(R||X||W||N)&&(V="border")}if(V!=="border"&&m(I.clientX,I.clientY)&&(V="header"),!V||!t.draggable&&V==="header"||!t.resizable&&V==="border"){u.state="mousedown",u.pressedSpot="",u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value});return}u.state="mousedown",u.pressedSpot=V,u.top=i.value.offsetTop,u.left=i.value.offsetLeft,u.width=i.value.offsetWidth,u.height=i.value.offsetHeight,u.clientX=I.clientX,u.clientY=I.clientY,n("mousedown",{...u,ref:i.value}),window.addEventListener("mousemove",k),window.addEventListener("mouseup",M)},S=I=>{!t.draggable&&!t.resizable||C(I)},x=()=>{l.value=!l.value,o.nextTick(()=>{l.value?(g.top=i.value.offsetTop,g.left=i.value.offsetLeft,g.width=i.value.offsetWidth,g.height=i.value.offsetHeight,b({top:0,left:0,width:document.body.clientWidth,height:document.body.clientHeight})):b({top:g.top,left:g.left,width:g.width,height:g.height}),n("expand",{top:g.top,left:g.left,width:g.width,height:g.height})})},L=()=>{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,p.top=!1,p.left=!1,p.right=!1,p.bottom=!1,g.top=null,g.left=null,g.width=null,g.height=null,Object.keys(h).forEach(I=>{delete h[I]})};return o.watch(()=>t.visible,I=>{I||L()}),{dragStyle:h,startDrag:Z,moveMouse:S,clickExpandBtn:x}},Tt=(()=>{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(i=>i.sequence!==n.sequence))},get windows(){return e.slice()},getWindowBySequence(n){return e.find(i=>i.sequence===n)},isEmpty(){return e.length<=0},isFirstWindowOpen(){return t===1}}})(),Mt=(()=>{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)}}})(),wx=e=>{const t=window.getComputedStyle(e).getPropertyValue("z-index").trim();return!t||isNaN(t)?700:parseInt(t)},Po=()=>{const e=(n,i)=>n.zIndex>i.zIndex?1:n.zIndex<i.zIndex?-1:n.sequence>i.sequence?1:-1;return Array.prototype.map.call(Tt.windows,n=>({...n,zIndex:wx(n.elem)})).sort(e)},Ix=({closeWin:e,windowRef:t})=>{const{props:n}=o.getCurrentInstance();let i=null,s=null;const l=()=>Tt.add({sequence:i,closeWin:e,elem:t.value,escClose:n.escClose}),a=b=>{Tt.remove(b)},r=b=>{if(Tt.isEmpty())return;const{code:C}=b;if(C!=="Escape")return;const y=Po(),w=y[y.length-1];w.escClose&&w.closeWin()},c=()=>{i=l(),t.value.dataset.sequence=i,Tt.isFirstWindowOpen()&&document.addEventListener("keydown",r)},d=()=>{const b=Tt.getWindowBySequence(i);a(b)},h=({elem:b,zIndex:C})=>{if(n.isModal){const y=b.parentElement.getElementsByClassName("ev-window-dim-layer")[0];y.style.zIndex=C}b.style.zIndex=C},u=()=>{Tt.windows.length===1&&Mt.resetToLower();const b=Mt.getNext();h({elem:t.value,zIndex:b})},f=b=>String(b.sequence)===t.value.dataset.sequence,p=()=>{const b=Po();if(Tt.windows.length>Mt.getAllocableCount()){const y=b.reverse();let w=0;y.forEach(k=>{if(f(k))return;const M=Mt.getPrevFrom(w++);h({elem:k.elem,zIndex:M})});const T=Mt.getNextOverLimit();h({elem:t.value,zIndex:T})}else{Mt.resetToLower(),b.forEach(w=>{if(f(w))return;const T=Mt.getNext();h({elem:w.elem,zIndex:T})});const y=Mt.getNext();h({elem:t.value,zIndex:y})}},g=()=>{Mt.isUpperLimitClose()?p():u()},m=()=>{if(!t.value||!n.focusable)return;const b=Po(),C=b[b.length-1];f(C)||g()};return o.onMounted(()=>{n.visible&&(c(),s=setTimeout(g,0))}),o.onBeforeUnmount(()=>{n.visible&&(d(),clearTimeout(s))}),o.watch(()=>n.visible,b=>{o.nextTick(()=>{b?(c(),s=setTimeout(g,0)):(d(),clearTimeout(s))})}),o.watch(()=>n.escClose,b=>{if(!n.visible)return;const C=Tt.getWindowBySequence(i);C&&(C.escClose=b)}),{setFocus:m}},Lx={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:i,baseStyle:s,closeWin:l,numberToUnit:a,removeUnit:r}=Cx(),{dragStyle:c,startDrag:d,moveMouse:h,clickExpandBtn:u}=kx({windowRef:e,headerRef:t,isFullExpandWindow:n,numberToUnit:a,removeUnit:r}),{setFocus:f}=Ix({closeWin:l,windowRef:e});return{windowRef:e,headerRef:t,baseStyle:s,dragStyle:c,maximizableIcon:i,closeWin:l,startDrag:d,moveMouse:h,clickExpandBtn:u,setFocus:f}}},Tx={key:0,ref:"headerRef",class:"ev-window-header"},Mx={key:0,class:"ev-window-icon"},vx={key:1,class:"ev-window-title"},Rx={class:"ev-window-content"},Vx={key:1,class:"ev-window-footer"},Ex={class:"ev-window-top-right-icon"};function Gx(e,t,n,i,s,l){return o.openBlock(),o.createBlock(o.Teleport,{to:"#ev-window-modal"},[o.createVNode(o.Transition,{name:"ev-window-fade",appear:""},{default:o.withCtx(()=>[n.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["ev-window-wrapper",{"scroll-lock":n.hideScroll},{"scroll-allow":!n.hideScroll&&!n.isModal}])},[n.isModal?(o.openBlock(),o.createElementBlock("div",{key:0,class:"ev-window-dim-layer",onClick:t[0]||(t[0]=a=>i.closeWin("layer")),onWheel:o.withModifiers(()=>{},["stop","prevent"])},null,32)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref:"windowRef",class:o.normalizeClass(["ev-window",n.windowClass,{fullscreen:!!n.fullscreen}]),style:o.normalizeStyle({...i.baseStyle,...i.dragStyle}),onMousedown:t[3]||(t[3]=(...a)=>i.startDrag&&i.startDrag(...a)),onMousemove:t[4]||(t[4]=(...a)=>i.moveMouse&&i.moveMouse(...a)),onClick:t[5]||(t[5]=(...a)=>i.setFocus&&i.setFocus(...a))},[e.$slots.header||n.iconClass||n.title?(o.openBlock(),o.createElementBlock("div",Tx,[e.$slots.header?o.renderSlot(e.$slots,"header",{key:0}):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.iconClass?(o.openBlock(),o.createElementBlock("span",Mx,[o.createElementVNode("i",{class:o.normalizeClass(n.iconClass)},null,2)])):o.createCommentVNode("",!0),n.title?(o.openBlock(),o.createElementBlock("p",vx,o.toDisplayString(n.title),1)):o.createCommentVNode("",!0)],64))],512)):o.createCommentVNode("",!0),o.createElementVNode("div",Rx,[o.renderSlot(e.$slots,"default")]),e.$slots.footer?(o.openBlock(),o.createElementBlock("div",Vx,[o.renderSlot(e.$slots,"footer")])):o.createCommentVNode("",!0),o.createElementVNode("div",Ex,[n.maximizable&&!n.fullscreen?(o.openBlock(),o.createElementBlock("span",{key:0,class:"ev-window-maximizable",onClick:t[1]||(t[1]=(...a)=>i.clickExpandBtn&&i.clickExpandBtn(...a))},[o.createElementVNode("i",{class:o.normalizeClass(i.maximizableIcon)},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:"ev-window-close",onClick:t[2]||(t[2]=(...a)=>i.closeWin&&i.closeWin(...a))},[...t[6]||(t[6]=[o.createElementVNode("i",{class:"ev-icon-close"},null,-1)])])])],38)],2)):o.createCommentVNode("",!0)]),_:3})])}const si=de(Lx,[["render",Gx]]);si.install=e=>{e.component(si.name,si)};const Wx={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:o.computed(()=>e.clickOutside?"click":null),closeLoading:()=>t("update:modelValue",!1)}}},Zx={class:"ev-loading-spinner"},Xx={class:"ev-loading-spinner"};function Nx(e,t,n,i,s,l){return n.fullscreen?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"body"},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading full-screen"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[0]||(t[0]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Zx,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.modelValue?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,class:"ev-loading"},{[o.toHandlerKey(`${i.clickEventName}`)]:t[1]||(t[1]=(...a)=>i.closeLoading&&i.closeLoading(...a))}),[o.createElementVNode("div",Xx,[e.$slots.default?o.renderSlot(e.$slots,"default",{key:0}):(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass([n.iconClass||"ev-icon-refresh2","ev-loading-icon"]),style:o.normalizeStyle(n.iconStyle)},null,6))])],16)):o.createCommentVNode("",!0)],64))}const oi=de(Wx,[["render",Nx]]);oi.install=e=>{e.component(oi.name,oi)};const Px={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=o.computed(()=>({height:`${e.strokeWidth}px`})),n=o.computed(()=>{if(Array.isArray(e.color)){const i=[...e.color].sort((l,a)=>l.value-a.value);let s=i[0].color;if(!e.modelValue)return{width:`${e.modelValue}%`,"background-color":s};for(let l=0;l<i.length;l++){const a=l===0?0:i[l-1].value,r=i[l].value;if(e.modelValue>a&&e.modelValue<=r){s=i[l].color;break}}return{width:`${e.modelValue}%`,"background-color":s}}return{width:`${e.modelValue}%`,"background-color":e.color}});return{wrapperStyle:t,innerStyle:n}}},Bx={class:"ev-progress"},Dx={key:0,class:"ev-progress-inner-text"},Yx={key:0,class:"ev-progress-label"};function Ox(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",Bx,[o.createElementVNode("div",{class:"ev-progress-wrapper",style:o.normalizeStyle(i.wrapperStyle)},[o.createElementVNode("div",{class:"ev-progress-inner",style:o.normalizeStyle(i.innerStyle)},[n.innerText?(o.openBlock(),o.createElementBlock("div",Dx,o.toDisplayString(n.innerText),1)):o.createCommentVNode("",!0)],4)],4),e.$slots.default?(o.openBlock(),o.createElementBlock("div",Yx,[o.renderSlot(e.$slots,"default")])):o.createCommentVNode("",!0)])}const li=de(Px,[["render",Ox]]);li.install=e=>{e.component(li.name,li)};const Hx={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,i=o.ref(n),s=o.computed(()=>!!e.item.children&&!!e.item.children.length);return{isExpand:i,hasChild:s,clickMenu:a=>{s.value&&a.depth===e.depth?e.expandable&&(i.value=!i.value):t("click",a)}}}},zx={class:"text"};function Fx(e,t,n,i,s,l){return n.item.hidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["ev-menu-item",`depth${n.depth}`,{active:!n.item.disabled&&n.item.value===n.selectedItem}])},[o.createElementVNode("div",{class:o.normalizeClass(["ev-menu-title",{expandable:i.hasChild&&n.expandable,disabled:n.item.disabled}]),onClick:t[0]||(t[0]=a=>i.clickMenu({item:n.item,depth:n.depth,disabled:n.item.disabled}))},[n.item.iconClass?(o.openBlock(),o.createElementBlock("i",{key:0,class:o.normalizeClass(["front-icon",n.item.iconClass])},null,2)):o.createCommentVNode("",!0),o.createElementVNode("span",zx,[n.item.slotKey?o.renderSlot(e.$slots,n.item.slotKey,{key:0,item:n.item,depth:n.depth,selectedItem:n.selectedItem},()=>[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(n.item.text||n.item.value),1)],64))]),n.expandable&&i.hasChild?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["list-expend-icon",{expend:n.expandable&&i.isExpand}])},[...t[1]||(t[1]=[o.createElementVNode("i",{class:"ev-icon-s-arrow-up"},null,-1)])],2)):o.createCommentVNode("",!0)],2),i.hasChild?o.withDirectives((o.openBlock(),o.createElementBlock("ol",{key:0,class:o.normalizeClass(["ev-menu-sub",`depth${n.depth}`])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.item.children,(a,r)=>(o.openBlock(),o.createBlock(o.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:i.clickMenu},null,8,["depth","item","selected-item","expandable","disabled","comp","onClick"]))),128))],2)),[[o.vShow,i.isExpand]]):o.createCommentVNode("",!0)],2))}const Tr=de(Hx,[["render",Fx]]),Ax={name:"EvMenu",components:{MenuItem:Tr},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=o.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:Tr}}},Kx={class:"ev-menu"};function _x(e,t,n,i,s,l){const a=o.resolveComponent("menu-item");return o.openBlock(),o.createElementBlock("ul",Kx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${r.text}_${c}_0`,item:r,"selected-item":n.modelValue,expandable:n.expandable,disabled:n.disabled,comp:i.component,onClick:i.clickMenu},o.createSlots({_:2},[o.renderList(e.$slots,(d,h)=>({name:h,fn:o.withCtx(u=>[o.renderSlot(e.$slots,h,o.mergeProps({ref_for:!0},u))])}))]),1032,["item","selected-item","expandable","disabled","comp","onClick"]))),128))])}const ai=de(Ax,[["render",_x]]);ai.install=e=>{e.component(ai.name,ai)};const Ux={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=o.reactive(e.data),i=o.computed(()=>e.data.children&&e.data.children.length),s=o.computed(()=>{const m=e.expandIcon?e.expandIcon:"ev-icon-s-play",b=e.expandIcon?e.collapseIcon:"ev-icon-s-play";return e.data.expand?b:m}),l=o.computed(()=>e.data.children);function a(m,b){t("update-checked-info",{nodeKey:b,isChecked:m})}function r({nodeKey:m,isChecked:b}){t("update-checked-info",{nodeKey:m,isChecked:b})}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 p(m){t("show-context-menu",!0,m)}return{expandIconClasses:s,showExpandIcon:i,treeData:n,childrenInfo:l,handleCheck:a,emitCheckedInfo:r,handleExpand:c,clickTreeContent:d,emitClickedContent:h,dblClickTreeContent:u,emitDblClickedContent:f,handleContextmenu:p,emitContextMenuFlag:(m,b)=>{t("show-context-menu",m,b)}}}},Jx={class:"ev-tree-children"},jx={class:"ev-tree-node"};function Qx(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-checkbox");return o.withDirectives((o.openBlock(),o.createElementBlock("ul",Jx,[o.createElementVNode("li",null,[o.createElementVNode("span",{class:o.normalizeClass([{expand:i.treeData.expand},"ev-tree-toggle"])},[i.showExpandIcon?(o.openBlock(),o.createBlock(a,{key:0,icon:i.expandIconClasses,onClick:i.handleExpand},null,8,["icon","onClick"])):o.createCommentVNode("",!0)],2),o.createElementVNode("div",jx,[n.useCheckbox?(o.openBlock(),o.createBlock(r,{key:0,modelValue:i.treeData.checked,"onUpdate:modelValue":t[0]||(t[0]=c=>i.treeData.checked=c),indeterminate:i.treeData.indeterminate,disabled:i.treeData.disabled,onChange:t[1]||(t[1]=c=>i.handleCheck(i.treeData.checked,i.treeData.nodeKey))},null,8,["modelValue","indeterminate","disabled"])):o.createCommentVNode("",!0),i.treeData.iconClass?(o.openBlock(),o.createBlock(a,{key:1,icon:i.treeData.iconClass,class:"ev-tree-icon"},null,8,["icon"])):o.createCommentVNode("",!0),o.createElementVNode("span",{class:o.normalizeClass([{"ev-tree-title-selected":i.treeData.selected,"ev-tree-title-disabled":i.treeData.disabled},"ev-tree-title"]),onContextmenu:t[2]||(t[2]=(...c)=>i.handleContextmenu&&i.handleContextmenu(...c)),onClick:t[3]||(t[3]=(...c)=>i.clickTreeContent&&i.clickTreeContent(...c)),onDblclick:t[4]||(t[4]=(...c)=>i.dblClickTreeContent&&i.dblClickTreeContent(...c))},o.toDisplayString(i.treeData.title),35)]),o.createVNode(o.TransitionGroup,{name:"fade"},{default:o.withCtx(()=>[i.treeData.expand?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.childrenInfo,(c,d)=>(o.openBlock(),o.createBlock(o.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:i.emitCheckedInfo,onClickNode:i.emitClickedContent,onDblclickNode:i.emitDblClickedContent,onShowContextMenu:i.emitContextMenuFlag},null,40,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu"]))),128)):o.createCommentVNode("",!0)]),_:1})])],512)),[[o.vShow,i.treeData.visible]])}const Mr=de(Ux,[["render",Qx]]),$x={name:"EvTree",components:{TreeNode:Mr},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=o.ref(e.data);let i=[];const s=o.ref(null);let l=!1;const a=Mr;function r(S){const x=i[S].parent;if(typeof x>"u")return;const L=i[S].node,I=i[x].node;if(!(L.checked===I.checked&&L.indeterminate===I.indeterminate)){if(L.checked)I.checked=I.children.every(V=>V.checked),I.indeterminate=!I.checked;else{const V=v=>v.checked||L.indeterminate;I.checked=!1,I.indeterminate=I.children.some(V)}r(x)}}function c(S,x={}){const L=Object.keys(x);for(let I=0;I<L.length;I++)S[L[I]]=x[L[I]];S.children&&S.children.forEach(I=>{c(I,x)})}function d(){let S=0;const x=[],L=[];function I(V,v){const E=V;E.nodeKey=S++,Object.hasOwnProperty.call(E,"selected")||(E.selected=!1),Object.hasOwnProperty.call(E,"visible")||(E.visible=!0),"value"in E&&L.includes(E.value)?(console.warn("[EVUI][Tree] The 'value' of data should be unique."),E.value+=E.nodeKey):"value"in E||(E.value=E.title+E.nodeKey),L.push(E.value),x[E.nodeKey]={node:E,nodeKey:E.nodeKey},typeof v<"u"&&(x[E.nodeKey].parent=v.nodeKey,x[v.nodeKey].children.push(E.nodeKey)),E.children&&(x[E.nodeKey].children=[],E.children.forEach(G=>I(G,E)))}return n.value.length&&I(n.value[0]),x}i=d();function h(){return i.filter(S=>S.node.checked).map(S=>S.node)}function u(){h().forEach(x=>{c(x,{checked:!0});const L=i[x.nodeKey].parent;if(!L&&L!==0)return;const I=i[L].node;typeof x.checked<"u"&&x.checked&&I.checked!==x.checked&&r(x.nodeKey)})}function f({nodeKey:S,isChecked:x}){const L=i[S].node;L.checked=x,L.indeterminate=!1,r(S),c(L,{checked:x,indeterminate:!1});const I=h();t("check",I),u()}function p(S){const x=i[S].node;for(let L=0;L<i.length;L++)i[L].node.nodeKey!==S&&(i[L].node.selected=!1);t("click-node",{title:x.title,value:x.value})}function g(S){const x=i[S].node;t("dblclick-node",{title:x.title,value:x.value})}const m=S=>{e.contextMenuItems.length&&l&&(s.value.show(S),l=!1)},b=(S,x)=>{l=S,m(x)},C=(S,x)=>S.toLowerCase().includes(x.toLowerCase()),y=S=>{var x;if(S.children){const L=!!((x=S.children.filter(I=>C(I.title,e.searchWord)))!=null&&x.length);S.children.forEach(I=>{y(I),I.visible=L&&C(I.title,e.searchWord)||!L})}};function w(S){S.children&&S.children.forEach(x=>{x.visible=!1,w(x)})}function T(S){if(!S&&S!==0)return;const x=i[S];x.node.visible=!0,x.parent!==void 0&&T(x.parent)}function k(S){i.forEach(L=>{const I=L.node;I.visible=!1}),i.filter(L=>C(L.node.title,S)).forEach(L=>{const I=L.node;I.visible=!0,e.searchIncludeChildren?y(I):w(I);const V=i[I.nodeKey].parent;T(V)})}const M=o.computed(()=>!n.value.length||n.value.every(S=>!S.visible));o.watch(()=>e.data,S=>{n.value=S,i=d()},{deep:!0});let Z;return o.watch(()=>e.searchWord,S=>{Z&&clearTimeout(Z),Z=setTimeout(()=>{S?k(S):i.forEach(x=>{const L=x.node;L.visible=!0})},200)}),o.onMounted(()=>{u();const S=h();S.length&&t("check",S)}),o.onBeforeUnmount(()=>{Z&&clearTimeout(Z)}),{treeNodeData:n,contextMenu:s,component:a,isShowEmptyText:M,updateCheckedInfo:f,clickContent:p,dblClickContent:g,showContextMenu:m,getContextMenuFlag:b}}},qx={class:"ev-tree-view"},e0={key:0};function t0(e,t,n,i,s,l){const a=o.resolveComponent("tree-node"),r=o.resolveComponent("ev-context-menu");return o.openBlock(),o.createElementBlock("div",qx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.treeNodeData,(c,d)=>(o.openBlock(),o.createBlock(a,{key:d,data:c,"use-checkbox":n.useCheckbox,"expand-icon":n.expandIcon,"collapse-icon":n.collapseIcon,comp:i.component,onUpdateCheckedInfo:i.updateCheckedInfo,onClickNode:i.clickContent,onDblclickNode:i.dblClickContent,onShowContextMenu:i.getContextMenuFlag,onContextmenu:o.withModifiers(i.showContextMenu,["prevent"])},null,8,["data","use-checkbox","expand-icon","collapse-icon","comp","onUpdateCheckedInfo","onClickNode","onDblclickNode","onShowContextMenu","onContextmenu"]))),128)),i.isShowEmptyText?(o.openBlock(),o.createElementBlock("div",e0,o.toDisplayString(n.emptyText),1)):o.createCommentVNode("",!0),n.contextMenuItems.length?(o.openBlock(),o.createBlock(r,{key:1,ref:"contextMenu",items:n.contextMenuItems},null,8,["items"])):o.createCommentVNode("",!0)])}const ri=de($x,[["render",t0]]);ri.install=e=>{e.component(ri.name,ri)};const n0={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=o.computed({get:()=>e.modelValue,set:k=>{if(e.type==="range"){if(Array.isArray(k)){const M=k[0]>k[1]?"00:00":k[0],Z=M.value>k[1]?"23:59":k[1];t("update:modelValue",[M,Z])}}else t("update:modelValue",k)}}),i=o.computed(()=>{const k=["start time","end time"];return Array.isArray(e.placeholder)?[typeof e.placeholder[0]=="string"?e.placeholder[0]:k[0],typeof e.placeholder[1]=="string"?e.placeholder[1]:k[1]]:typeof e.placeholder=="string"?[e.placeholder,e.placeholder]:k}),s=o.ref(Array.isArray(n.value)?[`${n.value[0]}`,`${n.value[1]}`]:`${n.value}`),l=o.reactive({single:!1,rangeStart:!1,rangeEnd:!1}),a=k=>/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(k),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:k=>{t("focus",k)},blurInputTime:k=>{t("blur",k)},changeTime:k=>{a(n.value)?s.value=n.value:n.value=s.value,l.single=!a(n.value),t("change",k,n.value)},focusInputStartTime:k=>{t("focus",k)},blurInputStartTime:k=>{t("blur",k)},changeStartTime:k=>{r(),l.rangeStart=!1,t("change",k,n.value)},focusInputEndTime:k=>{t("focus",k)},blurInputEndTime:k=>{t("blur",k)},changeEndTime:k=>{c(),l.rangeEnd=!1,t("change",k,n.value)},placeholders:i}}},i0={class:"ev-time-picker"},s0={key:0,class:"ev-time-picker-range"},o0=["disabled","readonly","placeholder"],l0=["disabled","readonly","placeholder"],a0={key:1,class:"ev-time-picker-single"},r0=["disabled","readonly","placeholder"];function c0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",i0,[n.type==="range"?(o.openBlock(),o.createElementBlock("div",s0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeStart,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>i.time[0]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[0],onFocus:t[1]||(t[1]=(...r)=>i.focusInputStartTime&&i.focusInputStartTime(...r)),onBlur:t[2]||(t[2]=(...r)=>i.blurInputStartTime&&i.blurInputStartTime(...r)),onChange:t[3]||(t[3]=(...r)=>i.changeStartTime&&i.changeStartTime(...r))},null,40,o0),[[o.vModelText,i.time[0]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearStartTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2),t[12]||(t[12]=o.createElementVNode("p",{class:"tilde"},"~",-1)),o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.rangeEnd,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>i.time[1]=r),class:"ev-input",disabled:n.disabled,readonly:n.readonly,placeholder:i.placeholders[1],onFocus:t[5]||(t[5]=(...r)=>i.focusInputEndTime&&i.focusInputEndTime(...r)),onBlur:t[6]||(t[6]=(...r)=>i.blurInputEndTime&&i.blurInputEndTime(...r)),onChange:t[7]||(t[7]=(...r)=>i.changeEndTime&&i.changeEndTime(...r))},null,40,l0),[[o.vModelText,i.time[1]]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearEndTime},null,8,["onClick"])):o.createCommentVNode("",!0)],2)])):(o.openBlock(),o.createElementBlock("div",a0,[o.createElementVNode("div",{class:o.normalizeClass([{error:i.isWrongType.single,clearable:n.clearable,disabled:n.disabled,readonly:n.readonly},"ev-time-picker-wrapper"])},[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>i.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)=>i.focusInputTime&&i.focusInputTime(...r)),onBlur:t[10]||(t[10]=(...r)=>i.blurInputTime&&i.blurInputTime(...r)),onChange:t[11]||(t[11]=(...r)=>i.changeTime&&i.changeTime(...r))},null,40,r0),[[o.vModelText,i.time]]),o.createVNode(a,{icon:"ev-icon-time",class:"ev-input-prefix"}),n.clearable?(o.openBlock(),o.createBlock(a,{key:0,icon:"ev-icon-error",class:"ev-input-suffix",onClick:i.clearContents},null,8,["onClick"])):o.createCommentVNode("",!0)],2)]))])}const ci=de(n0,[["render",c0]]);ci.install=e=>{e.component(ci.name,ci)};const d0={name:"EvGridToolbar"},h0={class:"gridToolbar"};function u0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",h0,[o.renderSlot(e.$slots,"toolbarWrapper")])}const f0=de(d0,[["render",u0]]),m0={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=o.ref(e.modelValue),i=s=>{n.value=s>0?s:1,t("update:modelValue",n.value)};return o.watch(()=>e.modelValue,s=>{n.value=s}),{currentValue:n,changePage:i}}},p0={class:"grid-pagination"};function g0(e,t,n,i,s,l){const a=o.resolveComponent("ev-pagination");return o.openBlock(),o.createElementBlock("div",p0,[o.createVNode(a,{modelValue:i.currentValue,"onUpdate:modelValue":t[0]||(t[0]=r=>i.currentValue=r),total:n.total,"per-page":n.perPage,"visible-page":n.visiblePage,"show-page-info":n.showPageInfo,order:n.order,onChange:i.changePage},null,8,["modelValue","total","per-page","visible-page","show-page-info","order","onChange"])])}const vr=de(m0,[["render",g0],["__scopeId","data-v-2e265290"]]);var b0=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Bo=Math.ceil,tt=Math.floor,Ue="[BigNumber Error] ",Rr=Ue+"Number primitive has more than 15 significant digits: ",ft=1e14,ue=14,Do=9007199254740991,Yo=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ot=1e7,Xe=1e9;function Vr(e){var t,n,i,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,p=1,g=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},b="0123456789abcdefghijklmnopqrstuvwxyz",C=!0;function y(S,x){var L,I,V,v,E,G,R,X,W=this;if(!(W instanceof y))return new y(S,x);if(x==null){if(S&&S._isBigNumber===!0){W.s=S.s,!S.c||S.e>u?W.c=W.e=null:S.e<h?W.c=[W.e=0]:(W.e=S.e,W.c=S.c.slice());return}if((G=typeof S=="number")&&S*0==0){if(W.s=1/S<0?(S=-S,-1):1,S===~~S){for(v=0,E=S;E>=10;E/=10,v++);v>u?W.c=W.e=null:(W.e=v,W.c=[S]);return}X=String(S)}else{if(!b0.test(X=String(S)))return i(W,X,G);W.s=X.charCodeAt(0)==45?(X=X.slice(1),-1):1}(v=X.indexOf("."))>-1&&(X=X.replace(".","")),(E=X.search(/e/i))>0?(v<0&&(v=E),v+=+X.slice(E+1),X=X.substring(0,E)):v<0&&(v=X.length)}else{if(we(x,2,b.length,"Base"),x==10&&C)return W=new y(S),M(W,a+W.e+1,r);if(X=String(S),G=typeof S=="number"){if(S*0!=0)return i(W,X,G,x);if(W.s=1/S<0?(X=X.slice(1),-1):1,y.DEBUG&&X.replace(/^0\.0*|\./,"").length>15)throw Error(Rr+S)}else W.s=X.charCodeAt(0)===45?(X=X.slice(1),-1):1;for(L=b.slice(0,x),v=E=0,R=X.length;E<R;E++)if(L.indexOf(I=X.charAt(E))<0){if(I=="."){if(E>v){v=R;continue}}else if(!V&&(X==X.toUpperCase()&&(X=X.toLowerCase())||X==X.toLowerCase()&&(X=X.toUpperCase()))){V=!0,E=-1,v=0;continue}return i(W,String(S),G,x)}G=!1,X=n(X,x,10,W.s),(v=X.indexOf("."))>-1?X=X.replace(".",""):v=X.length}for(E=0;X.charCodeAt(E)===48;E++);for(R=X.length;X.charCodeAt(--R)===48;);if(X=X.slice(E,++R)){if(R-=E,G&&y.DEBUG&&R>15&&(S>Do||S!==tt(S)))throw Error(Rr+W.s*S);if((v=v-E-1)>u)W.c=W.e=null;else if(v<h)W.c=[W.e=0];else{if(W.e=v,W.c=[],E=(v+1)%ue,v<0&&(E+=ue),E<R){for(E&&W.c.push(+X.slice(0,E)),R-=ue;E<R;)W.c.push(+X.slice(E,E+=ue));E=ue-(X=X.slice(E)).length}else E-=R;for(;E--;X+="0");W.c.push(+X)}}else W.c=[W.e=0]}y.clone=Vr,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(S){var x,L;if(S!=null)if(typeof S=="object"){if(S.hasOwnProperty(x="DECIMAL_PLACES")&&(L=S[x],we(L,0,Xe,x),a=L),S.hasOwnProperty(x="ROUNDING_MODE")&&(L=S[x],we(L,0,8,x),r=L),S.hasOwnProperty(x="EXPONENTIAL_AT")&&(L=S[x],L&&L.pop?(we(L[0],-Xe,0,x),we(L[1],0,Xe,x),c=L[0],d=L[1]):(we(L,-Xe,Xe,x),c=-(d=L<0?-L:L))),S.hasOwnProperty(x="RANGE"))if(L=S[x],L&&L.pop)we(L[0],-Xe,-1,x),we(L[1],1,Xe,x),h=L[0],u=L[1];else if(we(L,-Xe,Xe,x),L)h=-(u=L<0?-L:L);else throw Error(Ue+x+" cannot be zero: "+L);if(S.hasOwnProperty(x="CRYPTO"))if(L=S[x],L===!!L)if(L)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))f=L;else throw f=!L,Error(Ue+"crypto unavailable");else f=L;else throw Error(Ue+x+" not true or false: "+L);if(S.hasOwnProperty(x="MODULO_MODE")&&(L=S[x],we(L,0,9,x),p=L),S.hasOwnProperty(x="POW_PRECISION")&&(L=S[x],we(L,0,Xe,x),g=L),S.hasOwnProperty(x="FORMAT"))if(L=S[x],typeof L=="object")m=L;else throw Error(Ue+x+" not an object: "+L);if(S.hasOwnProperty(x="ALPHABET"))if(L=S[x],typeof L=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(L))C=L.slice(0,10)=="0123456789",b=L;else throw Error(Ue+x+" invalid: "+L)}else throw Error(Ue+"Object expected: "+S);return{DECIMAL_PLACES:a,ROUNDING_MODE:r,EXPONENTIAL_AT:[c,d],RANGE:[h,u],CRYPTO:f,MODULO_MODE:p,POW_PRECISION:g,FORMAT:m,ALPHABET:b}},y.isBigNumber=function(S){if(!S||S._isBigNumber!==!0)return!1;if(!y.DEBUG)return!0;var x,L,I=S.c,V=S.e,v=S.s;e:if({}.toString.call(I)=="[object Array]"){if((v===1||v===-1)&&V>=-Xe&&V<=Xe&&V===tt(V)){if(I[0]===0){if(V===0&&I.length===1)return!0;break e}if(x=(V+1)%ue,x<1&&(x+=ue),String(I[0]).length==x){for(x=0;x<I.length;x++)if(L=I[x],L<0||L>=ft||L!==tt(L))break e;if(L!==0)return!0}}}else if(I===null&&V===null&&(v===null||v===1||v===-1))return!0;throw Error(Ue+"Invalid BigNumber: "+S)},y.maximum=y.max=function(){return T(arguments,-1)},y.minimum=y.min=function(){return T(arguments,1)},y.random=function(){var S=9007199254740992,x=Math.random()*S&2097151?function(){return tt(Math.random()*S)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(L){var I,V,v,E,G,R=0,X=[],W=new y(l);if(L==null?L=a:we(L,0,Xe),E=Bo(L/ue),f)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(E*=2));R<E;)G=I[R]*131072+(I[R+1]>>>11),G>=9e15?(V=crypto.getRandomValues(new Uint32Array(2)),I[R]=V[0],I[R+1]=V[1]):(X.push(G%1e14),R+=2);R=E/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(E*=7);R<E;)G=(I[R]&31)*281474976710656+I[R+1]*1099511627776+I[R+2]*4294967296+I[R+3]*16777216+(I[R+4]<<16)+(I[R+5]<<8)+I[R+6],G>=9e15?crypto.randomBytes(7).copy(I,R):(X.push(G%1e14),R+=7);R=E/7}else throw f=!1,Error(Ue+"crypto unavailable");if(!f)for(;R<E;)G=x(),G<9e15&&(X[R++]=G%1e14);for(E=X[--R],L%=ue,E&&L&&(G=Yo[ue-L],X[R]=tt(E/G)*G);X[R]===0;X.pop(),R--);if(R<0)X=[v=0];else{for(v=-1;X[0]===0;X.splice(0,1),v-=ue);for(R=1,G=X[0];G>=10;G/=10,R++);R<ue&&(v-=ue-R)}return W.e=v,W.c=X,W}}(),y.sum=function(){for(var S=1,x=arguments,L=new y(x[0]);S<x.length;)L=L.plus(x[S++]);return L},n=function(){var S="0123456789";function x(L,I,V,v){for(var E,G=[0],R,X=0,W=L.length;X<W;){for(R=G.length;R--;G[R]*=I);for(G[0]+=v.indexOf(L.charAt(X++)),E=0;E<G.length;E++)G[E]>V-1&&(G[E+1]==null&&(G[E+1]=0),G[E+1]+=G[E]/V|0,G[E]%=V)}return G.reverse()}return function(L,I,V,v,E){var G,R,X,W,N,P,D,H,B=L.indexOf("."),Y=a,O=r;for(B>=0&&(W=g,g=0,L=L.replace(".",""),H=new y(I),P=H.pow(L.length-B),g=W,H.c=x(vt(it(P.c),P.e,"0"),10,V,S),H.e=H.c.length),D=x(L,I,V,E?(G=b,S):(G=S,b)),X=W=D.length;D[--W]==0;D.pop());if(!D[0])return G.charAt(0);if(B<0?--X:(P.c=D,P.e=X,P.s=v,P=t(P,H,Y,O,V),D=P.c,N=P.r,X=P.e),R=X+Y+1,B=D[R],W=V/2,N=N||R<0||D[R+1]!=null,N=O<4?(B!=null||N)&&(O==0||O==(P.s<0?3:2)):B>W||B==W&&(O==4||N||O==6&&D[R-1]&1||O==(P.s<0?8:7)),R<1||!D[0])L=N?vt(G.charAt(1),-Y,G.charAt(0)):G.charAt(0);else{if(D.length=R,N)for(--V;++D[--R]>V;)D[R]=0,R||(++X,D=[1].concat(D));for(W=D.length;!D[--W];);for(B=0,L="";B<=W;L+=G.charAt(D[B++]));L=vt(L,X,G.charAt(0))}return L}}(),t=function(){function S(I,V,v){var E,G,R,X,W=0,N=I.length,P=V%Ot,D=V/Ot|0;for(I=I.slice();N--;)R=I[N]%Ot,X=I[N]/Ot|0,E=D*R+X*P,G=P*R+E%Ot*Ot+W,W=(G/v|0)+(E/Ot|0)+D*X,I[N]=G%v;return W&&(I=[W].concat(I)),I}function x(I,V,v,E){var G,R;if(v!=E)R=v>E?1:-1;else for(G=R=0;G<v;G++)if(I[G]!=V[G]){R=I[G]>V[G]?1:-1;break}return R}function L(I,V,v,E){for(var G=0;v--;)I[v]-=G,G=I[v]<V[v]?1:0,I[v]=G*E+I[v]-V[v];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,V,v,E,G){var R,X,W,N,P,D,H,B,Y,O,_,A,Q,U,ee,$,te,J=I.s==V.s?1:-1,q=I.c,j=V.c;if(!q||!q[0]||!j||!j[0])return new y(!I.s||!V.s||(q?j&&q[0]==j[0]:!j)?NaN:q&&q[0]==0||!j?J*0:J/0);for(B=new y(J),Y=B.c=[],X=I.e-V.e,J=v+X+1,G||(G=ft,X=nt(I.e/ue)-nt(V.e/ue),J=J/ue|0),W=0;j[W]==(q[W]||0);W++);if(j[W]>(q[W]||0)&&X--,J<0)Y.push(1),N=!0;else{for(U=q.length,$=j.length,W=0,J+=2,P=tt(G/(j[0]+1)),P>1&&(j=S(j,P,G),q=S(q,P,G),$=j.length,U=q.length),Q=$,O=q.slice(0,$),_=O.length;_<$;O[_++]=0);te=j.slice(),te=[0].concat(te),ee=j[0],j[1]>=G/2&&ee++;do{if(P=0,R=x(j,O,$,_),R<0){if(A=O[0],$!=_&&(A=A*G+(O[1]||0)),P=tt(A/ee),P>1)for(P>=G&&(P=G-1),D=S(j,P,G),H=D.length,_=O.length;x(D,O,H,_)==1;)P--,L(D,$<H?te:j,H,G),H=D.length,R=1;else P==0&&(R=P=1),D=j.slice(),H=D.length;if(H<_&&(D=[0].concat(D)),L(O,D,_,G),_=O.length,R==-1)for(;x(j,O,$,_)<1;)P++,L(O,$<_?te:j,_,G),_=O.length}else R===0&&(P++,O=[0]);Y[W++]=P,O[0]?O[_++]=q[Q]||0:(O=[q[Q]],_=1)}while((Q++<U||O[0]!=null)&&J--);N=O[0]!=null,Y[0]||Y.splice(0,1)}if(G==ft){for(W=1,J=Y[0];J>=10;J/=10,W++);M(B,v+(B.e=W+X*ue-1)+1,E,N)}else B.e=X,B.r=+N;return B}}();function w(S,x,L,I){var V,v,E,G,R;if(L==null?L=r:we(L,0,8),!S.c)return S.toString();if(V=S.c[0],E=S.e,x==null)R=it(S.c),R=I==1||I==2&&(E<=c||E>=d)?hs(R,E):vt(R,E,"0");else if(S=M(new y(S),x,L),v=S.e,R=it(S.c),G=R.length,I==1||I==2&&(x<=v||v<=c)){for(;G<x;R+="0",G++);R=hs(R,v)}else if(x-=E+(I===2&&v>E),R=vt(R,v,"0"),v+1>G){if(--x>0)for(R+=".";x--;R+="0");}else if(x+=v-G,x>0)for(v+1==G&&(R+=".");x--;R+="0");return S.s<0&&V?"-"+R:R}function T(S,x){for(var L,I,V=1,v=new y(S[0]);V<S.length;V++)I=new y(S[V]),(!I.s||(L=tn(v,I))===x||L===0&&v.s===x)&&(v=I);return v}function k(S,x,L){for(var I=1,V=x.length;!x[--V];x.pop());for(V=x[0];V>=10;V/=10,I++);return(L=I+L*ue-1)>u?S.c=S.e=null:L<h?S.c=[S.e=0]:(S.e=L,S.c=x),S}i=function(){var S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,x=/^([^.]+)\.$/,L=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,V=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,E,G,R){var X,W=G?E:E.replace(V,"");if(I.test(W))v.s=isNaN(W)?null:W<0?-1:1;else{if(!G&&(W=W.replace(S,function(N,P,D){return X=(D=D.toLowerCase())=="x"?16:D=="b"?2:8,!R||R==X?P:N}),R&&(X=R,W=W.replace(x,"$1").replace(L,"0.$1")),E!=W))return new y(W,X);if(y.DEBUG)throw Error(Ue+"Not a"+(R?" base "+R:"")+" number: "+E);v.s=null}v.c=v.e=null}}();function M(S,x,L,I){var V,v,E,G,R,X,W,N=S.c,P=Yo;if(N){e:{for(V=1,G=N[0];G>=10;G/=10,V++);if(v=x-V,v<0)v+=ue,E=x,R=N[X=0],W=tt(R/P[V-E-1]%10);else if(X=Bo((v+1)/ue),X>=N.length)if(I){for(;N.length<=X;N.push(0));R=W=0,V=1,v%=ue,E=v-ue+1}else break e;else{for(R=G=N[X],V=1;G>=10;G/=10,V++);v%=ue,E=v-ue+V,W=E<0?0:tt(R/P[V-E-1]%10)}if(I=I||x<0||N[X+1]!=null||(E<0?R:R%P[V-E-1]),I=L<4?(W||I)&&(L==0||L==(S.s<0?3:2)):W>5||W==5&&(L==4||I||L==6&&(v>0?E>0?R/P[V-E]:0:N[X-1])%10&1||L==(S.s<0?8:7)),x<1||!N[0])return N.length=0,I?(x-=S.e+1,N[0]=P[(ue-x%ue)%ue],S.e=-x||0):N[0]=S.e=0,S;if(v==0?(N.length=X,G=1,X--):(N.length=X+1,G=P[ue-v],N[X]=E>0?tt(R/P[V-E]%P[E])*G:0),I)for(;;)if(X==0){for(v=1,E=N[0];E>=10;E/=10,v++);for(E=N[0]+=G,G=1;E>=10;E/=10,G++);v!=G&&(S.e++,N[0]==ft&&(N[0]=1));break}else{if(N[X]+=G,N[X]!=ft)break;N[X--]=0,G=1}for(v=N.length;N[--v]===0;N.pop());}S.e>u?S.c=S.e=null:S.e<h&&(S.c=[S.e=0])}return S}function Z(S){var x,L=S.e;return L===null?S.toString():(x=it(S.c),x=L<=c||L>=d?hs(x,L):vt(x,L,"0"),S.s<0?"-"+x:x)}return s.absoluteValue=s.abs=function(){var S=new y(this);return S.s<0&&(S.s=1),S},s.comparedTo=function(S,x){return tn(this,new y(S,x))},s.decimalPlaces=s.dp=function(S,x){var L,I,V,v=this;if(S!=null)return we(S,0,Xe),x==null?x=r:we(x,0,8),M(new y(v),S+v.e+1,x);if(!(L=v.c))return null;if(I=((V=L.length-1)-nt(this.e/ue))*ue,V=L[V])for(;V%10==0;V/=10,I--);return I<0&&(I=0),I},s.dividedBy=s.div=function(S,x){return t(this,new y(S,x),a,r)},s.dividedToIntegerBy=s.idiv=function(S,x){return t(this,new y(S,x),0,1)},s.exponentiatedBy=s.pow=function(S,x){var L,I,V,v,E,G,R,X,W,N=this;if(S=new y(S),S.c&&!S.isInteger())throw Error(Ue+"Exponent not an integer: "+Z(S));if(x!=null&&(x=new y(x)),G=S.e>14,!N.c||!N.c[0]||N.c[0]==1&&!N.e&&N.c.length==1||!S.c||!S.c[0])return W=new y(Math.pow(+Z(N),G?S.s*(2-ds(S)):+Z(S))),x?W.mod(x):W;if(R=S.s<0,x){if(x.c?!x.c[0]:!x.s)return new y(NaN);I=!R&&N.isInteger()&&x.isInteger(),I&&(N=N.mod(x))}else{if(S.e>9&&(N.e>0||N.e<-1||(N.e==0?N.c[0]>1||G&&N.c[1]>=24e7:N.c[0]<8e13||G&&N.c[0]<=9999975e7)))return v=N.s<0&&ds(S)?-0:0,N.e>-1&&(v=1/v),new y(R?1/v:v);g&&(v=Bo(g/ue+2))}for(G?(L=new y(.5),R&&(S.s=1),X=ds(S)):(V=Math.abs(+Z(S)),X=V%2),W=new y(l);;){if(X){if(W=W.times(N),!W.c)break;v?W.c.length>v&&(W.c.length=v):I&&(W=W.mod(x))}if(V){if(V=tt(V/2),V===0)break;X=V%2}else if(S=S.times(L),M(S,S.e+1,1),S.e>14)X=ds(S);else{if(V=+Z(S),V===0)break;X=V%2}N=N.times(N),v?N.c&&N.c.length>v&&(N.c.length=v):I&&(N=N.mod(x))}return I?W:(R&&(W=l.div(W)),x?W.mod(x):v?M(W,g,r,E):W)},s.integerValue=function(S){var x=new y(this);return S==null?S=r:we(S,0,8),M(x,x.e+1,S)},s.isEqualTo=s.eq=function(S,x){return tn(this,new y(S,x))===0},s.isFinite=function(){return!!this.c},s.isGreaterThan=s.gt=function(S,x){return tn(this,new y(S,x))>0},s.isGreaterThanOrEqualTo=s.gte=function(S,x){return(x=tn(this,new y(S,x)))===1||x===0},s.isInteger=function(){return!!this.c&&nt(this.e/ue)>this.c.length-2},s.isLessThan=s.lt=function(S,x){return tn(this,new y(S,x))<0},s.isLessThanOrEqualTo=s.lte=function(S,x){return(x=tn(this,new y(S,x)))===-1||x===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(S,x){var L,I,V,v,E=this,G=E.s;if(S=new y(S,x),x=S.s,!G||!x)return new y(NaN);if(G!=x)return S.s=-x,E.plus(S);var R=E.e/ue,X=S.e/ue,W=E.c,N=S.c;if(!R||!X){if(!W||!N)return W?(S.s=-x,S):new y(N?E:NaN);if(!W[0]||!N[0])return N[0]?(S.s=-x,S):new y(W[0]?E:r==3?-0:0)}if(R=nt(R),X=nt(X),W=W.slice(),G=R-X){for((v=G<0)?(G=-G,V=W):(X=R,V=N),V.reverse(),x=G;x--;V.push(0));V.reverse()}else for(I=(v=(G=W.length)<(x=N.length))?G:x,G=x=0;x<I;x++)if(W[x]!=N[x]){v=W[x]<N[x];break}if(v&&(V=W,W=N,N=V,S.s=-S.s),x=(I=N.length)-(L=W.length),x>0)for(;x--;W[L++]=0);for(x=ft-1;I>G;){if(W[--I]<N[I]){for(L=I;L&&!W[--L];W[L]=x);--W[L],W[I]+=ft}W[I]-=N[I]}for(;W[0]==0;W.splice(0,1),--X);return W[0]?k(S,W,X):(S.s=r==3?-1:1,S.c=[S.e=0],S)},s.modulo=s.mod=function(S,x){var L,I,V=this;return S=new y(S,x),!V.c||!S.s||S.c&&!S.c[0]?new y(NaN):!S.c||V.c&&!V.c[0]?new y(V):(p==9?(I=S.s,S.s=1,L=t(V,S,0,3),S.s=I,L.s*=I):L=t(V,S,0,p),S=V.minus(L.times(S)),!S.c[0]&&p==1&&(S.s=V.s),S)},s.multipliedBy=s.times=function(S,x){var L,I,V,v,E,G,R,X,W,N,P,D,H,B,Y,O=this,_=O.c,A=(S=new y(S,x)).c;if(!_||!A||!_[0]||!A[0])return!O.s||!S.s||_&&!_[0]&&!A||A&&!A[0]&&!_?S.c=S.e=S.s=null:(S.s*=O.s,!_||!A?S.c=S.e=null:(S.c=[0],S.e=0)),S;for(I=nt(O.e/ue)+nt(S.e/ue),S.s*=O.s,R=_.length,N=A.length,R<N&&(H=_,_=A,A=H,V=R,R=N,N=V),V=R+N,H=[];V--;H.push(0));for(B=ft,Y=Ot,V=N;--V>=0;){for(L=0,P=A[V]%Y,D=A[V]/Y|0,E=R,v=V+E;v>V;)X=_[--E]%Y,W=_[E]/Y|0,G=D*X+W*P,X=P*X+G%Y*Y+H[v]+L,L=(X/B|0)+(G/Y|0)+D*W,H[v--]=X%B;H[v]=L}return L?++I:H.splice(0,1),k(S,H,I)},s.negated=function(){var S=new y(this);return S.s=-S.s||null,S},s.plus=function(S,x){var L,I=this,V=I.s;if(S=new y(S,x),x=S.s,!V||!x)return new y(NaN);if(V!=x)return S.s=-x,I.minus(S);var v=I.e/ue,E=S.e/ue,G=I.c,R=S.c;if(!v||!E){if(!G||!R)return new y(V/0);if(!G[0]||!R[0])return R[0]?S:new y(G[0]?I:V*0)}if(v=nt(v),E=nt(E),G=G.slice(),V=v-E){for(V>0?(E=v,L=R):(V=-V,L=G),L.reverse();V--;L.push(0));L.reverse()}for(V=G.length,x=R.length,V-x<0&&(L=R,R=G,G=L,x=V),V=0;x;)V=(G[--x]=G[x]+R[x]+V)/ft|0,G[x]=ft===G[x]?0:G[x]%ft;return V&&(G=[V].concat(G),++E),k(S,G,E)},s.precision=s.sd=function(S,x){var L,I,V,v=this;if(S!=null&&S!==!!S)return we(S,1,Xe),x==null?x=r:we(x,0,8),M(new y(v),S,x);if(!(L=v.c))return null;if(V=L.length-1,I=V*ue+1,V=L[V]){for(;V%10==0;V/=10,I--);for(V=L[0];V>=10;V/=10,I++);}return S&&v.e+1>I&&(I=v.e+1),I},s.shiftedBy=function(S){return we(S,-Do,Do),this.times("1e"+S)},s.squareRoot=s.sqrt=function(){var S,x,L,I,V,v=this,E=v.c,G=v.s,R=v.e,X=a+4,W=new y("0.5");if(G!==1||!E||!E[0])return new y(!G||G<0&&(!E||E[0])?NaN:E?v:1/0);if(G=Math.sqrt(+Z(v)),G==0||G==1/0?(x=it(E),(x.length+R)%2==0&&(x+="0"),G=Math.sqrt(+x),R=nt((R+1)/2)-(R<0||R%2),G==1/0?x="5e"+R:(x=G.toExponential(),x=x.slice(0,x.indexOf("e")+1)+R),L=new y(x)):L=new y(G+""),L.c[0]){for(R=L.e,G=R+X,G<3&&(G=0);;)if(V=L,L=W.times(V.plus(t(v,V,X,1))),it(V.c).slice(0,G)===(x=it(L.c)).slice(0,G))if(L.e<R&&--G,x=x.slice(G-3,G+1),x=="9999"||!I&&x=="4999"){if(!I&&(M(V,V.e+a+2,0),V.times(V).eq(v))){L=V;break}X+=4,G+=4,I=1}else{(!+x||!+x.slice(1)&&x.charAt(0)=="5")&&(M(L,L.e+a+2,1),S=!L.times(L).eq(v));break}}return M(L,L.e+a+1,r,S)},s.toExponential=function(S,x){return S!=null&&(we(S,0,Xe),S++),w(this,S,x,1)},s.toFixed=function(S,x){return S!=null&&(we(S,0,Xe),S=S+this.e+1),w(this,S,x)},s.toFormat=function(S,x,L){var I,V=this;if(L==null)S!=null&&x&&typeof x=="object"?(L=x,x=null):S&&typeof S=="object"?(L=S,S=x=null):L=m;else if(typeof L!="object")throw Error(Ue+"Argument not an object: "+L);if(I=V.toFixed(S,x),V.c){var v,E=I.split("."),G=+L.groupSize,R=+L.secondaryGroupSize,X=L.groupSeparator||"",W=E[0],N=E[1],P=V.s<0,D=P?W.slice(1):W,H=D.length;if(R&&(v=G,G=R,R=v,H-=v),G>0&&H>0){for(v=H%G||G,W=D.substr(0,v);v<H;v+=G)W+=X+D.substr(v,G);R>0&&(W+=X+D.slice(v)),P&&(W="-"+W)}I=N?W+(L.decimalSeparator||"")+((R=+L.fractionGroupSize)?N.replace(new RegExp("\\d{"+R+"}\\B","g"),"$&"+(L.fractionGroupSeparator||"")):N):W}return(L.prefix||"")+I+(L.suffix||"")},s.toFraction=function(S){var x,L,I,V,v,E,G,R,X,W,N,P,D=this,H=D.c;if(S!=null&&(G=new y(S),!G.isInteger()&&(G.c||G.s!==1)||G.lt(l)))throw Error(Ue+"Argument "+(G.isInteger()?"out of range: ":"not an integer: ")+Z(G));if(!H)return new y(D);for(x=new y(l),X=L=new y(l),I=R=new y(l),P=it(H),v=x.e=P.length-D.e-1,x.c[0]=Yo[(E=v%ue)<0?ue+E:E],S=!S||G.comparedTo(x)>0?v>0?x:X:G,E=u,u=1/0,G=new y(P),R.c[0]=0;W=t(G,x,0,1),V=L.plus(W.times(I)),V.comparedTo(S)!=1;)L=I,I=V,X=R.plus(W.times(V=X)),R=V,x=G.minus(W.times(V=x)),G=V;return V=t(S.minus(L),I,0,1),R=R.plus(V.times(X)),L=L.plus(V.times(I)),R.s=X.s=D.s,v=v*2,N=t(X,I,v,r).minus(D).abs().comparedTo(t(R,L,v,r).minus(D).abs())<1?[X,I]:[R,L],u=E,N},s.toNumber=function(){return+Z(this)},s.toPrecision=function(S,x){return S!=null&&we(S,1,Xe),w(this,S,x,2)},s.toString=function(S){var x,L=this,I=L.s,V=L.e;return V===null?I?(x="Infinity",I<0&&(x="-"+x)):x="NaN":(S==null?x=V<=c||V>=d?hs(it(L.c),V):vt(it(L.c),V,"0"):S===10&&C?(L=M(new y(L),a+V+1,r),x=vt(it(L.c),L.e,"0")):(we(S,2,b.length,"Base"),x=n(vt(it(L.c),V,"0"),10,S,I,!0)),I<0&&L.c[0]&&(x="-"+x)),x},s.valueOf=s.toJSON=function(){return Z(this)},s._isBigNumber=!0,s[Symbol.toStringTag]="BigNumber",s[Symbol.for("nodejs.util.inspect.custom")]=s.valueOf,e!=null&&y.set(e),y}function nt(e){var t=e|0;return e>0||e===t?t:t-1}function it(e){for(var t,n,i=1,s=e.length,l=e[0]+"";i<s;){for(t=e[i++]+"",n=ue-t.length;n--;t="0"+t);l+=t}for(s=l.length;l.charCodeAt(--s)===48;);return l.slice(0,s+1||1)}function tn(e,t){var n,i,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],i=l&&!l[0],n||i)return n?i?0:-r:a;if(a!=r)return a;if(n=a<0,i=c==d,!s||!l)return i?0:!s^n?1:-1;if(!i)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 we(e,t,n,i){if(e<t||e>n||e!==tt(e))throw Error(Ue+(i||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ds(e){var t=e.c.length-1;return nt(e.e/ue)==t&&e.c[t]%2!=0}function hs(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function vt(e,t,n){var i,s;if(t<0){for(s=n+".";++t;s+=n);e=s+e}else if(i=e.length,++t>i){for(s=n,t-=i;--t;s+=n);e+=s}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var Er=Vr();function nn(e){return new Er(e)}function Oo(e,t){return nn(e).plus(nn(t)).toNumber()}function y0(e,t){return nn(e).minus(nn(t)).toNumber()}function x0(e,t){return nn(e).dividedBy(nn(t)).toNumber()}function Gr(e,t){return nn(e).decimalPlaces(t,Er.ROUND_DOWN).toNumber()}const S0={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=o.ref(),i=2,s=o.computed(()=>e.stores),l=o.computed(()=>e.orderedColumns),a=o.computed(()=>e.useCheckbox),r=o.computed(()=>e.styleOption),c=p=>p==null||p<0?t.default:p>t.max?t.max:p,d=(p,g)=>{if(typeof g=="string"&&g.length===0)return g;const{type:m,decimal:b}=p;let C=g;return m==="number"?(C=Qt(g),C=C===!1?g:C):m==="float"&&(C=C.toFixed(c(b??t.default)).replace(/\B(?=(\d{3})+(?!\d))/g,",")),C},h=p=>l.value.findIndex(g=>g.field===p),u=p=>{const{type:g,field:m,summaryType:b,summaryDecimal:C,summaryOnlyTopParent:y}=p;let w="";const T=h(m);if(T>=0){if(b==="count")return s.value.store.length;if(g==="number"||g==="float"){let k=[];switch(e.isTree?k=s.value.store.reduce((M,Z)=>{var S,x;return y?Z.parent||M.push((S=Z.data)==null?void 0:S[m]):M.push((x=Z.data)==null?void 0:x[m]),M},[]):k=s.value.store.map(M=>M[i][T]),b){case"sum":{const M=k.reduce((Z,S)=>{const x=Number(S);return Number.isNaN(x)?Z:Oo(Z,x)},0);w=M&&Gr(M,c(C??t.default));break}case"average":{const M=k.reduce((Z,S)=>{const x=Number(S);return Number.isNaN(x)?Z:Oo(Z,x)},0);w=M&&Gr(x0(M,k.length),c(C??t.default));break}case"max":{const M=k.filter(Z=>Z!=null);w=M.length?Math.max(...M):"";break}case"min":{const M=k.filter(Z=>Z!=null);w=M.length?Math.min(...M):"";break}}w=d(p,w)}}return w},f=p=>{const g=p.summaryRenderer,m=p.summaryData?p.summaryData:[],b=[p.field,...m];let C=g;return b.forEach((y,w)=>{const T=h(y);if(T>=0){const k=u(s.value.orderedColumns[T]);C=C.replace(`{${w}}`,k)}}),C};return o.watch(()=>e.scrollLeft,p=>{o.nextTick(()=>{n.value.scrollLeft=p})}),{columns:l,styleInfo:r,showCheckbox:a,summaryRef:n,getSummaryValue:u,getSummaryRenderer:f}}},C0={class:"column-list"},k0=["title"],w0=["title"];function I0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",{ref:"summaryRef",class:o.normalizeClass({"grid-summary":!0,"non-border":i.styleInfo.borderStyle==="none"})},[o.createElementVNode("ul",C0,[i.showCheckbox?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle}),style:o.normalizeStyle({width:`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[o.createElementVNode("span",{style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columns,(a,r)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`summary_${r}`},[a.hide?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"non-border":!!i.styleInfo.borderStyle,[a.type]:a.type,[a.align]:a.align}),style:o.normalizeStyle({width:`${a.width}px`,"min-width":`${i.styleInfo.minWidth}px`,"line-height":`${i.styleInfo.rowHeight}px`})},[a.summaryType||a.summaryRenderer?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle({width:"100%",height:`${i.styleInfo.rowHeight}px`})},[a.summaryRenderer?(o.openBlock(),o.createElementBlock("div",{key:0,title:i.getSummaryRenderer(a)},o.toDisplayString(i.getSummaryRenderer(a)),9,k0)):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getSummaryValue(a)},o.toDisplayString(i.getSummaryValue(a)),9,w0))],4)):(o.openBlock(),o.createElementBlock("span",{key:1,style:o.normalizeStyle({height:`${i.styleInfo.rowHeight}px`})},null,4))],6))],64))),128))])],2)}const Wr=de(S0,[["render",I0],["__scopeId","data-v-4b9bef37"]]),L0={name:"EVGridColumnSetting",directives:{clickoutside:Yi},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=o.computed({get:()=>e.isShow,set:I=>t("update:isShow",I)}),i=o.ref(null),s=o.ref(""),l=o.ref(!1),a=o.ref([]),r=o.ref([]),c=o.ref([]),d=o.ref([]),h=o.computed(()=>l.value?c.value:r.value),u=o.computed(()=>!h.value.length);let f=null,p=null;const g=o.reactive({top:null,left:null}),m=o.computed({get:()=>e.isShowMenuOnClick,set:I=>t("update:isShowMenuOnClick",I)}),b=I=>{var V;(I==null?void 0:I.length)===1?p=I[0]:(I==null?void 0:I.length)<1&&(p==null&&(p=(V=r.value[0])==null?void 0:V.text),a.value.push(p))},C=I=>{f&&clearTimeout(f),f=setTimeout(()=>{if(l.value=!1,I){const V=I.toString().toLowerCase();c.value=r.value.filter(v=>v.label.toString().toLowerCase().includes(V)),l.value=!0}},500)},y=()=>{s.value="",l.value=!1,c.value.length=0},w=()=>{const I=d.value.length?d.value:r.value;a.value=I.filter(V=>V.originChecked).map(V=>V.text),y()},T=()=>{d.value=r.value.filter(V=>a.value.includes(V.text));const I=d.value.map(V=>V.text);t("apply-column",I),n.value=!1,m.value=!1},k=o.ref(),M=o.ref(),Z=()=>{M.value=Ze(a.value),r.value=e.columns.filter(I=>!I.hide&&I.caption).map(I=>{var E,G;const V=(E=k.value)==null?void 0:E.find(R=>R.field===I.field);let v=!1;return V?v=(V==null?void 0:V.hiddenDisplay)!==(I==null?void 0:I.hiddenDisplay)||!((G=M.value)!=null&&G.length)?!(I!=null&&I.hiddenDisplay):M.value.includes(I.field):v=!I.hiddenDisplay,{label:I.caption,text:I.field,originChecked:!I.hiddenDisplay,checked:v,fixed:I.fixed}}),a.value=r.value.filter(I=>I.checked).map(I=>I.text),d.value.length=0,k.value=Ze(e.columns)},S=()=>{n.value=!1,m.value=!1},x=()=>{const I=document.createElement("div");I.id="ev-grid-column-setting-modal",I.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-column-setting-modal")||document.body.appendChild(I)},L=async()=>{var D;await o.nextTick();const I=document.documentElement.clientWidth,V=document.documentElement.clientHeight,v=(D=i.value)==null?void 0:D.getBoundingClientRect(),E=v==null?void 0:v.width,G=v==null?void 0:v.height,{top:R,left:X,columnListMenuWidth:W}=e.position;let N;W?(N=X,I<X+E&&(N=X-E-W)):N=X-E;const P=V-G;g.top=`${Math.min(R,P)+document.documentElement.scrollTop}px`,g.left=`${N+document.documentElement.scrollLeft}px`};return o.onBeforeMount(()=>x()),o.watch(()=>e.columns,()=>{Z()},{immediate:!0,deep:!0}),o.watch(()=>n.value,async()=>{w(),n.value&&await L()}),o.watch(()=>e.hiddenColumn,I=>{const V=d.value.length?d.value.filter(v=>v.text!==I):r.value.filter(v=>v.text!==I&&v.checked);d.value=V,a.value=V.map(v=>v.text)}),{columnSettingWrapper:i,columnSettingStyle:g,isShowColumnSetting:n,checkColumnGroup:a,columnList:h,searchVm:s,isDisabled:u,onSearchColumn:C,onApplyColumn:T,onCheckColumn:b,hideColumnSetting:S}}},T0={class:"ev-grid-column-setting__header"},M0={class:"header-title"},v0={class:"ev-grid-column-setting__content"},R0={key:1,class:"is-empty"},V0={class:"ev-grid-column-setting__footer"};function E0(e,t,n,i,s,l){const a=o.resolveComponent("ev-text-field"),r=o.resolveComponent("ev-checkbox"),c=o.resolveComponent("ev-checkbox-group"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowColumnSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-column-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{ref:"columnSettingWrapper",class:"ev-grid-column-setting",style:o.normalizeStyle(i.columnSettingStyle)},[o.createElementVNode("div",T0,[o.createElementVNode("p",M0,o.toDisplayString(n.textInfo.title),1),o.createVNode(a,{modelValue:i.searchVm,"onUpdate:modelValue":t[0]||(t[0]=u=>i.searchVm=u),type:"search",placeholder:n.textInfo.search,onInput:i.onSearchColumn},null,8,["modelValue","placeholder","onInput"])]),o.createElementVNode("div",v0,[i.columnList.length?(o.openBlock(),o.createBlock(c,{key:0,modelValue:i.checkColumnGroup,"onUpdate:modelValue":t[1]||(t[1]=u=>i.checkColumnGroup=u),onChange:i.onCheckColumn},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.columnList,(u,f)=>(o.openBlock(),o.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:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(u==null?void 0:u.label),1)]),_:2},1032,["label","disabled","tooltip-title"]))),128))]),_:1},8,["modelValue","onChange"])):(o.openBlock(),o.createElementBlock("p",R0,o.toDisplayString(n.textInfo.empty),1))]),o.createElementVNode("div",V0,[o.createVNode(d,{type:"primary",disabled:i.isDisabled,onClick:i.onApplyColumn},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.textInfo.ok),1)]),_:1},8,["disabled","onClick"])])],4)),[[h,i.hideColumnSetting]])])):o.createCommentVNode("",!0)}const Zr=de(L0,[["render",E0]]),G0={name:"EVGridFilterSetting",directives:{clickoutside:Yi},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=o.ref([]),i=o.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=T=>T==="string"||T==="stringNumber"?[...r,...c]:T==="number"||T==="float"?[...a,...c]:T==="boolean"?[{name:"=",value:"="}]:[],h=o.computed(()=>d(e.column.type)),u=o.computed({get:()=>e.isShow,set:T=>t("update:isShow",T)}),f=()=>{const T=n.value.length>=2?n.value[1].operator:"and";n.value.push({comparison:"=",operator:T,value:"",caption:i.value.caption})},p=T=>{n.value.length>1?n.value.splice(T,1):T===0&&(n.value[0].comparison="=",n.value[0].value="")},g=(T,k)=>{(T==="isEmpty"||T==="isNotEmpty")&&(n.value[k].value="")},m=T=>{n.value=n.value.map(k=>({...k,operator:T}))},b=()=>{t("apply-filtering",i.value.field,n.value.filter(T=>T.value||T.comparison==="isEmpty"||T.comparison==="isNotEmpty"))};o.watch(()=>e.isShow,T=>{var Z;const k=[],M=Ze(e.items);T&&i.value.field&&((Z=M[i.value.field])!=null&&Z.length?M[i.value.field].forEach(S=>{k.push(S)}):k.push({comparison:"=",operator:"and",value:"",caption:i.value.caption}),n.value=k)});const C=(T,k)=>{var M;return((M=T.find(Z=>Z.value===k))==null?void 0:M.name)||""},y=()=>{const T=document.createElement("div");T.id="ev-grid-filter-setting-modal",T.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filter-setting-modal")||document.body.appendChild(T)};return o.onBeforeMount(()=>{y()}),{filteringItems:n,isShowFilterSetting:u,items1:s,items2:h,booleanItems:l,addRow:f,removeRow:p,changeOperator:m,applyFiltering:b,changeComparison:g,getSelectTitle:C,validateValue:(T,k)=>{(T==="number"||T==="float")&&(k.value=k.value.replace(/[^0-9.,]/g,""))}}}},W0={class:"ev-grid-filter-setting__header"},Z0={class:"header-title"},X0={class:"ev-grid-filter-setting__content"},N0={class:"ev-grid-filter-setting__row--button"},P0={class:"ev-grid-filter-setting__footer"};function B0(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("ev-text-field"),d=o.resolveComponent("ev-button"),h=o.resolveDirective("clickoutside");return i.isShowFilterSetting?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:"#ev-grid-filter-setting-modal"},[o.withDirectives((o.openBlock(),o.createElementBlock("section",{class:"ev-grid-filter-setting",style:o.normalizeStyle({top:e.$props.position.top,left:e.$props.position.left})},[o.createElementVNode("div",W0,[o.createVNode(a,{icon:"ev-icon-filter-list"}),o.createElementVNode("span",Z0," Filter ("+o.toDisplayString(e.$props.column.caption)+") ",1)]),o.createElementVNode("div",X0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.filteringItems,(u,f)=>(o.openBlock(),o.createElementBlock("div",{key:f,class:"ev-grid-filter-setting__row"},[o.createVNode(r,{modelValue:u.operator,"onUpdate:modelValue":p=>u.operator=p,class:"ev-grid-filter-setting__row--operator",title:i.getSelectTitle(i.items1,u.operator),items:i.items1,disabled:f>1,style:o.normalizeStyle({visibility:f>0?"visible":"hidden"}),onChange:i.changeOperator},null,8,["modelValue","onUpdate:modelValue","title","items","disabled","style","onChange"]),o.createVNode(r,{modelValue:u.comparison,"onUpdate:modelValue":p=>u.comparison=p,class:"ev-grid-filter-setting__row--comparison",title:i.getSelectTitle(i.items2,u.comparison),items:i.items2,onChange:p=>i.changeComparison(u.comparison,f)},null,8,["modelValue","onUpdate:modelValue","title","items","onChange"]),e.$props.column.type==="boolean"?(o.openBlock(),o.createBlock(r,{key:0,modelValue:u.value,"onUpdate:modelValue":p=>u.value=p,class:"ev-grid-filter-setting__row--comparison",items:i.booleanItems},null,8,["modelValue","onUpdate:modelValue","items"])):(o.openBlock(),o.createBlock(c,{key:1,modelValue:u.value,"onUpdate:modelValue":p=>u.value=p,class:"ev-grid-filter-setting__row--value",disabled:u.comparison==="isEmpty"||u.comparison==="isNotEmpty",onInput:p=>i.validateValue(e.$props.column.type,u)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"])),o.createElementVNode("div",N0,[o.createVNode(a,{icon:"ev-icon-trash2",onClick:p=>i.removeRow(f)},null,8,["onClick"])])]))),128))]),o.createElementVNode("div",P0,[o.createVNode(d,{type:"primary",onClick:i.applyFiltering},{default:o.withCtx(()=>[...t[0]||(t[0]=[o.createTextVNode(" OK ",-1)])]),_:1},8,["onClick"])])],4)),[[h,()=>{i.isShowFilterSetting=!1}]])])):o.createCommentVNode("",!0)}const D0=de(G0,[["render",B0]]),Y0={name:"GridSortButton",props:{icon:{type:String,default:""}}},O0={key:0},H0={key:1},z0={key:2};function F0(e,t,n,i,s,l){return n.icon==="basic"?(o.openBlock(),o.createElementBlock("span",O0,[...t[0]||(t[0]=[o.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o.createElementVNode("rect",{width:"14",height:"14",rx:"2",fill:"#F1F3F5"}),o.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
- 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
7
+ 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#121212"}),o.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
9
- 8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(i.openBlock(),i.createElementBlock("span",C0,[...t[1]||(t[1]=[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 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
9
+ 8.5L4.71008 9.205L7.00008 11.5L9.29508 9.205L8.58508 8.5L7.00008 10.085Z`,fill:"#D8D8D8","fill-opacity":"0.09"})],-1)])])):n.icon==="asc"?(o.openBlock(),o.createElementBlock("span",H0,[...t[1]||(t[1]=[o.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 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
10
10
  4.795L5.41508 5.5L7.00008 3.915Z" fill="#121212"></path><path d="M7.00008 3.915L8.58508 5.5L9.29008 4.795L7.00008 2.5L4.70508
11
11
  4.795L5.41508 5.5L7.00008 3.915Z" fill="#D8D8D8" fill-opacity="0.09"></path><path d="M7.00008 9.585L8.58508 8L9.29008 8.705L7.00008 11L4.70508
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
12
+ 8.705L5.41508 8L7.00008 9.585Z" fill="#DEE2E6"></path></svg>`,1)])])):n.icon==="desc"?(o.openBlock(),o.createElementBlock("span",z0,[...t[2]||(t[2]=[o.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 Mr=re(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)])])):o.createCommentVNode("",!0)}const Xr=de(Y0,[["render",F0]]),A0={name:"GridOptionButton"},K0={width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function _0(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("svg",K0,[...t[0]||(t[0]=[o.createElementVNode("circle",{cx:"6.49805",cy:"11.998",r:"1.5",transform:"rotate(-90 6.49805 11.998)",fill:"#ADB5BD"},null,-1),o.createElementVNode("circle",{cx:"11.998",cy:"11.998",r:"1.5",transform:"rotate(-90 11.998 11.998)",fill:"#ADB5BD"},null,-1),o.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 Ns=re(M0,[["render",I0]]),Et=0,gn=1,de=2,no=3,Vs=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=Xt(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}}},ai=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,k;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,B=((k=d.expandedRows)==null?void 0:k.map(v=>I.findIndex(N=>N[de]===v)))??[],V=I.length*x+E*b;let S=0,C=0;if(E)for(S=0;C+x<m.scrollTop;S++)B.includes(S)&&(C+=b),C+=x;else S=Math.floor(m.scrollTop/x),C=Math.max(S,0)*x;S>I.length-1&&(S=0);let M=0,w=0;if(E)for(let v=S;w<=m.clientHeight;v++)B.includes(v)&&(w+=b),w+=x,M+=1;else M=m.clientHeight>x?Math.ceil(m.clientHeight/x):I.length,w=M*x;const T=S+M+1,D=Math.max(S,0),L=T,O=o.table;n.viewStore=I.slice(D,L),t.hasVerticalScrollBar=M<I.length||m.clientHeight<O.clientHeight,t.vScrollTopHeight=C,t.vScrollBottomHeight=V-w-t.vScrollTopHeight,p&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(L/l.perPage)+1,l.startIndex=L,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,k=x!==y;m!==b&&(p!=null&&p.clientHeight)&&u(!0),k&&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 k=s.body;let I=k.offsetWidth;const E=k.offsetHeight,B=((y=k.querySelector("tr"))==null?void 0:y.offsetHeight)||o.rowHeight,V=I-k.clientWidth,S=r.orderedColumns.reduce((C,M)=>(M.hide||M.hiddenDisplay||(M.width?C.totalWidth+=M.width:C.emptyCount++),C),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(B*t.rows.length>E&&(I-=V),l.useCheckbox.use&&(I-=o.minWidth),a.useRowDetail&&(I-=o.minWidth),x=I-S.totalWidth,x>0){const C=S.emptyCount===0?0:Math.floor(x/S.emptyCount);b=x-C*S.emptyCount,x=S.emptyCount!==0?C:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(r.orderedColumns.forEach(k=>{const I=c(k)?o.rendererMinWidth:o.minWidth;k.width&&k.width<I&&(k.width=I),!k.width&&!k.hide&&(k.width=x)}),b&&r.orderedColumns.length){let k=r.orderedColumns.length-1,I=r.orderedColumns[k];for(;k>0&&I&&(I.hide||I.hiddenDisplay);)k-=1,I=r.orderedColumns[k];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(k=>{const I=k;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,k=s.body,I=y.getBoundingClientRect().left,E=y.querySelector(`li[data-index="${x}"]`),B=c(r.orderedColumns[x])?o.rendererMinWidth:o.minWidth,V=E.getBoundingClientRect(),S=s.resizeLine,C=V.left-I+B,M=V.right-I,w=b.clientX,T=V.left-I;k.style.overflow="auto",S.style.left=`${M}px`,o.showResizeLine=!0;const D=O=>{const v=O.clientX-w,N=M+v,R=Math.max(C,N);S.style.left=`${R}px`},L=()=>{const v=parseInt(S.style.left,10)-T;r.orderedColumns[x]&&(r.orderedColumns[x].width=v,r.orderedColumns[x].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),g();const N=ai(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",L,{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[Et],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,k)=>{if(b==="shift"){const I=h[Et];if(a>-1)for(let E=Math.min(I,a);E<=Math.max(I,a);E++)if(!y)o.originStore[E][no]=!0,a!==E&&n.selectedRow.push(o.originStore[E][de]);else{o.originStore[E][no]=!1;const B=n.selectedRow.indexOf(o.originStore[E][de]);B>-1&&n.selectedRow.splice(B,1)}}else b==="ctrl"&&(y?n.selectedRow.splice(n.selectedRow.indexOf(h[de]),1):n.selectedRow.push(k))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const b=h[de],y=h[no];h[no]=!h[no];let k="";d.shiftKey?k="shift":d.ctrlKey&&(k="ctrl"),n.multiple&&k?g(k,y,b):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(b)||(n.selectedRow=[b])):y?n.selectedRow=[]:n.selectedRow=[b],a=h[Et],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))}}},L0=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][gn]=h[gn])};return{onCheck:(h,u)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),u[gn]){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[gn]);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[Et],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[gn]=u)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},O0=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[Vs]=!l[Vs],n("update:expanded",t.expandedRows),n("expand-row",s,l[de],l[Vs],l[Et])}}},R0=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:ai(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=ai(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 M;const{field:m,index:x}=t.sortColumn||{},b=((M=t.sortFunction)==null?void 0:M[m])??null,y=(w,T)=>w>T?-1:1,k=(w,T)=>w<T?-1:1,I=(w,T)=>(w===null)-(T===null)||Number(T)-Number(w),E=(w,T)=>(w===null)-(T===null)||Number(w)-Number(T);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((w,T)=>typeof w[Et]=="number"?k(w[Et],T[Et]):0);return}const B=t.sortColumn.type||"string",V=t.sortOrder==="desc"?y:k,S=t.sortOrder==="desc"?I:E,C=(w,T)=>{var O,v;let D=w[de][x],L=T[de][x];return w[de][x]&&typeof w[de][x]=="object"&&(D=w[de][x][(O=n.originColumns[x])==null?void 0:O.field],L=T[de][x][(v=n.originColumns[x])==null?void 0:v.field]),{aCol:D,bCol:L}};if(b){n.store.sort((w,T)=>{const D=w[de][x],L=T[de][x],O=b(D,L);return t.sortOrder==="desc"?-O:O});return}switch(B){case"string":n.store.sort((w,T)=>{let{aCol:D,bCol:L}=C(w,T);if((!D||typeof D=="string")&&(!L||typeof L=="string")){D=D||"",L=L||"";const O=D.toLowerCase(),v=L.toLowerCase();if(D!==L&&O===v){const N=Array.from(D).findIndex((R,P)=>R!==L[P]);return V(D[N],L[N])}return V(O,v)}return 0});break;case"stringNumber":n.store.sort((w,T)=>{let{aCol:D,bCol:L}=C(w,T);return!D||typeof D=="string"||typeof D=="number"?(D=D===""?null:D,L=L===""?null:L,S(D??null,L??null)):0});break;default:n.store.sort((w,T)=>{const{aCol:D,bCol:L}=C(w,T);return!D||typeof D=="number"||typeof D=="boolean"?S(D??null,L??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 B=0;E.forEach(V=>{const S=l.checkedRows.includes(V[de]);V[gn]=S,B+=S?1:0}),E.length&&(l.isHeaderChecked=E.length===B,l.isHeaderIndeterminate=E.length!==B&&B>0,l.isHeaderUncheckable=E.every(V=>t.uncheckable.includes(V[de])||t.disabledRows.includes(V[de])))},g=(E,B,V)=>{if(typeof E!="string"||B===null)return!1;const S=B==null?void 0:B.toLowerCase(),C=E==null?void 0:E.toLowerCase();let M=S.includes(C);return V&&(V==="start"?M=S.startsWith(C):V==="end"&&(M=S.endsWith(C))),M},p=(E,B)=>{const V=B.comparison,S=B.value;let C=E[de][B.index];(C||C===0)&&(C=`${E[de][B.index]}`);let M;return V==="="?M=(S==null?void 0:S.toLowerCase())===(C==null?void 0:C.toLowerCase()):V==="!="?M=(S==null?void 0:S.toLowerCase())!==(C==null?void 0:C.toLowerCase()):V==="%s%"?M=g(S,C):V==="notLike"?M=!g(S,C):V==="s%"?M=g(S,C,"start"):V==="%s"?M=g(S,C,"end"):V==="isEmpty"?M=C==null||C==="":V==="isNotEmpty"&&(M=!!C),M},m=(E,B,V)=>{const S=B.comparison,C=Number(B.value.replace(/,/g,""));let M=Number(E[de][B.index]),w;return V==="float"&&(M=Number(M.toFixed(3))),S==="="?w=M===C:S===">"?w=M>C:S==="<"?w=M<C:S==="<="?w=M<=C:S===">="?w=M>=C:S==="!="?w=M!==C:S==="isEmpty"?w=M==null||isNaN(M):S==="isNotEmpty"&&(w=!!M||M===0),w},x=(E,B)=>{const V=B.comparison,S=B.value,C=`${E[de][B.index]}`;let M;return V==="="&&(M=C===S),M},b=(E,B,V)=>{let S=B==="string"||B==="stringNumber"?p:m;return B==="boolean"&&(S=x),E.filter(C=>S(C,V,B))||[]},y=()=>{const E=o.filteringItemsByColumn,B=Object.keys(E),V=s.originStore;let S=[],C=!1,M=[];B.forEach((w,T)=>{const D=E[w],L=u(w),O=t.columns[L].type,v=o.columnOperator==="or",N=T>0&&o.columnOperator==="and";D.forEach((R,P)=>{!S.length&&!C?S=b(V,O,{...R,index:L}):N&&R.operator==="or"?P>0?S.push(...b(M,O,{...R,index:L})):S=b(M,O,{...R,index:L}):P===0&&v||P!==0&&R.operator==="or"?S.push(...b(V,O,{...R,index:L})):S=b(S,O,{...R,index:L}),C=!0}),M=JSON.parse(JSON.stringify(S))}),C?s.filterStore=Up(S,JSON.stringify):s.filterStore=V};let k=null;return{onSearch:E=>{k&&clearTimeout(k),k=setTimeout(()=>{o.isSearch=!1,o.searchWord=E,E&&(s.searchStore=s.store.filter(B=>{let V=!1;const S=n.isFilteringColumn?B[de].filter((C,M)=>n.visibleColumnIdx.includes(M)):B[de];for(let C=0;C<s.orderedColumns.length;C++){const M=s.orderedColumns[C]||{};let w=S[M.index]??null;if(M.type=M.type||"string",w!==null&&(w instanceof Array?w=JSON.stringify(w):typeof w=="object"&&(w=w[M.field]),!M.hide&&((M==null?void 0:M.searchable)===void 0||M!=null&&M.searchable)&&(w=r(M,w).toString(),V=w.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 k=y;return k.validate&&(k.disabled=!k.validate(k.itemId,o.selectedRow)),k.selectedRow=o.selectedRow??[],k.contextmenuInfo=o.contextmenuInfo??[],k});x.push(...b)}t.contextMenuItems=x,t.menu.show(m)},200)};return{setContextMenu:u,onContextMenu:m=>{var k,I,E;m.preventDefault();const b=(I=(k=m.target.closest(".row"))==null?void 0:k.dataset)==null?void 0:I.index;let y=null;b&&(y=(E=n.viewStore.find(B=>B[Et]===+b))==null?void 0:E[de]),y&&(o.contextmenuInfo=[y],u(m))},onColumnContextMenu:(m,x)=>{var b,y,k,I,E,B,V,S;if(m.target.className==="column-name"){const C=x.sortable===void 0?!0:x.sortable,M=l.isFiltering&&x.filterable===void 0?!0:x.filterable,w=[{text:((b=t.columnMenuTextInfo)==null?void 0:b.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!C,hidden:(y=t.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>s(x,"asc")},{text:((k=t.columnMenuTextInfo)==null?void 0:k.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!C,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 T=document.documentElement.clientWidth,D=t.columnMenu.menuStyle.clientX,L=t.columnMenu.menuStyle.pageX,O=350;T<D+O&&(t.columnMenu.menuStyle.left=`${L-O}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:!M,hidden:((B=t.hiddenColumnMenuItem)==null?void 0:B.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:((S=t.hiddenColumnMenuItem)==null?void 0:S.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=[],!C&&!M&&!a.value)return;t.columnMenuItems=w.filter(T=>!T.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,k,I;const b=s.orderedColumns.find(E=>(E==null?void 0:E.sortOption)&&["asc","desc"].includes(E.sortOption.sortType));if(m){const E=[];let B=!1;p.forEach((V,S)=>{const C=t.checked.includes(V),M=t.uncheckable.includes(V)||t.disabledRows.includes(V);let w=!1;n.useSelect&&(w=t.selected.includes(V)),!C&&!M&&(B=!0);let T=!1;c.useRowDetail&&(T=t.expanded.includes(V));const D=t.disabledRows.includes(V);E.push([S,C,V,w,T,M,D])}),p.length!==t.checked.length&&(p.length===((y=t.uncheckable)==null?void 0:y.length)||p.length===((k=t.disabledRows)==null?void 0:k.length))&&(B=!0),o.isHeaderChecked=p.length>0?!B:!1,o.isHeaderIndeterminate=B&&!!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})}}},Er=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 k=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[k].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=I.width,s.columnSettingPosition.top=I.top,s.columnSettingPosition.left=I.right}else{const k=m==null?void 0:m.getBoundingClientRect(),I=k==null?void 0:k.height;s.columnSettingPosition.top=(k==null?void 0:k.top)+I,s.columnSettingPosition.left=k==null?void 0:k.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(k=>k.index===m.index);if(b&&b!==m&&(b.hiddenDisplay=x),Array.isArray(o.movedColumns)){const k=o.movedColumns.find(I=>I.index===m.index);k&&k!==m&&(k.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(),k=new Set(m);o.filteredColumns=y.filter(I=>{const E=k.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 k=y.field===m;return u(y,k),!k}),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:No,observeVisibility:Yi,resize:kn},components:{Toolbar:Yb,GridPagination:yr,GridSummary:wr,ColumnSetting:kr,FilterSetting:x0,GridSortButton:Mr,GridOptionButton:Ns},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(),u=i.ref(null),f=i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useGridSetting)==null?void 0:ne.use)||!1}),g=i.computed(()=>e.option.showHeader??!0),p=i.computed(()=>{var $;return(($=e.option)==null?void 0:$.useSummary)||!1}),m=i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.stripe)||!1}),x=i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.border)||""}),b=i.computed(()=>{var $;return(($=e.option.style)==null?void 0:$.highlight)??-1}),y=i.computed(()=>e.option.emptyText??"No records"),k=e.option.rowMinHeight||35,I=i.ref(0),E=i.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),B=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 $,ne;return((ne=($=e.option)==null?void 0:$.useGridSetting)==null?void 0:ne.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"}}),S=i.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:i.computed(()=>{const $=B.isFiltering?S.filterStore:S.originStore;return B.isSearch?S.searchStore:$}),filteredColumns:[],movedColumns:[],originColumns:i.computed(()=>e.columns.map(($,ne)=>{var Se;return{index:ne,hiddenDisplay:!1,...$,width:isFinite($.width)?$.width:void 0,sortOption:{sortType:((Se=$==null?void 0:$.sortOption)==null?void 0:Se.sortType)||"init"}}})),orderedColumns:i.computed(()=>{const $=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:$}),updatedColumns:i.computed(()=>ai(S))}),C=i.reactive({usePage:i.computed(()=>{var $;return(($=e.option.page)==null?void 0:$.use)||!1}),useClient:((Yr=e.option.page)==null?void 0:Yr.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 $,ne;return($=e.option.page)!=null&&$.useClient?S.store.length:(ne=e.option.page)==null?void 0:ne.total}),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(()=>C.useClient&&C.usePage&&!C.isInfinite),isHighlight:!1,highlightPage:0}),M=i.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:i.computed(()=>e.option.useCheckbox||{})}),w=i.reactive({expandedRows:e.expanded,useRowDetail:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.rowDetail)==null?void 0:ne.use)??!1}),detailRowHeight:i.computed(()=>{var $,ne;return(ne=($=e.option)==null?void 0:$.rowDetail)==null?void 0:ne.detailRowHeight})}),T=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 $,ne;return((ne=($=e.option)==null?void 0:$.useSelection)==null?void 0:ne.use)??!0}),multiple:i.computed(()=>{var $,ne;return((ne=($=e.option)==null?void 0:$.useSelection)==null?void 0:ne.multiple)??!1})}),L=i.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),O=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}),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>k?e.option.rowHeight:k),gridWidth:i.computed(()=>e.width?h(e.width):"100%"),gridHeight:i.computed(()=>e.height?h(e.height):"100%")}),N=()=>{M.checkedRows=[],M.isHeaderChecked=!1,M.isHeaderIndeterminate=!1,S.store.forEach($=>{$[1]=!1})},R=()=>{D.selectedRow=[],S.store.forEach($=>{$[3]=!1})},P=()=>{S.store.forEach($=>{$[4]=!1}),w.expandedRows=[]},{getPagingData:_,updatePagingInfo:z,changePage:W}=_0({stores:S,pageInfo:C,sortInfo:L,filterInfo:B,elementInfo:E,clearCheckInfo:N}),A=i.ref(0),{updateVScroll:F,updateHScroll:H,onScroll:U}=T0({scrollInfo:T,stores:S,elementInfo:E,resizeInfo:v,pageInfo:C,summaryScroll:A,expandedInfo:w,getPagingData:_,updatePagingInfo:z}),{onCheck:j,onCheckAll:q}=L0({checkInfo:M,stores:S,pageInfo:C,getPagingData:_}),{onExpanded:Z}=O0({expandedInfo:w}),{onSort:ee,getSortTarget:K,setSort:te,setSortInfo:G,hasSortTarget:Q}=R0({sortInfo:L,stores:S,updatePagingInfo:z}),{onSearch:J,setFilter:le,setHeaderCheckboxByFilter:he}=N0({columnSettingInfo:V,filterInfo:B,stores:S,checkInfo:M,pageInfo:C,getConvertValue:c,updateVScroll:F,getPagingData:_,updatePagingInfo:z,getColumnIndex:d}),{setStore:ae}=P0({selectInfo:D,checkInfo:M,stores:S,sortInfo:L,elementInfo:E,filterInfo:B,expandedInfo:w,setSort:te,setSortInfo:G,updateVScroll:F,setFilter:le}),{calculatedColumn:fe,onResize:Me,onShow:rt,onColumnResize:ct}=B0({resizeInfo:v,elementInfo:E,checkInfo:M,expandedInfo:w,stores:S,isRenderer:a,updateVScroll:F,updateHScroll:H,contextInfo:O}),{setPositionColumnSetting:xt,initColumnSettingInfo:fo,onApplyColumn:mo,setColumnHidden:go}=Er({stores:S,columnSettingInfo:V,contextInfo:O,onSearch:J,onResize:Me}),{setContextMenu:qt,onContextMenu:Fs,onColumnContextMenu:Hs,onGridSettingContextMenu:hi}=V0({contextInfo:O,stores:S,selectInfo:D,useGridSetting:f,filterInfo:B,columnSettingInfo:V,setColumnHidden:go,onSort:ee}),{onRowClick:ui,onRowDblClick:fi}=D0({selectInfo:D,stores:S}),{onDragStart:mi,onDragOver:gi,onDrop:pi}=A0({stores:S}),yi=$=>{O.gridSettingContextMenuItems.length=0,O.customGridSettingContextMenu.length?hi($):V.isShowColumnSetting=!0},Kt=$=>{var ne,Se,bt,Jt,po,It,Qe,xi,bi,jr;$.type==="wheel"&&((ne=O.menu)==null||ne.hide($)),$.type==="scroll"&&!((Se=$.target.classList)!=null&&Se.contains("table-body"))&&!((Jt=(bt=$.target.offsetParent)==null?void 0:bt.classList)!=null&&Jt.contains("ev-select-dropbox"))&&!((It=(po=$.target.offsetParent)==null?void 0:po.classList)!=null&&It.contains("ev-grid-column-setting"))&&!((xi=(Qe=$.target.offsetParent)==null?void 0:Qe.classList)!=null&&xi.contains("ev-text-field-wrapper"))&&(B.isShowFilterSetting=!1,V.isShowColumnSetting=!1,O.isShowMenuOnClick=!1,(bi=O.columnMenu)==null||bi.hide($),(jr=O.gridSettingMenu)==null||jr.hide())};i.onMounted(()=>{fe(),ae({rows:e.rows,isInit:!0}),document.addEventListener("wheel",Kt,{capture:!1}),document.addEventListener("scroll",Kt,{capture:!0})}),i.onUnmounted(()=>{document.removeEventListener("wheel",Kt,{capture:!1}),document.removeEventListener("scroll",Kt,{capture:!0})}),i.onActivated(()=>{Me()}),i.onUpdated(()=>{var $;I.value=(($=E["grid-wrapper"])==null?void 0:$.offsetWidth)/1.5||0}),i.watch(()=>V.isShowColumnSetting,$=>{var ne;if(!$){(ne=O.gridSettingMenu)==null||ne.hide();return}xt(u.value)}),i.watch(()=>e.columns,()=>{Q()?G(K()):(G(K()),te()),B.filteringColumn=null,B.filteringItemsByColumn={},S.filterStore=[],ae({rows:[],isMakeIndex:!1}),fo(),S.movedColumns.length=0},{deep:!0}),i.watch(()=>L.isSorting,$=>{$&&(ae({rows:S.originStore,isMakeIndex:!1}),L.isSorting=!$,C.isClientPaging&&(C.currentPage=1,S.pagingStore=_(),N()))}),i.watch(()=>e.rows,$=>{ae({rows:$}),B.isSearch&&J(B.searchWord),Me()},{deep:!0}),i.watch(()=>e.uncheckable,()=>{ae({rows:e.rows})},{deep:!0}),i.watch(()=>e.checked,$=>{M.checkedRows=$}),i.watch(()=>e.disabledRows,()=>{S.store.length&&S.store.forEach($=>{$[6]=e.disabledRows.includes($[2])})},{deep:!0}),i.watch(()=>M.checkedRows,$=>{M.isHeaderChecked=!1;let ne=S.store;C.isClientPaging&&(ne=_()),ne.length&&(ne.forEach(Se=>{Se[1]=$.includes(Se[2])}),M.isHeaderChecked=$.length===ne.length),F()}),i.watch(()=>e.selected,$=>{D.useSelect&&(D.selectedRow=$)}),i.watch(()=>D.selectedRow,$=>{D.useSelect&&(S.store.forEach(ne=>{ne[3]=$.includes(ne[2])&&!e.disabledRows.includes(ne[2])}),F())}),i.watch(()=>b.value,async $=>{if(await i.nextTick(),$>=0){if(C.usePage&&!C.isInfinite&&(C.highlightPage=Math.ceil($/C.perPage)||1,C.highlightPage!==C.currentPage)){C.currentPage=C.highlightPage,C.isHighlight=!0;return}E.body.scrollTop=v.rowHeight*b.value}}),i.watch(()=>M.useCheckbox.mode,()=>{N()}),i.watch(()=>D.useSelect,()=>{R()}),i.watch(()=>D.multiple,()=>{R()}),i.watch(()=>e.checked.length,$=>{$||N()}),i.watch(()=>e.expanded.length,$=>{$||P(),F()}),i.watch(()=>[e.option.columnWidth,v.gridWidth],async()=>{await i.nextTick(),v.columnWidth=e.option.columnWidth;const $=E["grid-wrapper"];$.style.width=v.gridWidth,$.style.height=v.gridHeight,S.orderedColumns.map(ne=>{var bt;const Se=ne;return!((bt=e.columns[ne.index])!=null&&bt.width)&&!Se.resized&&(Se.width=0),Se}),Me()}),i.watch(()=>e.option.searchValue,$=>{$!==void 0&&(J(($==null?void 0:$.value)??$),C.isClientPaging&&(N(),R()))},{immediate:!0}),i.watch(()=>{var $;return($=e.option.page)==null?void 0:$.currentPage},$=>{var Se;const ne=$||1;C.currentPage=(Se=e.option.page)!=null&&Se.isInfinite?1:ne},{immediate:!0}),i.watch(()=>C.currentPage,($,ne)=>{i.nextTick(()=>{W(ne),C.isClientPaging&&$!==ne&&(N(),R()),F(),$===C.highlightPage&&C.isHighlight&&(E.body.scrollTop=v.rowHeight*b.value,C.isHighlight=!C.isHighlight)})});const pn=i.reactive({boxTop:0,boxLeft:0}),Y=i.ref(null),oe=i.ref(!1),ue=i.ref(!1),xe=i.ref(null),Ee=i.ref({}),Ae=i.reactive({caption:"",field:""}),Ue=i.ref([]),uw=[{name:"AND",value:"and"},{name:"OR",value:"or"}],Ws=i.ref(0),fw=({caption:$,field:ne},Se)=>{if(Ae.caption=$,Ae.field=ne,Ue.value=Se,(Se==null?void 0:Se.length)>1){oe.value=!0;const bt=Y.value.getBoundingClientRect().left,Jt=window.pageYOffset+Y.value.getBoundingClientRect().top+Y.value.getBoundingClientRect().height;pn.boxTop=`${Jt}px`,pn.boxLeft=`${bt}px`}},mw=()=>{S.filterStore=[],ae({rows:[],isMakeIndex:!1})},$s=async $=>{var Jt,po;$&&ue.value&&(Ws.value=0);const ne=(Jt=Y.value)==null?void 0:Jt.getElementsByClassName("filtering-items__item"),Se=[];let bt=0;if(ne){for(let It=0;It<ne.length;It++){const Qe=ne[It];Qe.classList.remove("non-display");const xi=(po=Y.value.getBoundingClientRect())==null?void 0:po.width,{width:bi}=Qe.getBoundingClientRect();bt+=bi+10,xi-150<=bt&&!Qe.classList.contains("filtering-items__item--count")?(Ws.value++,Se.push(Qe),Ee.value={...Ee.value,[Qe.dataset.field]:Ce(B.filteringItemsByColumn[Qe.dataset.field])}):delete Ee.value[Qe.dataset.field]}ne.forEach(It=>{const Qe=Se.includes(It);It.classList.toggle("non-display",Qe)})}},gw=async($,ne)=>{ne!=null&&ne.length?(B.filteringItemsByColumn[$]=ne,ue.value=!0):(delete Ee.value[$],delete B.filteringItemsByColumn[$]),await i.nextTick(),$s(!0),B.isShowFilterSetting=!1,S.filterStore=[],ae({rows:[],isMakeIndex:!1}),he(S.filterStore)};let Xs=null;const pw=()=>{Xs&&clearTimeout(Xs),Xs=setTimeout(()=>{ue.value=!ue.value,$s(ue.value)},150)},yw=()=>{B.filteringColumn=null,B.filteringItemsByColumn={},Ee.value={},S.filterStore=[],ae({rows:[],isMakeIndex:!1})},xw=i.computed(()=>{var $;return{width:`${I.value}px`,top:`${(($=Y.value)==null?void 0:$.getBoundingClientRect().height)||0}px`}}),bw=$=>{const ne=B.filteringItemsByColumn[$];return ne==null?void 0:ne[ne.length-1]},Sw=()=>{const $=document.createElement("div");$.id="ev-grid-filtering-items-modal",$.setAttribute("style","position: absolute; top: 0; left: 0;"),document.getElementById("ev-grid-filtering-items-modal")||document.body.appendChild($)};return i.onBeforeMount(()=>Sw()),{idColIndex:i.computed(()=>{var $;return($=S.orderedColumns.find(ne=>ne.field==="id"))==null?void 0:$.index}),summaryScroll:A,showHeader:g,stripeStyle:m,borderStyle:x,highlightIdx:b,useSummary:p,useGridSetting:f,toolbarRef:u,stores:S,emptyText:y,...i.toRefs(E),...i.toRefs(S),...i.toRefs(B),...i.toRefs(T),...i.toRefs(C),...i.toRefs(v),...i.toRefs(D),...i.toRefs(M),...i.toRefs(w),...i.toRefs(L),...i.toRefs(O),...i.toRefs(V),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:F,updateHScroll:H,onScroll:U,calculatedColumn:fe,onResize:Me,onShow:rt,onColumnResize:ct,onRowClick:ui,onRowDblClick:fi,onCheck:j,onCheckAll:q,onExpanded:Z,onSort:ee,setSort:te,setStore:ae,setContextMenu:qt,onContextMenu:Fs,onSearch:J,setGridSetting:yi,onApplyColumn:mo,onColumnContextMenu:Hs,filteringItemsWidth:I,isShowColumnFilteringItems:ue,operatorItems:uw,selectedFilteringItems:Ue,selectedFilteringColumn:Ae,filteringItemsRef:Y,isShowFilteringItemsBox:oe,filteringItemsStyle:xw,hiddenFilteringItemsCount:Ws,...i.toRefs(pn),hiddenFilteringItemsRef:xe,hiddenFilteringItemsByColumn:Ee,removeAllFiltering:yw,onExpandFilteringItems:pw,setColumnFilteringItems:$s,onChangeOperator:mw,onApplyFilter:gw,onClickFilteringItem:fw,getFilteringItemByField:bw,onDragStart:mi,onDragOver:gi,onDrop:pi,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"],eS=["onMousedown"],tS={ref:"table"},nS=["data-index","disabled","onClick","onContextmenu","onDblclick"],oS=["data-name","data-index","disabled"],iS={key:0},sS=["title"],lS=["disabled"],aS=["disabled"],rS={key:0},cS=["colspan"],dS={key:0},hS={class:"is-empty"},uS={ref:"resizeLine",class:"table-resize-line"};function fS(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"),k=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,B)=>{var V,S,C,M;return i.openBlock(),i.createElementBlock(i.Fragment,{key:B},[B===0?(i.openBlock(),i.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=i.withModifiers((...w)=>o.onExpandFilteringItems&&o.onExpandFilteringItems(...w),["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),B===1?(i.openBlock(),i.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=w=>e.columnOperator=w),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(w=>{var T;return o.onClickFilteringItem({caption:(T=o.getFilteringItemByField(E))==null?void 0:T.caption,field:E},e.filteringItemsByColumn[E])},["stop"])},[i.createElementVNode("span",$0,i.toDisplayString((V=o.getFilteringItemByField(E))==null?void 0:V.caption)+" "+i.toDisplayString((S=o.getFilteringItemByField(E))==null?void 0:S.comparison),1),e.filteringItemsByColumn[E].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(C=o.getFilteringItemByField(E))==null?void 0:C.value},i.toDisplayString((M=o.getFilteringItemByField(E))==null?void 0:M.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:w=>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,B)=>{var V,S,C,M;return i.openBlock(),i.createElementBlock("div",{key:B,class:"filtering-items__item",onClick:i.withModifiers(w=>{var T;return o.onClickFilteringItem({caption:(T=o.getFilteringItemByField(E))==null?void 0:T.caption,field:E},o.hiddenFilteringItemsByColumn[E])},["stop"])},[i.createElementVNode("span",j0,i.toDisplayString((V=o.getFilteringItemByField(E))==null?void 0:V.caption)+" "+i.toDisplayString((S=o.getFilteringItemByField(E))==null?void 0:S.comparison),1),o.hiddenFilteringItemsByColumn[E].length<2?(i.openBlock(),i.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(C=o.getFilteringItemByField(E))==null?void 0:C.value},i.toDisplayString((M=o.getFilteringItemByField(E))==null?void 0:M.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:w=>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,B)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:B},[!E.hide&&!E.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":B,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===B&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===B?"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(B,V),["stop","left"])},null,40,eS)],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",tS,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(E,B)=>{var V,S;return i.openBlock(),i.createElementBlock(i.Fragment,{key:o.idColIndex!=null?E[2][o.idColIndex]:B},[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:C=>o.onRowClick(C,E),onContextmenu:C=>o.onRowClick(C,E,!0),onDblclick:C=>o.onRowDblClick(C,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":C=>E[1]=C,class:"row-checkbox-input",disabled:E[5]||E[o.ROW_DISABLED_INDEX],onChange:C=>o.onCheck(C,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":C=>E[4]=C,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:i.withModifiers(C=>o.onExpanded(C,E),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.orderedColumns,(C,M)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:`${o.idColIndex!=null?E[2][o.idColIndex]:B}-${M}`},[!C.hide&&!C.hiddenDisplay?(i.openBlock(),i.createElementBlock("td",{key:0,"data-name":C.field,"data-index":C.index,class:i.normalizeClass({cell:!0,render:o.isRenderer(C),[C.type]:C.type,[C.align]:C.align,[C.field]:C.field,"non-border":!!o.borderStyle}),style:i.normalizeStyle({width:`${C.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${o.isRenderer(C)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),disabled:E[o.ROW_DISABLED_INDEX]},[e.$slots[C.field]?(i.openBlock(),i.createElementBlock("div",iS,[i.renderSlot(e.$slots,C.field,{item:{row:E,column:C},disabled:E[o.ROW_DISABLED_INDEX]},void 0,!0)])):(i.openBlock(),i.createElementBlock("div",{key:1,title:o.getConvertValue(C,E[2][C.index])},i.toDisplayString(o.getConvertValue(C,E[2][C.index])),9,sS))],14,oS)):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]=C=>o.onContextMenu(C))},[i.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,aS)):(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]=C=>o.onContextMenu(C))},null,8,["disabled"]))],14,lS)):i.createCommentVNode("",!0)],42,nS),e.useRowDetail&&((S=e.$slots)!=null&&S.rowDetail)&&E[4]?(i.openBlock(),i.createElementBlock("tr",rS,[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,cS)])):i.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("tr",dS,[i.createElementVNode("td",hS,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)],16)),[[y,o.onResize],[k,{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 oo=re(z0,[["render",fS],["__scopeId","data-v-22cd2bf6"]]);oo.install=e=>{e.component(oo.name,oo)};const ri=document.createElement("canvas").getContext("2d"),X={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},coordinateKey(e,t){return`${e}|${t}`},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=fh(1),l=uh(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};ri.save(),ri.font=t;const n=ri.measureText(e),o=t.match(/(\d+(?:\.\d+)?)px/),l=(o?Number(o[1]):14)*1.2;return ri.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`},calcBoxDistance(e,t,n){if(e.w!==null&&e.w!==void 0&&e.h!==null&&e.h!==void 0){const o=e.xp,s=e.yp,l=Math.min(o,o+e.w),a=Math.max(o,o+e.w),r=Math.min(s,s+e.h),c=Math.max(s,s+e.h),d=Math.max(0,l-t,t-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(e.xp-t)**2+(e.yp-n)**2}};function mS(e){const t=(String(e).split(".")[1]??"").length;return e.toFixed(t+1)}var gS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ir={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(gS,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(L){var O=["th","st","nd","rd"],v=L%100;return"["+L+(O[(v-20)%10]||O[v]||O[0])+"]"}},k=function(L,O,v){var N=String(L);return!N||N.length>=O?L:""+Array(O+1-N.length).join(v)+L},I={s:k,z:function(L){var O=-L.utcOffset(),v=Math.abs(O),N=Math.floor(v/60),R=v%60;return(O<=0?"+":"-")+k(N,2,"0")+":"+k(R,2,"0")},m:function L(O,v){if(O.date()<v.date())return-L(v,O);var N=12*(v.year()-O.year())+(v.month()-O.month()),R=O.clone().add(N,u),P=v-R<0,_=O.clone().add(N+(P?-1:1),u);return+(-(N+(v-R)/(P?R-_:_-R))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:g,w:h,d,D:p,h:c,m:r,s:a,ms:l,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},E="en",B={};B[E]=y;var V="$isDayjsObject",S=function(L){return L instanceof T||!(!L||!L[V])},C=function L(O,v,N){var R;if(!O)return E;if(typeof O=="string"){var P=O.toLowerCase();B[P]&&(R=P),v&&(B[P]=v,R=P);var _=O.split("-");if(!R&&_.length>1)return L(_[0])}else{var z=O.name;B[z]=O,R=z}return!N&&R&&(E=R),R||!N&&E},M=function(L,O){if(S(L))return L.clone();var v=typeof O=="object"?O:{};return v.date=L,v.args=arguments,new T(v)},w=I;w.l=C,w.i=S,w.w=function(L,O){return M(L,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var T=function(){function L(v){this.$L=C(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[V]=!0}var O=L.prototype;return O.parse=function(v){this.$d=function(N){var R=N.date,P=N.utc;if(R===null)return new Date(NaN);if(w.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 z=_[2]-1||0,W=(_[7]||"0").substring(0,3);return P?new Date(Date.UTC(_[1],z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,W)):new Date(_[1],z,_[3]||1,_[4]||0,_[5]||0,_[6]||0,W)}}return new Date(R)}(v),this.init()},O.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()},O.$utils=function(){return w},O.isValid=function(){return this.$d.toString()!==m},O.isSame=function(v,N){var R=M(v);return this.startOf(N)<=R&&R<=this.endOf(N)},O.isAfter=function(v,N){return M(v)<this.startOf(N)},O.isBefore=function(v,N){return this.endOf(N)<M(v)},O.$g=function(v,N,R){return w.u(v)?this[N]:this.set(R,v)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(v,N){var R=this,P=!!w.u(N)||N,_=w.p(v),z=function(Z,ee){var K=w.w(R.$u?Date.UTC(R.$y,ee,Z):new Date(R.$y,ee,Z),R);return P?K:K.endOf(d)},W=function(Z,ee){return w.w(R.toDate()[Z].apply(R.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(ee)),R)},A=this.$W,F=this.$M,H=this.$D,U="set"+(this.$u?"UTC":"");switch(_){case g:return P?z(1,0):z(31,11);case u:return P?z(1,F):z(0,F+1);case h:var j=this.$locale().weekStart||0,q=(A<j?A+7:A)-j;return z(P?H-q:H+(6-q),F);case d:case p:return W(U+"Hours",0);case c:return W(U+"Minutes",1);case r:return W(U+"Seconds",2);case a:return W(U+"Milliseconds",3);default:return this.clone()}},O.endOf=function(v){return this.startOf(v,!1)},O.$set=function(v,N){var R,P=w.p(v),_="set"+(this.$u?"UTC":""),z=(R={},R[d]=_+"Date",R[p]=_+"Date",R[u]=_+"Month",R[g]=_+"FullYear",R[c]=_+"Hours",R[r]=_+"Minutes",R[a]=_+"Seconds",R[l]=_+"Milliseconds",R)[P],W=P===d?this.$D+(N-this.$W):N;if(P===u||P===g){var A=this.clone().set(p,1);A.$d[z](W),A.init(),this.$d=A.set(p,Math.min(this.$D,A.daysInMonth())).$d}else z&&this.$d[z](W);return this.init(),this},O.set=function(v,N){return this.clone().$set(v,N)},O.get=function(v){return this[w.p(v)]()},O.add=function(v,N){var R,P=this;v=Number(v);var _=w.p(N),z=function(F){var H=M(P);return w.w(H.date(H.date()+Math.round(F*v)),P)};if(_===u)return this.set(u,this.$M+v);if(_===g)return this.set(g,this.$y+v);if(_===d)return z(1);if(_===h)return z(7);var W=(R={},R[r]=o,R[c]=s,R[a]=n,R)[_]||1,A=this.$d.getTime()+v*W;return w.w(A,this)},O.subtract=function(v,N){return this.add(-1*v,N)},O.format=function(v){var N=this,R=this.$locale();if(!this.isValid())return R.invalidDate||m;var P=v||"YYYY-MM-DDTHH:mm:ssZ",_=w.z(this),z=this.$H,W=this.$m,A=this.$M,F=R.weekdays,H=R.months,U=R.meridiem,j=function(ee,K,te,G){return ee&&(ee[K]||ee(N,P))||te[K].slice(0,G)},q=function(ee){return w.s(z%12||12,ee,"0")},Z=U||function(ee,K,te){var G=ee<12?"AM":"PM";return te?G.toLowerCase():G};return P.replace(b,function(ee,K){return K||function(te){switch(te){case"YY":return String(N.$y).slice(-2);case"YYYY":return w.s(N.$y,4,"0");case"M":return A+1;case"MM":return w.s(A+1,2,"0");case"MMM":return j(R.monthsShort,A,H,3);case"MMMM":return j(H,A);case"D":return N.$D;case"DD":return w.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return j(R.weekdaysMin,N.$W,F,2);case"ddd":return j(R.weekdaysShort,N.$W,F,3);case"dddd":return F[N.$W];case"H":return String(z);case"HH":return w.s(z,2,"0");case"h":return q(1);case"hh":return q(2);case"a":return Z(z,W,!0);case"A":return Z(z,W,!1);case"m":return String(W);case"mm":return w.s(W,2,"0");case"s":return String(N.$s);case"ss":return w.s(N.$s,2,"0");case"SSS":return w.s(N.$ms,3,"0");case"Z":return _}return null}(ee)||_.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(v,N,R){var P,_=this,z=w.p(N),W=M(v),A=(W.utcOffset()-this.utcOffset())*o,F=this-W,H=function(){return w.m(_,W)};switch(z){case g:P=H()/12;break;case u:P=H();break;case f:P=H()/3;break;case h:P=(F-A)/6048e5;break;case d:P=(F-A)/864e5;break;case c:P=F/s;break;case r:P=F/o;break;case a:P=F/n;break;default:P=F}return R?P:w.a(P)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return B[this.$L]},O.locale=function(v,N){if(!v)return this.$L;var R=this.clone(),P=C(v,N,!0);return P&&(R.$L=P),R},O.clone=function(){return w.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},L}(),D=T.prototype;return M.prototype=D,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",g],["$D",p]].forEach(function(L){D[L[1]]=function(O){return this.$g(O,L[0],L[1])}}),M.extend=function(L,O){return L.$i||(L(O,T,M),L.$i=!0),M},M.locale=C,M.isDayjs=S,M.unix=function(L){return M(1e3*L)},M.en=B[E],M.Ls=B,M.p={},M})})(Ir);var yS=Ir.exports;const Le=pS(yS),xS={createDataSet(e,t){Object.keys(this.seriesInfo.charts).forEach(n=>{var s;const o=this.seriesInfo.charts[n];if(o.length)if(n==="pie")this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,o);else if(n==="scatter")o.forEach(l=>{const a=this.seriesList[l],r=e[l],c=a==null?void 0:a.passingValue;a&&r&&(a.data=this.addSeriesDSforScatter(r),a.minMax=this.getSeriesMinMax(a.data,c))});else if(n==="heatMap")o.forEach(l=>{const a=this.seriesList[l],r=a==null?void 0:a.passingValue,c=e[l];a&&c&&(a.labels=t,a.data=this.addSeriesDSForHeatMap(c),a.minMax=this.getSeriesMinMax(a.data,r),a.valueOpt=this.getSeriesValueOptForHeatMap(a))});else{const l=o[0],a=(s=this.seriesList[l])==null?void 0:s.passingValue;for(let r=0;r<o.length;r++){const c=o[r],d=this.seriesList[c],h=e==null?void 0:e[c],{passingValue:u,interpolation:f}=d,g=f==="zero"||u!=null&&u!==void 0;let p=!1,m;if(!h)m=h;else if(!g)m=h;else{m=new Array(h.length);for(let x=0;x<h.length;x++){const b=h[x];f==="zero"&&!b?m[x]=0:b===u?(p=!0,m[x]=null):m[x]=b}}d.hasPassingValueInData=p,d&&m&&(d.isExistGrp&&d.stackIndex&&!d.isOverlapping?d.data=this.addSeriesStackDS(m,t,d.bsIds,d.stackIndex):d.data=this.addSeriesDS(m,t,d.isExistGrp,a),d.minMax=this.getSeriesMinMax(d.data,d.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 T=c[w];T&&m<T.x&&(m=T.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,k=m||y,I=w=>{w.data.length=0,w.dataKeys?w.dataKeys.clear():w.dataKeys=new Set,w.max=0,w.min=1/0};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:[],dataKeys:new Set,max:0,min:1/0},I(u[w]);h.toTime=k,h.fromTime=h.toTime-p*1e3}const E=(k-y)/1e3,B=Number.isFinite(E)?Math.max(0,Math.floor(E)):0;if(h.toTime=k,h.fromTime=h.toTime-p*1e3,m&&(h.toTime-m)/1e3>p&&r==="")return;for(let w=0;w<p;w++)u[w]?u[w].data?u[w].dataKeys||(u[w].dataKeys=new Set):(u[w].data=[],u[w].dataKeys=new Set,u[w].max=0,u[w].min=1/0):u[w]={data:[],dataKeys:new Set,max:0,min:1/0};if(B>0)if(B>=p){for(let w=0;w<p;w++)I(u[w]);h.startIndex=0,h.endIndex=p-1}else{let w=h.startIndex,T=h.endIndex;for(let D=0;D<B;D++)I(u[w]),w=(w+1)%p,T=(T+1)%p;h.startIndex=w,h.endIndex=T}const V=this.options.coordinateDedupe!==!1;for(let w=0;w<d;w++){const T=c[w];if(T){const D=Math.floor(T.x/1e3)*1e3;if(h.fromTime<=D){let L=h.endIndex-(h.toTime-D)/1e3;L<0&&(L=p+L);const O=u[L],v=X.coordinateKey(T.x,T.y);V&&O.dataKeys.has(v)||(V&&O.dataKeys.add(v),O.data.push({x:T.x,y:T.y,o:T.value??T.y,color:T.color}),O.max=Math.max(O.max,T.y),O.min=Math.min(O.min,T.y))}}}const S=1e3,C={maxY:0,minY:1/0};for(let w=0;w<p;w++){const T=u[w];for(let D=0;D<T.data.length;D++){const L=T.data[D],O=Math.floor(L.x/S)*S;O>=h.fromTime&&O<=h.toTime&&Number.isFinite(L.y)&&(L.y>C.maxY&&(C.maxY=L.y),L.y<C.minY&&(C.minY=L.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=0),this.seriesInfo.charts.scatter.forEach(a=>{const r=this.seriesList[a];r.data=this.dataSet,r.minMax={minX:Le(n.fromTime),minY:n.minY,maxX:Le(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,k=b==null?void 0:b.o,I=!X.isNullOrUndefined(x.passingValue)&&x.passingValue===k,E=f>=0&&k>=0||f<0&&k<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,o){const s=this.options.horizontal,l=[],a=n&&!X.isNullOrUndefined(o);for(let r=0;r<e.length;r++){let c=e[r],d=t[r];if(c&&typeof c=="object"&&(c.x||c.y)&&(c=s?c.x:c.y,d=s?e[r].y:e[r].x),d!==null){const h=a&&c===o?0:c;if(h!==null&&typeof h=="object"||c!==null&&typeof c=="object")l.push(this.addData(h,d,c));else{const u=h??null,f=c??null;l.push(s?{x:u,y:d,o:f,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:d,y:u,o:f,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return l},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=!X.isNullOrUndefined(t),l={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};for(let a=0;a<e.length;a++){const r=e[a],c=r.x,d=r.y,h=r.o;(!s||h!==t)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,o&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!o&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}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.getHitItemByPosition([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=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}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]},getHitItemByPosition(e,t=!1,n,o=!1,s=!1){var T;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=e;let d=n;if(d===void 0&&!t){const D=l.find(L=>{var v;const O=this.seriesList[L];return(O==null?void 0:O.show)&&((v=O==null?void 0:O.data)==null?void 0:v.length)>0});if(D){const L=this.seriesList[D].data,O=a?e[1]:e[0];let v=1/0,N=-1;for(let R=0;R<L.length;R++){const P=s||l.some(z=>{var A,F,H,U;const W=this.seriesList[z];return(W==null?void 0:W.show)&&((F=(A=W.data)==null?void 0:A[R])==null?void 0:F.o)!==null&&((U=(H=W.data)==null?void 0:H[R])==null?void 0:U.o)!==void 0}),_=L[R];if(P&&_){let z;if(a?z=_.h?_.yp+_.h/2:_.yp:z=_.w?_.xp+_.w/2:_.xp,z!=null){const W=Math.abs(O-z);W<v&&(v=W,N=R)}}}N!==-1&&(d=N)}}let h=null,u=null,f=null,g=null,p="",m=null,x=1/0,b=!1,y=null,k=null,I=null,E=null,B="",V=null,S=1/0,C=0,M=!1;for(let D=0;D<l.length;D++){const L=l[D],O=this.seriesList[L],v=t?O.findApproximateData:O.findGraphData;if(v){const N=v.call(O,e,a,d,o),R=N.data,P=N.index;if(R)if(X.isPieType(N.type))h=N.type,u=L,p=L,f=(R.ea-R.sa)/2,g=R.o,m=R.index;else{const _=a?R.y:R.x,z=a?R.yp:R.xp;if(_!=null){const W=a?R.o||R.x:R.o||R.y;O.stackIndex!=null?(C+=isNaN(R.o)?0:R.o,M=!0):C+=R.y;const A=W!=null&&!Number.isNaN(W),F=R.xp!==null&&R.xp!==void 0&&R.yp!==null&&R.yp!==void 0;if(A&&F){const H=X.calcBoxDistance(R,r,c);(B===""||H<S)&&(S=H,y=O.type,k=_,I=z,E=W,B=L,V=P)}else A&&B===""&&(y=O.type,k=_,I=z,E=W,B=L,V=P);if(N.hit&&R.xp!==void 0&&R.yp!==void 0){const H=(R.xp-e[0])**2+(R.yp-e[1])**2;N.directHit?((!b||H<x)&&(x=H,h=O.type,u=_,f=z,g=W,p=L,m=P),b=!0):b||H<x&&(x=H,h=O.type,u=_,f=z,g=W,p=L,m=P)}}}}}if(s&&p===""&&B===""&&d!==void 0&&d>=0){const D=l.find(O=>{var N;const v=this.seriesList[O];return(v==null?void 0:v.show)&&((N=v==null?void 0:v.data)==null?void 0:N.length)>0}),L=D?(T=this.seriesList[D].data)==null?void 0:T[d]:null;L&&(k=a?L.y:L.x,V=d)}const w=p!=="";return{type:w?h:y,label:w?u:k,pos:w?f:I,value:w?g:E,sId:w?p:B,acc:C,useStack:M,dataIndex:w?m:V}},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,k)=>k.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:k,interval:I=1}=h,[E,B]=k??[0,d.labels.length],V=Math.floor((+B-+E)/I)+1,S=(f-u)/V,M=Math.floor(((t==="yAxis"||r?o:n)-u)/S);y==="step"?g=E+M:g=(d==null?void 0:d.labels.findIndex(T=>T===+E))+M}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,k;n<u-a?(y=u,k=0):n>f+a?(y=f,k=this.data.labels.length-1):y=n,p=this.getHitItemByPosition([y,o],c==null?void 0:c.useApproximateValue,k,!0,!0),g=p.dataIndex??-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,k=f[y[0].units.rectStart],I=f[y[0].units.rectEnd],E=Math.abs(t[l?0:1]-k),B=(l?x:b)/2,V=Math.abs(k-I)/g,S=Math.floor((E+B)/V);return V*S+B>E&&V*S-B<E&&(u=S*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!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==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=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(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;(!X.checkSafeInteger(c)||!X.checkSafeInteger(d)||!X.checkSafeInteger(u)||!X.checkSafeInteger(h)||!X.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}},bS={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"}},Pt=["#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"],io={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"},SS={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},CS={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},vr={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,firstLabelFontStyle: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}}},Tr={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null},Ps={color:"#FF0000",lineWidth:1,label:Tr},_s={color:"#FAE59D"},wS={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"}}},yt={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}},kS=Object.freeze([1,2,5]),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")?X.getOpacity(g):1,m=s?l:p;h.addColorStop(f,X.colorStringToRgba(g,m))}return h}};class MS{constructor(t,n,o){const s=Re({},n,io);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:Pt[o%Pt.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,_,z,W,A,F,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&&((W=(z=r==null?void 0:r.selected)==null?void 0:z.seriesId)!=null&&W.length)){const U=(F=(A=r==null?void 0:r.selected)==null?void 0:A.seriesId)==null?void 0:F.includes(this.sId);p=this.extent[U?"highlight":"downplay"]}else f&&g.length?p=this.extent.downplay:p=this.extent.normal;p===this.extent.downplay&&(p={...p,opacity:h});const m=U=>U!=null&&U.includes("rgba")?X.getOpacity(U):p.opacity,x=this.color,b=m(x),y=this.pointFill,k=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=X.colorStringToRgba(x,b),this.segments&&n.setLineDash(this.segments);const B=this.useLinearInterpolation();let V=0;const S=l.x[this.xAxisIndex],C=l.y[this.yAxisIndex];let M=o.chartWidth-(s.left+s.right);const w=o.chartHeight-(s.top+s.bottom);this.combo&&(V=M/(this.data.length||1),M-=V,this.size.comboOffset=V);const T=o.x1+s.left+V/2,D=o.y2-s.bottom,L=U=>{const j=Math.min(Math.max(U,S.graphMin),S.graphMax);return ie.calculateX(j,S.graphMin,S.graphMax,M,T)},O=U=>{const j=Math.min(Math.max(U,C.graphMin),C.graphMax);return ie.calculateY(j,C.graphMin,C.graphMax,w,D)},v=this.data.some(U=>U.o<0),N=v?O(0):o.y2-s.bottom;let R;if(this.data.forEach(U=>{let j=L(U.x),q=O(U.y);this.isExistGrp&&B&&U.o===null&&(q=O(U.b??0)),j!==null&&(j+=X.aliasPixel(j)),U.xp=j,U.yp=q,!(B&&U.o===null)&&(pt(R==null?void 0:R.y)&&!this.isExistGrp||!B&&(pt(R==null?void 0:R.y)||pt(U.o))?n.moveTo(j,q):n.lineTo(j,q),R=U)}),n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const U=X.colorStringToRgba(this.fillColor||x,I);if((H=this.fill)!=null&&H.gradient){let K=this.data[0].yp,te=this.data[0].y;this.data.forEach(J=>{J.yp&&J.yp<=K?K=J.yp:J.y&&J.y>=te&&(te=J.y)});const G=n.createLinearGradient(0,o.y2,0,K),Q=p.opacity<1?U:x;G.addColorStop(0,v?Q:U),G.addColorStop(.5,U),G.addColorStop(1,Q),n.fillStyle=G}else n.fillStyle=U;let j=null,q=null;const Z=this.data.map(K=>K==null?void 0:K.o),ee=[];for(let K=0;K<Z.length+1;K++)if(B&&Pp(Z[K])||!B&&pt(Z[K])){if(j!==null&&q!==null){const G=Z.slice(j,K).findLastIndex(Q=>!pt(Q)&&Q!==null);ee.push([j,j+G]),j=null,q=null}}else B&&Z[K]===null||(j=j===null?K:j),q=K;ee.forEach(([K,te])=>{if(K===te){const G=this.data[K];n.moveTo(G.xp-E,G.yp),n.lineTo(G.xp+E,G.yp),n.lineTo(G.xp+E,O(G.b)??N),n.closePath();return}for(let G=K;G<=te;G++){const Q=this.data[G];if(G===K?n.moveTo(Q.xp,Q.yp):Q.o!==null&&n.lineTo(Q.xp,Q.yp),G===te){for(let J=te;J>=K;J--){const le=this.data[J],he=L(le.x);if(le.o!==null){const ae=O(le.b)??O(0);n.lineTo(he,ae)}}n.closePath()}}}),n.fill()}if(!d){n.strokeStyle=X.colorStringToRgba(x,b);const U=X.colorStringToRgba(y,1),j=X.colorStringToRgba(y,k),q=this.interpolation==="linear"&&this.data.filter(Z=>Z.o!==null).length===1;this.data.forEach((Z,ee)=>{var J,le;if(Z.xp===null||Z.yp===null||Z.o===null)return;const K=(J=this.data[ee-1])==null?void 0:J.o,te=(le=this.data[ee+1])==null?void 0:le.o,G=!B&&pt(K)&&pt(te)||q,Q=g.includes(ee);(this.point||G||Q)&&(n.fillStyle=Q&&!c?U:j,ie.drawPoint(n,this.pointStyle,this.pointSize,Z.xp,Z.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=X.colorStringToRgba(this.color,0),s.fillStyle=X.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 f;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this.data.filter(g=>!X.isNullOrUndefined(g.x)),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??io.pointSize)+io.pointSize,io.highlight.maxSize),u=g=>{if(!g||g.xp===void 0||g.yp===void 0)return!1;const p=l-g.xp,m=a-g.yp;return p*p+m*m<=h*h};if(c!=null&&c.length)if(typeof o=="number"&&this.show){if(r.data=c[o],r.index=o,r.data){const g=c[o];g.o!==null&&g.o!==void 0&&g.yp!==null&&g.yp!==void 0&&(Math.abs(a-g.yp)<=15&&(r.hit=!0),u(g)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let g=1/0,p=-1;const m=[];c.forEach((k,I)=>{k.xp!==null&&k.yp!==null&&k.o!==null&&m.push({...k,originalIndex:I})}),m.length===0&&c.forEach((k,I)=>{m.push({...k,originalIndex:I})});let x=0,b=m.length-1;for(;x<=b;){const k=Math.floor((x+b)/2),I=m[k],E=Math.abs(l-I.xp);if(E<g&&(g=E,p=I.originalIndex),I.xp<l){if(x=k+1,x<m.length){const B=Math.abs(l-m[x].xp);B<g&&(g=B,p=m[x].originalIndex)}}else if(I.xp>l){if(b=k-1,b>=0){const B=Math.abs(l-m[b].xp);B<g&&(g=B,p=m[b].originalIndex)}}else break}const y=m.findIndex(k=>k.originalIndex===p);if(y!==-1)for(let k=Math.max(0,y-2);k<=Math.min(m.length-1,y+2);k++){const I=m[k],E=Math.abs(l-I.xp);E<g&&(g=E,p=I.originalIndex)}if(p!==-1){let k=50;if(c.length>1){const E=[];for(let B=1;B<c.length;B++)c[B].xp!==null&&c[B-1].xp!==null&&E.push(Math.abs(c[B].xp-c[B-1].xp));E.length>0&&(k=E.reduce((B,V)=>B+V,0)/E.length)}const I=Math.max(k,1);if(g<=I)r.data=c[p],r.index=p;else{let E=!1,B=d?1/0:I;const V=d?m:c;for(let S=0;S<V.length;S++){const C=Math.abs(l-V[S].xp);C<=B&&(E=!0,B=C,p=d?V[S].originalIndex:S)}E&&(r.data=c[p],r.index=p)}if(r.data){const E=c[p];Math.abs(a-E.yp)<=15&&(r.hit=!0),u(E)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((f=r==null?void 0:r.data)==null?void 0:f.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=>!X.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 k=Math.sqrt((n-l[y].xp)**2+(o-l[y].yp)**2);k<u&&(u=k,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 ES{constructor(t,n,o,s=!1){const l=bs({},io,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]=Pt[o%Pt.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=X.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")?X.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=X.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],c=new Set,d=a!==!1;for(let h=0;h<this.data.length;h++){const u=this.data[h],f=h,g=X.coordinateKey(u.x,u.y);let p;if(l?p=l.sId===this.sId:d?p=s.get(g)===this.sId&&!c.has(g):p=!0,p&&(this.calcItem(u,t),u.xp!==null&&u.yp!==null)){const x=u.y>r.graphMax&&this.overflowColor||u.dataColor||this.color,b=this.getOpacity(t,x,f);n.strokeStyle=this.getCachedColor(x,b);const y=u.dataColor||this.pointFill,k=this.getOpacity(t,y,f);n.fillStyle=this.getCachedColor(y,k),ie.drawPoint(n,this.pointStyle,this.pointSize,u.xp,u.yp),d&&!l&&c.add(g)}}}realTimeScatterDraw(t){var f,g,p,m,x,b;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;const u=a!==!1;for(let y=0;y<((g=(f=this.data[this.sId])==null?void 0:f.dataGroup)==null?void 0:g.length);y++)for(let k=0;k<((m=(p=this.data[this.sId])==null?void 0:p.dataGroup[y])==null?void 0:m.data.length);k++){const I=(b=(x=this.data[this.sId])==null?void 0:x.dataGroup[y])==null?void 0:b.data[k];h++;let E;if(l?E=l.sId===this.sId:u?E=s.get(X.coordinateKey(I.x,I.y))===this.sId:E=!0,E&&(this.calcItem(I,t),I.xp!==null&&I.yp!==null)){const B=I.y>r.graphMax&&this.overflowColor,V=B||I.color||this.color,S=B||I.color||this.pointFill||this.color,C=this.getOpacity(t,V,k),M=this.getOpacity(t,S,k);n.strokeStyle=this.getCachedColor(V,C),n.fillStyle=this.getCachedColor(S,M),ie.drawPoint(n,c,d,I.xp,I.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 Br{constructor(t,n,o,s){const l=Re({},n,SS);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Pt[o%Pt.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 W,A,F,H,U;if(!this.show)return;const n=t.ctx,o=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.thickness,c=t.showSeriesCount;this.isHorizontal=t.isHorizontal;const{isHorizontal:d,showValue:h}=this;let u,f;const g=l.x[this.xAxisIndex],p=l.y[this.yAxisIndex];let m=this.data.length;const[x,b]=d?[p.minIndex,p.maxIndex]:[g.minIndex,g.maxIndex];ve(x)&&ve(b)&&(m=b-x+1);const y=o.chartWidth-(s.left+s.right),k=o.chartHeight-(s.top+s.bottom),I=o.x1+s.left,E=o.y2-s.bottom,B=ie.calculateX(0,g.graphMin,g.graphMax,y),V=ie.calculateY(0,p.graphMin,p.graphMax,k),S=d?I+B:I,C=d?E:E+V,M=d?k:y,w=M/(m||1);let T;t.cPadRatio>=1||t.cPadRatio<=0?T=2:T=Math.max(M*(t.cPadRatio/2)/m,2);let L,O,v;L=w>T*2?w-T*2:w,L=this.isExistGrp?L:L/c;const N=this.calculateBarSize(r,L);O=d?null:N,v=d?N:null;const R=d?(L-v)/2:(L-O)/2,P=this.isExistGrp?1:a+1;this.size.cat=w,this.size.bar=L,this.size.cPad=T,this.size.bPad=R,this.size.w=O,this.size.h=v,this.size.ix=P,this.chartRect=o,this.labelOffset=s,this.borderRadius=t.borderRadius,this.filteredCount=m;const _=ve(x)?x:0,z=ve(b)?b:this.data.length-1;this.visibleStartIndex=_;for(let j=_;j<=z;j++){const q=j-_,Z=this.data[j];if(Z){const ee=d?C-w*q-T:S+w*q+T;if(d?(u=S,f=Math.round(ee-(L*P-(v+R)))):(u=Math.round(ee+(L*P-(O+R))),f=C),d){const fe=Z.b?Z.o:Z.x,Me=Math.min(Math.max(fe,g.graphMin),g.graphMax);if(O=ie.calculateX(Me,g.graphMin,g.graphMax,y,-B),Z.b){const ct=Math.min(Math.max(Z.b,g.graphMin),g.graphMax);u=ie.calculateX(ct,g.graphMin,g.graphMax,y,S-B)}const rt=fe>0?-1:1;O=fe&&Math.abs(O)===0?rt:O}else{const fe=Z.b?Z.o:Z.y,Me=Math.min(Math.max(fe,p.graphMin),p.graphMax);if(v=ie.calculateY(Me,p.graphMin,p.graphMax,k,-V),Z.b){const ct=Math.min(Math.max(Z.b,p.graphMin),p.graphMax);f=ie.calculateY(ct,p.graphMin,p.graphMax,k,C-V)}const rt=fe>0?-1:1;v=fe&&Math.abs(v)===0?rt:v}const K=Z.dataColor||this.color,te=t==null?void 0:t.legendHitInfo,G=(W=t==null?void 0:t.selectLabel)==null?void 0:W.option,Q=(A=t==null?void 0:t.selectItem)==null?void 0:A.option,J=((H=(F=t==null?void 0:t.selectLabel)==null?void 0:F.selected)==null?void 0:H.dataIndex)??[],{dataIndex:le,seriesID:he}=((U=t==null?void 0:t.selectItem)==null?void 0:U.selected)??{};let ae=!1;if(te?ae=(te==null?void 0:te.sId)!==this.sId:G!=null&&G.use&&(G!=null&&G.useSeriesOpacity)?ae=J.length&&!J.includes(j):ft(le)&&(Q!=null&&Q.useSeriesOpacity)&&(this.isExistGrp?ae=le!==j:ae=le!==j||he!==this.sId),typeof K!="string")n.fillStyle=ie.createGradient(n,d,{x:u,y:f,w:O,h:v},K,ae,t.unSelectedOpacity);else{const fe=K.includes("rgba")?X.getOpacity(K):1,Me=ae?t.unSelectedOpacity:fe;n.fillStyle=X.colorStringToRgba(K,Me)}this.drawBar({ctx:n,positions:{x:u,y:f,w:O,h:v}}),h.use&&this.drawValueLabels({context:n,data:Z,positions:{x:u,y:f,h:v,w:O},isHighlight:!1,textColor:Z.dataTextColor,index:j}),Z.xp=u,Z.yp=f,Z.w=O,Z.h=d?-v:v,Z.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.directHit=a.hit),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=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u];if(!f){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{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.directHit=l.hit,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 k=ft(this.stackIndex);k?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=X.labelSignFormat(y,f)??"");const E=y<0,B=Math.round(b.measureText(I).width),V=c,S=r&&h!=="end"?10:4,C=E?g-S:g+S,M=E?p+S:p-S,w=g+m/2,T=s?p+x/2:p-x/2,D=r?T+c*.1:T,L=Math.abs(m),O=Math.abs(x),v=L-S,N=O-S,R=B<=L&&L>=V;switch(h){case"start":{if(r){if(B<v&&V<O){const P=E?C-B:C;b.fillText(I,P,D)}}else if(R&&V+S<=O){const P=E?p+V/2+S:p-V/2-S;b.fillText(I,w,P)}break}case"center":{r?B<v&&V<O&&b.fillText(I,w,D):R&&V<N&&b.fillText(I,w,p+x/2);break}case"out":{if(k){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const P=this.chartRect.x1+this.labelOffset.left,_=this.chartRect.x2-this.labelOffset.right;if(V<this.size.bar)if(E){const z=g-S+m-B;z>P&&b.fillText(I,z,D)}else{const z=g+S+m;z+B<_&&b.fillText(I,z,D)}}else{const P=this.chartRect.y1+this.labelOffset.top,_=this.chartRect.y2-this.labelOffset.bottom;if(B<=this.size.bar)if(E){const z=p+x+S+V/2;z+V/2<=_&&b.fillText(I,w,z)}else{const z=p+x-S-V/2;z-V/2>=P&&b.fillText(I,w,z)}}break}default:case"end":{if(r){if(B<v&&V<O){const P=E?g+m+S:g+m-B-S;b.fillText(I,P,D)}}else if(E){const P=p+x-V/2-S;P>M&&R&&V+S<=O&&b.fillText(I,w,P)}else R&&V+S<=O&&b.fillText(I,w,p+x+V/2+S);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 IS 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,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 B;this.isExistGrp?B=I-E*2:B=(I-E*2)/d;const S=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(B,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(B*c):B;let C=r?null:S,M=r?null:S,w=r?S:null;const T=r?(B-w)/2:(B-C)/2,D=this.isExistGrp?1:a+1;this.size.cat=I,this.size.bar=B,this.size.cPad=E,this.size.bPad=T,this.size.w=C,this.size.ix=D,this.chartRect=o,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((L,O)=>{if(n.beginPath(),r?(h=x,u=ie.calculateY(L.y,g.graphMin,g.graphMax,m,b)):(h=ie.calculateSubX(L.x,f.graphMin,f.graphMax,p,x),h<x?(M-=x-h,h=h+C<x?null:x):h+C>y&&(M-=M-(y-h)),h>=y&&(h=null),h!==null&&(h+=Math.ceil(B*D)-Math.round(C+T)),u=b),r?L.b?(C=ie.calculateX(L.x-L.b,f.graphMin,f.graphMax,p),h=ie.calculateX(L.b,f.graphMin,f.graphMax,p,x)):C=ie.calculateX(L.x,f.graphMin,f.graphMax,p):L.b?(w=ie.calculateY(L.y-L.b,g.graphMin,g.graphMax,m),u=ie.calculateY(L.b,g.graphMin,g.graphMax,m,b)):w=ie.calculateY(L.y,g.graphMin,g.graphMax,m),h!==null&&u!==null){const v=L.dataColor||this.color,N=v.includes("rgba")?X.getOpacity(v):1,R=this.state==="downplay"?t.unSelectedOpacity:N;typeof v!="string"?(C=C!==M?M:C,n.fillStyle=ie.createGradient(n,r,{x:h,y:u,w:C,h:w},v,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=X.colorStringToRgba(v,R),this.drawBar({ctx:n,positions:{x:h,y:u,w:C,h:w}}),this.showValue.use&&this.drawValueLabels({context:n,data:L,positions:{x:h,y:u,h:w,w:C},isHighlight:!1,index:O})}M=C,L.xp=h,L.yp=u,L.w=C,L.h=r?-w:w})}}class vS{constructor(t,n,o){const s=bs({},CS,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${o}`),this.color===void 0&&(this.color=Pt[o%Pt.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")?X.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=X.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=X.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")?X.getOpacity(l):1,p=this.state==="downplay"?this.unSelectedOpacity:g;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=X.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 TS{constructor(t,n,o,s,l){const a=bs({},wS,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("#")?X.hexToRgb(s):s.replace(o,""),u=l.includes("#")?X.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:k},I)=>{n.push({id:`color#${I}`,color:y,label:k,state:"normal",show:!0})});else{const y=Math.floor((f-m)/(a-1)),k=Math.floor((g-x)/(a-1)),I=Math.floor((p-b)/(a-1));for(let E=0;E<a;E++){const B=+f-y*E,V=+g-k*E,S=+p-I*E;n.push({id:`color#${E}`,color:`rgb(${B},${V},${S})`,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=$e(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=X.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||qi(r)&&qi(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,k)=>{var I,E;if(!r){let B;const{option:V,selected:S}=c,{option:C,selected:M}=a,w=ft(S==null?void 0:S.dataIndex)&&(S==null?void 0:S.dataIndex)>-1,T=((I=M==null?void 0:M.label)==null?void 0:I.length)>0;return w?B=V.useSeriesOpacity?k!==(S==null?void 0:S.dataIndex):!1:T&&(B=C.useSeriesOpacity?!((E=M==null?void 0:M.label)!=null&&E.includes(this.getItemLabel(a,b))):!1),B?.1:y}return y};this.data.forEach((b,y)=>{var C;let I=this.calculateXY("x",b.x,f,p),E=this.calculateXY("y",b.y,g,m),B=this.size.w,V=this.size.h;const S=b.o;if(I!==null&&E!==null&&S!==null&&S!==void 0){const{show:M,opacity:w,dataColor:T,id:D,isHighlight:L}=this.getItemInfo(S);let O=w;w===1&&X.getColorStringType(b.dataColor)==="RGBA"&&(O=X.getOpacity(b.dataColor));const v=x(b,O,y);if(b.dataColor||(b.dataColor=T),b.cId=D,n.save(),M){n.fillStyle=X.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===((C=c==null?void 0:c.selected)==null?void 0:C.dataIndex);P&&_&&(N={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let z=!1;if(N.show&&N.lineWidth>0){const{color:W,lineWidth:A,opacity:F}=N,H=A*2;z=H<Math.floor(B)&&H<Math.floor(V),n.strokeStyle=z?X.colorStringToRgba(W,v===1?F:v):void 0,z?(n.lineWidth=A,I+=A,E+=A,B-=H,V-=H):n.lineWidth=0}I+=1,b.xp=I,b.yp=E,b.w=B,b.h=V,this.drawItem(n,I,E,B,V,{...N,show:z}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:b}),L&&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=X.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 k=b-m/2,I=y-x/2;g.fillText(p,k,I);break}case"right":{const k=c+h-m;g.fillText(p,k,y);break}case"bottom":{const k=b-m/2,I=y+x/2;g.fillText(p,k,I);break}case"left":g.fillText(p,c,y);break;default:{const k=b-m/2;g.fillText(p,k,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=$e(o.o-x,b-x),{start:k,end:I}=this.colorState[0];f=k<=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=X.getColorStringType(o.dataColor)==="RGBA"?t.dataColor:X.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=(k,I,E)=>{let B,V,S;k==="x"?(V=m,S=u+r):(V=x,S=g),a[k].findIndex((M,w)=>(B=S+V*w,B<=I&&I<=B+V))>-1?b[E]=["xsp","ysp"].includes(E)?B:B+V:I<S&&(b[E]=S)};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:k}}=this.currentLabelInfo,I=p||f.length,E=b||g.length,B=(d-c)/I,V=(u-h)/E,S=n+s,C=o+l,M={min:Math.floor((n-c)/B),max:Math.floor((S-c-B)/B)},w=E-1,T={min:w-Math.round((C-h-V)/V),max:w-Math.round((o-h)/V)},D=this.getFilteredLabel(f,I,m,x),L=this.getFilteredLabel(g,E,y,k);r={xMin:D[M.min],xMax:D[M.max],yMin:L[T.min],yMax:L[T.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:xS,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 MS(n,o,s);if(t==="scatter")return this.seriesInfo.charts.scatter.push(n),new ES(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 IS(n,o,s,l):new Br(n,o,s,l);if(t==="pie")return this.seriesInfo.charts.pie.push(n),new vS(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 TS(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 so{constructor(t,n,o,s){const l=Re({},n,vr);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=o,this.units=bS[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.2),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);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:X.calcTextSizeCanvas(c,X.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n,o=[]){const s=X.getLabelStyle(this.labelStyle);return[...(t??[]).map(r=>this.getLabelFormat(r)),...o].reduce((r,c)=>{var h;const d=((h=X.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},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=X.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,B,V,S,C,M,w,T,D,L,O,v,N,R,P,_,z,W,A;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 k;if(this.drawAxisTitle(t,n),r.font=X.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,k=X.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(p,x+k),r.lineTo(m,x+k)):(r.moveTo(x+k,p),r.lineTo(x+k,m)),r.stroke(),r.closePath()),!(h===0||u===null)){if((I=this.labelStyle)!=null&&I.show){const F=m-p,H=F/h,U=[],j=o.interval;let q=null,Z=null,ee=p,K=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const G=Math.floor(u/j)*j;G!==+u&&(K=G+j,ee+=F/(f-u)*(K-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,k=X.aliasPixel(r.lineWidth);let te;for(let G=0;G<=h;G++)if(q=Math.round(ee+H*G),q<=m||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),U[G]=K+G*g,U[G]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,Z=q+k,te=this.getLabelFormat(Math.min(f,U[G]),{prev:U[G-1]??""});const J=((B=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:B.use)&&((S=(V=this.options)==null?void 0:V.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((C=l==null?void 0:l.dataIndex)==null?void 0:C.length)&&!(l!=null&&l.label.map(fe=>this.getLabelFormat(Math.min(f,fe),{prev:U[G-1]??""})).includes(te));let le;G===h&&this.lastLabelFontStyle?(r.font=X.getLabelStyle(this.lastLabelFontStyle),le=this.lastLabelFontStyle.color):G===0&&this.firstLabelFontStyle?(r.font=X.getLabelStyle(this.firstLabelFontStyle),le=this.firstLabelFontStyle.color):(r.font=X.getLabelStyle(this.labelStyle),le=this.labelStyle.color);let he=1;X.getColorStringType(le)==="RGBA"&&(he=X.getOpacity(le)),r.fillStyle=X.colorStringToRgba(le,J?(M=this.options)==null?void 0:M.unSelectedOpacity:he);let ae;if(this.type==="x"){if(ae=this.position==="top"?x-10:x+10,((w=c==null?void 0:c.brush)!=null&&w.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),q,ae),!J&&((T=c==null?void 0:c.selectItem)!=null&&T.showLabelTip)&&(s!=null&&s.label)&&!((D=this.options)!=null&&D.horizontal)){const fe=this.getLabelFormat(Math.min(f,s.label+0*g));if(fe===te){const Me=Math.round(r.measureText((L=this.labelStyle)==null?void 0:L.fontSize).width);X.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(fe).width)+10,height:Me,x:q,y:ae+(Me-2),borderRadius:2,arrowSize:3,text:te,backgroundColor:(v=(O=c==null?void 0:c.selectItem)==null?void 0:O.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(Z,x),r.lineTo(Z,x+y),r.stroke(),r.closePath()),(G!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(Z,x),r.lineTo(Z,b),r.stroke(),r.closePath())}else ae=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),ae,q),G===h&&(Z-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(x+(this.axisLineWidth??1),Z),r.lineTo(x-y,Z),r.stroke(),r.closePath()),G!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(x,Z),r.lineTo(b,Z),r.stroke(),r.closePath())}}if((_=this.plotBands)!=null&&_.length||(z=this.plotLines)!=null&&z.length){const F=t.chartWidth-(n.left+n.right),H=t.chartHeight-(n.top+n.bottom),U=k+1,j=d.x1,q=d.x2+U,Z=d.y1-U,ee=d.y2;(W=this.plotBands)==null||W.forEach(K=>{const te=Re({},K,_s),{from:G,to:Q,label:J}=te,le=X.isNullOrUndefined(G)?u:Math.max(G,u),he=X.isNullOrUndefined(Q)?f:Math.min(Q,f);this.setPlotBandStyle(te);let ae,fe;if(this.type==="x"){if(ae=ie.calculateX(le,u,f,F,j),fe=ie.calculateX(he,u,f,F,j),ae===null||fe===null)return;this.drawXPlotBand(ae,fe,j,q,Z,ee)}else{if(ae=ie.calculateY(le,u,f,H,ee),fe=ie.calculateY(he,u,f,H,ee),ae===null||fe===null)return;this.drawYPlotBand(ae,fe,j,q,Z,ee)}if(J.show){const Me=this.getNormalizedLabelOptions(t,J),rt=this.getPlotBandLabelPosition(ae,fe,Me,q,Z);this.drawPlotLabel(Me,rt)}r.restore()}),(A=this.plotLines)==null||A.forEach(K=>{if(typeof+K.value!="number")return;const te=Re({},K,Ps),{value:G,label:Q}=te;let J;if(this.type==="x"){if(J=ie.calculateX(G,u,f,F,j),J===null)return;this.setPlotLineStyle(te),this.drawXPlotLine(J,j,q,Z,ee)}else{if(J=ie.calculateY(G,u,f,H,ee),J===null)return;this.setPlotLineStyle(te),this.drawYPlotLine(J,j,q,Z,ee)}if(Q.show){const le=this.getNormalizedLabelOptions(t,Q),he=this.getPlotLineLabelPosition(J,le,q,Z);this.drawPlotLabel(le,he)}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+=X.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+=X.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=Re({},n,Tr),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=X.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=X.getLabelStyle(t);let x=0,b=0,y=0,k=0;this.type==="x"?(x=s-u,b=s+a,y=o-g-u,k=o+g+u):(x=s-p-u,b=s+p+u,y=o-f,k=o+u),m.fillStyle=c,m.strokeStyle=d,m.lineWidth=h,m.moveTo(y,b),m.lineTo(y,x),m.lineTo(k,x),m.lineTo(k,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?X.truncateLabelWithEllipsis(t,n,this.ctx,o):t}}function BS(e){if(typeof e=="string"&&yt[e])return{ms:yt[e].size,unit:e,time:1};if(typeof e=="object"&&e!==null&&e.unit&&e.time>0){const t=yt[e.unit];return t?{ms:e.time*t.size,unit:e.unit,time:e.time}:null}return typeof e=="number"&&e>0&&Number.isFinite(e)?{ms:e,unit:null,time:null}:null}function DS(e,t){if(!t.unit)return Le(e.valueOf()+t.ms);const n=t.time||1;switch(t.unit){case"month":return e.add(n,"month");case"quarter":return e.add(n*3,"month");case"year":return e.add(n,"year");case"week":return e.add(n*7,"day");default:return Le(e.valueOf()+t.ms)}}function LS(e,t){return t.unit?DS(Le(e),t).valueOf():e+t.ms}function OS(e,t){if(!t.unit)return Math.ceil(e/t.ms)*t.ms;const n=t.time||1,o=Le(e);if(["millisecond","second","minute","hour"].includes(t.unit)){const s=o.startOf("day").valueOf(),l=yt[t.unit].size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="day"){const s=o.startOf("year").valueOf(),l=yt.day.size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="week"){let s=o.startOf("year");const l=s.day();s=s.subtract((l+6)%7,"day");const a=s.valueOf(),r=yt.week.size*n,c=e-a;return a+Math.ceil(c/r)*r}if(t.unit==="month"){const s=o.startOf("year"),l=o.startOf("month"),a=o.month(),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(t.unit==="quarter"){const s=o.startOf("year"),l=Math.floor(o.month()/3),r=o.month(l*3).startOf("month").valueOf()>=e?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(t.unit==="year"){const s=o.startOf("year"),l=2e3,a=s.valueOf()>=e?o.year()-l:o.year()+1-l,r=Math.ceil(a/n)*n;return Le(`${l+r}-01-01`).startOf("day").valueOf()}return e}function RS(e,t,n){const o=[];let s=OS(e,n);const l=1e4;for(;s<=t&&o.length<l;)o.push(s),s=LS(s,n);return o}class NS extends so{normalizeTimeValue(t){if(t==null)return null;if(typeof t=="number")return Number.isFinite(t)?t:null;const n=Le(t).valueOf();return Number.isFinite(n)?n:null}calculateScaleRange(t,n){const o=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(o)||typeof o=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:X.calcTextSizeCanvas("",X.getLabelStyle(this.labelStyle))};let l=o;Array.isArray(o)&&o.length===2?l=[this.normalizeTimeValue(o[0]),this.normalizeTimeValue(o[1])]:typeof o=="function"&&(l=(...h)=>{const[u,f]=o(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(f)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...t,min:this.normalizeTimeValue(t==null?void 0:t.min),max:this.normalizeTimeValue(t==null?void 0:t.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(t,n={}){if(this.formatter){const o=this.formatter(t,n);if(typeof o=="string")return o}return Le(t).format(this.timeFormat)}getInterval(t){const n=this.normalizeTimeValue(t.maxValue),o=this.normalizeTimeValue(t.minValue),s=t.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=yt[this.interval].size:typeof this.interval=="object"?l=this.interval.time*yt[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-o)/s)}calculateSteps(t){const n=this.normalizeTimeValue(t.minValue),o=this.normalizeTimeValue(t.maxValue),s=Math.max(1,t.maxSteps??1);if(n==null||o==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+o;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=BS(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=Math.ceil((a-l)/c.ms);let h=!this.fixedSteps&&d>s?Math.max(1,Math.floor(d/s)):1,u,f;const g=h+1e4;for(;h<=g;){const p=c.unit?{ms:c.ms*h,unit:c.unit,time:(c.time||1)*h}:{ms:c.ms*h,unit:null,time:null};if(f=p.ms,u=RS(l,a,p),u.length<=s||this.fixedSteps)break;h++}return{steps:Math.max(0,u.length-1),interval:f,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:u}}draw(t,n,o,s,l){var y,k,I,E,B,V,S,C,M,w,T,D,L,O,v,N,R,P,_,z;const a=this.ctx,r=this.options,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=o.graphMin,h=o.graphMax,u=o.ticks,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=5;let b=0;if(this.drawAxisTitle(t,n),a.font=X.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,b=X.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,p+b),a.lineTo(g,p+b)):(a.moveTo(p+b,f),a.lineTo(p+b,g)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((y=this.labelStyle)!=null&&y.show){const W=c.x2-c.x1,A=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,b=X.aliasPixel(a.lineWidth);let F;for(let H=0;H<u.length;H++){const U=u[H];let j;if(this.type==="x"?j=ie.calculateX(U,d,h,W,c.x1):j=ie.calculateY(U,d,h,A,c.y2),j===null)continue;U===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const Z=j+b;F=this.getLabelFormat(U,{prev:u[H-1]??""});const ee=((I=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:I.use)&&((B=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:B.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((V=l==null?void 0:l.dataIndex)==null?void 0:V.length)&&!(l!=null&&l.label.map(Q=>this.getLabelFormat(Q,{prev:u[H-1]??""})).includes(F));let K;H===u.length-1&&this.lastLabelFontStyle?(a.font=X.getLabelStyle(this.lastLabelFontStyle),K=this.lastLabelFontStyle.color):H===0&&this.firstLabelFontStyle?(a.font=X.getLabelStyle(this.firstLabelFontStyle),K=this.firstLabelFontStyle.color):(a.font=X.getLabelStyle(this.labelStyle),K=this.labelStyle.color);let te=1;X.getColorStringType(K)==="RGBA"&&(te=X.getOpacity(K)),a.fillStyle=X.colorStringToRgba(K,ee?(S=this.options)==null?void 0:S.unSelectedOpacity:te);let G;if(this.type==="x"){if(G=this.position==="top"?p-10:p+10,((C=r==null?void 0:r.brush)!=null&&C.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(F),j,G),!ee&&((M=r==null?void 0:r.selectItem)!=null&&M.showLabelTip)&&(s!=null&&s.label)&&!((w=this.options)!=null&&w.horizontal)){const Q=this.getLabelFormat(s.label);if(Q===F){const J=Math.round(a.measureText((T=this.labelStyle)==null?void 0:T.fontSize).width);X.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(Q).width)+10,height:J,x:j,y:G+(J-2),borderRadius:2,arrowSize:3,text:F,backgroundColor:(L=(D=r==null?void 0:r.selectItem)==null?void 0:D.labelTipStyle)==null?void 0:L.backgroundColor,textColor:(v=(O=r==null?void 0:r.selectItem)==null?void 0:O.labelTipStyle)==null?void 0:v.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(Z,p),a.lineTo(Z,p+x),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(Z,p),a.lineTo(Z,m),a.stroke(),a.closePath())}else{G=this.position==="left"?p-10:p+10,((N=r==null?void 0:r.brush)!=null&&N.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(F),G,j);let Q=Z;H===u.length-1&&(Q-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(p+(this.axisLineWidth??1),Q),a.lineTo(p-x,Q),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(p,Q),a.lineTo(m,Q),a.stroke(),a.closePath())}}}if((R=this.plotBands)!=null&&R.length||(P=this.plotLines)!=null&&P.length){const W=t.chartWidth-(n.left+n.right),A=t.chartHeight-(n.top+n.bottom),F=b+1,H=c.x1,U=c.x2+F,j=c.y1-F,q=c.y2;(_=this.plotBands)==null||_.forEach(Z=>{const ee=Re({},Z,_s),{from:K,to:te,label:G}=ee,Q=X.isNullOrUndefined(K)?d:Math.max(K,d),J=X.isNullOrUndefined(te)?h:Math.min(te,h);this.setPlotBandStyle(ee);let le,he;if(this.type==="x"){if(le=ie.calculateX(Q,d,h,W,H),he=ie.calculateX(J,d,h,W,H),le===null||he===null)return;this.drawXPlotBand(le,he,H,U,j,q)}else{if(le=ie.calculateY(Q,d,h,A,q),he=ie.calculateY(J,d,h,A,q),le===null||he===null)return;this.drawYPlotBand(le,he,H,U,j,q)}if(G.show){const ae=this.getNormalizedLabelOptions(t,G),fe=this.getPlotBandLabelPosition(le,he,ae,U,j);this.drawPlotLabel(ae,fe)}a.restore()}),(z=this.plotLines)==null||z.forEach(Z=>{if(!Number.isFinite(+Z.value))return;const ee=Re({},Z,Ps),{value:K,label:te}=ee;let G;if(this.type==="x"){if(G=ie.calculateX(K,d,h,W,H),G===null)return;this.setPlotLineStyle(ee),this.drawXPlotLine(G,H,U,j,q)}else{if(G=ie.calculateY(K,d,h,A,q),G===null)return;this.setPlotLineStyle(ee),this.drawYPlotLine(G,H,U,j,q)}if(te.show){const Q=this.getNormalizedLabelOptions(t,te),J=this.getPlotLineLabelPosition(G,Q,U,j);this.drawPlotLabel(Q,J)}a.restore()})}}}}class VS extends so{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 X.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)}getExactInterval(t,n){if(!Number.isFinite(t)||t<=0)return{interval:1,steps:1};const o=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=o;r>=1;r--){const c=t/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<t&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((t/o).toFixed(12)),steps:o}}getStepsWithNiceScale({max:t,min:n,maxSteps:o}){const s=t-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/o,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=t,d=n,h=0,u=0,f=1/0;for(let g=a;g<=r;g++){const p=10**g;for(const m of kS){const x=m*p;if(x>=l){const b=x*1e-10,y=Math.floor((n+b)/x)*x,k=Math.ceil((t-y-b)/x),I=y+x*k;if(k<=o&&I>=t-b){const E=n-y+(I-t);E<f&&(c=I,d=y,h=x,u=k,f=E)}}}}if(!(h>0)||u<=0){const g=Math.max(1,o),p=s/g||1;return{max:t,min:n,interval:p,steps:g}}return{max:c,min:d,interval:h,steps:u}}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}getLegacyOneMaxScale(t){return this.decimalPoint?t>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}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 k=this.getDecimalPointFromInterval(y);k!=null&&!Number.isNaN(k)?this.adjustedDecimalPoint=k:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(y):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},g=(y,k)=>Math.max(1,Math.round(y/k+u)),p=({min:y,max:k,interval:I})=>{let E=0,B=0;return y>=0?(E=+y,B=Math.ceil(k/I)*I):k>=0?(E=Math.floor(y/I)*I,B=Math.ceil(k/I)*I):(B=+k,E=Math.floor(y/I)*I),{graphMin:E,graphMax:B}};if(l&&c){const y=d,k=h,I=r,B=(k-y)/I;if(Math.abs(B-Math.round(B))<u&&B<=s||this.fixedSteps){const S=Math.round(B);return f(I),{steps:S,interval:I,graphMin:y,graphMax:k}}}if(l){const y=d,k=h,I=k-y,{interval:E,steps:B}=this.getExactInterval(I,s);return f(E),{steps:B,interval:E,graphMin:y,graphMax:k}}if(c){let y=r,k=0,I=0,E=0,B=0;for({graphMin:k,graphMax:I}=p({min:n,max:o,interval:y}),E=I-k,B=g(E,y);B>s;)y+=r,{graphMin:k,graphMax:I}=p({min:n,max:o,interval:y}),E=I-k,B=g(E,y);return f(y),{steps:B,interval:y,graphMin:k,graphMax:I}}const m=this.startToZero&&n>=0?0:n,x=this.startToZero&&o<=0?0:o;if(m===0&&x===1){const y=this.getLegacyOneMaxScale(s);return f(y.interval),{steps:y.steps,interval:y.interval,graphMin:m,graphMax:x}}const 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 u;let o,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null)){const f=this.getLabelFormat(0),g=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:f,maxLabel:g,size:X.calcTextSizeCanvas(g,X.getLabelStyle(this.labelStyle))}}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 c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const f=o,g=o*(this.autoScaleRatio+1);if(o=this.decimalPoint?g:Math.ceil(g),o>0&&s<0){const p=f-o;s+=p}else if(o<0&&s<0){const p=s*(this.autoScaleRatio+1);s=this.decimalPoint?p:Math.ceil(p)}}this.startToZero&&!c&&(s>0&&(s=0),o<0&&(o=0)),o===s&&(o+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(o,{isMaxValueSameAsMin:l});return{min:s,max:o,minLabel:d,maxLabel:h,size:X.calcTextSizeCanvas(h,X.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class PS extends so{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=X.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:X.calcTextSize(r,X.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const o=t.maxValue,s=t.minValue,l=t.maxSteps,a=X.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 X.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,o=t.minValue;return 10**X.calculateMagnitude(n-o)}}const As=new WeakMap;class _S extends so{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}getStepMinMax(t,n){return this.labelStyle.alignToGridLine?t:n!=null&&n.use?(As.has(this.labels)||As.set(this.labels,X.getStringMinMax(this.labels)),As.get(this.labels)):X.getStringMinMax(this.labels)}calculateScaleRange(t,n,o){const s=this.getStepMinMax(t,n);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:X.calcTextSizeCanvas(this.getLabelFormat(l,u),X.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,k,I,E,B,V,S,C,M,w,T;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=X.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=X.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 L=(g-f)/d,O=this.labelStyle.alignToGridLine;let v=null,N=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let R,P,_;for(_=0;_<d;_+=h){const z=u+_,W=this.labels[z];v=Math.round(f+L*_),N=v+D,R=this.getLabelFormat(W,x);const{selectLabel:A,selectItem:F,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=(A==null?void 0:A.use)&&(A==null?void 0:A.useLabelOpacity)&&U===this.type&&((k=l==null?void 0:l.dataIndex)==null?void 0:k.length)&&!((I=l==null?void 0:l.dataIndex)!=null&&I.includes(z));let q;_===d-1&&this.lastLabelFontStyle?(a.font=X.getLabelStyle(this.lastLabelFontStyle),q=this.lastLabelFontStyle.color):_===0&&this.firstLabelFontStyle?(a.font=X.getLabelStyle(this.firstLabelFontStyle),q=this.firstLabelFontStyle.color):(a.font=X.getLabelStyle(this.labelStyle),q=this.labelStyle.color);let Z=1;if(X.getColorStringType(q)==="RGBA"&&(Z=X.getOpacity(q)),a.fillStyle=X.colorStringToRgba(q,j?(E=this.options)==null?void 0:E.unSelectedOpacity:Z),this.type==="x"){P=this.position==="top"?p-10:p+10;const ee=O?v:v+L/2;if(a.fillText(this.checkFixWidth(R),ee,P),!j&&(F!=null&&F.showLabelTip)&&(s!=null&&s.label)&&!H){const K=s.label;if(K===R){const te=Math.round(a.measureText((B=this.labelStyle)==null?void 0:B.fontSize).width);X.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(K).width)+10,height:te,x:v+L/2,y:P+(te-2),borderRadius:2,arrowSize:3,text:R,backgroundColor:(V=F==null?void 0:F.labelTipStyle)==null?void 0:V.backgroundColor,textColor:(S=F==null?void 0:F.labelTipStyle)==null?void 0:S.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(v+L/2,p),a.lineTo(v+L/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 ee=O?v:v+L/2;a.fillText(this.checkFixWidth(R),P,ee),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(p+(this.axisLineWidth??1),ee),a.lineTo(p-b,ee),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(this.showLastLabel){const z=u+d-1;if(u+Math.floor((d-1)/h)*h!==z){const A=Math.round(f+L*(d-1)),F=O?A:A+L/2,H=this.getLabelFormat(r[z],x);a.font=this.lastLabelFontStyle?X.getLabelStyle(this.lastLabelFontStyle):X.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(H),F,P):a.fillText(this.checkFixWidth(H),P,F),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(F,p),a.lineTo(F,p+b)):(a.moveTo(p+(this.axisLineWidth??1),F),a.lineTo(p-b,F)),a.stroke(),a.closePath())}}if(O&&!this.showLastLabel){const z=Kb(+r[1],+r[0]),W=Rs(+r[r.length-1],z);if(isNaN(W))return;v=Math.round(f+L*this.labels.length),N=v+D;const A=this.getLabelFormat(`${W}`,x),F=v+L/2;a.font=X.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(A),v,P):a.fillText(this.checkFixWidth(A),P,v),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(F,p),a.lineTo(F,p+b)):(a.moveTo(p+(this.axisLineWidth??1),N),a.lineTo(p-b,N)),a.stroke(),a.closePath())}a.closePath()}if((C=this.plotBands)!=null&&C.length||(M=this.plotLines)!=null&&M.length){const D=X.aliasPixel(a.lineWidth)+1,L=c.x1+D,O=c.x2,v=c.y1+D,N=c.y2,R=(g-f)/(this.labelStyle.show?r.length:1);(w=this.plotBands)==null||w.forEach(P=>{if(!P.from&&!P.to)return;const _=Re({},P,_s),{from:z=0,to:W=r.length,label:A}=_,F=Math.round(f+R*z),H=Math.round(f+R*W);if(this.setPlotBandStyle(_),this.type==="x"?this.drawXPlotBand(F,H,L,O,v,N):this.drawYPlotBand(F,H,L,O,v,N),A.show){const U=this.getNormalizedLabelOptions(t,A),j=this.getPlotBandLabelPosition(F,H,U,O,v);this.drawPlotLabel(U,j)}a.restore()}),(T=this.plotLines)==null||T.forEach(P=>{if(!P.value)return;const _=Re({},P,Ps),{value:z,label:W}=_,A=Math.round(f+R*z)+R/2;if(this.setPlotLineStyle(_),this.type==="x"?this.drawXPlotLine(A,L,O,v,N):this.drawYPlotLine(A,L,O,v,N),W.show){const F=this.getNormalizedLabelOptions(t,W),H=this.getPlotLineLabelPosition(A,F,O,v);this.drawPlotLabel(F,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=X.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return X.truncateLabelWithEllipsis(t,n,o,s)}getLabelWidthHasMaxLength(t,n,o=[]){const s=X.getLabelStyle(this.labelStyle),l=(t==null?void 0:t.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(t??[]).map(d=>this.getLabelFormat(d,a)),...o].reduce((d,h)=>{var f;const u=((f=X.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class AS extends so{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 Le(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 yt[this.interval].size;if(typeof this.interval=="object")return this.interval.time*yt[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 L,O,v,N,R,P,_,z,W,A,F,H,U,j,q,Z;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=X.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 k=X.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(p,x+k),a.lineTo(m,x+k)):(a.moveTo(x+k,p),a.lineTo(x+k,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 B=[];let V=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let C,M,w;const T=d<=2?Math.max(1,g-1):Math.round(g/d),D=T===g?g:g-1;for(w=0;w<=D;w+=T){B[w]=Le(h).valueOf()+w*f,V=Math.round(p+E*w),S=V+k;let ee;for(let Q=0;Q<B.length;Q++)B[Q]!==void 0&&Q!==w&&(ee=B[Q]);C=this.getLabelFormat(Math.min(u,B[w]),{prev:ee});const K=((O=(L=this.options)==null?void 0:L.selectLabel)==null?void 0:O.use)&&((N=(v=this.options)==null?void 0:v.selectLabel)==null?void 0:N.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((R=l==null?void 0:l.dataIndex)==null?void 0:R.length)&&!(l!=null&&l.label.map(Q=>this.getLabelFormat(Math.min(u,Q),{prev:ee})).includes(C)),te=this.labelStyle.color;let G=1;if(X.getColorStringType(te)==="RGBA"&&(G=X.getOpacity(te)),a.fillStyle=X.colorStringToRgba(te,K?(P=this.options)==null?void 0:P.unSelectedOpacity:G),this.type==="x"){if(M=this.position==="top"?x-10:x+10,a.fillText(this.checkFixWidth(C),V,M),!K&&((z=(_=this.options)==null?void 0:_.selectItem)!=null&&z.showLabelTip)&&(s!=null&&s.label)&&!((W=this.options)!=null&&W.horizontal)){const Q=this.getLabelFormat(Math.min(u,s.label+0*f));if(Q===C){const J=Math.round(a.measureText((A=this.labelStyle)==null?void 0:A.fontSize).width);X.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(Q).width)+10,height:J,x:V,y:M+(J-2),borderRadius:2,arrowSize:3,text:C,backgroundColor:(U=(H=(F=this.options)==null?void 0:F.selectItem)==null?void 0:H.labelTipStyle)==null?void 0:U.backgroundColor,textColor:(Z=(q=(j=this.options)==null?void 0:j.selectItem)==null?void 0:q.labelTipStyle)==null?void 0:Z.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,x),a.lineTo(S,x+y),a.stroke(),a.closePath()),w<g&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,x),a.lineTo(S,b),a.stroke(),a.closePath())}else M=this.position==="left"?x-10:x+10,a.fillText(this.checkFixWidth(C),M,V),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(x+(this.axisLineWidth??1),S),a.lineTo(x-y,S),a.stroke(),a.closePath()),w<g&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(x,S),a.lineTo(b,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&I&&w*T===g){const ee=Le(r[1]).diff(Le(r[0])),K=this.getLabelFormat(Le(B[g-1]+ee));V=Math.round(p+E*g),S=V+k,this.type==="x"?(a.fillText(this.checkFixWidth(K),V,M),this.showGrid&&(a.moveTo(S,x),a.lineTo(S,b))):(a.fillText(this.checkFixWidth(K),M,V),this.showGrid&&(a.moveTo(x,S),a.lineTo(b,S))),a.stroke()}a.closePath()}}const zS={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`}},FS={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,X.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=X.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?X.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,X.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=X.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?X.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",X.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(),X.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,k,I,E,B;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=(k=e==null?void 0:e.title)!=null&&k.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}=((B=e==null?void 0:e.legend)==null?void 0:B.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=X.labelSignFormat(+n,t)),o}},Lr=28,HS={width:70,height:60},WS={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+$e(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>Lr?Lr: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 k=(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 B=E.getElementsByClassName("ev-chart-legend-label");B[0].style.cssText=`${m}0%;`,B[1].style.cssText=`${m}100%;`,l!==void 0&&a!==void 0&&(B[0].innerText=this.isSide?I:k,B[1].innerText=this.isSide?k:I);const V=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");V[0].style.cssText=p+x,V[1].style.cssText=p+b;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var x,b,y,k;const e=this.options,t=(x=e==null?void 0:e.legend)==null?void 0:x.position,{width:n,height:o}=HS,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}=((k=e==null?void 0:e.legend)==null?void 0:k.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`)}},$S={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=Re({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,vr.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,k,I,E;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)||qi((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=!Ge((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 B=e==="x"?(x=(m=(p=this.options.axesX)==null?void 0:p[0])==null?void 0:m.scrollbar)==null?void 0:x.resetPosition:(k=(y=(b=this.options.axesY)==null?void 0:b[0])==null?void 0:y.scrollbar)==null?void 0:k.resetPosition;if(a){const V=(I=s==null?void 0:s[0])==null?void 0:I.range,S=this.scrollbar[e].range;if(!B&&(V!=null&&V.length)&&(S!=null&&S.length)){const C=V[1]-V[0];this.scrollbar[e].range=[S[0],S[0]+C]}else this.scrollbar[e].range=V!=null&&V.length?[...V]:null}(B||t)&&this.resetScrollbarSavedPositions(e),this.initScrollbarRange(e)}this.scrollbar[e].use=!!((E=s==null?void 0:s[0].scrollbar)!=null&&E.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,S;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?(S=this.options.title)==null?void 0:S.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 C=Math.max(0,f-g.size);n.savedAtStart?g.position=0:n.savedAtEnd?g.position=C:g.position=Math.min(n.savedPositionRatio*f,C)}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,k,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;`,k=`${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;`,k=`${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 B=o.getElementsByClassName("ev-chart-scrollbar-thumb");if(B[0].style.cssText=b,B[0].style.backgroundColor=n.thumbStyle.background,B[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const C=o.getElementsByClassName("ev-chart-scrollbar-button-up"),M=Math.floor(f-g.size),w=Math.floor(g.position)>M?.5:1;C[0].style.cssText=`background-color: ${n.background};${y}`,C[0].style.opacity=w,C[0].children[0].style.display="block";const T=o.getElementsByClassName("ev-chart-scrollbar-button-down");T[0].style.cssText=`background-color: ${n.background};${k}`,T[0].style.opacity=Math.floor(g.position)<0?.5:1,T[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 k=t/r,I=y/c+1,E=+o-d;a=k*I,h=k*(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=Ko(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:k,clientHeight:I}=a,E=y<=0,B=Math.ceil(y)+I>=k,V=s.deltaY<0,S=s.deltaY>0;if(!(E&&V||B&&S))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 k;if(g?k=y-p-l:k=p+m-y-l,k<=0)return;let I,E;const B=Math.round(Math.abs(k)/x)*r,[V,S]=s;if(k>0){const C=a+(B-+V);I=+V+C,E=I+(+S-+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 XS(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function Or(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,XS(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(M){const w=o,T=s;return o=s=void 0,d=M,a=e.apply(T,w),a}function m(M,w){return g?(window.cancelAnimationFrame(r),window.requestAnimationFrame(M)):setTimeout(M,w)}function x(M){if(g)return window.cancelAnimationFrame(M);clearTimeout(M)}function b(M){return d=M,r=m(I,t),h?p(M):a}function y(M){const w=M-c,T=M-d,D=t-w;return u?Math.min(D,l-T):D}function k(M){const w=M-c,T=M-d;return c===void 0||w>=t||w<0||u&&T>=l}function I(){const M=Date.now();if(k(M))return E(M);r=m(I,y(M))}function E(M){return r=void 0,f&&o?p(M):(o=s=void 0,a)}function B(){r!==void 0&&x(r),d=0,o=c=s=r=void 0}function V(){return r===void 0?a:E(Date.now())}function S(){return r!==void 0}function C(...M){const w=Date.now(),T=k(w);if(o=M,s=this,c=w,T){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 C.cancel=B,C.flush=V,C.pending=S,C}const US="Expected a function";function YS(e,t,n){let o=!0,s=!0;if(typeof e!="function")throw new TypeError(US);return Or(e,t,{leading:o,maxWait:t,trailing:s})}const jS={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,!0),y=b.hitId??Object.keys(b.items)[0],k=b.items[y];k&&(l.label=k.label,l.value=(I=k.data)==null?void 0:I.o,l.seriesId=y,l.dataIndex=k.index,l.acc=(E=k.data)==null?void 0:E.acc)},m=b=>{var V,S;const y=this.findHitItem(a,!0),k=y.hitId??Object.keys(y.items)[0],I=y.items[k],{labelIndex:E}=this.getLabelInfoByPosition(a,b),{dataIndex:B}=this.regulateSelectedLabelInfo(E,b);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(B,b),I&&(l.label=I.label,l.seriesId=k,l.value=(V=I.data)==null?void 0:V.o,l.acc=(S=I.data)==null?void 0:S.acc,l.dataIndex=I.index)},x=()=>{var I,E,B;const b=this.findHitItem(a,!0),y=b.hitId??Object.keys(b.items)[0],k=b.items[y];if(y!==null){const V=this.updateSelectedSeriesInfo(y,!0);k&&(l.label=k.label,l.value=(I=k.data)==null?void 0:I.o,l.seriesId=(E=V.seriesId)==null?void 0:E.at(0),l.acc=(B=k.data)==null?void 0:B.acc,l.dataIndex=k.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.getHitItemByPosition(a,!1,void 0,!1,!0);({label:l.label,value:l.value,sId:l.seriesId,dataIndex: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.dataIndex})},m=y=>{var E,B,V,S;const{labelIndex:k}=this.getLabelInfoByPosition(a,y),{dataIndex:I}=this.regulateSelectedLabelInfo(k,y);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(I,y),y&&(this.defaultSelectInfo.targetAxis=I!=null&&I.length?y:null),l.selected={eventTarget:"label",...Ce(this.defaultSelectInfo)},l.label=(B=(E=this.defaultSelectInfo)==null?void 0:E.label)==null?void 0:B.at(0),l.dataIndex=(S=(V=this.defaultSelectInfo)==null?void 0:V.dataIndex)==null?void 0:S.at(0)},x=()=>{const y=this.findHitItem(a,!0),k=y.hitId??Object.keys(y.items)[0],I=y.items[k];if(!pt(k)){const E=this.updateSelectedSeriesInfo(k,!1);this.defaultSelectInfo.seriesId=E.seriesId,l.selected={eventTarget:"series",...Ce(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:k}=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"},!k&&I!==(y?"yAxis":"xAxis"))return;m(I)}}else if(u)p();else if(f){const{useBothAxis:k}=d,I=this.getCurMouseLocation(a);if((I==="yAxis"||I==="xAxis")&&!k&&I!==(y?"yAxis":"xAxis"))return;I!=="canvas"&&m(k?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 p,m,x;if(!(((m=(p=this.tooltipDOM)==null?void 0:p.style)==null?void 0:m.display)==="block"))return;const a=((x=this.tooltipDOM)==null?void 0:x.querySelector(this.options.tooltip.htmlScrollTarget))||this.tooltipBodyDOM;if(!a||a.scrollHeight<=a.clientHeight){this.hideTooltipDOM();return}const{scrollTop:r,scrollHeight:c,clientHeight:d}=a,h=r<=0,u=Math.ceil(r)+d>=c,f=s.deltaY<0,g=s.deltaY>0;s.preventDefault(),!(h&&f)&&!(u&&g)&&(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=YS(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:k,ysp:I,width:E,height:B}=this.getDragInfoForHeatMap(y);f.xsp=k,f.ysp=I,f.width=E,f.height=B}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=Re({},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,Ge(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,k=n/u,I=o/f,E=g*k,B=p*I;l.fillRect(b,y,E,B)}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"?Le(h).format(c[0].timeFormat):h,o.originVal=c[0].type==="time"?Le(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,t=!1){var E,B,V;const n=Object.keys(this.seriesList),o={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=e;let c=null,d="",h=0,u="",f=null,g=null,p=1/0,m=!1,x=null,b=1/0;const y=this.findClosestDataIndex(e,n,t);if(y===-1&&!this.isNotUseIndicator())return{items:o,hitId:c,maxTip:[d,u],maxHighlight:null};const k=n.every(S=>this.seriesList[S].type==="bar");for(let S=0;S<n.length;S++){const C=n[S],M=this.seriesList[C];if(M.findGraphData&&M.show){const w=M.findGraphData(e,s,y,!k);if(w!=null&&w.data){let T;if(w.data.o===null&&M.interpolation!=="zero"?M.isExistGrp||(T=s?w.data.x:w.data.y):isNaN(w.data.o)||(T=w.data.o),T!=null){const D=this.getFormattedTooltipLabel({dataId:M.id,seriesId:C,seriesName:M.name,itemData:w.data}),L=l?l.measureText(D).width:1;w.id=M.id,w.name=D,w.axis={x:M.xAxisIndex,y:M.yAxisIndex},w.label=s?(E=w.data)==null?void 0:E.y:(B=w.data)==null?void 0:B.x,o[C]=w;const O=this.getFormattedTooltipValue({dataId:M.id,seriesId:C,seriesName:D,value:T,itemData:w.data});if(w.data.formatted=O,h<L&&(d=D,h=L),u.length<=`${O}`.length&&(u=`${O}`),(f===null||f<=T)&&(f=T,g=C),w.hit&&w.data.xp!==void 0&&w.data.yp!==void 0){const v=(w.data.xp-e[0])**2+(w.data.yp-e[1])**2;w.directHit?((!m||v<p)&&(p=v,c=C),m=!0):!m&&v<p&&(p=v,c=C)}if(w.data.xp!==void 0&&w.data.yp!==void 0&&w.data.xp!==null&&w.data.yp!==null){const v=X.calcBoxDistance(w.data,a,r);v<b&&(b=v,x=C)}}}}}c===null&&(c=x!==null?x:Object.keys(o)[0]);const I=f!==null?[g,f]:null;if(t&&Object.keys(o).length===0&&y!==-1){const S=n.find(M=>{var T;const w=this.seriesList[M];return(w==null?void 0:w.show)&&((T=w==null?void 0:w.data)==null?void 0:T.length)>0}),C=S?(V=this.seriesList[S].data)==null?void 0:V[y]:null;C&&(o[""]={id:"",name:"",label:s?C.y:C.x,index:y,axis:{x:0,y:0},data:{o:void 0,x:C.x,y:C.y}},c="")}return{items:o,hitId:c,maxTip:[d,u],maxHighlight:I}},findClosestDataIndex(e,t,n=!1){var p;const[o,s]=e,l=!!this.options.horizontal,a=l?s:o,r=t.find(m=>{var b;const x=this.seriesList[m];return(x==null?void 0:x.show)&&((b=x==null?void 0:x.data)==null?void 0:b.length)>0});if(!r||!((p=this.seriesList[r])!=null&&p.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const m=[];for(let x=1;x<c.length;x++){const b=c[x-1],y=c[x];if(b&&y){let k,I;l?(k=b.h?b.yp+b.h/2:b.yp,I=y.h?y.yp+y.h/2:y.yp):(k=b.w?b.xp+b.w/2:b.xp,I=y.w?y.xp+y.w/2:y.xp),k!==null&&I!==null&&m.push(Math.abs(I-k))}}m.length>0&&(d=m.reduce((x,b)=>x+b,0)/m.length)}let h=1/0,u=-1;for(let m=0;m<c.length;m++)if(n||t.some(b=>{var k,I,E,B;const y=this.seriesList[b];return(y==null?void 0:y.show)&&((I=(k=y.data)==null?void 0:k[m])==null?void 0:I.o)!==null&&((B=(E=y.data)==null?void 0:E[m])==null?void 0:B.o)!==void 0})){const b=c[m];if(b){let y;if(l?y=b.h?b.yp+b.h/2:b.yp:y=b.w?b.xp+b.w/2:b.xp,y!==null){const k=Math.abs(a-y);k<h&&(h=k,u=m)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?t.some(x=>{const b=this.seriesList[x];if(b!=null&&b.show){const y=b.passingValue,k=b.interpolation,I=b.hasPassingValueInData;return k==="linear"||k==="none"&&!!y&&I}return!1})?u:-1:u},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":Xt(o):d=Xt(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(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.x)===s),y=this.getFormattedTooltipLabel({dataId:x.id,seriesId:m,seriesName:x.name,itemData:b}),k=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 S={};S.color=x.color,S.hit=!1,S.name=y,S.axis={x:x.xAxisIndex,y:x.yAxisIndex},S.index=n?x.yAxisIndex:x.xAxisIndex,S.data=b,S.data.formatted=k,e.items[m]=S}const I=t?t.measureText(l).width:1,E=t?t.measureText(y).width:1;I<E&&(l=y);const B=t?t.measureText(a).width:1,V=t?t.measureText(`${k}`).width:1;B<V&&(a=`${k}`)}}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=Ce(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=Ce(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=Ce(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 k,I,E,B;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&&((k=this.boxOverflow)!=null&&k.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&&((B=this.boxOverflow)!=null&&B.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.dataIndex)===((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.dataIndex)},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}},zs=8,ci=50,lo=17,GS=8,ZS={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=Or(()=>{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 z,W,A,F,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(),u=this.options.tooltip,f=this.getColorMargin(),g=e.hitId,p=l[g].data,m=l[g].axis,x=(z=u.formatter)==null?void 0:z.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?(A=(W=l[e.hitId])==null?void 0:W.data)==null?void 0:A.y:(H=(F=l[e.hitId])==null?void 0:F.data)==null?void 0:H.x,k=(y==null?void 0:y.length)>a.length?y:a,I=Math.round(n.measureText(k).width),E=Math.round(n.measureText(r).width),B=I+E+h.l+h.r+f+ci+lo,V=B>u.maxWidth?u.maxWidth:B;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const q=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+ci+lo);Object.values(l).map(ee=>ee.name).forEach(ee=>{if(n.measureText(ee).width>q){let K="";for(let te=0;te<ee.length;te++){const G=ee[te],Q=`${K}${G}`;n.measureText(Q).width>q?(K=G,S+=1):K=Q}}S+=1}),n.restore()}const C=h.t+S*this.getTextHeight()+d*zs+h.b;let M;u.useScrollbar&&C>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",M=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",M=C),this.tooltipCanvas.width=V*this.pixelRatio,this.tooltipCanvas.height=C*this.pixelRatio,this.tooltipCanvas.style.width=`${V}px`,this.tooltipCanvas.style.height=`${C}px`,this.tooltipHeaderDOM.style.width=`${V}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${M+6}px`,this.tooltipDOM.style.display="block";const w=document.body.clientWidth,T=document.body.clientHeight,D=20,L=((U=this.tooltipDOM)==null?void 0:U.offsetHeight)||((j=this.tooltipHeaderDOM)==null?void 0:j.offsetHeight)+M+GS,O=w-V-D,v=T-L-D,N=o+D,R=s+D,P=o-V-D,_=s-L-D;this.tooltipDOM.style.left=N>O?`${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 u=2,f=2;u+=X.aliasPixel(u),f+=X.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=lo),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,k=x.formatted;let I=u+4,E=f+p*d;I+=X.aliasPixel(I),E+=X.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 B={id:g[m].id,name:g[m].name,value:k,dataId:g[m].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:I,y:E}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(B):c.fontColor.label??c.fontColor;const V=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-ci,S=I+h,C=E;if(V>n.measureText(y).width)n.fillText(y,S,C);else if(c.textOverflow==="wrap"){let M="",w=C;for(let T=0;T<y.length;T++){const D=y[T],L=`${M}${D}`;n.measureText(L).width>V?(n.fillText(M,S,w),M=D,p+=1,w+=d):M=L}n.fillText(M,S,w)}else{const M=X.truncateLabelWithEllipsis(y,V,n);n.fillText(M,S,C)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(B):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(k,this.tooltipDOM.offsetWidth-a.r,E),n.restore(),n.closePath(),f+=zs,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:B}=u.valueOpt,V=$e(l.o-E,B-E),{start:S,end:C}=x[0];p=S<=V&&V<=C||l.o===-1}else{const E=x.find(({id:B})=>B===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+=lo);const y=c.l+2,k=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=ie.createGradient(n,d,{x:y,y:k,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:k}),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,k),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,k),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+=X.aliasPixel(h),u+=X.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=lo),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 k=h+4,I=u+g*c;k+=X.aliasPixel(k),I+=X.aliasPixel(I),n.beginPath(),typeof x!="string"?n.fillStyle=ie.createGradient(n,!1,{x:k-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:k,y:I}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(E):r.fontColor.label??r.fontColor;const B=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-ci,V=k+d,S=I;if(B>n.measureText(b).width)n.fillText(b,V,S);else if(r.textOverflow==="wrap"){let C="",M=S;for(let w=0;w<b.length;w++){const T=b[w],D=`${C}${T}`;n.measureText(D).width>B?(n.fillText(C,V,M),C=T,g+=1,M+=c):C=D}n.fillText(C,V,M)}else{const C=X.truncateLabelWithEllipsis(b,B,n);n.fillText(C,V,S)}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+=zs,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=X.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),X.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,k,I,E,B,V;if(!((u=this.data)!=null&&u.labels)||!e)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.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 S=c.y2-c.y1,C=(f=this.options.axesY)==null?void 0:f.some(T=>T.categoryMode),M=(g=this.options.axesY)==null?void 0:g.some(T=>T.type==="time");let w;if(C)w=c.y1+S*(n+.5)/d;else if(M){const T=(m=(p=this.axesSteps)==null?void 0:p.y)==null?void 0:m[0],D=(T==null?void 0:T.graphMin)??+((x=this.data.labels)==null?void 0:x[0]),L=(T==null?void 0:T.graphMax)??+((b=this.data.labels)==null?void 0:b[this.data.labels.length-1]);w=c.y1+S*(+e-D)/(L-D)}else w=c.y1+S*n/(d-1);h=[c.x2,w]}else{const S=c.x2-c.x1,C=(y=this.options.axesX)==null?void 0:y.some(T=>T.categoryMode),M=(k=this.options.axesX)==null?void 0:k.some(T=>T.type==="time");let w;if(C)w=c.x1+S*(n+.5)/d;else if(M){const T=(E=(I=this.axesSteps)==null?void 0:I.x)==null?void 0:E[0],D=(T==null?void 0:T.graphMin)??+((B=this.data.labels)==null?void 0:B[0]),L=(T==null?void 0:T.graphMax)??+((V=this.data.labels)==null?void 0:V[this.data.labels.length-1]);w=c.x1+S*(+e-D)/(L-D)}else w=c.x1+S*n/(d-1);h=[w,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}},qS={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,k=Math.min(x,b);for(let E=0;E<o.length;E++){const B=o[E];if(!B)return;let V=k-(k-y)/o.length*E;if((I=s==null?void 0:s.pieStroke)!=null&&I.use&&(V-=s.pieStroke.lineWidth),V<0)return;if(B.or=V,E<o.length-1?B.ir=k-(k-y)/o.length*(E+1):B.ir=1,B.total){for(let S=0;S<B.data.length;S++)if(r=B.data[S],c=r.value,g=c/B.total*100,d=2*Math.PI*(c/B.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const C={...s.pieStroke};B.data.length===1&&s.pieStroke.use&&(C.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:M,legendHitInfo:w,unSelectedOpacity:T}=e;f.isSelect=(M==null?void 0:M.sId)===r.id,f.isDownplay=w&&w.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,C,T),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 k=0;k<b.data.length;k++)if(r=b.data[k],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:B,unSelectedOpacity:V}=e;c.isSelect=(E==null?void 0:E.sId)===r.id,c.isDownplay=B&&B.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}},KS={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 k=this.calculateTipInfo(y,"sel",b);if(k){let I=!1;if(s.use&&(r==null?void 0:r.dp)===k.dp&&(I=!0),x.showTextTip||x.showTip){if(x.tipText==="label"){const E=o?t.axesY[0]:t.axesX[0],B=k.label;k.text=E.type==="time"?Le(B).format(E.timeFormat):B}else k.text=Xt(k.value);this.drawTextTip({opt:x,tipType:"sel",seriesOpt:y,isSamePos:I,...k})}x.showIndicator&&this.drawFixedIndicator({opt:x,seriesOpt:y,...k})}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=Xt(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 k=m==="bar"?y:b;t==="sel"&&(n&&n.label!==null?(s.pos=m==="bar"?n.dataIndex:n.label,k=s.pos):s.pos!==null&&(k=s.pos));let I=o?e.minMax.maxX:e.minMax.maxY,E;if(t==="sel"){if(n&&n.label!==null)E=n.label,n.value!==null?(I=n.useStack?n.acc:n.value,s.value=I):s.value!==null&&(I=s.value),s.label=E;else if(s.value!==null)I=s.value,E=s.label;else if(s.pos!==null){const w=m==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[w]=="function"){const T=this[w](s.pos);I=T.useStack?T.acc:T.value,E=T.label,s.value=I,s.label=E}}}let B,V,S;if(m==="bar"){const w=o?this.scrollbar.y:this.scrollbar.x;if(w!=null&&w.use){const[T,D]=(w==null?void 0:w.range)??[];if(k>=T&&k<=D)k-=T??0;else return!1}o?(V=Math.round(x.h/2),B=p-x.cat*k-x.cPad,S=B-(x.bar*x.ix-(x.h+x.bPad))-V):(V=Math.round(x.w/2),B=f+x.cat*k+x.cPad,S=B+(x.bar*x.ix-(x.w+x.bPad))+V)}else m==="line"?S=ie.calculateX(k,h.graphMin,h.graphMax,d-x.comboOffset,f+x.comboOffset/2):m==="scatter"&&(S=ie.calculateX(k,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:g,ysp:p},...{dp:S,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),k=d.chartHeight-(h.top+h.bottom),I=t?y:k,E=u[g.units.rectStart];let B=this.options.type==="bar"?4:6;B*=t?1:-1;const V=Object.keys(this.seriesList??{}),S=V.filter(W=>this.seriesList[W].show),C=V.some(W=>this.seriesList[W].isExistGrp&&!this.seriesList[W].isOverlapping),M=((r=this.data.groups)==null?void 0:r[0])??[];let w,T,D,L,O,v,N,R,P,_=0,z=(c=f.labels)==null?void 0:c.length;if(f.labels){let W=f.labels.length;if(b!=null&&b.use){const{range:A,interval:F,type:H}=b,[U,j]=A??[];ve(U)&&ve(j)&&(W=Math.floor((+j-+U)/F)+1,_=H==="step"?U:f.labels.findIndex(q=>q===+U),z=H==="step"?j:f.labels.findIndex(q=>q===+j))}L=u[f.units.rectStart],O=u[f.units.rectEnd],v=(O-L)/W}else N=this.axesSteps.x[0],R=V.find(W=>{var A;return((A=this.seriesList[W])==null?void 0:A.type)==="line"}),P=this.seriesList[R].size;s.forEach((W,A)=>{var F;if(D=p.graphMax,!n.fixedPosTop){if(C){const H=S==null?void 0:S.reduce((q,Z)=>{var ee,K;return M.includes(Z)&&(((ee=W[Z])==null?void 0:ee.value)??W[Z])>0?q+(((K=W[Z])==null?void 0:K.value)??W[Z]):q},0),U=((F=S==null?void 0:S.filter(q=>!M.includes(q)))==null?void 0:F.map(q=>{var Z;return((Z=W[q])==null?void 0:Z.value)??W[q]}))??[],j=(U==null?void 0:U.length)>0?U.reduce((q,Z)=>Math.max(q,Z??-1/0),-1/0):-1/0;D=H>0?Math.max(j,H):Math.max(j,0)}else if(S.length){const H=S.map(j=>{var q;return((q=W[j])==null?void 0:q.value)??W[j]}),U=H.length>0?H.reduce((j,q)=>Math.max(j,q??-1/0),-1/0):-1/0;D=U>0||this.options.type!=="bar"?U:0}}if(f.labels){if(o[A]<_||o[A]>z)return;const H=o[A]-_;w=Math.round(L+v*H)+v/2}else w=x(l[A],N.graphMin,N.graphMax,y-P.comboOffset,u.x1+P.comboOffset/2);T=m(D,p.graphMin,p.graphMax,I,E)+B,this.showTip({context:this.bufferCtx,x:t?T:w,y:t?w:T,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,k=4,{fontSize:I,fontFamily:E,fontWeight:B,height:V}=g.tipStyle,S=`normal normal ${B} ${I}px ${E}`;let C=1;p==="line"?C+=6:p==="scatter"?C+=b==null?void 0:b.pointSize:p==="bar"&&(C+=4);let M,w=h;if(g.fixedPosTop)t?(M=ie.calculateX(o.graphMax,o.graphMin,o.graphMax,l,r),M+=C):(M=ie.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),M-=C);else if(t){const L=Math.min(Math.max(u,o.graphMin),o.graphMax);M=ie.calculateX(L,o.graphMin,o.graphMax,l,r),M=u<0?M-C:M+C}else{const L=p==="bar"&&u<0?0:u,O=Math.min(Math.max(L,s.graphMin),s.graphMax);M=ie.calculateY(O,s.graphMin,s.graphMax,a,d),M=L<0?M+C:M-C}let T="center";n.save(),n.font=S;const D=Math.round(Math.max(n.measureText(f).width+12,40));t||(h+D/2>c-10?(T="right",w-=D/2-y*2):h-D/2<r+10&&(T="left",w+=D/2-y*2)),n.restore(),(g.showTextTip||m==="max")&&this.showTextTip({context:n,type:T,width:D,height:V,x:t?M+D/2:w,y:t?w+V/2:M,opt:g,arrowSize:y,borderRadius:k,text:f,textStyle:S,isNegative:u<0}),g.showTip&&m==="sel"&&this.showTip({context:n,x:t?M:h,y:t?h:M,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 Rr=class{constructor(t,n,o,s,l,a,r){Object.keys(Dr).forEach(d=>Object.assign(this,Dr[d])),o.brush||(Object.assign(this,ZS),Object.assign(this,jS),Object.assign(this,KS),Object.assign(this,FS),Object.assign(this,qS),Object.assign(this,zS),Object.assign(this,$S)),o.type==="heatMap"&&o.legend.type==="gradient"&&Object.assign(this,WS),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);const c=o.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),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",{willReadFrequently:c}),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,k=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)k[I]!==void 0&&b.push(k[I])}else if(h)b=Array.from({length:g},(y,k)=>u+k*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 x,b,y,k;const d=this.axesX[c],h=(x=this.axesSteps)==null?void 0:x.x[c],u=t(h,"x",d),f=ve((b=d==null?void 0:d.labelStyle)==null?void 0:b.fixWidth)?d.labelStyle.fixWidth:0;let g=[];const p=(y=this.axesSteps)==null?void 0:y.x[c];if((d==null?void 0:d.type)==="linear"&&p!=null){const{graphMin:I,graphMax:E}=p;if(typeof I=="number"&&typeof E=="number"){const B=Math.abs(I)>=Math.abs(E)?I:E;g=[mS(B)]}}const m=((k=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:k.call(d,u,this.chartRect,g))??0;return{...r,size:{width:f||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,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(X.coordinateKey(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(X.coordinateKey(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,isHorizontal:this.options.horizontal};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 k=this.seriesList[b[y]];switch(x){case"line":{const I=t==null?void 0:t.legend;k.draw({legendHitInfo:I,...d});break}case"heatMap":{const I=t==null?void 0:t.legend;k.draw({legendHitInfo:I,...d});break}case"bar":{const I=t==null?void 0:t.legend,{thickness:E,cPadRatio:B,borderRadius:V}=this.options;k.draw({thickness:E,cPadRatio:B,borderRadius:V,showSeriesCount:u,showIndex:h,legendHitInfo:I,...d}),k.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 B=this.lastHitInfo,V=this.defaultSelectItemInfo;B!=null&&B.dataIndex||(B==null?void 0:B.dataIndex)===0?E={seriesID:B.sId,dataIndex:B.dataIndex}:V!=null&&V.dataIndex||(V==null?void 0:V.dataIndex)===0?E={...V}:E=null}this.options.seriesReverse&&(k=this.seriesList[b.at(-1-y)]),k.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 VS(t,r,o,a);case"time":return r.categoryMode?new AS(t,r,o,l,a):new NS(t,r,o,a);case"log":return new PS(t,r,o);case"step":return new _S(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,B,V,S;const{width:t,height:n}=this.getChartDOMRect(),o=this.options.padding,s=(B=(E=this.options.axesX)==null?void 0:E[0])==null?void 0:B.title,l=(S=(V=this.options.axesY)==null?void 0:V[0])==null?void 0:S.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),k=o.top+c,I=Math.max(n-o.bottom-r-u,k+2);return{x1:b,x2:y,y1:k,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,k,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 B=!!((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():B&&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=(k=n.tooltip)==null?void 0:k.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&&(f?this.drawSelectionArea(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(),((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.initRect(),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 JS={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},QS={class:"ev-chart-toolbar"},eC={class:"ev-chart-toolbar__icon"};function tC(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon");return i.openBlock(),i.createElementBlock("div",QS,[i.createElementVNode("div",eC,[(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=re(JS,[["render",tC],["__scopeId","data-v-dfbffbab"]]);class nC{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(B=>+B.$d==+u.$d),y=p.findLastIndex(B=>+B.$d==+f.$d);const k=B=>l/(g.length-1)*(B-m);let I=k(b);if(b===y&&(I-o>=s-I?b-=1:y+=1),b===m&&y===x)return;b-y===-1&&(I=k(b));const E=k(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,k=Math.ceil(y*(s/r)),I=Math.ceil(y*((r-l)/r)),E=B=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(t.style.opacity="initial",B(!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-=k,h-=k,u+=k+I,f+=I,requestAnimationFrame(()=>E(B))));return new Promise(B=>E(B))}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 oC={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"}},iC={series:{},groups:[],labels:[],data:{}},sC=()=>{let e=null;const t=200;return{clickEventCallback:s=>{e&&(clearTimeout(e),e=null),e=setTimeout(()=>{s(),e=null},t)},dblClickEventCallback:s=>{e&&(clearTimeout(e),e=null),s()}}},Vr=(e,t)=>{const{props:n,emit:o}=i.getCurrentInstance(),s=f=>{const g=Re({},f,oC);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=>Re(f,iC),a=Ce(n.selectedItem),r=Ce(n.selectedLabel??(e==null?void 0:e.value)),c=Ce(n.selectedSeries),{clickEventCallback:d,dblClickEventCallback:h}=sC();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}},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(Jl(e.width)),height:o(Jl(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(),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=C=>{C.data.length&&C.range&&c.value&&g.dragZoom(C)},y=()=>{p.props.options.forEach((C,M)=>{if(C.zoom={...C.zoom,use:c.value,getRangeInfo:b},c.value)C.dragSelection={...C.dragSelection,use:!0,keepDisplay:!1};else{const{use:w,keepDisplay:T}=m.options[M].dragSelection??{};C.dragSelection={use:!!w,keepDisplay:!!T}}})},k=()=>{if(n!=null&&n.value?(p.dom=n.value.querySelectorAll(".ev-chart-container"),p.dom.length&&s.value.forEach(({data:C,options:M},w)=>{C.chartIdx=w,p.props.data.push(C),p.props.options.push(M),x.value.push(w)})):(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=Ce(p.props.data),m.options=Ce(p.props.options);const C={updateZoomStartIdx:M=>a("update:zoomStartIdx",M),updateZoomEndIdx:M=>a("update:zoomEndIdx",M)};g=new nC(p,m,u,h.value,r,f,C)}},I=C=>{m.data[0].labels.length<=1||(c.value=!c.value,C?C.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),y(),g.setIconStyle(c.value),g.setEventListener(c.value))},E=(C,M)=>{if(g.isAnimationFinish)switch(M){case"dragZoom":I(C.target);break;case"reset":g.initZoom();break;case"previous":case"latest":g.clickMoveZoomArea(M);break}};i.onUpdated(()=>{g&&h.value&&g.setIcon(h.value)});const B=C=>{!Ge(C.zoom,u.zoom)&&(u.zoom=C.zoom,g?(!u.zoom.toolbar.show&&c.value&&I(),g.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&k())},V=C=>{d.value?(r.value||(m.data=n?Ce(C):[Ce(C)],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},S=(C,M)=>{if(g.isUseToolbar){g.isUseToolbar=!1;return}c.value&&(g.executeZoom(C,M),g.setZoomAreaMemory(C,M))};return i.watch(()=>[f.start,f.end],([C,M],[w])=>{if(o!=null&&o.value)if(typeof o.value.dataIndex=="number")C>=(w??0)?o.value.dataIndex-=C-(w??0):o.value.dataIndex+=w-C;else for(let T=0;T<o.value.dataIndex.length;T++)C>=(w??0)?o.value.dataIndex[T]-=C-(w??0):o.value.dataIndex[T]+=w-C;(f.isUseButton||f.isUseScroll)&&g.executeZoom(C,M)}),i.watch(()=>[f.isUseButton,f.isUseScroll],([C,M],[w,T])=>{w&&!C?g.setZoomAreaMemory(f.start,f.end):T&&!M&&(g.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:p,evChartToolbarRef:h,evChartClone:m,brushIdx:f,createEvChartZoom:k,setOptionsForUseZoom:B,setDataForUseZoom:V,controlZoomIdx:S,onClickToolbar:E}},lC={name:"EvChart",components:{EvChartToolbar:Nr},directives:{resize:kn},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}=Vr(a,r),x=p(e.data),b=m(e.options),y=i.computed(()=>e.selectedLabel),k=i.computed(()=>e.selectedItem),{wrapper:I,wrapperStyle:E}=Pr(b),{evChartZoomOptions:B,evChartToolbarRef:V,createEvChartZoom:S,setOptionsForUseZoom:C,setDataForUseZoom:M,controlZoomIdx:w,onClickToolbar:T}=s?{}:_r(b,{wrapper:I,evChartGroupRef:null},e.selectedLabel?y:k,d);let D=null,L=null;const O=A=>{var F;D?(A.updateSeries&&(D.updateSeries=!0),A.updateData&&(D.updateData=!0),A.updateLegend&&(D.updateLegend=!0),A.updateTooltip&&(D.updateTooltip=!0),(F=A.updateSelTip)!=null&&F.update&&(D.updateSelTip??(D.updateSelTip={}),D.updateSelTip.update=!0)):D={...A},clearTimeout(L),L=setTimeout(()=>{D&&n&&n.update(D),D=null,L=null},0)},v=()=>{var H;let A;b.selectLabel.use?A=f:b.selectSeries.use&&(A=g);const F=(H=e.options.realTimeScatter)!=null&&H.use?{...e.data,groups:[],labels:[]}:x;n=new Rr(I.value,F,b,h,u,A,l)},N=()=>{n&&(n.init(),!s&&b.zoom.toolbar.show&&S(),b.legend.show&&b.legend.external&&n.emitLegendData())};i.watch(()=>e.options,A=>{var q,Z;const F=m(A),H=((Z=(q=n.options)==null?void 0:q.legend)==null?void 0:Z.show)??!1,U=!Ge(F.legend.table,n.options.legend.table),j=F.tooltip.use&&!Ge(F.tooltip,n.options.tooltip);n.options=Ce(F),O({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:U,updateTooltip:j}),F.legend.show&&F.legend.external&&!H&&n.emitLegendData(),s||C(F)},{deep:!0,flush:"post"}),i.watch(()=>e.data,A=>{var j,q;const F=(j=e.options.realTimeScatter)!=null&&j.use?{...A,groups:[],labels:[]}:p(A),H=!Ge(F.series,n.data.series)||!Ge(F.groups,n.data.groups)||e.options.type==="heatMap",U=!Ge(F,n.data);n.data=(q=e.options.realTimeScatter)!=null&&q.use?F:Ce(F),O({updateSeries:H,updateSelTip:{update:!0,keepDomain:!1},updateData:U}),!s&&U&&M(F)},{deep:!0,flush:"post"}),s&&!(a!=null&&a.value)&&i.watch(()=>c.start,(A,F)=>{if(y!=null&&y.value)for(let H=0;H<y.value.dataIndex.length;H++)A>=(F??0)?y.value.dataIndex[H]-=A-(F??0):y.value.dataIndex[H]+=F-A;else k!=null&&k.value&&(A>=(F??0)?k.value.dataIndex-=A-(F??0):k.value.dataIndex+=F-A)}),i.watch(()=>k.value,A=>{const F=e.options.type;n.selectItemByData(A,F)},{deep:!0,flush:"post"}),i.watch(()=>(a==null?void 0:a.value)??y.value,A=>{A!=null&&A.dataIndex&&n.selectLabelByData(A.dataIndex,A==null?void 0:A.targetAxis)},{deep:!0,flush:"post"}),i.watch(()=>e.selectedSeries,A=>{var F;(F=b.selectSeries)!=null&&F.use?A.seriesId&&n.selectSeriesByData(A.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,F])=>{w(A,F)}),i.watch(()=>e.realTimeScatterReset,A=>{A&&(Object.keys(n.dataSet??{}).forEach(F=>{n.dataSet[F]&&(n.dataSet[F].dataGroup=[])}),t("update:realTimeScatterReset",!1))}),i.watch(()=>{var A;return(A=e.options.realTimeScatter)==null?void 0:A.use},A=>{n.options.realTimeScatter.use=A??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),i.watch(()=>r==null?void 0:r.value,A=>{A&&e.options.syncHover!==!1&&(A.label==null?n.overlayClear():n.drawSyncedIndicator(A))},{deep:!0,flush:"post"}),i.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await v(),await N(),o.value=!0}),i.onBeforeUnmount(()=>{var A;clearTimeout(L),D=null,L=null,n&&"destroy"in n&&n.destroy(),(A=d==null?void 0:d.value)!=null&&A.length&&(d.value.length=0),o.value=!1}),i.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const R=A=>{n==null||n.toggleSeries(A)},P=A=>{n==null||n.highlightSeries(A)},_=()=>{n==null||n.unhighlightSeries()},z=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},W=Zo(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return i.onActivated(()=>{o.value&&W()}),{wrapper:I,wrapperStyle:E,onResize:W,redraw:z,toggleSeries:R,highlightSeries:P,unhighlightSeries:_,evChartToolbarRef:V,injectIsChartGroup:s,onClickToolbar:T,normalizedOptions:b,zoomOptions:i.toRef(B??{zoom:{}},"zoom")}}},aC={key:0,ref:"evChartToolbarRef"};function rC(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",aC,[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 ao=re(lC,[["render",rC]]);ao.install=e=>{e.component(ao.name,ao)};const cC={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"}}}}},dC=()=>{const e=i.ref(!1),t=i.ref(),n=i.ref([]),o=i.reactive({list:[],chartIdx:null});return{getNormalizedOptions:l=>Re({},l,cC),isExecuteZoom:e,brushSeries:o,evChartGroupRef:t,evChartPropsInGroup:n}},hC={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}=dC(),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:k}=_r(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:k}}},uC={key:0,ref:"evChartToolbarRef"},fC={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function mC(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",uC,[i.createVNode(a,{toolbar:o.zoomOptions.toolbar,onOnClickToolbar:o.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):i.createCommentVNode("",!0),i.createElementVNode("div",fC,[i.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const ro=re(hC,[["render",mC],["__scopeId","data-v-b1c0c322"]]);ro.install=e=>{e.component(ro.name,ro)};const ke={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Ne={LEFT:"leftX",RIGHT:"rightX"};let gC=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 ke.BUTTON.INCREASE:case ke.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Ne.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===Ne.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case ke.GRAB.UP:case ke.GRAB.DOWN:this.brushRectX<=0&&s===ke.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===ke.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}const h=a*c;return s===ke.BUTTON.INCREASE||s===ke.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{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}}getCanvasOffsetX(t){const n=this.brushCanvas.getBoundingClientRect();return t.clientX-n.left}addEvent(){let t;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=Ko(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),t.isInsideButton?this.isDragMode="button":t.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):t.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const o=l=>{this.isDragMode||(t=this.getMousePosition(l),this.changeCursor(t))};this.onMouseMove=Ko(o,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?ke.WHEEL.DOWN:ke.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=Zo(s,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),o=n(Ne.RIGHT)>n(Ne.LEFT)?Ne.LEFT:Ne.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Ne.LEFT)||s(Ne.RIGHT),r=s(Ne.LEFT)&&l(Ne.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"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),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.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.isDragMode==="grab"?this.clickBrushInsideX<t.offsetX-n&&(o=ke.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(o=this.curBrushButtonType===Ne.LEFT?ke.BUTTON.DECREASE:ke.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>t.offsetX+n&&(o=ke.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(o=this.curBrushButtonType===Ne.LEFT?ke.BUTTON.INCREASE:ke.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 ke.WHEEL.UP:case ke.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case ke.WHEEL.DOWN:case ke.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case ke.BUTTON.INCREASE:if(this.curBrushButtonType===Ne.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case ke.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Ne.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===Ne.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Ne.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(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const pC={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},yC=()=>({getNormalizedBrushOptions:t=>Re({},t,pC)}),xC={name:"EvChartBrush",directives:{resize:kn},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}=yC(),d=i.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:g,getNormalizedData:p,getNormalizedOptions:m}=Vr(),x=i.computed(()=>p((s.data??[])[d.value.chartIdx])),b=i.computed(()=>{var w,T;const C=l.props.options[d.value.chartIdx],M={...C,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:[{...(w=C==null?void 0:C.axesX)==null?void 0:w[0],title:{use:!1}}],axesY:[{...(T=C==null?void 0:C.axesY)==null?void 0:T[0],title:{use:!1}}]};return m(M)}),{wrapper:y,wrapperStyle:k}=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,(C,M)=>{var w;C.brush.chartIdx<=((w=s.data)==null?void 0:w.length)-1?n&&!Ge(M.brush,C.brush)?n.removeBrushWrapper():t&&!Ge(C,M)&&(t.options=Ce(C),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Ce(x.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),i.watch(()=>s.data,C=>{if(t){const M=C[d.value.chartIdx];if(M){const w=!Ge(M.series,t.data.series),T=r.list[d.value.chartIdx];typeof T=="object"&&Object.keys(T).length&&Object.keys(M.series).forEach(D=>{var L;"show"in M.series[D]||(M.series[D].show=((L=T[D])==null?void 0:L.show)??!0)}),t.data=Ce(M),t.update({updateSeries:w,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const I=()=>{let C;b.value.selectLabel.use?C=f:b.value.selectSeries.use&&(C=g),t=new Rr(y.value,x.value,b.value,h,u,C)},E=()=>{n=new gC(t,x,d,a,y)},B=()=>{t&&t.init()},V=C=>{n&&n.init(C)};i.watch(()=>[a.start,a.end],()=>{var C;y.value&&d.value.chartIdx<=((C=s.data)==null?void 0:C.length)-1&&V()}),i.onMounted(async()=>{d.value.show&&(await I(),await B(),E(),V()),o.value=!0}),i.onUpdated(async()=>{var C;if(d.value.show&&d.value.chartIdx<=((C=s.data)==null?void 0:C.length)-1){const M=r.list[d.value.chartIdx];typeof M=="object"&&Object.keys(M).length&&Object.keys(x.value.series).forEach(w=>{var T;"show"in x.value.series[w]||(x.value.series[w].show=((T=M[w])==null?void 0:T.show)??!0)}),await I(),await B(),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 S=Zo(()=>{t&&"resize"in t&&new Promise(M=>t.resize(M)).then(M=>{M&&V(M)})},0);return i.onActivated(()=>{o.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:y,evChartBrushStyle:k,onResize:S}}};function bC(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 co=re(xC,[["render",bC]]);co.install=e=>{e.component(co.name,co)};const SC={name:"TreeGridNode",components:{GridOptionButton:Ns},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,k)=>{t("check-tree-data",y,k)},o=y=>{t("expand-tree-data",y)},s=(y,k)=>{t("click-tree-data",y,k)},l=(y,k)=>{t("dbl-click-tree-data",y,k)},a=y=>{t("context-menu",y)},r=y=>{const k=e.expandIcon?e.expandIcon:"",I=e.expandIcon?e.collapseIcon:"";return y.expand?I:k},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||[],k=y.findIndex(E=>E.expandColumn&&!E.hide&&!E.hiddenDisplay);if(k!==-1)return k;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,k)=>({cell:!0,"tree-td":k===0,[y.type]:y.type,[y.align]:y.align,[y.field]:y.field,"non-border":!!e.borderStyle}),getColumnStyle:(y,k)=>({width:`${y.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===k?"none":"1px solid #CFCFCF"}),getDepthStyle:y=>({"margin-left":`${y*13}px`})}}},CC=["data-index"],wC=["data-name","data-index"],kC={class:"td-content__wrapper"},MC=["title"],EC={class:"td-content"};function IC(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",kC,[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,MC)):i.createCommentVNode("",!0),i.createElementVNode("div",EC,[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,wC)):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,CC)}const vC=re(SC,[["render",IC],["__scopeId","data-v-faab3696"]]),TC={name:"EvTreeGridToolbar"},BC={class:"tree-grid-toolbar"};function DC(e,t,n,o,s,l){return i.openBlock(),i.createElementBlock("div",BC,[i.renderSlot(e.$slots,"toolbarWrapper")])}const LC=re(TC,[["render",DC]]),OC=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=Xt(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}}},di=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(o=>{const s=n.find(l=>l.index===o.index)??{};return{...o,...s}})},RC=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 k=y+x+1,I=Math.max(y,0),E=k,B=o.table;n.viewStore=g.slice(I,E),t.hasVerticalScrollBar=x<g.length||p.clientHeight<B.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}}},NC=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 k=y.offsetWidth;const I=y.offsetHeight,E=a.orderedColumns.reduce((B,V)=>(V.hide||V.hiddenDisplay||(V.width?B.totalWidth+=V.width:B.emptyCount++),B),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(o.rowHeight*m.length>I-o.scrollWidth&&(k-=o.scrollWidth),l.useCheckbox.use&&(k-=o.minWidth),x=k-E.totalWidth,x>0){const B=E.emptyCount===0?0:Math.floor(x/E.emptyCount);b=x-B*E.emptyCount,x=E.emptyCount!==0?B:x}else x=o.columnWidth;x=x<o.minWidth?o.minWidth:x,o.columnWidth=x}if(a.orderedColumns.forEach(y=>{const k=r(y)?o.rendererMinWidth:o.minWidth;y.width&&y.width<k&&(y.width=k),!y.width&&!y.hide&&(y.width=x)}),b&&a.orderedColumns.length){let y=a.orderedColumns.length-1,k=a.orderedColumns[y];for(;y>0&&k&&(k.hide||k.hiddenDisplay);)y-=1,k=a.orderedColumns[y];k&&(k.width+=b)}o.isResize=!o.isResize},f=()=>{i.nextTick(()=>{var m,x;o.adjust&&a.orderedColumns.forEach(b=>{var k;const y=b;return!((k=t.columns[b.index])!=null&&k.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,k=b.getBoundingClientRect().left,I=b.querySelector(`li[data-index="${m}"]`),E=r(a.orderedColumns[m])?o.rendererMinWidth:o.minWidth,B=I.getBoundingClientRect(),V=y.getBoundingClientRect().right-k,S=s.resizeLine,C=B.left-k+E,M=B.right-k,w=x.clientX,T=B.left-k;y.style.overflow="auto",S.style.left=`${M}px`,o.showResizeLine=!0;const D=O=>{const v=O.clientX-w,N=M+v;let R=Math.max(C,N);R=Math.min(V,R),S.style.left=`${R}px`},L=()=>{const v=parseInt(S.style.left,10)-T;a.orderedColumns[m]&&(a.orderedColumns[m].width=v,a.orderedColumns[m].resized=!0),o.showResizeLine=!1,document.removeEventListener("mousemove",D),f();const N=di(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",L,{once:!0})}}},VC=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))}}},PC=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))},k=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(B=>B.index!==E.index)};y(),p.checked?(k(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)}}},_C=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)),k=o.viewStore[y];s.selectedRow=[k],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(g,p)=>{var m,x,b,y,k,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:((k=n.columnMenuTextInfo)==null?void 0:k.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)}}},AC=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()}}},zC=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 k=t.orderedColumns[y]||{};let I=x[k.field]??null;if(k.type=k.type||"string",I!==null&&!k.hide&&((k==null?void 0:k.searchable)===void 0||k!=null&&k.searchable)&&(I=s(k,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)}}},FC=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})}}},HC=({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=di(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:di(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")})}}},WC={name:"EvTreeGrid",components:{TreeGridNode:vC,Toolbar:LC,GridPagination:yr,GridSummary:wr,ColumnSetting:kr,GridSortButton:Mr,GridOptionButton:Ns},directives:{observeVisibility:Yi,resize:kn},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 hi,ui,fi,mi,gi,pi,yi,Kt,pn;const t=i.ref(null),n=i.computed(()=>{var Y,oe;return((oe=(Y=e.option)==null?void 0:Y.useGridSetting)==null?void 0:oe.use)||!1}),o=i.computed(()=>{var Y;return((Y=e.option)==null?void 0:Y.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 Y,oe;return((oe=(Y=e.option)==null?void 0:Y.useGridSetting)==null?void 0:oe.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((ui=(hi=e.option)==null?void 0:hi.useGridSetting)==null?void 0:ui.columnMenuText)??"Column List",search:((mi=(fi=e.option)==null?void 0:fi.useGridSetting)==null?void 0:mi.searchText)??"Search",empty:((pi=(gi=e.option)==null?void 0:gi.useGridSetting)==null?void 0:pi.emptyText)??"No records",ok:((Kt=(yi=e.option)==null?void 0:yi.useGridSetting)==null?void 0:Kt.okBtnText)??"OK"}}),c=i.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:i.computed(()=>c.treeStore.filter(Y=>Y.show)),searchStore:i.computed(()=>c.treeStore.filter(Y=>Y.isFilter)),store:i.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:i.computed(()=>e.columns.map((Y,oe)=>{var ue;return{index:oe,hiddenDisplay:!1,...Y,width:isFinite(Y.width)?Y.width:void 0,sortOption:{sortType:((ue=Y==null?void 0:Y.sortOption)==null?void 0:ue.sortType)||"init"}}})),orderedColumns:i.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:i.computed(()=>di(c))}),d=i.reactive({usePage:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.use)||!1}),useClient:((pn=e.option.page)==null?void 0:pn.useClient)||!1,isInfinite:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.total)||0}),perPage:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.perPage)||20}),visiblePage:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.visiblePage)||8}),order:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.order)||"center"}),showPageInfo:i.computed(()=>{var Y;return((Y=e.option.page)==null?void 0:Y.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}=OC({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 Y,oe;return((oe=(Y=e.option)==null?void 0:Y.useSelection)==null?void 0:oe.use)??!0}),limitCount:i.computed(()=>{var oe,ue;let Y=(ue=(oe=e.option)==null?void 0:oe.useSelection)==null?void 0:ue.limitCount;return Y=Y&&Y>=2?Y:0,Y}),multiple:i.computed(()=>{var Y,oe;return((oe=(Y=e.option)==null?void 0:Y.useSelection)==null?void 0:oe.multiple)??!1})}),k=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 Y,oe;return((oe=(Y=e.option)==null?void 0:Y.useGridSetting)==null?void 0:oe.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}),B=i.reactive({showHeader:i.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:i.computed(()=>{var Y;return((Y=e.option.style)==null?void 0:Y.stripe)||!1}),borderStyle:i.computed(()=>{var Y;return((Y=e.option.style)==null?void 0:Y.border)||""}),highlightIdx:i.computed(()=>{var Y;return((Y=e.option.style)==null?void 0:Y.highlight)??-1})}),V=()=>{y.selectedRow.length=0,c.store.forEach(Y=>{Y.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(Y=>{Y.checked=!1,Y.indeterminate=!1})},{getPagingData:C,updatePagingInfo:M,changePage:w}=FC({stores:c,pageInfo:d,sortInfo:k,filterInfo:a,elementInfo:l,clearCheckInfo:S}),T=i.ref(0),{updateVScroll:D,updateHScroll:L,onScroll:O}=RC({scrollInfo:b,stores:c,elementInfo:l,resizeInfo:E,pageInfo:d,summaryScroll:T,getPagingData:C,updatePagingInfo:M}),{onRowClick:v,onRowDblClick:N}=VC(y),{onCheck:R,onCheckAll:P}=PC({checkInfo:h,stores:c,checkHeader:x,pageInfo:d,getPagingData:C}),{calculatedColumn:_,onResize:z,onShow:W,onColumnResize:A}=NC({resizeInfo:E,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:D,updateHScroll:L,contextInfo:I}),{setTreeNodeStore:F,handleExpand:H}=AC({stores:c,onResize:z}),{onSort:U,initSortInfo:j,setSortInfo:q}=HC({sortInfo:k,stores:c}),{onSearch:Z}=zC({stores:c,filterInfo:a,pageInfo:d,getConvertValue:g,onResize:z,checkHeader:x,getPagingData:C,updatePagingInfo:M}),{setPositionColumnSetting:ee,initColumnSettingInfo:K,onApplyColumn:te,setColumnHidden:G}=Er({stores:c,columnSettingInfo:r,contextInfo:I,onSearch:Z,onResize:z}),{setContextMenu:Q,onContextMenu:J,onColumnContextMenu:le,onGridSettingContextMenu:he}=_C({contextInfo:I,stores:c,selectInfo:y,useGridSetting:n,columnSettingInfo:r,setColumnHidden:G,onSort:U}),ae=Y=>{I.gridSettingContextMenuItems.length=0,I.customGridSettingContextMenu.length?he(Y):r.isShowColumnSetting=!0},fe=Y=>{var oe,ue,xe,Ee,Ae,Ue;Y.type==="wheel"&&((oe=I.menu)==null||oe.hide(Y)),Y.type==="scroll"&&!((ue=Y.target.classList)!=null&&ue.contains("table-body"))&&!((Ee=(xe=Y.target.offsetParent)==null?void 0:xe.classList)!=null&&Ee.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,I.isShowMenuOnClick=!1,(Ae=I.columnMenu)==null||Ae.hide(Y),(Ue=I.gridSettingMenu)==null||Ue.hide())};i.onMounted(()=>{var Y;if(c.treeStore=F(),c.originStore=Ce(c.treeStore),(Y=e.option)!=null&&Y.useSort)q(e.columns,!1);else{const oe=I.hiddenColumnMenuItem;oe.ascending=!0,oe.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(()=>{z()}),i.watch(()=>{var Y;return(Y=e.option)==null?void 0:Y.useSort},Y=>{const oe=e.option.hiddenColumnMenuItem,ue=I.hiddenColumnMenuItem;Y?(ue.ascending=(oe==null?void 0:oe.ascending)??!1,ue.descending=(oe==null?void 0:oe.descending)??!1,q(e.columns,!1)):(ue.ascending=!0,ue.descending=!0,j(e.columns))}),i.watch(()=>r.isShowColumnSetting,Y=>{var oe;if(!Y){(oe=I.gridSettingMenu)==null||oe.hide();return}ee(t.value)}),i.watch(()=>e.columns,()=>{K()},{deep:!0,immediate:!0}),i.watch(()=>e.checked,Y=>{h.checkedRows=Y}),i.watch(()=>h.checkedRows,Y=>{h.isHeaderChecked=!1;let oe=c.store;d.isClientPaging&&(oe=C()),oe.length&&(oe.forEach(ue=>{ue.checked=!!Y.find(xe=>xe.index===ue.index)}),x(oe)),D()}),i.watch(()=>e.selected,Y=>{y.useSelect&&(y.selectedRow=Y)}),i.watch(()=>y.selectedRow,Y=>{y.useSelect&&(c.store.forEach(oe=>{oe.selected=!!Y.find(ue=>ue.index===oe.index)}),D())},{deep:!0}),i.watch(()=>B.highlightIdx,async Y=>{await i.nextTick();const oe=xe=>{if(!(xe!=null&&xe.children))return;const{children:Ee}=xe;Ee.forEach(Ae=>{const Ue=Ae;Ue.parent.show&&Ue.parent.expand?Ue.show=!0:Ue.show=!1,Ue.isFilter=!0,Ue.hasChild&&oe(Ue)})},ue=xe=>{if(!(xe!=null&&xe.parent)){oe(xe);return}const{parent:Ee}=xe;Ee.show=!0,Ee.isFilter=!0,Ee.expand=!0,oe(Ee),ue(Ee)};if(Y>=0){const xe=c.store.find(Ae=>Ae.index===Y);if(!xe)return;xe.show=!0,xe.isFilter=!0,ue(xe);const Ee=c.showTreeStore.map(Ae=>Ae.index).indexOf(xe.index);if(d.usePage&&!d.isInfinite){const Ae=Math.ceil(Ee/d.perPage);if(d.highlightPage=Ee===d.perPage?Ae+1:Ae||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=E.rowHeight*Ee}}),i.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),i.watch(()=>y.useSelect,()=>{V()}),i.watch(()=>y.multiple,()=>{V()}),i.watch(()=>e.rows,Y=>{c.treeRows=Y,c.treeStore=F(),z()},{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(Y=>{var ue;const oe=Y;return!((ue=e.columns[Y.index])!=null&&ue.width)&&!oe.resized&&(oe.width=0),oe}),z()}),i.watch(()=>e.option.searchValue,Y=>{i.nextTick(()=>{Y!==void 0&&(Z((Y==null?void 0:Y.value)??Y),d.isClientPaging&&(S(),V()))})},{immediate:!0}),i.watch(()=>{var Y;return(Y=e.option.page)==null?void 0:Y.currentPage},Y=>{var ue;const oe=Y||1;d.currentPage=(ue=e.option.page)!=null&&ue.isInfinite?1:oe},{immediate:!0}),i.watch(()=>d.currentPage,(Y,oe)=>{i.nextTick(()=>{if(w(oe),d.isClientPaging&&Y!==oe&&(S(),V()),D(),Y===d.highlightPage&&d.isHighlight){const ue=c.pagingStore.map(xe=>xe.index).indexOf(B.highlightIdx);l.body.scrollTop=E.rowHeight*ue,d.isHighlight=!d.isHighlight}})});const Me=()=>({"column-sort__icon":!0,"column-sort__icon--asc":k.sortOrder==="asc","column-sort__icon--desc":k.sortOrder==="desc"}),rt=i.computed(()=>({width:E.gridWidth,height:E.gridHeight})),ct=i.computed(()=>({"table-body":!0,stripe:B.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!B.borderStyle})),xt=i.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:E.adjust,"non-header":!B.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),fo=i.computed(()=>({"table-header":!0,"non-border":!!B.borderStyle})),mo=i.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!B.borderStyle})),go=i.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),qt=Y=>({column:!0,render:u(Y),"non-border":!!B.borderStyle,[Y.field]:Y.field}),Fs=(Y,oe)=>{const ue=u(Y);return{width:`${Y.width}px`,"min-width":ue?`${E.rendererMinWidth}px;`:`${E.minWidth}px`,"margin-right":c.orderedColumns.length-1===oe&&b.hasVerticalScrollBar&&b.hasHorizontalScrollBar?`${E.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===oe?"none":"1px solid #CFCFCF"}},Hs=Y=>`${Y}Node`;return{summaryScroll:T,gridStyle:rt,gridClass:xt,headerClass:fo,headerCheckboxClass:mo,isHeaderCheckbox:go,bodyStyle:ct,useSummary:o,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...i.toRefs(B),...i.toRefs(l),...i.toRefs(c),...i.toRefs(a),...i.toRefs(b),...i.toRefs(E),...i.toRefs(y),...i.toRefs(h),...i.toRefs(k),...i.toRefs(I),...i.toRefs(d),...i.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:g,getColumnIndex:p,setPixelUnit:m,updateVScroll:D,updateHScroll:L,onScroll:O,calculatedColumn:_,onResize:z,onShow:W,onColumnResize:A,onRowClick:v,onRowDblClick:N,onCheck:R,onCheckAll:P,setContextMenu:Q,onContextMenu:J,onSearch:Z,handleExpand:H,getColumnClass:qt,getColumnStyle:Fs,getSlotName:Hs,setGridSetting:ae,onApplyColumn:te,onColumnContextMenu:le,onSort:U,sortIconClass:Me}}},$C={class:"column-list"},XC=["data-index"],UC=["title","onClick"],YC=["onClick"],jC=["onMousedown"],GC={ref:"table"},ZC=["title"],qC={key:0},KC={class:"is-empty"},JC={ref:"resizeLine",class:"table-resize-line"};function QC(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",$C,[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,k)=>{var I,E;return i.openBlock(),i.createElementBlock(i.Fragment,{key:k},[!y.hide&&!y.hiddenDisplay?(i.openBlock(),i.createElementBlock("li",{key:0,"data-index":k,class:i.normalizeClass(o.getColumnClass(y)),style:i.normalizeStyle(o.getColumnStyle(y,k))},[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:[B=>o.onColumnContextMenu(B,y),t[1]||(t[1]=i.withModifiers((...B)=>e.columnMenu.show&&e.columnMenu.show(...B),["prevent"]))]},[i.createTextVNode(i.toDisplayString(y.caption)+" ",1),i.createElementVNode("span",{onClick:i.withModifiers(B=>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,YC)],10,UC)),i.createElementVNode("span",{class:"column-resize",onMousedown:i.withModifiers(B=>o.onColumnResize(k,B),["stop","left"])},null,40,jC)],14,XC)):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",GC,[i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.viewStore,(y,k)=>(i.openBlock(),i.createBlock(h,{key:k,"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:B})=>[e.$slots[I.field]?i.renderSlot(e.$slots,I.field,{key:0,item:{data:B.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,ZC))])})),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",qC,[i.createElementVNode("td",KC,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",JC,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 ho=re(WC,[["render",QC],["__scopeId","data-v-9ed705b7"]]);ho.install=e=>{e.component(ho.name,ho)};const ew={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},tw=["aria-current"];function nw(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,tw)}const ow={name:"EvPagination",components:{EvIcon:un,pageButton:re(ew,[["render",nw]])},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 k=y;k<=x;k++)b.push(u(k));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),k=s.value-y+1+b;if(o.value>y&&o.value<k){const E=s.value,B=o.value-y+2,V=o.value+y-2-b,S=B-1===2?2:-1,C=V+1===E-1?V+1:-1;return[u(1),u(S),...f(B,V),u(C),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===k){const I=o.value-y+1;return[u(1),u(-1),...f(I,s.value)]}return[...f(1,y),u(-1),...f(k,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}}},iw={class:"pagination"},sw={key:0,class:"pagination-info"},lw={key:0,class:"pagination-ellipsis"},aw=["onClick"];function rw(e,t,n,o,s,l){const a=i.resolveComponent("ev-icon"),r=i.resolveComponent("page-button");return i.openBlock(),i.createElementBlock("nav",iw,[n.showPageInfo?(i.openBlock(),i.createElementBlock("small",sw,[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",lw,[...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,aw))],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 uo=re(ow,[["render",rw]]);uo.install=e=>{e.component(uo.name,uo)};const cw="3.9.2",dw=[Mn,En,ln,In,an,rn,vn,Tn,Dn,Ln,On,Vn,$n,un,Yn,jn,Gn,Zn,qn,Kn,Jn,Qn,eo,to,oo,ao,ro,co,ti,oi,ii,ho,uo],hw={version:cw,install:e=>{e&&dw.forEach(t=>{e.use(t)})}};se.EvButton=ln,se.EvButtonGroup=In,se.EvCalendar=Yn,se.EvChart=ao,se.EvChartBrush=co,se.EvChartGroup=ro,se.EvCheckbox=an,se.EvCheckboxGroup=rn,se.EvContextMenu=Zn,se.EvDatePicker=jn,se.EvGrid=oo,se.EvIcon=un,se.EvInputNumber=Vn,se.EvLoading=Kn,se.EvMenu=Qn,se.EvMessage=ti,se.EvMessageBox=ii,se.EvNotification=oi,se.EvPagination=uo,se.EvProgress=Jn,se.EvRadio=vn,se.EvRadioGroup=Tn,se.EvScheduler=Gn,se.EvSelect=Dn,se.EvSlider=$n,se.EvTabPanel=En,se.EvTabs=Mn,se.EvTextField=On,se.EvTimePicker=to,se.EvToggle=Ln,se.EvTree=eo,se.EvTreeGrid=ho,se.EvWindow=qn,se.default=hw,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 Ho=de(A0,[["render",_0]]),Rt=0,wn=1,me=2,di=3,zo=4,U0=()=>{const{props:e}=o.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=Qt(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}}},us=e=>{var i;const t=((i=e.movedColumns)!=null&&i.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}})},J0=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c,expandedInfo:d}=e,h=g=>{var y,w;const m=i.body,b=s.rowHeight,C=d.detailRowHeight??0;if(m){let T=n.store;l.isClientPaging&&(T=r());const k=((y=d.expandedRows)==null?void 0:y.length)??0,M=((w=d.expandedRows)==null?void 0:w.map(R=>T.findIndex(X=>X[me]===R)))??[],Z=T.length*b+k*C;let S=0,x=0;if(k)for(S=0;x+b<m.scrollTop;S++)M.includes(S)&&(x+=C),x+=b;else S=Math.floor(m.scrollTop/b),x=Math.max(S,0)*b;S>T.length-1&&(S=0);let L=0,I=0;if(k)for(let R=S;I<=m.clientHeight;R++)M.includes(R)&&(I+=C),I+=b,L+=1;else L=m.clientHeight>b?Math.ceil(m.clientHeight/b):T.length,I=L*b;const V=S+L+1,v=Math.max(S,0),E=V,G=i.table;n.viewStore=T.slice(v,E),t.hasVerticalScrollBar=L<T.length||m.clientHeight<G.clientHeight,t.vScrollTopHeight=x,t.vScrollBottomHeight=Z-I-t.vScrollTopHeight,g&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(E/l.perPage)+1,l.startIndex=E,c({onScrollEnd:!0}))}},u=g=>{if(d.useRowDetail&&!d.detailRowHeight){let m=n.store;l.isClientPaging&&(m=r()),n.viewStore=[...m],t.vScrollTopHeight=0,t.vScrollBottomHeight=0}else h(g)},f=()=>{const g=i.header,m=i.body,b=i.table;g.scrollLeft=m.scrollLeft,a.value=m.scrollLeft,t.hasHorizontalScrollBar=m.clientWidth<b.clientWidth};return{updateVScroll:u,updateHScroll:f,onScroll:()=>{const g=i.body,m=g.scrollTop,b=g.scrollLeft,C=t.lastScroll.top,y=t.lastScroll.left,w=b!==y;m!==C&&(g!=null&&g.clientHeight)&&u(!0),w&&f(),t.lastScroll.top=m,t.lastScroll.left=b}}},j0=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,elementInfo:s,checkInfo:l,expandedInfo:a,stores:r,isRenderer:c,updateVScroll:d,updateHScroll:h,contextInfo:u}=e,f=()=>{var y;let b=i.columnWidth,C=0;if(i.adjust){const w=s.body;let T=w.offsetWidth;const k=w.offsetHeight,M=((y=w.querySelector("tr"))==null?void 0:y.offsetHeight)||i.rowHeight,Z=T-w.clientWidth,S=r.orderedColumns.reduce((x,L)=>(L.hide||L.hiddenDisplay||(L.width?x.totalWidth+=L.width:x.emptyCount++),x),{totalWidth:u.customContextMenu.length?30:0,emptyCount:0});if(M*t.rows.length>k&&(T-=Z),l.useCheckbox.use&&(T-=i.minWidth),a.useRowDetail&&(T-=i.minWidth),b=T-S.totalWidth,b>0){const x=S.emptyCount===0?0:Math.floor(b/S.emptyCount);C=b-x*S.emptyCount,b=S.emptyCount!==0?x:b}else b=i.columnWidth;b=b<i.minWidth?i.minWidth:b,i.columnWidth=b}if(r.orderedColumns.forEach(w=>{const T=c(w)?i.rendererMinWidth:i.minWidth;w.width&&w.width<T&&(w.width=T),!w.width&&!w.hide&&(w.width=b)}),C&&r.orderedColumns.length){let w=r.orderedColumns.length-1,T=r.orderedColumns[w];for(;w>0&&T&&(T.hide||T.hiddenDisplay);)w-=1,T=r.orderedColumns[w];T&&(T.width+=C)}},p=()=>{const b=new Map(t.columns.map(C=>[C.field,C.width]));o.nextTick(()=>{var C,y;i.adjust&&r.orderedColumns.forEach(w=>{const T=w;return T.resized||(T.width=b.get(T.field)??0),T},void 0),f(),(C=s.body)!=null&&C.clientHeight&&d(),(y=s.body)!=null&&y.clientWidth&&h()})};return{calculatedColumn:f,onResize:p,onShow:b=>{b&&p()},onColumnResize:(b,C)=>{C.preventDefault();const y=s.header,w=s.body,T=y.getBoundingClientRect().left,k=y.querySelector(`li[data-index="${b}"]`),M=c(r.orderedColumns[b])?i.rendererMinWidth:i.minWidth,Z=k.getBoundingClientRect(),S=s.resizeLine,x=Z.left-T+M,L=Z.right-T,I=C.clientX,V=Z.left-T;w.style.overflow="auto",S.style.left=`${L}px`,i.showResizeLine=!0;const v=G=>{const R=G.clientX-I,X=L+R,W=Math.max(x,X);S.style.left=`${W}px`},E=()=>{const R=parseInt(S.style.left,10)-V;r.orderedColumns[b]&&(r.orderedColumns[b].width=R,r.orderedColumns[b].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",v),p();const X=us(r);n("resize-column",{column:r.orderedColumns[b],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",v),document.addEventListener("mouseup",E,{once:!0})}}},Q0=e=>{const{emit:t}=o.getCurrentInstance(),{selectInfo:n,stores:i}=e,s=(d,h)=>{var p;const u=(p=d.target.tagName)==null?void 0:p.toLowerCase();let f={};return u==="td"?f=d.target.dataset:f=d.target.parentNode.dataset,{event:d,rowData:h[me],rowIndex:h[Rt],cellName:f.name,cellIndex:f.index}};let l=null,a=-1;return{onRowClick:(d,h,u)=>{var g,m,b;if((g=d.target.parentElement.classList)!=null&&g.contains("row-checkbox-input"))return!1;const f=!!((b=(m=d.target.closest("td"))==null?void 0:m.classList)!=null&&b.contains("row-contextmenu")),p=(C,y,w)=>{if(C==="shift"){const T=h[Rt];if(a>-1)for(let k=Math.min(T,a);k<=Math.max(T,a);k++)if(!y)i.originStore[k][di]=!0,a!==k&&n.selectedRow.push(i.originStore[k][me]);else{i.originStore[k][di]=!1;const M=n.selectedRow.indexOf(i.originStore[k][me]);M>-1&&n.selectedRow.splice(M,1)}}else C==="ctrl"&&(y?n.selectedRow.splice(n.selectedRow.indexOf(h[me]),1):n.selectedRow.push(w))};return l&&clearTimeout(l),l=setTimeout(()=>{if(n.useSelect){const C=h[me],y=h[di];h[di]=!h[di];let w="";d.shiftKey?w="shift":d.ctrlKey&&(w="ctrl"),n.multiple&&w?p(w,y,C):u||f?(n.selectedRow=[...n.selectedRow],n.selectedRow.includes(C)||(n.selectedRow=[C])):y?n.selectedRow=[]:n.selectedRow=[C],a=h[Rt],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))}}},$0=e=>{const{checkInfo:t,stores:n,pageInfo:i,getPagingData:s}=e,{props:l,emit:a}=o.getCurrentInstance(),r=h=>{const u=n.originStore.findIndex(f=>f[me]===h[me]);u!==-1&&(n.originStore[u][wn]=h[wn])};return{onCheck:(h,u)=>{if(t.useCheckbox.mode==="single"&&t.prevCheckedRow.length&&(t.prevCheckedRow=[],r(t.prevCheckedRow)),u[wn]){t.useCheckbox.mode==="single"?t.checkedRows=[u[me]]:t.checkedRows.push(u[me]);let f=n.store;i.isClientPaging&&(f=s());const p=f.filter(g=>!l.uncheckable.includes(g[me])).filter(g=>!l.disabledRows.includes(g[me])).every(g=>g[wn]);f.length&&p&&(t.isHeaderChecked=!0),t.isHeaderIndeterminate=f.length&&!p}else t.useCheckbox.mode==="single"?t.checkedRows=[]:t.checkedRows.splice(t.checkedRows.indexOf(u[me]),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[Rt],u[me])},onCheckAll:h=>{const u=t.isHeaderChecked;let f=n.store;i.isClientPaging&&(f=s()),f.forEach(p=>{const g=l.uncheckable.includes(p[me])||l.disabledRows.includes(p[me]);u?!t.checkedRows.includes(p[me])&&!g&&t.checkedRows.push(p[me]):t.checkedRows.splice(t.checkedRows.indexOf(p[me]),1),g||(p[wn]=u)}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",h,t.checkedRows)}}},q0=e=>{const{expandedInfo:t}=e,{emit:n}=o.getCurrentInstance();return{onExpanded:(s,l)=>{const a=l[me],r=t.expandedRows.indexOf(a);r===-1?t.expandedRows.push(a):t.expandedRows.splice(r,1),l[zo]=!l[zo],n("update:expanded",t.expandedRows),n("expand-row",s,l[me],l[zo],l[Rt])}}},eS=e=>{const{sortInfo:t,stores:n,updatePagingInfo:i}=e,{emit:s}=o.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,b="init")=>{n.orderedColumns.forEach(C=>{C.index===(m==null?void 0:m.index)&&b?C.sortOption={sortType:b}:C.sortOption={sortType:"init"}})},c=()=>{const m=n.originColumns.filter(b=>b.hiddenDisplay||b.hide);m.length&&m.forEach(b=>{b.sortOption={sortType:"init"}})},d=new a,h=(m,b=!0)=>{const{sortType:C}=(m==null?void 0:m.sortOption)||{};t.sortColumn=m,t.sortField=m==null?void 0:m.field,t.sortOrder=C,t.isSorting=!!C,b&&(r(m,C),s("change-column-info",{type:"sort",columns:us(n)}))},u=(m,b)=>{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),b&&(d.orders=l(),b==="desc"&&(t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder))),t.sortOrder=d.dequeue(),d.enqueue(t.sortOrder),t.isSorting=!0,i({onSort:!0}),c(),r(m,t.sortOrder);const y=us(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 L;const{field:m,index:b}=t.sortColumn||{},C=((L=t.sortFunction)==null?void 0:L[m])??null,y=(I,V)=>I>V?-1:1,w=(I,V)=>I<V?-1:1,T=(I,V)=>(I===null)-(V===null)||Number(V)-Number(I),k=(I,V)=>(I===null)-(V===null)||Number(I)-Number(V);if(t.sortOrder==="init"||!t.sortField&&!t.isSorting){n.store.sort((I,V)=>typeof I[Rt]=="number"?w(I[Rt],V[Rt]):0);return}const M=t.sortColumn.type||"string",Z=t.sortOrder==="desc"?y:w,S=t.sortOrder==="desc"?T:k,x=(I,V)=>{var G,R;let v=I[me][b],E=V[me][b];return I[me][b]&&typeof I[me][b]=="object"&&(v=I[me][b][(G=n.originColumns[b])==null?void 0:G.field],E=V[me][b][(R=n.originColumns[b])==null?void 0:R.field]),{aCol:v,bCol:E}};if(C){n.store.sort((I,V)=>{const v=I[me][b],E=V[me][b],G=C(v,E);return t.sortOrder==="desc"?-G:G});return}switch(M){case"string":n.store.sort((I,V)=>{let{aCol:v,bCol:E}=x(I,V);if((!v||typeof v=="string")&&(!E||typeof E=="string")){v=v||"",E=E||"";const G=v.toLowerCase(),R=E.toLowerCase();if(v!==E&&G===R){const X=Array.from(v).findIndex((W,N)=>W!==E[N]);return Z(v[X],E[X])}return Z(G,R)}return 0});break;case"stringNumber":n.store.sort((I,V)=>{let{aCol:v,bCol:E}=x(I,V);return!v||typeof v=="string"||typeof v=="number"?(v=v===""?null:v,E=E===""?null:E,S(v??null,E??null)):0});break;default:n.store.sort((I,V)=>{const{aCol:v,bCol:E}=x(I,V);return!v||typeof v=="number"||typeof v=="boolean"?S(v??null,E??null):0});break}},p=()=>{var m;return(m=n.orderedColumns)==null?void 0:m.find(b=>(b==null?void 0:b.sortOption)&&l(!1).includes(b.sortOption.sortType))};return{onSort:u,getSortTarget:p,setSort:f,setSortInfo:h,hasSortTarget:()=>!!p()}},tS=e=>{const{props:t}=o.getCurrentInstance(),{columnSettingInfo:n,filterInfo:i,stores:s,checkInfo:l,pageInfo:a,getConvertValue:r,updateVScroll:c,getPagingData:d,updatePagingInfo:h,getColumnIndex:u}=e,f=k=>{let M=0;k.forEach(Z=>{const S=l.checkedRows.includes(Z[me]);Z[wn]=S,M+=S?1:0}),k.length&&(l.isHeaderChecked=k.length===M,l.isHeaderIndeterminate=k.length!==M&&M>0,l.isHeaderUncheckable=k.every(Z=>t.uncheckable.includes(Z[me])||t.disabledRows.includes(Z[me])))},p=(k,M,Z)=>{if(typeof k!="string"||M===null)return!1;const S=M==null?void 0:M.toLowerCase(),x=k==null?void 0:k.toLowerCase();let L=S.includes(x);return Z&&(Z==="start"?L=S.startsWith(x):Z==="end"&&(L=S.endsWith(x))),L},g=(k,M)=>{const Z=M.comparison,S=M.value;let x=k[me][M.index];(x||x===0)&&(x=`${k[me][M.index]}`);let L;return Z==="="?L=(S==null?void 0:S.toLowerCase())===(x==null?void 0:x.toLowerCase()):Z==="!="?L=(S==null?void 0:S.toLowerCase())!==(x==null?void 0:x.toLowerCase()):Z==="%s%"?L=p(S,x):Z==="notLike"?L=!p(S,x):Z==="s%"?L=p(S,x,"start"):Z==="%s"?L=p(S,x,"end"):Z==="isEmpty"?L=x==null||x==="":Z==="isNotEmpty"&&(L=!!x),L},m=(k,M,Z)=>{const S=M.comparison,x=Number(M.value.replace(/,/g,""));let L=Number(k[me][M.index]),I;return Z==="float"&&(L=Number(L.toFixed(3))),S==="="?I=L===x:S===">"?I=L>x:S==="<"?I=L<x:S==="<="?I=L<=x:S===">="?I=L>=x:S==="!="?I=L!==x:S==="isEmpty"?I=L==null||isNaN(L):S==="isNotEmpty"&&(I=!!L||L===0),I},b=(k,M)=>{const Z=M.comparison,S=M.value,x=`${k[me][M.index]}`;let L;return Z==="="&&(L=x===S),L},C=(k,M,Z)=>{let S=M==="string"||M==="stringNumber"?g:m;return M==="boolean"&&(S=b),k.filter(x=>S(x,Z,M))||[]},y=()=>{const k=i.filteringItemsByColumn,M=Object.keys(k),Z=s.originStore;let S=[],x=!1,L=[];M.forEach((I,V)=>{const v=k[I],E=u(I),G=t.columns[E].type,R=i.columnOperator==="or",X=V>0&&i.columnOperator==="and";v.forEach((W,N)=>{!S.length&&!x?S=C(Z,G,{...W,index:E}):X&&W.operator==="or"?N>0?S.push(...C(L,G,{...W,index:E})):S=C(L,G,{...W,index:E}):N===0&&R||N!==0&&W.operator==="or"?S.push(...C(Z,G,{...W,index:E})):S=C(S,G,{...W,index:E}),x=!0}),L=JSON.parse(JSON.stringify(S))}),x?s.filterStore=ub(S,JSON.stringify):s.filterStore=Z};let w=null;return{onSearch:k=>{w&&clearTimeout(w),w=setTimeout(()=>{i.isSearch=!1,i.searchWord=k,k&&(s.searchStore=s.store.filter(M=>{let Z=!1;const S=n.isFilteringColumn?M[me].filter((x,L)=>n.visibleColumnIdx.includes(L)):M[me];for(let x=0;x<s.orderedColumns.length;x++){const L=s.orderedColumns[x]||{};let I=S[L.index]??null;if(L.type=L.type||"string",I!==null&&(I instanceof Array?I=JSON.stringify(I):typeof I=="object"&&(I=I[L.field]),!L.hide&&((L==null?void 0:L.searchable)===void 0||L!=null&&L.searchable)&&(I=r(L,I).toString(),Z=I.toLowerCase().includes(k.toString().toLowerCase()),Z)))break}return Z}),i.isSearch=!0),f(s.store),!k&&a.isClientPaging&&a.prevPage&&(a.currentPage=1,s.pagingStore=d()),h({onSearch:!0}),c()},500)},setFilter:y,setHeaderCheckboxByFilter:f}},nS=e=>{const{contextInfo:t,stores:n,selectInfo:i,onSort:s,filterInfo:l,useGridSetting:a,columnSettingInfo:r,setColumnHidden:c}=e;let d=null;const{emit:h}=o.getCurrentInstance(),u=m=>{d&&clearTimeout(d);const b=[];d=setTimeout(()=>{if(t.customContextMenu.length){const C=t.customContextMenu.map(y=>{const w=y;return w.validate&&(w.disabled=!w.validate(w.itemId,i.selectedRow)),w.selectedRow=i.selectedRow??[],w.contextmenuInfo=i.contextmenuInfo??[],w});b.push(...C)}t.contextMenuItems=b,t.menu.show(m)},200)};return{setContextMenu:u,onContextMenu:m=>{var w,T,k;m.preventDefault();const C=(T=(w=m.target.closest(".row"))==null?void 0:w.dataset)==null?void 0:T.index;let y=null;C&&(y=(k=n.viewStore.find(M=>M[Rt]===+C))==null?void 0:k[me]),y&&(i.contextmenuInfo=[y],u(m))},onColumnContextMenu:(m,b)=>{var C,y,w,T,k,M,Z,S;if(m.target.className==="column-name"){const x=b.sortable===void 0?!0:b.sortable,L=l.isFiltering&&b.filterable===void 0?!0:b.filterable,I=[{text:((C=t.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!x,hidden:(y=t.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>s(b,"asc")},{text:((w=t.columnMenuTextInfo)==null?void 0:w.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!x,hidden:(T=t.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>s(b,"desc")},{text:((k=t.columnMenuTextInfo)==null?void 0:k.filter)??"Filter",iconClass:"ev-icon-filter-list",click:()=>{const V=document.documentElement.clientWidth,v=t.columnMenu.menuStyle.clientX,E=t.columnMenu.menuStyle.pageX,G=350;V<v+G&&(t.columnMenu.menuStyle.left=`${E-G}px`),l.filterSettingPosition={top:t.columnMenu.menuStyle.top,left:t.columnMenu.menuStyle.left},l.isShowFilterSetting=!0,l.filteringColumn=b,h("change-column-info",{type:"filter",columns:n.updatedColumns})},disabled:!L,hidden:((M=t.hiddenColumnMenuItem)==null?void 0:M.filter)||!l.isFiltering},{text:((Z=t.columnMenuTextInfo)==null?void 0:Z.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!a.value||n.orderedColumns.length===1||b.fixed,hidden:((S=t.hiddenColumnMenuItem)==null?void 0:S.hide)||!a.value,click:()=>{c(b.field),h("change-column-status",{columns:n.updatedColumns}),h("change-column-info",{type:"display",columns:n.updatedColumns})}}];if(t.columnMenuItems=[],!x&&!L&&!a.value)return;t.columnMenuItems=I.filter(V=>!V.hidden)}},onGridSettingContextMenu:m=>{const{useDefaultColumnSetting:b,columnSettingTextInfo:C}=r,y={text:(C==null?void 0:C.title)??"Column List",isShowMenu:!0,click:()=>{r.isShowColumnSetting=!0,t.isShowMenuOnClick=!0}};t.customGridSettingContextMenu.length&&(t.gridSettingContextMenuItems=[...t.customGridSettingContextMenu]),b&&t.gridSettingContextMenuItems.push(y),t.gridSettingMenu.show(m)}}},iS=e=>{const{props:t}=o.getCurrentInstance(),{selectInfo:n,checkInfo:i,stores:s,sortInfo:l,elementInfo:a,filterInfo:r,expandedInfo:c,setSort:d,setSortInfo:h,updateVScroll:u,setFilter:f}=e;return{setStore:({rows:g,isMakeIndex:m=!0,isInit:b=!1})=>{var y,w,T;const C=s.orderedColumns.find(k=>(k==null?void 0:k.sortOption)&&["asc","desc"].includes(k.sortOption.sortType));if(m){const k=[];let M=!1;g.forEach((Z,S)=>{const x=t.checked.includes(Z),L=t.uncheckable.includes(Z)||t.disabledRows.includes(Z);let I=!1;n.useSelect&&(I=t.selected.includes(Z)),!x&&!L&&(M=!0);let V=!1;c.useRowDetail&&(V=t.expanded.includes(Z));const v=t.disabledRows.includes(Z);k.push([S,x,Z,I,V,L,v])}),g.length!==t.checked.length&&(g.length===((y=t.uncheckable)==null?void 0:y.length)||g.length===((w=t.disabledRows)==null?void 0:w.length))&&(M=!0),i.isHeaderChecked=g.length>0?!M:!1,i.isHeaderIndeterminate=M&&!!i.checkedRows.length,i.isHeaderUncheckable=g.every(Z=>t.uncheckable.includes(Z)||t.disabledRows.includes(Z)),s.originStore=k}r.isFiltering&&f(),C&&b&&h(C,!1),l.sortField&&d(),(T=a.body)!=null&&T.clientHeight&&u()}}},sS=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.store.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.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)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.store.length<=i.perPage)n.pagingStore=n.store;else{const f=(i.currentPage-1)*i.perPage,p=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.store.slice(f,p),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},Nr=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{stores:i,columnSettingInfo:s,contextInfo:l,onSearch:a,onResize:r}=e,c=m=>{var b,C,y;if(s.isShowColumnSetting)if(s.columnSettingPosition.columnListMenuWidth=0,l.gridSettingContextMenuItems.length){const w=l.gridSettingContextMenuItems.length-1,T=(y=(C=(b=l.gridSettingMenu)==null?void 0:b.rootMenuList)==null?void 0:C.$el)==null?void 0:y.children[0].children[w].getBoundingClientRect();s.columnSettingPosition.columnListMenuWidth=T.width,s.columnSettingPosition.top=T.top,s.columnSettingPosition.left=T.right}else{const w=m==null?void 0:m.getBoundingClientRect(),T=w==null?void 0:w.height;s.columnSettingPosition.top=(w==null?void 0:w.top)+T,s.columnSettingPosition.left=w==null?void 0:w.right}},d=()=>{i.filteredColumns.length=0,s.isFilteringColumn=!1,s.visibleColumnIdx=[],s.hiddenColumn=""},h=()=>Array.isArray(i.movedColumns)&&i.movedColumns.length?i.movedColumns:i.originColumns||[],u=(m,b)=>{var y;if(!m)return;m.hiddenDisplay=b;const C=(y=i.originColumns)==null?void 0:y.find(w=>w.index===m.index);if(C&&C!==m&&(C.hiddenDisplay=b),Array.isArray(i.movedColumns)){const w=i.movedColumns.find(T=>T.index===m.index);w&&w!==m&&(w.hiddenDisplay=b)}},f=()=>{s.visibleColumnIdx=i.filteredColumns.map(C=>C.index);const m=i.originColumns.filter(C=>!C.hide||C.hiddenDisplay).map(C=>C.index),b=s.visibleColumnIdx;s.isFilteringColumn=b.length!==m.length,t.option.searchValue&&a(t.option.searchValue),r()};return{setPositionColumnSetting:c,initColumnSettingInfo:d,onApplyColumn:m=>{const b=i.orderedColumns.filter(T=>!T.hide&&!T.hiddenDisplay);if(m.length===b.length&&b.every(T=>m.includes(T.field)))return;const y=h(),w=new Set(m);i.filteredColumns=y.filter(T=>{const k=w.has(T.field)||!T.caption;return u(T,!k),k}),s.hiddenColumn="",f(),n("change-column-status",{columns:i.updatedColumns}),n("change-column-info",{type:"display",columns:i.updatedColumns})},setColumnHidden:m=>{const b=i.orderedColumns.filter(y=>!y.hide&&!y.hiddenDisplay);if(b.length===1)return;i.filteredColumns=b.filter(y=>{const w=y.field===m;return u(y,w),!w}),h().forEach(y=>{y.field===m&&u(y,!0)}),s.hiddenColumn=m,f()}}},oS=({stores:e})=>{const{emit:t}=o.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)},i=(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;i(c,d),t("change-column-order",{column:e.orderedColumns[d],columns:e.updatedColumns}),t("change-column-info",{type:"order",columns:e.updatedColumns})}}},lS={name:"EvGrid",directives:{clickoutside:Yi,observeVisibility:js,resize:En},components:{Toolbar:f0,GridPagination:vr,GridSummary:Wr,ColumnSetting:Zr,FilterSetting:D0,GridSortButton:Xr,GridOptionButton:Ho},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 nc,ic,sc,oc,lc,ac,rc,cc,dc;const{isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h}=U0(),u=o.ref(null),f=o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ie.use)||!1}),p=o.computed(()=>e.option.showHeader??!0),g=o.computed(()=>{var F;return((F=e.option)==null?void 0:F.useSummary)||!1}),m=o.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.stripe)||!1}),b=o.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.border)||""}),C=o.computed(()=>{var F;return((F=e.option.style)==null?void 0:F.highlight)??-1}),y=o.computed(()=>e.option.emptyText??"No records"),w=e.option.rowMinHeight||35,T=o.ref(0),k=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),M=o.reactive({isSearch:!1,searchWord:"",isFiltering:o.computed(()=>e.option.useFilter??!1),isShowFilterSetting:!1,filterSettingPosition:{left:0,top:0},filteringColumn:null,filteringItemsByColumn:{},columnOperator:"and"}),Z=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ie.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((ic=(nc=e.option)==null?void 0:nc.useGridSetting)==null?void 0:ic.columnMenuText)??"Column List",search:((oc=(sc=e.option)==null?void 0:sc.useGridSetting)==null?void 0:oc.searchText)??"Search",empty:((ac=(lc=e.option)==null?void 0:lc.useGridSetting)==null?void 0:ac.emptyText)??"No records",ok:((cc=(rc=e.option)==null?void 0:rc.useGridSetting)==null?void 0:cc.okBtnText)??"OK"}}),S=o.reactive({viewStore:[],originStore:[],pagingStore:[],searchStore:[],filterStore:[],store:o.computed(()=>{const F=M.isFiltering?S.filterStore:S.originStore;return M.isSearch?S.searchStore:F}),filteredColumns:[],movedColumns:[],originColumns:o.computed(()=>e.columns.map((F,ie)=>{var Le;return{index:ie,hiddenDisplay:!1,...F,width:isFinite(F.width)?F.width:void 0,sortOption:{sortType:((Le=F==null?void 0:F.sortOption)==null?void 0:Le.sortType)||"init"}}})),orderedColumns:o.computed(()=>{const F=S.movedColumns.length?S.movedColumns:S.originColumns;return S.filteredColumns.length?S.filteredColumns:F}),updatedColumns:o.computed(()=>us(S))}),x=o.reactive({usePage:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.use)||!1}),useClient:((dc=e.option.page)==null?void 0:dc.useClient)||!1,isInfinite:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var F,ie;return(F=e.option.page)!=null&&F.useClient?S.store.length:(ie=e.option.page)==null?void 0:ie.total}),perPage:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.perPage)||20}),visiblePage:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.visiblePage)||8}),order:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.order)||"center"}),showPageInfo:o.computed(()=>{var F;return((F=e.option.page)==null?void 0:F.showPageInfo)||!1}),isClientPaging:o.computed(()=>x.useClient&&x.usePage&&!x.isInfinite),isHighlight:!1,highlightPage:0}),L=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),I=o.reactive({expandedRows:e.expanded,useRowDetail:o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:ie.use)??!1}),detailRowHeight:o.computed(()=>{var F,ie;return(ie=(F=e.option)==null?void 0:F.rowDetail)==null?void 0:ie.detailRowHeight})}),V=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),v=o.reactive({contextmenuInfo:e.contextmenuInfo,selectedRow:e.selected,useSelect:o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.useSelection)==null?void 0:ie.use)??!0}),multiple:o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.useSelection)==null?void 0:ie.multiple)??!1})}),E=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),G=o.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:o.computed(()=>{var F,ie;return((ie=(F=e.option)==null?void 0:F.useGridSetting)==null?void 0:ie.customContextMenu)||[]}),isShowMenuOnClick:!1}),R=o.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:o.computed(()=>e.option.rowHeight>w?e.option.rowHeight:w),gridWidth:o.computed(()=>e.width?h(e.width):"100%"),gridHeight:o.computed(()=>e.height?h(e.height):"100%")}),X=()=>{L.checkedRows=[],L.isHeaderChecked=!1,L.isHeaderIndeterminate=!1,S.store.forEach(F=>{F[1]=!1})},W=()=>{v.selectedRow=[],S.store.forEach(F=>{F[3]=!1})},N=()=>{S.store.forEach(F=>{F[4]=!1}),I.expandedRows=[]},{getPagingData:P,updatePagingInfo:D,changePage:H}=sS({stores:S,pageInfo:x,sortInfo:E,filterInfo:M,elementInfo:k,clearCheckInfo:X}),B=o.ref(0),{updateVScroll:Y,updateHScroll:O,onScroll:_}=J0({scrollInfo:V,stores:S,elementInfo:k,resizeInfo:R,pageInfo:x,summaryScroll:B,expandedInfo:I,getPagingData:P,updatePagingInfo:D}),{onCheck:A,onCheckAll:Q}=$0({checkInfo:L,stores:S,pageInfo:x,getPagingData:P}),{onExpanded:U}=q0({expandedInfo:I}),{onSort:ee,getSortTarget:$,setSort:te,setSortInfo:J,hasSortTarget:q}=eS({sortInfo:E,stores:S,updatePagingInfo:D}),{onSearch:j,setFilter:ae,setHeaderCheckboxByFilter:he}=tS({columnSettingInfo:Z,filterInfo:M,stores:S,checkInfo:L,pageInfo:x,getConvertValue:c,updateVScroll:Y,getPagingData:P,updatePagingInfo:D,getColumnIndex:d}),{setStore:se}=iS({selectInfo:v,checkInfo:L,stores:S,sortInfo:E,elementInfo:k,filterInfo:M,expandedInfo:I,setSort:te,setSortInfo:J,updateVScroll:Y,setFilter:ae}),{calculatedColumn:fe,onResize:ge,onShow:le,onColumnResize:ce}=j0({resizeInfo:R,elementInfo:k,checkInfo:L,expandedInfo:I,stores:S,isRenderer:a,updateVScroll:Y,updateHScroll:O,contextInfo:G}),{setPositionColumnSetting:be,initColumnSettingInfo:Ie,onApplyColumn:Ve,setColumnHidden:kt}=Nr({stores:S,columnSettingInfo:Z,contextInfo:G,onSearch:j,onResize:ge}),{setContextMenu:Vt,onContextMenu:jo,onColumnContextMenu:Qo,onGridSettingContextMenu:ps}=nS({contextInfo:G,stores:S,selectInfo:v,useGridSetting:f,filterInfo:M,columnSettingInfo:Z,setColumnHidden:kt,onSort:ee}),{onRowClick:gs,onRowDblClick:bs}=Q0({selectInfo:v,stores:S}),{onDragStart:ys,onDragOver:xs,onDrop:Ss}=oS({stores:S}),Cs=F=>{G.gridSettingContextMenuItems.length=0,G.customGridSettingContextMenu.length?ps(F):Z.isShowColumnSetting=!0},sn=F=>{var ie,Le,wt,on,ki,Et,ot,ks,ws,hc;F.type==="wheel"&&((ie=G.menu)==null||ie.hide(F)),F.type==="scroll"&&!((Le=F.target.classList)!=null&&Le.contains("table-body"))&&!((on=(wt=F.target.offsetParent)==null?void 0:wt.classList)!=null&&on.contains("ev-select-dropbox"))&&!((Et=(ki=F.target.offsetParent)==null?void 0:ki.classList)!=null&&Et.contains("ev-grid-column-setting"))&&!((ks=(ot=F.target.offsetParent)==null?void 0:ot.classList)!=null&&ks.contains("ev-text-field-wrapper"))&&(M.isShowFilterSetting=!1,Z.isShowColumnSetting=!1,G.isShowMenuOnClick=!1,(ws=G.columnMenu)==null||ws.hide(F),(hc=G.gridSettingMenu)==null||hc.hide())};o.onMounted(()=>{fe(),se({rows:e.rows,isInit:!0}),document.addEventListener("wheel",sn,{capture:!1}),document.addEventListener("scroll",sn,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",sn,{capture:!1}),document.removeEventListener("scroll",sn,{capture:!0})}),o.onActivated(()=>{ge()}),o.onUpdated(()=>{var F;T.value=((F=k["grid-wrapper"])==null?void 0:F.offsetWidth)/1.5||0}),o.watch(()=>Z.isShowColumnSetting,F=>{var ie;if(!F){(ie=G.gridSettingMenu)==null||ie.hide();return}be(u.value)}),o.watch(()=>e.columns,()=>{q()?J($()):(J($()),te()),M.filteringColumn=null,M.filteringItemsByColumn={},S.filterStore=[],se({rows:[],isMakeIndex:!1}),Ie(),S.movedColumns.length=0},{deep:!0}),o.watch(()=>E.isSorting,F=>{F&&(se({rows:S.originStore,isMakeIndex:!1}),E.isSorting=!F,x.isClientPaging&&(x.currentPage=1,S.pagingStore=P(),X()))}),o.watch(()=>e.rows,F=>{se({rows:F}),M.isSearch&&j(M.searchWord),ge()},{deep:!0}),o.watch(()=>e.uncheckable,()=>{se({rows:e.rows})},{deep:!0}),o.watch(()=>e.checked,F=>{L.checkedRows=F}),o.watch(()=>e.disabledRows,()=>{S.store.length&&S.store.forEach(F=>{F[6]=e.disabledRows.includes(F[2])})},{deep:!0}),o.watch(()=>L.checkedRows,F=>{L.isHeaderChecked=!1;let ie=S.store;x.isClientPaging&&(ie=P()),ie.length&&(ie.forEach(Le=>{Le[1]=F.includes(Le[2])}),L.isHeaderChecked=F.length===ie.length),Y()}),o.watch(()=>e.selected,F=>{v.useSelect&&(v.selectedRow=F)}),o.watch(()=>v.selectedRow,F=>{v.useSelect&&(S.store.forEach(ie=>{ie[3]=F.includes(ie[2])&&!e.disabledRows.includes(ie[2])}),Y())}),o.watch(()=>C.value,async F=>{if(await o.nextTick(),F>=0){if(x.usePage&&!x.isInfinite&&(x.highlightPage=Math.ceil(F/x.perPage)||1,x.highlightPage!==x.currentPage)){x.currentPage=x.highlightPage,x.isHighlight=!0;return}k.body.scrollTop=R.rowHeight*C.value}}),o.watch(()=>L.useCheckbox.mode,()=>{X()}),o.watch(()=>v.useSelect,()=>{W()}),o.watch(()=>v.multiple,()=>{W()}),o.watch(()=>e.checked.length,F=>{F||X()}),o.watch(()=>e.expanded.length,F=>{F||N(),Y()}),o.watch(()=>[e.option.columnWidth,R.gridWidth],async()=>{await o.nextTick(),R.columnWidth=e.option.columnWidth;const F=k["grid-wrapper"];F.style.width=R.gridWidth,F.style.height=R.gridHeight,S.orderedColumns.map(ie=>{var wt;const Le=ie;return!((wt=e.columns[ie.index])!=null&&wt.width)&&!Le.resized&&(Le.width=0),Le}),ge()}),o.watch(()=>e.option.searchValue,F=>{F!==void 0&&(j((F==null?void 0:F.value)??F),x.isClientPaging&&(X(),W()))},{immediate:!0}),o.watch(()=>{var F;return(F=e.option.page)==null?void 0:F.currentPage},F=>{var Le;const ie=F||1;x.currentPage=(Le=e.option.page)!=null&&Le.isInfinite?1:ie},{immediate:!0}),o.watch(()=>x.currentPage,(F,ie)=>{o.nextTick(()=>{H(ie),x.isClientPaging&&F!==ie&&(X(),W()),Y(),F===x.highlightPage&&x.isHighlight&&(k.body.scrollTop=R.rowHeight*C.value,x.isHighlight=!x.isHighlight)})});const In=o.reactive({boxTop:0,boxLeft:0}),K=o.ref(null),oe=o.ref(!1),pe=o.ref(!1),ke=o.ref(null),Re=o.ref({}),ze=o.reactive({caption:"",field:""}),Qe=o.ref([]),ak=[{name:"AND",value:"and"},{name:"OR",value:"or"}],$o=o.ref(0),rk=({caption:F,field:ie},Le)=>{if(ze.caption=F,ze.field=ie,Qe.value=Le,(Le==null?void 0:Le.length)>1){oe.value=!0;const wt=K.value.getBoundingClientRect().left,on=window.pageYOffset+K.value.getBoundingClientRect().top+K.value.getBoundingClientRect().height;In.boxTop=`${on}px`,In.boxLeft=`${wt}px`}},ck=()=>{S.filterStore=[],se({rows:[],isMakeIndex:!1})},qo=async F=>{var on,ki;F&&pe.value&&($o.value=0);const ie=(on=K.value)==null?void 0:on.getElementsByClassName("filtering-items__item"),Le=[];let wt=0;if(ie){for(let Et=0;Et<ie.length;Et++){const ot=ie[Et];ot.classList.remove("non-display");const ks=(ki=K.value.getBoundingClientRect())==null?void 0:ki.width,{width:ws}=ot.getBoundingClientRect();wt+=ws+10,ks-150<=wt&&!ot.classList.contains("filtering-items__item--count")?($o.value++,Le.push(ot),Re.value={...Re.value,[ot.dataset.field]:Ze(M.filteringItemsByColumn[ot.dataset.field])}):delete Re.value[ot.dataset.field]}ie.forEach(Et=>{const ot=Le.includes(Et);Et.classList.toggle("non-display",ot)})}},dk=async(F,ie)=>{ie!=null&&ie.length?(M.filteringItemsByColumn[F]=ie,pe.value=!0):(delete Re.value[F],delete M.filteringItemsByColumn[F]),await o.nextTick(),qo(!0),M.isShowFilterSetting=!1,S.filterStore=[],se({rows:[],isMakeIndex:!1}),he(S.filterStore)};let el=null;const hk=()=>{el&&clearTimeout(el),el=setTimeout(()=>{pe.value=!pe.value,qo(pe.value)},150)},uk=()=>{M.filteringColumn=null,M.filteringItemsByColumn={},Re.value={},S.filterStore=[],se({rows:[],isMakeIndex:!1})},fk=o.computed(()=>{var F;return{width:`${T.value}px`,top:`${((F=K.value)==null?void 0:F.getBoundingClientRect().height)||0}px`}}),mk=F=>{const ie=M.filteringItemsByColumn[F];return ie==null?void 0:ie[ie.length-1]},pk=()=>{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 o.onBeforeMount(()=>pk()),{idColIndex:o.computed(()=>{var F;return(F=S.orderedColumns.find(ie=>ie.field==="id"))==null?void 0:F.index}),summaryScroll:B,showHeader:p,stripeStyle:m,borderStyle:b,highlightIdx:C,useSummary:g,useGridSetting:f,toolbarRef:u,stores:S,emptyText:y,...o.toRefs(k),...o.toRefs(S),...o.toRefs(M),...o.toRefs(V),...o.toRefs(x),...o.toRefs(R),...o.toRefs(v),...o.toRefs(L),...o.toRefs(I),...o.toRefs(E),...o.toRefs(G),...o.toRefs(Z),isRenderer:a,getComponentName:r,getConvertValue:c,getColumnIndex:d,setPixelUnit:h,updateVScroll:Y,updateHScroll:O,onScroll:_,calculatedColumn:fe,onResize:ge,onShow:le,onColumnResize:ce,onRowClick:gs,onRowDblClick:bs,onCheck:A,onCheckAll:Q,onExpanded:U,onSort:ee,setSort:te,setStore:se,setContextMenu:Vt,onContextMenu:jo,onSearch:j,setGridSetting:Cs,onApplyColumn:Ve,onColumnContextMenu:Qo,filteringItemsWidth:T,isShowColumnFilteringItems:pe,operatorItems:ak,selectedFilteringItems:Qe,selectedFilteringColumn:ze,filteringItemsRef:K,isShowFilteringItemsBox:oe,filteringItemsStyle:fk,hiddenFilteringItemsCount:$o,...o.toRefs(In),hiddenFilteringItemsRef:ke,hiddenFilteringItemsByColumn:Re,removeAllFiltering:uk,onExpandFilteringItems:hk,setColumnFilteringItems:qo,onChangeOperator:ck,onApplyFilter:dk,onClickFilteringItem:rk,getFilteringItemByField:mk,onDragStart:ys,onDragOver:xs,onDrop:Ss,ROW_DISABLED_INDEX:6}}},aS={key:0,class:"filtering-items filtering-items--used"},rS={key:1,ref:"filteringItemsRef",class:"filtering-items"},cS=["data-field","onClick"],dS={class:"filtering-items__item--title"},hS=["title"],uS={key:1,class:"filtering-items__item--value"},fS=["onClick"],mS={class:"filtering-items__item--title"},pS=["title"],gS={key:1,class:"filtering-items__item--value"},bS={class:"column-list"},yS=["data-index"],xS=["title","onClick"],SS=["onClick"],CS=["onMousedown"],kS={ref:"table"},wS=["data-index","disabled","onClick","onContextmenu","onDblclick"],IS=["data-name","data-index","disabled"],LS={key:0},TS=["title"],MS=["disabled"],vS=["disabled"],RS={key:0},VS=["colspan"],ES={key:0},GS={class:"is-empty"},WS={ref:"resizeLine",class:"table-resize-line"};function ZS(e,t,n,i,s,l){var T;const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("ev-select"),c=o.resolveComponent("grid-option-button"),d=o.resolveComponent("toolbar"),h=o.resolveComponent("ev-checkbox"),u=o.resolveComponent("grid-sort-button"),f=o.resolveComponent("ev-context-menu"),p=o.resolveComponent("grid-summary"),g=o.resolveComponent("grid-pagination"),m=o.resolveComponent("filter-setting"),b=o.resolveComponent("column-setting"),C=o.resolveDirective("clickoutside"),y=o.resolveDirective("resize"),w=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(d,null,{toolbarWrapper:o.withCtx(()=>[o.createElementVNode("div",{class:"filtering",style:o.normalizeStyle({width:`${i.filteringItemsWidth}px`})},[e.isFiltering&&!Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",aS,[o.createVNode(a,{icon:"ev-icon-filter-list"}),t[18]||(t[18]=o.createElementVNode("span",null,"Filter",-1))])):o.createCommentVNode("",!0),e.isFiltering&&Object.keys(e.filteringItemsByColumn).length?(o.openBlock(),o.createElementBlock("div",rS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(e.filteringItemsByColumn),(k,M)=>{var Z,S,x,L;return o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[M===0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--filter",onClick:t[0]||(t[0]=o.withModifiers((...I)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...I),["stop"]))},[o.createVNode(a,{icon:"ev-icon-filter-list",class:"filtering-items-expand"}),o.createElementVNode("span",null," Filter ("+o.toDisplayString(Object.keys(e.filteringItemsByColumn).length)+") ",1),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",style:{"margin-left":"0"},onClick:o.withModifiers(i.removeAllFiltering,["stop"])},null,8,["onClick"])])):o.createCommentVNode("",!0),M===1?(o.openBlock(),o.createBlock(r,{key:1,modelValue:e.columnOperator,"onUpdate:modelValue":t[1]||(t[1]=I=>e.columnOperator=I),items:i.operatorItems,class:"filtering-items__item--operator",onChange:i.onChangeOperator},null,8,["modelValue","items","onChange"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"filtering-items__item non-display","data-field":k,onClick:o.withModifiers(I=>{var V;return i.onClickFilteringItem({caption:(V=i.getFilteringItemByField(k))==null?void 0:V.caption,field:k},e.filteringItemsByColumn[k])},["stop"])},[o.createElementVNode("span",dS,o.toDisplayString((Z=i.getFilteringItemByField(k))==null?void 0:Z.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(k))==null?void 0:S.comparison),1),e.filteringItemsByColumn[k].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(k))==null?void 0:x.value},o.toDisplayString((L=i.getFilteringItemByField(k))==null?void 0:L.value),9,hS)):(o.openBlock(),o.createElementBlock("span",uS," + "+o.toDisplayString(e.filteringItemsByColumn[k].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(k,[])},null,8,["onClick"])],8,cS)],64)}),128)),i.isShowColumnFilteringItems&&Object.keys(e.filteringItemsByColumn).length&&i.hiddenFilteringItemsCount>0?(o.openBlock(),o.createElementBlock("div",{key:0,class:"filtering-items__item filtering-items__item--count",onClick:t[2]||(t[2]=(...k)=>i.onExpandFilteringItems&&i.onExpandFilteringItems(...k))}," + "+o.toDisplayString(i.hiddenFilteringItemsCount),1)):o.createCommentVNode("",!0)],512)):o.createCommentVNode("",!0),!i.isShowColumnFilteringItems&&Object.keys(i.hiddenFilteringItemsByColumn).length?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:2,ref:"hiddenFilteringItemsRef",class:"filtering-items filtering-items__hidden-items",style:o.normalizeStyle(i.filteringItemsStyle)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Object.keys(i.hiddenFilteringItemsByColumn),(k,M)=>{var Z,S,x,L;return o.openBlock(),o.createElementBlock("div",{key:M,class:"filtering-items__item",onClick:o.withModifiers(I=>{var V;return i.onClickFilteringItem({caption:(V=i.getFilteringItemByField(k))==null?void 0:V.caption,field:k},i.hiddenFilteringItemsByColumn[k])},["stop"])},[o.createElementVNode("span",mS,o.toDisplayString((Z=i.getFilteringItemByField(k))==null?void 0:Z.caption)+" "+o.toDisplayString((S=i.getFilteringItemByField(k))==null?void 0:S.comparison),1),i.hiddenFilteringItemsByColumn[k].length<2?(o.openBlock(),o.createElementBlock("span",{key:0,class:"filtering-items__item--value",title:(x=i.getFilteringItemByField(k))==null?void 0:x.value},o.toDisplayString((L=i.getFilteringItemByField(k))==null?void 0:L.value),9,pS)):(o.openBlock(),o.createElementBlock("span",gS," + "+o.toDisplayString(i.hiddenFilteringItemsByColumn[k].length),1)),o.createVNode(a,{class:"filtering-items__item--remove",icon:"ev-icon-s-close",onClick:I=>i.onApplyFilter(k,[],!0)},null,8,["onClick"])],8,fS)}),128))],4)),[[C,()=>{i.isShowColumnFilteringItems||i.onExpandFilteringItems()}]]):o.createCommentVNode("",!0)],4),i.useGridSetting?(o.openBlock(),o.createBlock(c,{key:0,class:"grid-setting__icon",onClick:t[3]||(t[3]=k=>i.setGridSetting(k))})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",o.mergeProps({ref:"grid-wrapper"},e.$attrs,{class:"grid-wrapper",style:`width: ${e.gridWidth}; height: ${e.gridHeight};`}),[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass({table:!0,adjust:e.adjust,"ev-grid":!0,"non-header":!i.showHeader,"ev-grid--empty":!e.viewStore.length})},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass({"table-header":!0,"non-border":!!i.borderStyle})},[o.createElementVNode("ul",bS,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass({column:!0,"checkbox-all":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[e.useCheckbox.use&&e.useCheckbox.headerCheck&&e.useCheckbox.mode!=="single"?(o.openBlock(),o.createBlock(h,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[4]||(t[4]=k=>e.isHeaderChecked=k),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},null,6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(k,M)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:M},[!k.hide&&!k.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":M,class:o.normalizeClass({column:!0,render:i.isRenderer(k),"non-border":!!i.borderStyle,[k.field]:k.field}),style:o.normalizeStyle({width:`${k.width}px`,"min-width":`${i.isRenderer(k)?e.rendererMinWidth:e.minWidth}px`,"margin-right":e.orderedColumns.length-1===M&&(e.hasVerticalScrollBar||e.hasHorizontalScrollBar)?`${e.scrollWidth}px`:"0px","border-right":e.orderedColumns.length-1===M?"none":"1px solid #CFCFCF"}),draggable:!0,onDragstart:t[6]||(t[6]=(...Z)=>i.onDragStart&&i.onDragStart(...Z)),onDragover:t[7]||(t[7]=(...Z)=>i.onDragOver&&i.onDragOver(...Z)),onDrop:t[8]||(t[8]=(...Z)=>i.onDrop&&i.onDrop(...Z))},[k.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:k.caption,class:"column-name",onClick:[Z=>i.onColumnContextMenu(Z,k),t[5]||(t[5]=o.withModifiers((...Z)=>e.columnMenu.show&&e.columnMenu.show(...Z),["prevent"]))]},[o.createTextVNode(o.toDisplayString(k.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(Z=>i.onSort(k),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[k.sortable===void 0||k.sortable?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===k.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[k.sortable===void 0||k.sortable?(o.openBlock(),o.createBlock(u,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===k.field?(o.openBlock(),o.createBlock(u,{key:1,class:o.normalizeClass([{"column-sort__icon":!0,"column-sort__icon--asc":e.sortOrder==="asc","column-sort__icon--desc":e.sortOrder==="desc"}]),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?k.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,SS)],8,xS)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(Z=>i.onColumnResize(M,Z),["stop","left"])},null,40,CS)],46,yS)):o.createCommentVNode("",!0)],64))),128)),(T=e.$props.option.customContextMenu)!=null&&T.length?(o.openBlock(),o.createElementBlock("li",{key:2,class:o.normalizeClass({column:!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,i.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass({stripe:i.stripeStyle,"table-body":!0,"bottom-border":!!e.viewStore.length,"non-border":!!i.borderStyle}),onScroll:t[11]||(t[11]=(...k)=>i.onScroll&&i.onScroll(...k)),onContextmenu:t[12]||(t[12]=k=>i.onContextMenu(k))},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",kS,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(k,M)=>{var Z,S;return o.openBlock(),o.createElementBlock(o.Fragment,{key:i.idColIndex!=null?k[2][i.idColIndex]:M},[o.createElementVNode("tr",{"data-index":k[0],class:o.normalizeClass({row:!0,selected:k[3],highlight:k[0]===i.highlightIdx,"non-border":!!i.borderStyle&&i.borderStyle!=="rows"}),disabled:k[i.ROW_DISABLED_INDEX],onClick:x=>i.onRowClick(x,k),onContextmenu:x=>i.onRowClick(x,k,!0),onDblclick:x=>i.onRowDblClick(x,k)},[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass({cell:!0,"row-checkbox":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(h,{modelValue:k[1],"onUpdate:modelValue":x=>k[1]=x,class:"row-checkbox-input",disabled:k[5]||k[i.ROW_DISABLED_INDEX],onChange:x=>i.onCheck(x,k)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])],6)):o.createCommentVNode("",!0),e.useRowDetail?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({cell:!0,"row-detail-toggle":!0,"non-border":!!i.borderStyle,"row-detail-toggle--expanded":k[4]}),style:o.normalizeStyle({width:`${e.minWidth}px`,height:`${e.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:k[4],"onUpdate:modelValue":x=>k[4]=x,icon:"ev-icon-s-play",class:"row-detail-toggle-icon",onClick:o.withModifiers(x=>i.onExpanded(x,k),["stop"])},null,8,["modelValue","onUpdate:modelValue","onClick"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(x,L)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:`${i.idColIndex!=null?k[2][i.idColIndex]:M}-${L}`},[!x.hide&&!x.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":x.field,"data-index":x.index,class:o.normalizeClass({cell:!0,render:i.isRenderer(x),[x.type]:x.type,[x.align]:x.align,[x.field]:x.field,"non-border":!!i.borderStyle}),style:o.normalizeStyle({width:`${x.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${i.isRenderer(x)?e.rendererMinWidth:e.minWidth}px`,"border-right":e.orderedColumns.length-1===L?"none":"1px solid #CFCFCF"}),disabled:k[i.ROW_DISABLED_INDEX]},[e.$slots[x.field]?(o.openBlock(),o.createElementBlock("div",LS,[o.renderSlot(e.$slots,x.field,{item:{row:k,column:x},disabled:k[i.ROW_DISABLED_INDEX]},void 0,!0)])):(o.openBlock(),o.createElementBlock("div",{key:1,title:i.getConvertValue(x,k[2][x.index])},o.toDisplayString(i.getConvertValue(x,k[2][x.index])),9,TS))],14,IS)):o.createCommentVNode("",!0)],64))),128)),(Z=e.$props.option.customContextMenu)!=null&&Z.length?(o.openBlock(),o.createElementBlock("td",{key:2,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!i.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${e.rowHeight}px`,"min-width":"30px","line-height":`${e.rowHeight}px`}),disabled:k[i.ROW_DISABLED_INDEX]},[e.$slots.contextmenuIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",disabled:k[i.ROW_DISABLED_INDEX],onClick:t[9]||(t[9]=x=>i.onContextMenu(x))},[o.renderSlot(e.$slots,"contextmenuIcon",{},void 0,!0)],8,vS)):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",disabled:k[i.ROW_DISABLED_INDEX],onClick:t[10]||(t[10]=x=>i.onContextMenu(x))},null,8,["disabled"]))],14,MS)):o.createCommentVNode("",!0)],42,wS),e.useRowDetail&&((S=e.$slots)!=null&&S.rowDetail)&&k[4]?(o.openBlock(),o.createElementBlock("tr",RS,[o.createElementVNode("td",{colspan:k.length},[o.createElementVNode("div",{style:o.normalizeStyle({width:"100%",height:`${e.detailRowHeight}px`,"min-height":`${e.detailRowHeight}px`,"max-height":`${e.detailRowHeight}px`})},[o.renderSlot(e.$slots,"rowDetail",{item:{row:k}},void 0,!0)],4)],8,VS)])):o.createCommentVNode("",!0)],64)}),128)),e.viewStore.length?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",ES,[o.createElementVNode("td",GS,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(f,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(f,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(f,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",WS,null,512),[[o.vShow,e.showResizeLine]])],2)],16)),[[y,i.onResize],[w,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(p,{key:1,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:i.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(g,{key:2,modelValue:e.currentPage,"onUpdate:modelValue":t[13]||(t[13]=k=>e.currentPage=k),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"])):o.createCommentVNode("",!0),o.createVNode(m,{"is-show":e.isShowFilterSetting,"onUpdate:isShow":t[14]||(t[14]=k=>e.isShowFilterSetting=k),items:e.filteringItemsByColumn,"onUpdate:items":t[15]||(t[15]=k=>e.filteringItemsByColumn=k),column:e.filteringColumn,position:e.filterSettingPosition,onApplyFiltering:i.onApplyFilter},null,8,["is-show","items","column","position","onApplyFiltering"]),o.createVNode(b,{"is-show":e.isShowColumnSetting,"onUpdate:isShow":t[16]||(t[16]=k=>e.isShowColumnSetting=k),"is-show-menu-on-click":e.isShowMenuOnClick,"onUpdate:isShowMenuOnClick":t[17]||(t[17]=k=>e.isShowMenuOnClick=k),columns:e.updatedColumns,"hidden-column":e.hiddenColumn,position:e.columnSettingPosition,"text-info":e.columnSettingTextInfo,onApplyColumn:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const hi=de(lS,[["render",ZS],["__scopeId","data-v-22cd2bf6"]]);hi.install=e=>{e.component(hi.name,hi)};let ui=null;function XS(){return ui||(typeof document<"u"?ui=document.createElement("canvas").getContext("2d"):typeof OffscreenCanvas<"u"&&(ui=new OffscreenCanvas(1,1).getContext("2d")),ui)}const fi=new Map,NS=512,z={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),i=parseInt(t[2],16),s=parseInt(t[3],16);return`${n},${i},${s}`},getColorStringType(e){if(!e)return"";const t=e.replace(/ /g,""),n=/^#(?:[A-Fa-f0-9]{3}){1,2}$/.exec(t),i=/^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":i?l="RGB":s?l="RGBA":l="NONE",l},colorStringToRgba(e,t=1){const n=`${e}|${t}`,i=fi.get(n);if(i!==void 0)return i;const s=e.replace(/ /g,""),l=this.getColorStringType(s);let a="";switch(l){case"HEX":a=`rgba(${this.hexToRgb(s)},${t})`;break;case"RGB":a=s.replace(")",`, ${t})`).replace("rgb","rgba");break;case"RGBA":{const r=s.replace(/^.*,(.+)\)/,"$1");a=s.replace(`${r})`,`${t})`);break}default:a=`rgba(0, 0, 0, ${t})`;break}return fi.size>=NS&&fi.delete(fi.keys().next().value),fi.set(n,a),a},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},coordinateKey(e,t){return`${e}|${t}`},getLabelStyle(e){const{fontStyle:t="normal",fontWeight:n="normal",fontSize:i="12",fontFamily:s="Roboto"}=e;return`${t} normal ${n} ${i}px ${s}`},labelSignFormat(e,t=null){const n=Wh(1),i=Gh(1),s=Eh(1),l=Vh(1),a=1e3;let r;if(!yt(e))return e;const c=e<0,d=Math.abs(e),h=(u,f,p)=>{let g;return u%f===0?g=Yt(t)?`${u/f}${p}`:`${(u/f).toFixed(t)}${p}`:g=`${(u/f).toFixed(1)}${p}`,c?`-${g}`:g};if(d>=n)r=h(d,n,"P");else if(d>=i)r=h(d,i,"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=Yt(t)?d:d.toFixed(t);r=c?`-${u}`:`${u}`}return r},calcTextSize(e,t,n=0){const i=document.createElement("span"),s=`visibility:hidden; position:absolute; top:-10000px; font: ${t}; padding: 0 ${n}px`;i.setAttribute("style",s),i.style.font=t,i.textContent=e,document.body.appendChild(i);const l=i.getBoundingClientRect(),a=l.width||2,r=l.height||2;return i.remove(),{width:a,height:r}},calcTextSizeCanvas(e,t){if(!e)return{width:2,height:2};const n=XS();n.save(),n.font=t;const i=n.measureText(e),s=t.match(/(\d+(?:\.\d+)?)px/),a=(s?Number(s[1]):14)*1.2;return n.restore(),{width:Math.max(Math.ceil(i.width),2),height:Math.max(Math.ceil(a),2)}},getStringMinMax(e){const t={min:e[0],max:e[0]};return e.forEach(n=>{var i,s;((i=t==null?void 0:t.max)==null?void 0:i.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,i="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=i==="right"?a.substring(0,c):a.substring(1,a.length),r=n.measureText(a).width;return i==="right"?a+s:s+a},showLabelTip(e){const{ctx:t,width:n,height:i,x:s,y:l,arrowSize:a,borderRadius:r,text:c,backgroundColor:d,textColor:h}=e,u=s-n/2,f=s+n/2,p=l-i,g=l;t.beginPath(),t.save(),t.fillStyle=d||"#E96E2C",t.strokeStyle=d||"#E96E2C",t.shadowBlur=0,t.moveTo(u+r,p),t.quadraticCurveTo(u,p,u,p+r),t.lineTo(u,g-r),t.quadraticCurveTo(u,g,u+r,g),t.lineTo(f-r,g),t.quadraticCurveTo(f,g,f,g-r),t.lineTo(f,p+r),t.quadraticCurveTo(f,p,f-r,p),t.lineTo(s-a,p),t.lineTo(s,p-a),t.lineTo(s+a,p),t.lineTo(u+r,p),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,p+i/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(i=>{e.style[i]=t[i]})},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[,i,s,l]=e.match(t);return`rgba(${i}, ${s}, ${l}, 0.5)`}if(n.test(e)){const[,i,s,l,a]=e.match(n),r=(parseFloat(a)/2).toFixed(2);return`rgba(${i}, ${s}, ${l}, ${r})`}return e.startsWith("#")&&e.length>7?e:`${e}80`},calcBoxDistance(e,t,n){if(e.w!==null&&e.w!==void 0&&e.h!==null&&e.h!==void 0){const i=e.xp,s=e.yp,l=Math.min(i,i+e.w),a=Math.max(i,i+e.w),r=Math.min(s,s+e.h),c=Math.max(s,s+e.h),d=Math.max(0,l-t,t-a),h=Math.max(0,r-n,n-c);return d*d+h*h}return(e.xp-t)**2+(e.yp-n)**2}};function PS(e){const t=(String(e).split(".")[1]??"").length;return e.toFixed(t+1)}var BS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function DS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pr={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(BS,function(){var n=1e3,i=6e4,s=36e5,l="millisecond",a="second",r="minute",c="hour",d="day",h="week",u="month",f="quarter",p="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|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(E){var G=["th","st","nd","rd"],R=E%100;return"["+E+(G[(R-20)%10]||G[R]||G[0])+"]"}},w=function(E,G,R){var X=String(E);return!X||X.length>=G?E:""+Array(G+1-X.length).join(R)+E},T={s:w,z:function(E){var G=-E.utcOffset(),R=Math.abs(G),X=Math.floor(R/60),W=R%60;return(G<=0?"+":"-")+w(X,2,"0")+":"+w(W,2,"0")},m:function E(G,R){if(G.date()<R.date())return-E(R,G);var X=12*(R.year()-G.year())+(R.month()-G.month()),W=G.clone().add(X,u),N=R-W<0,P=G.clone().add(X+(N?-1:1),u);return+(-(X+(R-W)/(N?W-P:P-W))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:u,y:p,w:h,d,D:g,h:c,m:r,s:a,ms:l,Q:f}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},k="en",M={};M[k]=y;var Z="$isDayjsObject",S=function(E){return E instanceof V||!(!E||!E[Z])},x=function E(G,R,X){var W;if(!G)return k;if(typeof G=="string"){var N=G.toLowerCase();M[N]&&(W=N),R&&(M[N]=R,W=N);var P=G.split("-");if(!W&&P.length>1)return E(P[0])}else{var D=G.name;M[D]=G,W=D}return!X&&W&&(k=W),W||!X&&k},L=function(E,G){if(S(E))return E.clone();var R=typeof G=="object"?G:{};return R.date=E,R.args=arguments,new V(R)},I=T;I.l=x,I.i=S,I.w=function(E,G){return L(E,{locale:G.$L,utc:G.$u,x:G.$x,$offset:G.$offset})};var V=function(){function E(R){this.$L=x(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[Z]=!0}var G=E.prototype;return G.parse=function(R){this.$d=function(X){var W=X.date,N=X.utc;if(W===null)return new Date(NaN);if(I.u(W))return new Date;if(W instanceof Date)return new Date(W);if(typeof W=="string"&&!/Z$/i.test(W)){var P=W.match(b);if(P){var D=P[2]-1||0,H=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],D,P[3]||1,P[4]||0,P[5]||0,P[6]||0,H)):new Date(P[1],D,P[3]||1,P[4]||0,P[5]||0,P[6]||0,H)}}return new Date(W)}(R),this.init()},G.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},G.$utils=function(){return I},G.isValid=function(){return this.$d.toString()!==m},G.isSame=function(R,X){var W=L(R);return this.startOf(X)<=W&&W<=this.endOf(X)},G.isAfter=function(R,X){return L(R)<this.startOf(X)},G.isBefore=function(R,X){return this.endOf(X)<L(R)},G.$g=function(R,X,W){return I.u(R)?this[X]:this.set(W,R)},G.unix=function(){return Math.floor(this.valueOf()/1e3)},G.valueOf=function(){return this.$d.getTime()},G.startOf=function(R,X){var W=this,N=!!I.u(X)||X,P=I.p(R),D=function(U,ee){var $=I.w(W.$u?Date.UTC(W.$y,ee,U):new Date(W.$y,ee,U),W);return N?$:$.endOf(d)},H=function(U,ee){return I.w(W.toDate()[U].apply(W.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(ee)),W)},B=this.$W,Y=this.$M,O=this.$D,_="set"+(this.$u?"UTC":"");switch(P){case p:return N?D(1,0):D(31,11);case u:return N?D(1,Y):D(0,Y+1);case h:var A=this.$locale().weekStart||0,Q=(B<A?B+7:B)-A;return D(N?O-Q:O+(6-Q),Y);case d:case g:return H(_+"Hours",0);case c:return H(_+"Minutes",1);case r:return H(_+"Seconds",2);case a:return H(_+"Milliseconds",3);default:return this.clone()}},G.endOf=function(R){return this.startOf(R,!1)},G.$set=function(R,X){var W,N=I.p(R),P="set"+(this.$u?"UTC":""),D=(W={},W[d]=P+"Date",W[g]=P+"Date",W[u]=P+"Month",W[p]=P+"FullYear",W[c]=P+"Hours",W[r]=P+"Minutes",W[a]=P+"Seconds",W[l]=P+"Milliseconds",W)[N],H=N===d?this.$D+(X-this.$W):X;if(N===u||N===p){var B=this.clone().set(g,1);B.$d[D](H),B.init(),this.$d=B.set(g,Math.min(this.$D,B.daysInMonth())).$d}else D&&this.$d[D](H);return this.init(),this},G.set=function(R,X){return this.clone().$set(R,X)},G.get=function(R){return this[I.p(R)]()},G.add=function(R,X){var W,N=this;R=Number(R);var P=I.p(X),D=function(Y){var O=L(N);return I.w(O.date(O.date()+Math.round(Y*R)),N)};if(P===u)return this.set(u,this.$M+R);if(P===p)return this.set(p,this.$y+R);if(P===d)return D(1);if(P===h)return D(7);var H=(W={},W[r]=i,W[c]=s,W[a]=n,W)[P]||1,B=this.$d.getTime()+R*H;return I.w(B,this)},G.subtract=function(R,X){return this.add(-1*R,X)},G.format=function(R){var X=this,W=this.$locale();if(!this.isValid())return W.invalidDate||m;var N=R||"YYYY-MM-DDTHH:mm:ssZ",P=I.z(this),D=this.$H,H=this.$m,B=this.$M,Y=W.weekdays,O=W.months,_=W.meridiem,A=function(ee,$,te,J){return ee&&(ee[$]||ee(X,N))||te[$].slice(0,J)},Q=function(ee){return I.s(D%12||12,ee,"0")},U=_||function(ee,$,te){var J=ee<12?"AM":"PM";return te?J.toLowerCase():J};return N.replace(C,function(ee,$){return $||function(te){switch(te){case"YY":return String(X.$y).slice(-2);case"YYYY":return I.s(X.$y,4,"0");case"M":return B+1;case"MM":return I.s(B+1,2,"0");case"MMM":return A(W.monthsShort,B,O,3);case"MMMM":return A(O,B);case"D":return X.$D;case"DD":return I.s(X.$D,2,"0");case"d":return String(X.$W);case"dd":return A(W.weekdaysMin,X.$W,Y,2);case"ddd":return A(W.weekdaysShort,X.$W,Y,3);case"dddd":return Y[X.$W];case"H":return String(D);case"HH":return I.s(D,2,"0");case"h":return Q(1);case"hh":return Q(2);case"a":return U(D,H,!0);case"A":return U(D,H,!1);case"m":return String(H);case"mm":return I.s(H,2,"0");case"s":return String(X.$s);case"ss":return I.s(X.$s,2,"0");case"SSS":return I.s(X.$ms,3,"0");case"Z":return P}return null}(ee)||P.replace(":","")})},G.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},G.diff=function(R,X,W){var N,P=this,D=I.p(X),H=L(R),B=(H.utcOffset()-this.utcOffset())*i,Y=this-H,O=function(){return I.m(P,H)};switch(D){case p:N=O()/12;break;case u:N=O();break;case f:N=O()/3;break;case h:N=(Y-B)/6048e5;break;case d:N=(Y-B)/864e5;break;case c:N=Y/s;break;case r:N=Y/i;break;case a:N=Y/n;break;default:N=Y}return W?N:I.a(N)},G.daysInMonth=function(){return this.endOf(u).$D},G.$locale=function(){return M[this.$L]},G.locale=function(R,X){if(!R)return this.$L;var W=this.clone(),N=x(R,X,!0);return N&&(W.$L=N),W},G.clone=function(){return I.w(this.$d,this)},G.toDate=function(){return new Date(this.valueOf())},G.toJSON=function(){return this.isValid()?this.toISOString():null},G.toISOString=function(){return this.$d.toISOString()},G.toString=function(){return this.$d.toUTCString()},E}(),v=V.prototype;return L.prototype=v,[["$ms",l],["$s",a],["$m",r],["$H",c],["$W",d],["$M",u],["$y",p],["$D",g]].forEach(function(E){v[E[1]]=function(G){return this.$g(G,E[0],E[1])}}),L.extend=function(E,G){return E.$i||(E(G,V,L),E.$i=!0),L},L.locale=x,L.isDayjs=S,L.unix=function(E){return L(1e3*E)},L.en=M[k],L.Ls=M,L.p={},L})})(Pr);var YS=Pr.exports;const Ne=DS(YS),OS={createDataSet(e,t){var n;this._dataEpoch=(this._dataEpoch??0)+1,Object.keys(this.seriesInfo.charts).forEach(i=>{var l;const s=this.seriesInfo.charts[i];if(s.length)if(i==="pie")this.options.sunburst?this.createSunburstDataSet(e):this.createPieDataSet(e,s);else if(i==="scatter")s.forEach(a=>{const r=this.seriesList[a],c=e[a],d=r==null?void 0:r.passingValue;r&&c&&(r.data=this.addSeriesDSforScatter(c),r.minMax=this.getSeriesMinMax(r.data,d))});else if(i==="heatMap")s.forEach(a=>{const r=this.seriesList[a],c=r==null?void 0:r.passingValue,d=e[a];r&&d&&(r.labels=t,r.data=this.addSeriesDSForHeatMap(d),r.minMax=this.getSeriesMinMax(r.data,c),r.valueOpt=this.getSeriesValueOptForHeatMap(r))});else{const a=s[0],r=(l=this.seriesList[a])==null?void 0:l.passingValue,c=new Map;for(let d=0;d<s.length;d++){const h=s[d],u=this.seriesList[h];if(u&&u.show!==!1){const f=e==null?void 0:e[h],{passingValue:p,interpolation:g}=u,m=g==="zero"||p!=null&&p!==void 0;let b=!1,C;if(!f)C=f;else if(!m)C=f;else{C=new Array(f.length);for(let y=0;y<f.length;y++){const w=f[y];g==="zero"&&!w?C[y]=0:w===p?(b=!0,C[y]=null):C[y]=w}}if(u.hasPassingValueInData=b,C){const y=u.isExistGrp&&!u.isOverlapping;let w=null;y&&(w=c.get(u.groupIndex),w||(w={pos:[],neg:[]},c.set(u.groupIndex,w))),y&&u.stackIndex?u.data=this.addSeriesStackDS(C,t,u.stackIndex,w,u.data):u.data=this.addSeriesDS(C,t,u.isExistGrp,r,u.data),u.minMax=this.getSeriesMinMax(u.data,u.passingValue),y&&this.updateStackTops(w,u)}}}}}),(n=this.buildLabelValidMask)==null||n.call(this)},createRealTimeScatterDataSet(e){var i,s,l,a;const t=Object.keys(e),n={maxY:-1/0,minY:1/0,fromTime:0,toTime:0};for(let r=0;r<t.length;r++){const c=t[r],d=e[c],h=d==null?void 0:d.length;if(!this.isInit||this.updateSeries||!this.dataSet[c]){const v={dataGroup:[],startIndex:0,endIndex:null,length:0,fromTime:0,toTime:0};this.dataSet[c]={...v,...this.dataSet[c]}}const u=this.dataSet[c],f=u.dataGroup,p=this.options.realTimeScatter.range||300,g=u.length!==p;u.length=p;const m=u.length;let b=0;for(let v=0;v<h;v++){const E=d[v];E&&b<E.x&&(b=E.x)}b=b?Math.floor(b/1e3)*1e3:0;const C=((l=(s=(i=f.at(-1))==null?void 0:i.data)==null?void 0:s.at(-1))==null?void 0:l.x)||Date.now(),y=Math.floor(C/1e3)*1e3,w=u.toTime||y,T=b||w,k=v=>{v.data.length=0,v.dataKeys?v.dataKeys.clear():v.dataKeys=new Set,v.max=0,v.min=1/0};if(u.endIndex==null||g){u.startIndex=0,u.endIndex=m-1,f.length=m;for(let v=0;v<m;v++)f[v]=f[v]||{data:[],dataKeys:new Set,max:0,min:1/0},k(f[v]);u.toTime=T,u.fromTime=u.toTime-m*1e3}const M=(T-w)/1e3,Z=Number.isFinite(M)?Math.max(0,Math.floor(M)):0;if(u.toTime=T,u.fromTime=u.toTime-m*1e3,b&&(u.toTime-b)/1e3>m&&c==="")return;for(let v=0;v<m;v++)f[v]?f[v].data?f[v].dataKeys||(f[v].dataKeys=new Set):(f[v].data=[],f[v].dataKeys=new Set,f[v].max=0,f[v].min=1/0):f[v]={data:[],dataKeys:new Set,max:0,min:1/0};if(Z>0)if(Z>=m){for(let v=0;v<m;v++)k(f[v]);u.startIndex=0,u.endIndex=m-1}else{let v=u.startIndex,E=u.endIndex;for(let G=0;G<Z;G++)k(f[v]),v=(v+1)%m,E=(E+1)%m;u.startIndex=v,u.endIndex=E}const S=this.options.coordinateDedupe!==!1;let x=-1;for(let v=0;v<h;v++){const E=d[v];if(E){const G=Math.floor(E.x/1e3)*1e3;if(u.fromTime<=G){let R=u.endIndex-(u.toTime-G)/1e3;R<0&&(R=m+R);const X=f[R],W=z.coordinateKey(E.x,E.y);if(!(S&&X.dataKeys.has(W))){S&&X.dataKeys.add(W),X.data.push({x:E.x,y:E.y,o:E.value??E.y,color:E.color,k:S&&this.seriesInfo.charts.scatter.length>1?W:void 0}),X.max=Math.max(X.max,E.y),X.min=Math.min(X.min,E.y);const P=(u.toTime-G)/1e3;P>x&&(x=P)}}}}u.lastTick={seq:(((a=u.lastTick)==null?void 0:a.seq)??0)+1,gapCount:Z,prevToTime:w,toTime:u.toTime,length:m,startIndex:u.startIndex,endIndex:u.endIndex,maxDirtyAge:x};const L=1e3,I={maxY:-1/0,minY:1/0};for(let v=0;v<m;v++){const E=f[v];for(let G=0;G<E.data.length;G++){const R=E.data[G],X=Math.floor(R.x/L)*L;X>=u.fromTime&&X<=u.toTime&&Number.isFinite(R.y)&&(R.y>I.maxY&&(I.maxY=R.y),R.y<I.minY&&(I.minY=R.y))}}Number.isFinite(I.minY)&&(n.maxY=Math.max(n.maxY,I.maxY),n.minY=Math.min(n.minY,I.minY)),n.fromTime=u.fromTime,n.toTime=u.toTime}Number.isFinite(n.minY)||(n.minY=0,n.maxY=0),this.seriesInfo.charts.scatter.forEach(r=>{const c=this.seriesList[r];c.data=this.dataSet,c.minMax={minX:Ne(n.fromTime),minY:n.minY,maxX:Ne(n.toTime),maxY:n.maxY}})},createSunburstDataSet(e){this.pieDataSet=[];const t=this.pieDataSet,n=[];for(let i=0;i<e.length;i++){const s=e[i],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((i,s)=>s.value-i.value);n.length;){const i=n.shift(),s=i.parent,l=i.data,a=i.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(i=>{if(this.seriesList[i].show){const s=e[i][0]??0;n[0].total+=s,n[0].data.push({id:i,value:s,sa:0,ea:0})}}),n.forEach(i=>{i.data.sort((s,l)=>l.value-s.value)})},addSeriesStackDS(e,t,n=0,i=null,s){const l=this.options.horizontal,a=[],r=i==null?void 0:i.pos,c=i==null?void 0:i.neg,d=Array.isArray(s)?s:null;return e.forEach((h,u)=>{let f=(h>=0?r==null?void 0:r[u]:c==null?void 0:c[u])??0,p=h,g=t[u],m=h;if(f!=null&&g!=null){m&&typeof m=="object"&&("x"in m||"y"in m)&&(p=l?h.x:h.y,g=l?h.y:h.x);const b=(p==null?void 0:p.value)??p;n>0?b!=null?m=f+b:m=p:(f=0,m=b);const C=d&&d[a.length];a.push(this.addData(m,g,p,f,C||null))}}),a},updateStackTops(e,t){if(!t.show)return;const n=this.options.horizontal,i=t.passingValue,s=!z.isNullOrUndefined(i),l=t.data,a=e.pos,r=e.neg;for(let c=0;c<l.length;c++){const d=l[c],h=n?d.x:d.y,u=d.o,f=s&&u===i;h!=null&&!f&&(u>=0?a[c]=h:r[c]=h)}},addSeriesDS(e,t,n,i,s){const l=this.options.horizontal,a=[],r=n&&!z.isNullOrUndefined(i),c=Array.isArray(s)?s:null;for(let d=0;d<e.length;d++){let h=e[d],u=t[d];if(h&&typeof h=="object"&&(h.x||h.y)&&(h=l?h.x:h.y,u=l?e[d].y:e[d].x),u!==null){const f=r&&h===i?0:h;if(f!==null&&typeof f=="object"||h!==null&&typeof h=="object")a.push(this.addData(f,u,h));else{const p=f??null,g=h??null,m=c&&c[a.length];m&&typeof m=="object"?(m.x=l?p:u,m.y=l?u:p,m.o=g,m.b=null,m.xp=null,m.yp=null,m.w=null,m.h=null,m.dataColor=null,m.dataTextColor=null,a.push(m)):a.push(l?{x:p,y:u,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null}:{x:u,y:p,o:g,b:null,xp:null,yp:null,w:null,h:null,dataColor:null,dataTextColor:null})}}}return a},addSeriesDSforScatter(e){return e.map(t=>{const n=t.x,i={value:t.y,color:(t==null?void 0:t.color)||null};return this.addData(i,n,i)})},addSeriesDSForHeatMap(e){return e.map(({x:t,y:n,value:i,color:s=null})=>({x:t,y:n,o:i,xp:null,yp:null,w:null,h:null,dataColor:s,cId:null}))},addData(e,t,n=null,i=null,s=null){let l=null,a=null,r=null,c=null,d=null;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;const h=s||{};return this.options.horizontal?(h.x=l,h.y=t):(h.x=t,h.y=l),h.o=a,h.b=i,h.xp=null,h.yp=null,h.w=null,h.h=null,h.dataColor=r??c,h.dataTextColor=d,h},getSeriesMinMax(e,t){const n={minX:null,minY:null,maxX:null,maxY:null,maxDomain:null},i=this.options.horizontal;if(e.length){const s=!z.isNullOrUndefined(t),l={minX:e[0].x,minY:e[0].y,maxX:e[0].x,maxY:e[0].y,maxDomain:i?e[0].y:e[0].x,maxDomainIndex:0};for(let a=0;a<e.length;a++){const r=e[a],c=r.x,d=r.y,h=r.o;(!s||h!==t)&&(c<=l.minX&&(l.minX=c===null?0:c),d<=l.minY&&(l.minY=d===null?0:d),c>=l.maxX&&(l.maxX=c===null?0:c,i&&c!==null&&(l.maxDomain=d,l.maxDomainIndex=a)),d>=l.maxY&&(l.maxY=d===null?0:d,!i&&d!==null&&(l.maxDomain=c,l.maxDomainIndex=a)))}return l}return n},getVisibleWindowMaxSeries(e,t){var l;if(!Number.isFinite(e)||!Number.isFinite(t)||t<e)return null;const n=this.options.horizontal;let i=null;const s=Object.keys(this.seriesList);for(let a=0;a<s.length;a+=1){const r=this.seriesList[s[a]];if(r!=null&&r.show&&((l=r.data)!=null&&l.length)){const c=Math.max(0,e),d=Math.min(r.data.length-1,t);for(let h=c;h<=d;h+=1){const u=r.data[h],f=n?u==null?void 0:u.x:u==null?void 0:u.y;Number.isFinite(f)&&(!i||f>i.value)&&(i={sId:r.sId,value:f,index:h,domain:n?u==null?void 0:u.y:u==null?void 0:u.x})}}}return i},getSeriesValueOptForHeatMap(e){const{data:t,colorState:n,isGradient:i}=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&&!i&&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 i=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],p=f.data[e];if(p&&f.show&&f.showLegend){const g=n?p.y:p.x,m=n?p.yp:p.xp;if(g!=null){const b=n?p.o||p.x:p.o||p.y;f.stackIndex?(r+=isNaN(p.o)?0:p.o,c=!0):r+=p.y,(l===null||l<=b)&&(l=b,a=u,i=g,s=m)}}}d={label:i,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:i}=e;let s;if("seriesID"in e){const l=this.getDataByValues(n,i);if(!l||!(l!=null&&l.xp)||!(l!=null&&l.yp))return null;s=[this.getHitItemByPosition([l.xp,l.yp],t,i,!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=i==null?void 0:i.map(r=>{var h,u;const c=this.getDataByValues(a,r);if(!c)return null;const d=this.getHitItemByPosition([(c==null?void 0:c.xp)??0,(c==null?void 0:c.yp)??0],t,r,!0);return d&&!d.sId&&(d.sId=a,d.label=((u=(h=this.data)==null?void 0:h.labels)==null?void 0:u[r])??d.label,d.dataIndex=r),d})}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]},getHitItemByPosition(e,t=!1,n,i=!1,s=!1){var V;const l=Object.keys(this.seriesList),a=!!this.options.horizontal,[r,c]=e;let d=n;if(d===void 0&&!t){const v=l.find(E=>{var R;const G=this.seriesList[E];return(G==null?void 0:G.show)&&((R=G==null?void 0:G.data)==null?void 0:R.length)>0});if(v){const E=this.seriesList[v].data,G=a?e[1]:e[0];let R=1/0,X=-1;for(let W=0;W<E.length;W++){const N=s||l.some(D=>{var B,Y,O,_;const H=this.seriesList[D];return(H==null?void 0:H.show)&&((Y=(B=H.data)==null?void 0:B[W])==null?void 0:Y.o)!==null&&((_=(O=H.data)==null?void 0:O[W])==null?void 0:_.o)!==void 0}),P=E[W];if(N&&P){let D;if(a?D=P.h?P.yp+P.h/2:P.yp:D=P.w?P.xp+P.w/2:P.xp,D!=null){const H=Math.abs(G-D);H<R&&(R=H,X=W)}}}X!==-1&&(d=X)}}let h=null,u=null,f=null,p=null,g="",m=null,b=1/0,C=!1,y=null,w=null,T=null,k=null,M="",Z=null,S=1/0,x=0,L=!1;for(let v=0;v<l.length;v++){const E=l[v],G=this.seriesList[E],R=t?G.findApproximateData:G.findGraphData;if(R){const X=R.call(G,e,a,d,i),W=X.data,N=X.index;if(W)if(z.isPieType(X.type))h=X.type,u=E,g=E,f=(W.ea-W.sa)/2,p=W.o,m=W.index;else{const P=a?W.y:W.x,D=a?W.yp:W.xp;if(P!=null){const H=a?W.o||W.x:W.o||W.y;G.stackIndex!=null?(x+=isNaN(W.o)?0:W.o,L=!0):x+=W.y;const B=H!=null&&!Number.isNaN(H),Y=W.xp!==null&&W.xp!==void 0&&W.yp!==null&&W.yp!==void 0;if(B&&Y){const O=z.calcBoxDistance(W,r,c);(M===""||O<S)&&(S=O,y=G.type,w=P,T=D,k=H,M=E,Z=N)}else B&&M===""&&(y=G.type,w=P,T=D,k=H,M=E,Z=N);if(X.hit&&W.xp!==void 0&&W.yp!==void 0){const O=(W.xp-e[0])**2+(W.yp-e[1])**2;X.directHit?((!C||O<b)&&(b=O,h=G.type,u=P,f=D,p=H,g=E,m=N),C=!0):C||O<b&&(b=O,h=G.type,u=P,f=D,p=H,g=E,m=N)}}}}}if(s&&g===""&&M===""&&d!==void 0&&d>=0){const v=l.find(G=>{var X;const R=this.seriesList[G];return(R==null?void 0:R.show)&&((X=R==null?void 0:R.data)==null?void 0:X.length)>0}),E=v?(V=this.seriesList[v].data)==null?void 0:V[d]:null;E&&(w=a?E.y:E.x,Z=d)}const I=g!=="";return{type:I?h:y,label:I?u:w,pos:I?f:T,value:I?p:k,sId:I?g:M,acc:x,useStack:L,dataIndex:I?m:Z}},getLabelInfoByPosition(e,t){var m,b,C;const[n,i]=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,w)=>w.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 p,g;if(h!=null&&h.use&&((b=d==null?void 0:d.labels)!=null&&b.length)){const{type:y,range:w,interval:T=1}=h,[k,M]=w??[0,d.labels.length],Z=Math.floor((+M-+k)/T)+1,S=(f-u)/Z,L=Math.floor(((t==="yAxis"||r?i:n)-u)/S);y==="step"?p=k+L:p=(d==null?void 0:d.labels.findIndex(V=>V===+k))+L}else if((C=d==null?void 0:d.labels)!=null&&C.length){const y=(f-u)/d.labels.length,T=Math.floor(((t==="yAxis"?i:n)-u)/y);p=d.labels.length>T?T:-1}else{let y,w;n<u-a?(y=u,w=0):n>f+a?(y=f,w=this.data.labels.length-1):y=n,g=this.getHitItemByPosition([y,i],c==null?void 0:c.useApproximateValue,w,!0,!0),p=g.dataIndex??-1}return{labelIndex:p,hitInfo:g}},getCurMouseLabelVal(e,t,n){const{type:i,horizontal:s}=this.options,l=e==="xAxis",a=l?"x":"y";let r="",c=-1;const d=()=>{let u="";switch(i){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:p,interval:g,graphMin:m}=this.axesSteps[a][0],{width:b,height:C}=this.axesRange[a][0].size,y=l?this.axesX:this.axesY,w=f[y[0].units.rectStart],T=f[y[0].units.rectEnd],k=Math.abs(t[l?0:1]-w),M=(l?b:C)/2,Z=Math.abs(w-T)/p,S=Math.floor((k+M)/Z);return Z*S+M>k&&Z*S-M<k&&(u=S*g+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((i,s)=>{const l=i,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!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),r.minY!==null&&(l.y[d].min===null||r.minY!==null&&r.minY<l.y[d].min)&&(l.y[d].min=r.minY)):(r.minX!==null&&(l.x[c].min===null||r.minX!==null&&r.minX<l.x[c].min)&&(l.x[c].min=r.minX),(l.y[d].min===null||r.minY!==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,i,s,l,a,r,c,d;const h=[],u={"$ev-root":1.5*Math.PI};for(let f=0;f<e.length;f++){const p=e[f];d=!0;for(let g=0;g<p.data.length;g++)if(t=p.data[g],n=t.value,d&&(d=t.id==="dummy"),!f)a=u["$ev-root"],l=2*Math.PI*(n/p.total),r=a+l,t.sa=a,t.ea=r,u["$ev-root"]+=l;else{if(i=this.getParentInfo(f-1,t.parent),!i)break;u[t.parent]||(u[t.parent]=i.sa),a=u[t.parent],c=i.ea-i.sa,s=p.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=lb(this.pieDataSet))},getParentInfo(e,t){for(let n=e;n>=0;n--){const i=this.pieDataSet[n];for(let s=0;s<i.data.length;s++)if(i.data[s].id===t)return i.data[s]}return null},getAggregations(){const e=this.data.data,t=this.data.series,n={},i=Object.keys(t);return i==null||i.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,p)=>f+p,0),u=h/r.length||0;(!z.checkSafeInteger(c)||!z.checkSafeInteger(d)||!z.checkSafeInteger(u)||!z.checkSafeInteger(h)||!z.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}},HS={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"}},Ht=["#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"],mi={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"},zS={show:!0,highlight:{pointSize:5},xAxisIndex:0,yAxisIndex:0,category:!0,showLegend:!0,showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null,decimalPoint:null}},FS={show:!0,showLegend:!0,stroke:{show:!0,color:"#FFFFFF",lineWidth:2},showValue:{use:!1,fontSize:12,textColor:"#000000",formatter:null}},Br={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,firstLabelFontStyle: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}}},Dr={show:!1,fontSize:12,fontColor:"#FF0000",fillColor:"#FFFFFF",lineColor:"#FF0000",lineWidth:0,fontWeight:400,fontFamily:"Roboto",verticalAlign:"middle",textAlign:"center",textOverflow:"none",maxWidth:null},Fo={color:"#FF0000",lineWidth:1,label:Dr},Ao={color:"#FAE59D"},AS={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"}}},Ct={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}},KS=Object.freeze([1,2,5]),Yr=["cross","crossRot","star","line"],ne={calculateX(e,t,n,i,s=0){if(e==null||e>n||e<t)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateSubX(e,t,n,i,s=0){if(e==null)return null;const l=i/(n-t);return Math.ceil(s+l*(e-t))},calculateY(e,t,n,i,s=0){let l;if(e==null||e>n||e<t)return null;const a=i/(n-t);return s?l=s-a*(e-(t||0)):l=-(a*(e-(t||0))),Math.floor(l)},drawPoint(e,t,n,i,s){if(!(isNaN(n)||n<=0)){if(t==="rect"){const l=1/Math.SQRT2*n;e.fillRect(i-l,s-l,2*l,2*l),e.strokeRect(i-l,s-l,2*l,2*l);return}e.beginPath(),this._appendPointPath(e,t,n,i,s),Yr.includes(t)||e.fill(),e.stroke()}},_appendPointPath(e,t,n,i,s){let l,a,r,c,d,h,u,f,p;switch(t){case"triangle":l=3*n/Math.sqrt(3),c=l*Math.sqrt(3)/2,e.moveTo(i-l/2,s+c/3),e.lineTo(i+l/2,s+c/3),e.lineTo(i,s-2*c/3),e.closePath();break;case"rectRounded":h=n/Math.SQRT2,u=i-h,f=s-h,p=Math.SQRT2*n,this.roundedRect(e,u,f,p,p,n/2),e.closePath();break;case"rectRot":d=1/Math.SQRT2*n,e.moveTo(i-d,s),e.lineTo(i,s+d),e.lineTo(i+d,s),e.lineTo(i,s-d),e.closePath();break;case"cross":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;case"crossRot":a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"star":e.moveTo(i,s+n),e.lineTo(i,s-n),e.moveTo(i-n,s),e.lineTo(i+n,s),a=Math.cos(Math.PI/4)*n,r=Math.sin(Math.PI/4)*n,e.moveTo(i-a,s-r),e.lineTo(i+a,s+r),e.moveTo(i-a,s+r),e.lineTo(i+a,s-r),e.closePath();break;case"line":e.moveTo(i-n,s),e.lineTo(i+n,s),e.closePath();break;default:e.moveTo(i+n,s),e.arc(i,s,n,0,Math.PI*2);break}},drawPointBatch(e,t,n,i){if(!(isNaN(n)||n<=0||!i||!i.length)){if(t==="rect"){const s=1/Math.SQRT2*n;for(let l=0;l<i.length;l++)e.fillRect(i[l].xp-s,i[l].yp-s,2*s,2*s),e.strokeRect(i[l].xp-s,i[l].yp-s,2*s,2*s);return}e.beginPath();for(let s=0;s<i.length;s++)this._appendPointPath(e,t,n,i[s].xp,i[s].yp);Yr.includes(t)||e.fill(),e.stroke()}},roundedRect(e,t,n,i,s,l){const a=Math.PI,r=a/2;if(l){const c=Math.min(l,s/2,i/2),d=t+c,h=n+c,u=t+i-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,i,s)},createGradient(e,t,n,i,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<i.length;u++){const f=i[u][0]??0,p=i[u][1]??"rgba(255, 255, 255, 0)",g=p.includes("rgba")?z.getOpacity(p):1,m=s?l:g;h.addColorStop(f,z.colorStringToRgba(p,m))}return h}},_S=new Set(["triangle","rect","rectRounded","rectRot","cross","crossRot","star","line"]),Or=Math.PI*2;class US{constructor(t,n,i){const s=He({},n,mi);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor"].forEach(l=>{this[l]===void 0&&(this[l]=l==="pointFill"?this.color:Ht[i%Ht.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}_getValidGData(){const t=this.data,n=this._validGDataCache;if(n&&n.src===t&&n.length===t.length)return n.value;const i=t.filter(s=>!z.isNullOrUndefined(s.x));return this._validGDataCache={src:t,length:t.length,value:i},i}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastGeomData===this.data)return;const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=t,r=this.useLinearInterpolation();let c=0;const d=l.x[this.xAxisIndex],h=l.y[this.yAxisIndex];let u=i.chartWidth-(s.left+s.right);const f=i.chartHeight-(s.top+s.bottom);this.combo&&(c=u/(this.data.length||1),u-=c,this.size.comboOffset=c);const p=i.x1+s.left+c/2,g=i.y2-s.bottom,m=d.graphMin,b=d.graphMax,C=h.graphMin,y=h.graphMax,w=u/(b-m),T=f/(y-C),k=C||0,M=S=>S==null||S<m||S>b?null:Math.ceil(p+w*(S-m)),Z=S=>{const x=a&&S>y?y:S;return x==null||x<C||x>y?null:Math.floor(g?g-T*(x-k):-(T*(x-k)))};for(let S=0;S<this.data.length;S++){const x=this.data[S];let L=M(x.x),I=Z(x.y);this.isExistGrp&&r&&x.o===null&&(I=Z(x.b??0)),L!==null&&(L+=z.aliasPixel(L)),x.xp=L,x.yp=I}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastGeomData=this.data)}hasRenderableValue(){return this.data.some(t=>t.o!==null&&t.o!==void 0)}draw(t){var H,B,Y,O,_,A,Q,U,ee;if(!this.show)return;const{ctx:n,chartRect:i,labelOffset:s,axesSteps:l,selectLabel:a,selectSeries:r,legendHitInfo:c,isBrush:d,unSelectedOpacity:h,displayOverflow:u}=t;if(this.computeGeometry(t),!this.hasRenderableValue()&&!this.isExistGrp)return;const f=a==null?void 0:a.option,p=(f==null?void 0:f.use)&&(f==null?void 0:f.useSeriesOpacity),g=((H=a==null?void 0:a.selected)==null?void 0:H.dataIndex)??[];let m;if(c)m=this.extent[(c==null?void 0:c.sId)===this.sId?"highlight":"downplay"];else if((B=r==null?void 0:r.option)!=null&&B.use&&((O=(Y=r==null?void 0:r.selected)==null?void 0:Y.seriesId)!=null&&O.length)){const $=(A=(_=r==null?void 0:r.selected)==null?void 0:_.seriesId)==null?void 0:A.includes(this.sId);m=this.extent[$?"highlight":"downplay"]}else p&&g.length?m=this.extent.downplay:m=this.extent.normal;m===this.extent.downplay&&(m={...m,opacity:h});const b=$=>$!=null&&$.includes("rgba")?z.getOpacity($):m.opacity,C=this.color,y=b(C),w=this.pointFill,T=b(w),k=this.extent.downplay?this.fillOpacity*m.opacity:this.fillOpacity,M=this.lineWidth*m.lineWidth,Z=this._rgbaCache||(this._rgbaCache={}),S=($,te,J)=>{const q=Z[$];if(q!==void 0&&q.s===te&&q.o===J)return q.v;const j=z.colorStringToRgba(te,J);return Z[$]={s:te,o:J,v:j},j};n.beginPath(),n.save(),n.lineJoin="round",n.lineWidth=M,n.strokeStyle=S("stroke",C,y),this.segments&&n.setLineDash(this.segments);const x=this.useLinearInterpolation();let L=0;const I=l.x[this.xAxisIndex],V=l.y[this.yAxisIndex];let v=i.chartWidth-(s.left+s.right);const E=i.chartHeight-(s.top+s.bottom);this.combo&&(L=v/(this.data.length||1),v-=L,this.size.comboOffset=L);const G=i.x1+s.left+L/2,R=i.y2-s.bottom,X=$=>ne.calculateX($,I.graphMin,I.graphMax,v,G),W=$=>ne.calculateY(u&&$>V.graphMax?V.graphMax:$,V.graphMin,V.graphMax,E,R);let N,P=null,D=null;for(let $=0;$<this.data.length;$++){const te=this.data[$],J=te.xp,q=te.yp;x&&te.o===null||(J===null||q===null?N=void 0:(Yt(N==null?void 0:N.y)&&!this.isExistGrp||!x&&(Yt(N==null?void 0:N.y)||Yt(te.o))?(n.moveTo(J,q),P=J,D=q):(J!==P||q!==D)&&(n.lineTo(J,q),P=J,D=q),N=te))}if(n.stroke(),this.segments&&n.setLineDash([]),this.fill&&this.data.length){n.beginPath();const $=this.data.some(se=>se.o<0),te=$?W(0):i.y2-s.bottom,J=S("fill",this.fillColor||C,k);if((Q=this.fill)!=null&&Q.gradient){let se=this.data[0].yp,fe=this.data[0].y;this.data.forEach(ce=>{ce.yp&&ce.yp<=se?se=ce.yp:ce.y&&ce.y>=fe&&(fe=ce.y)});const ge=n.createLinearGradient(0,i.y2,0,se),le=m.opacity<1?J:C;ge.addColorStop(0,$?le:J),ge.addColorStop(.5,J),ge.addColorStop(1,le),n.fillStyle=ge}else n.fillStyle=J;let q=null,j=null;const ae=[],he=this.data.length;for(let se=0;se<he+1;se++){const fe=(U=this.data[se])==null?void 0:U.o;if(x&&ib(fe)||!x&&Yt(fe)){if(q!==null&&j!==null){let ge=q-1;for(let le=se-1;le>=q;le--){const ce=(ee=this.data[le])==null?void 0:ee.o;if(!Yt(ce)&&ce!==null){ge=le;break}}ae.push([q,ge]),q=null,j=null}}else x&&fe===null||(q=q===null?se:q),j=se}ae.forEach(([se,fe])=>{if(se===fe){const le=this.data[se];if(le.xp===null||le.yp===null)return;n.moveTo(le.xp-M,le.yp),n.lineTo(le.xp+M,le.yp),n.lineTo(le.xp+M,W(le.b)??te);return}let ge=!1;for(let le=se;le<=fe;le++){const ce=this.data[le];if(ce.xp!==null&&ce.yp!==null&&(ge?ce.o!==null&&n.lineTo(ce.xp,ce.yp):(n.moveTo(ce.xp,ce.yp),ge=!0)),le===fe)for(let Ie=fe;Ie>=se;Ie--){const Ve=this.data[Ie],kt=X(Ve.x);if(kt!==null&&Ve.o!==null){const Vt=W(Ve.b)??W(0);n.lineTo(kt,Vt)}}}}),n.fill()}if(!d){n.strokeStyle=S("stroke",C,y);const $=S("focus",w,1),te=S("blur",w,T);let J=!1;if(this.interpolation==="linear"){let le=0;for(let ce=0;ce<this.data.length&&!(this.data[ce].o!==null&&(le++,le>1));ce++);J=le===1}const q=g.length?new Set(g):null,j=this.pointSize,ae=this.pointStyle,he=this.data,se=he.length,fe=!_S.has(ae),ge=le=>{const ce=he[le];if(ce.xp===null||ce.yp===null||ce.o===null)return 0;let be;if(J)be=!0;else if(x)be=!1;else{const Ve=le>0?he[le-1].o:null,kt=le+1<se?he[le+1].o:null;be=Ve==null&&kt==null}const Ie=q?q.has(le):!1;return this.point||be||Ie?Ie&&!c?2:1:0};if(fe){let le=!1,ce=null;for(let be=0;be<se;be++){const Ie=ge(be);if(Ie!==0){const Ve=he[be];Ie===2?(ce===null&&(ce=[]),ce.push(Ve)):(le||(n.beginPath(),le=!0),n.moveTo(Ve.xp+j,Ve.yp),n.arc(Ve.xp,Ve.yp,j,0,Or))}}if(le&&(n.fillStyle=te,n.fill(),n.stroke()),ce!==null){n.beginPath();for(let be=0;be<ce.length;be++){const Ie=ce[be];n.moveTo(Ie.xp+j,Ie.yp),n.arc(Ie.xp,Ie.yp,j,0,Or)}n.fillStyle=$,n.fill(),n.stroke()}}else{let le=null,ce=null;for(let be=0;be<se;be++){const Ie=ge(be);if(Ie!==0){const Ve=he[be];Ie===2?(ce===null&&(ce=[]),ce.push(Ve)):(le===null&&(le=[]),le.push(Ve))}}le!==null&&(n.fillStyle=te,ne.drawPointBatch(n,ae,j,le)),ce!==null&&(n.fillStyle=$,ne.drawPointBatch(n,ae,j,ce))}}n.restore()}itemHighlight(t,n){const i=t.data,s=n,{xp:l,yp:a,o:r}=i;s.save(),l!==null&&a!==null&&r!==null&&this.pointHighlight&&(s.strokeStyle=z.colorStringToRgba(this.color,0),s.fillStyle=z.colorStringToRgba(this.color,this.highlight.maxShadowOpacity),ne.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=this.color,ne.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ne.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)),s.restore()}findGraphData(t,n,i,s){var f;const l=t[0],a=t[1],r={data:null,hit:!1,color:this.color},c=this._getValidGData(),d=this.useLinearInterpolation(),h=Math.max((this.pointSize??mi.pointSize)+mi.pointSize,mi.highlight.maxSize),u=p=>{if(!p||p.xp===void 0||p.yp===void 0)return!1;const g=l-p.xp,m=a-p.yp;return g*g+m*m<=h*h};if(c!=null&&c.length)if(typeof i=="number"&&this.show){if(r.data=c[i],r.index=i,r.data){const p=c[i];p.o!==null&&p.o!==void 0&&p.yp!==null&&p.yp!==void 0&&(Math.abs(a-p.yp)<=15&&(r.hit=!0),u(p)&&(r.hit=!0,r.directHit=!0))}}else if(typeof this.beforeFindItemIndex=="number"&&this.beforeFindItemIndex!==-1&&this.show&&s)r.data=c[this.beforeFindItemIndex],r.index=this.beforeFindItemIndex;else{let p=1/0,g=-1;const m=[];c.forEach((w,T)=>{w.xp!==null&&w.yp!==null&&w.o!==null&&m.push({...w,originalIndex:T})}),m.length===0&&c.forEach((w,T)=>{m.push({...w,originalIndex:T})});let b=0,C=m.length-1;for(;b<=C;){const w=Math.floor((b+C)/2),T=m[w],k=Math.abs(l-T.xp);if(k<p&&(p=k,g=T.originalIndex),T.xp<l){if(b=w+1,b<m.length){const M=Math.abs(l-m[b].xp);M<p&&(p=M,g=m[b].originalIndex)}}else if(T.xp>l){if(C=w-1,C>=0){const M=Math.abs(l-m[C].xp);M<p&&(p=M,g=m[C].originalIndex)}}else break}const y=m.findIndex(w=>w.originalIndex===g);if(y!==-1)for(let w=Math.max(0,y-2);w<=Math.min(m.length-1,y+2);w++){const T=m[w],k=Math.abs(l-T.xp);k<p&&(p=k,g=T.originalIndex)}if(g!==-1){let w=50;if(c.length>1){const k=[];for(let M=1;M<c.length;M++)c[M].xp!==null&&c[M-1].xp!==null&&k.push(Math.abs(c[M].xp-c[M-1].xp));k.length>0&&(w=k.reduce((M,Z)=>M+Z,0)/k.length)}const T=Math.max(w,1);if(p<=T)r.data=c[g],r.index=g;else{let k=!1,M=d?1/0:T;const Z=d?m:c;for(let S=0;S<Z.length;S++){const x=Math.abs(l-Z[S].xp);x<=M&&(k=!0,M=x,g=d?Z[S].originalIndex:S)}k&&(r.data=c[g],r.index=g)}if(r.data){const k=c[g];Math.abs(a-k.yp)<=15&&(r.hit=!0),u(k)&&(r.hit=!0,r.directHit=!0)}}}return s||(this.beforeMouseXp=l,this.beforeMouseYp=a,typeof r.index=="number"&&(this.beforeFindItemIndex=r.index)),d&&((f=r==null?void 0:r.data)==null?void 0:f.o)===null&&(r.data=null),r}findApproximateData(t){var f,p;const n=t[0],i=t[1],s={data:null,hit:!1,color:this.color},l=this.data.filter(g=>!z.isNullOrUndefined(g.x));if(!l.length)return s;const a=l.length>1?Math.abs(((f=l[1])==null?void 0:f.xp)-((p=l[0])==null?void 0:p.xp)):50,r=Math.max(a*.4,10);let c=0,d=l.length-1,h=-1,u=1/0;for(;c<=d;){const g=Math.floor((c+d)/2),m=l[g].xp;if(m-r<=n&&n<=m+r){const b=Math.max(0,g-2),C=Math.min(l.length-1,g+2);for(let y=b;y<=C;y++)if(l[y].xp!==null&&l[y].yp!==null){const w=Math.sqrt((n-l[y].xp)**2+(i-l[y].yp)**2);w<u&&(u=w,h=y)}return h!==-1&&(s.data=l[h],s.index=h,u<5&&(s.hit=!0)),s}else if(m+r<n){if(g<d&&n<l[g+1].xp){const b=Math.abs(l[g].xp-n),C=Math.abs(l[g+1].xp-n);s.data=b>C?l[g+1]:l[g],s.index=b>C?g+1:g;const y=s.data;return Math.abs(i-y.yp)<10&&(s.hit=!0),s}c=g+1}else{if(g>0&&n>l[g-1].xp){const b=Math.abs(l[g-1].xp-n),C=Math.abs(l[g].xp-n);s.data=b>C?l[g]:l[g-1],s.index=b>C?g:g-1;const y=s.data;return Math.abs(i-y.yp)<10&&(s.hit=!0),s}d=g-1}}return s}findItems({xsp:t,width:n}){const i=t+n;return this.data.filter(s=>t-1<=s.xp&&s.xp<=i+1)}}class JS{constructor(t,n,i,s=!1){const l=Mo({},mi,n);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),["color","pointFill","fillColor","overflowColor"].forEach(a=>{this[a]===void 0&&(this[a]=Ht[i%Ht.length])}),this.sId=t,this.data=[],this.type="scatter",this.realTimeScatter=s,this._rtTotalCount=0,this._colorCache=new Map}getCachedColor(t,n){const i=`${t}_${n}`;if(this._colorCache.has(i))return this._colorCache.get(i);const s=z.colorStringToRgba(t,n);if(this._colorCache.size>100){const l=this._colorCache.keys().next().value;this._colorCache.delete(l)}return this._colorCache.set(i,s),s}draw(t){this.show&&(this.computeGeometry(t),this.realTimeScatter?this.realTimeScatterDraw(t):this.defaultScatterDraw(t))}computeGeometry(t){this.show&&(this.realTimeScatter?this.computeRealTimeGeometry(t):this.computeDefaultGeometry(t))}computeDefaultGeometry(t){const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=new Set,a=s!==!1;for(let r=0;r<this.data.length;r++){const c=this.data[r],d=z.coordinateKey(c.x,c.y);let h;i?h=i.sId===this.sId:a?h=n.get(d)===this.sId&&!l.has(d):h=!0,h&&(this.calcItem(c,t),c.xp!==null&&c.yp!==null&&a&&!i&&l.add(d))}}computeRealTimeGeometry(t){var r,c,d,h,u,f;const{duple:n,legendHitInfo:i,coordinateDedupe:s}=t,l=s!==!1;let a=0;for(let p=0;p<((c=(r=this.data[this.sId])==null?void 0:r.dataGroup)==null?void 0:c.length);p++)for(let g=0;g<((h=(d=this.data[this.sId])==null?void 0:d.dataGroup[p])==null?void 0:h.data.length);g++){const m=(f=(u=this.data[this.sId])==null?void 0:u.dataGroup[p])==null?void 0:f.data[g];a++;let b;i?b=i.sId===this.sId:l?b=n.get(z.coordinateKey(m.x,m.y))===this.sId:b=!0,b&&this.calcItem(m,t)}this._rtTotalCount=a}getOpacity(t,n,i){const s=n.includes("rgba")?z.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)!==i),l?c:s}calcItem(t,n){const{chartRect:i,labelOffset:s,axesSteps:l,displayOverflow:a}=n;let r;const c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex],h=i.chartWidth-(s.left+s.right),u=i.chartHeight-(s.top+s.bottom),f=i.x1+s.left,p=i.y2-s.bottom;let g=ne.calculateX(t.x,c.graphMin,c.graphMax,h,f);const m=ne.calculateY(a&&t.y>d.graphMax?d.graphMax:t.y,d.graphMin,d.graphMax,u,p);g!==null&&(r=z.aliasPixel(g),g+=r),t.xp=g,t.yp=m}defaultScatterDraw(t){const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.y[this.yAxisIndex],c=new Set,d=a!==!1,h=d&&!l,u=h?new Map:null;for(let f=0;f<this.data.length;f++){const p=this.data[f],g=f,m=z.coordinateKey(p.x,p.y);let b;if(l?b=l.sId===this.sId:d?b=s.get(m)===this.sId&&!c.has(m):b=!0,b&&p.xp!==null&&p.yp!==null){const y=p.y>r.graphMax&&this.overflowColor||p.dataColor||this.color,w=this.getOpacity(t,y,g),T=this.getCachedColor(y,w),k=p.dataColor||this.pointFill,M=this.getOpacity(t,k,g),Z=this.getCachedColor(k,M);if(h){const S=`${T} ${Z}`;let x=u.get(S);x||(x={strokeStyle:T,fillStyle:Z,points:[]},u.set(S,x)),x.points.push(p),c.add(m)}else n.strokeStyle=T,n.fillStyle=Z,ne.drawPoint(n,this.pointStyle,this.pointSize,p.xp,p.yp)}}h&&u.forEach(f=>{n.strokeStyle=f.strokeStyle,n.fillStyle=f.fillStyle,ne.drawPointBatch(n,this.pointStyle,this.pointSize,f.points)})}realTimeScatterDraw(t){var g,m,b,C,y,w;const{ctx:n,axesSteps:i,duple:s,legendHitInfo:l,coordinateDedupe:a}=t,r=i.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;const u=a!==!1,f=u&&!l,p=f?new Map:null;for(let T=0;T<((m=(g=this.data[this.sId])==null?void 0:g.dataGroup)==null?void 0:m.length);T++)for(let k=0;k<((C=(b=this.data[this.sId])==null?void 0:b.dataGroup[T])==null?void 0:C.data.length);k++){const M=(w=(y=this.data[this.sId])==null?void 0:y.dataGroup[T])==null?void 0:w.data[k];h++;let Z;if(l?Z=l.sId===this.sId:u?Z=s.get(M.k??z.coordinateKey(M.x,M.y))===this.sId:Z=!0,Z&&M.xp!==null&&M.yp!==null){const S=M.y>r.graphMax&&this.overflowColor,x=S||M.color||this.color,L=S||M.color||this.pointFill||this.color,I=this.getOpacity(t,x,k),V=this.getOpacity(t,L,k),v=this.getCachedColor(x,I),E=this.getCachedColor(L,V);if(f){const G=`${v} ${E}`;let R=p.get(G);R||(R={strokeStyle:v,fillStyle:E,points:[]},p.set(G,R)),R.points.push(M)}else n.strokeStyle=v,n.fillStyle=E,ne.drawPoint(n,c,d,M.xp,M.yp)}}f&&p.forEach(T=>{n.strokeStyle=T.strokeStyle,n.fillStyle=T.fillStyle,ne.drawPointBatch(n,c,d,T.points)}),this._rtTotalCount=h}realTimeScatterDrawStrip(t,n,i){var u;if(!this.show)return;const s=(u=this.data[this.sId])==null?void 0:u.dataGroup;if(!s)return;const{duple:l,coordinateDedupe:a}=i,r=a!==!1&&!!l,c=i.axesSteps.y[this.yAxisIndex],d=typeof this.pointStyle=="string"?this.pointStyle:this.pointStyle.value,h=typeof this.pointSize=="number"?this.pointSize:this.pointSize.value;for(let f=0;f<n.length;f++){const p=s[n[f]];if(p!=null&&p.data)for(let g=0;g<p.data.length;g++){const m=p.data[g];if(!(r&&l.get(m.k??z.coordinateKey(m.x,m.y))!==this.sId)&&(this.calcItem(m,i),m.xp!==null&&m.yp!==null)){const b=m.y>c.graphMax&&this.overflowColor,C=b||m.color||this.color,y=b||m.color||this.pointFill||this.color,w=this.getOpacity(i,C,g),T=this.getOpacity(i,y,g);t.strokeStyle=this.getCachedColor(C,w),t.fillStyle=this.getCachedColor(y,T),ne.drawPoint(t,d,h,m.xp,m.yp)}}}}refreshRtHitCoords(t){var i,s;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let l=0;l<n.length;l++){const a=(s=n[l])==null?void 0:s.data;if(a)for(let r=0;r<a.length;r++)this.calcItem(a[r],t)}}refreshRtTotalCount(){var i,s,l;let t=0;const n=(i=this.data[this.sId])==null?void 0:i.dataGroup;if(n)for(let a=0;a<n.length;a++)t+=((l=(s=n[a])==null?void 0:s.data)==null?void 0:l.length)??0;return this._rtTotalCount=t,t}findItemsInRange(t,n,i,s,l){return t.filter(a=>n-1<=a.xp&&a.xp<=s+1&&i-1<=a.yp&&a.yp<=l+1)}defaultScatterFindItems(t,n,i,s,l){return this.findItemsInRange(t,n,i,s,l)}realTimeScatterFindItems(t,n,i,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,i,s,l))}return a}findItems({xsp:t,ysp:n,width:i,height:s}){const l=this.data,a=t+i,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 i=t.data,s=n,l=i.xp,a=i.yp;if(s.save(),l!==null&&a!==null){const r=i.dataColor||this.color,c=i.dataColor||this.pointFill;s.strokeStyle=this.getCachedColor(r,0),s.fillStyle=this.getCachedColor(c,this.highlight.maxShadowOpacity),ne.drawPoint(s,this.pointStyle,this.highlight.maxShadowSize,l,a),s.fillStyle=r,ne.drawPoint(s,this.pointStyle,this.highlight.maxSize,l,a),s.fillStyle="#fff",ne.drawPoint(s,this.pointStyle,this.highlight.defaultSize,l,a)}s.restore()}findGraphData(t){var c;const n=t[0],i=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 p=d[f];if(p!=null&&p.data)for(let g=p.data.length-1;g>=0;g--){const m=p.data[g];if(m.xp!==null&&m.yp!==null){const b=m.xp,C=m.yp;if(b-l<=n&&n<=b+l&&C-l<=i&&i<=C+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<=i&&i<=u+l});return r>-1&&(s.data=a[r],s.index=r,s.hit=!0),s}}class Hr{constructor(t,n,i,s){const l=He({},n,zS);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.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}}computeGeometry(t){if(!this.show)return;const n=t.scaleVersion!=null&&t.dataEpoch!=null,i=t.showIndex??0,s=t.showSeriesCount??0;if(n&&this._lastDataEpoch===t.dataEpoch&&this._lastScaleVersion===t.scaleVersion&&this._lastShowIndex===i&&this._lastShowSeriesCount===s&&this._lastGeomData===this.data)return;const l=t.chartRect,a=t.labelOffset,r=t.axesSteps,c=t.showIndex,d=t.thickness,h=t.showSeriesCount;this.isHorizontal=t.isHorizontal;const{isHorizontal:u}=this;let f,p;const g=r.x[this.xAxisIndex],m=r.y[this.yAxisIndex];let b=this.data.length;const[C,y]=u?[m.minIndex,m.maxIndex]:[g.minIndex,g.maxIndex];ve(C)&&ve(y)&&(b=y-C+1);const w=l.chartWidth-(a.left+a.right),T=l.chartHeight-(a.top+a.bottom),k=l.x1+a.left,M=l.y2-a.bottom,Z=ne.calculateX(0,g.graphMin,g.graphMax,w),S=ne.calculateY(0,m.graphMin,m.graphMax,T),x=u?k+Z:k,L=u?M:M+S,I=u?T:w,V=I/(b||1);let v;t.cPadRatio>=1||t.cPadRatio<=0?v=2:v=Math.max(I*(t.cPadRatio/2)/b,2);let G,R,X;G=V>v*2?V-v*2:V,G=this.isExistGrp?G:G/h;const W=this.calculateBarSize(d,G);R=u?null:W,X=u?W:null;const N=u?(G-X)/2:(G-R)/2,P=this.isExistGrp?1:c+1;this.size.cat=V,this.size.bar=G,this.size.cPad=v,this.size.bPad=N,this.size.w=R,this.size.h=X,this.size.ix=P,this.chartRect=l,this.labelOffset=a,this.borderRadius=t.borderRadius,this.filteredCount=b;const D=ve(C)?C:0,H=ve(y)?y:this.data.length-1;this.visibleStartIndex=D;for(let B=D;B<=H;B++){const Y=B-D,O=this.data[B];if(O){const _=u?L-V*Y-v:x+V*Y+v;if(u?(f=x,p=Math.round(_-(G*P-(X+N)))):(f=Math.round(_+(G*P-(R+N))),p=L),u){const A=O.b?O.o:O.x,Q=t.displayOverflow&&A>g.graphMax?g.graphMax:A;R=ne.calculateX(Q,g.graphMin,g.graphMax,w,-Z),O.b&&(f=ne.calculateX(O.b,g.graphMin,g.graphMax,w,x-Z));const U=A>0?-1:1;R=A&&R!==null&&Math.abs(R)===0?U:R}else{const A=O.b?O.o:O.y,Q=t.displayOverflow&&A>m.graphMax?m.graphMax:A;X=ne.calculateY(Q,m.graphMin,m.graphMax,T,-S),O.b&&(p=ne.calculateY(O.b,m.graphMin,m.graphMax,T,L-S));const U=A>0?-1:1;X=A&&X!==null&&Math.abs(X)===0?U:X}O.xp=f,O.yp=p,O.w=R,O.h=u?-X:X,O.index=B}}n&&(this._lastDataEpoch=t.dataEpoch,this._lastScaleVersion=t.scaleVersion,this._lastShowIndex=i,this._lastShowSeriesCount=s,this._lastGeomData=this.data)}draw(t){var Y,O,_,A,Q;if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=t.chartRect,s=t.labelOffset,l=t.axesSteps,a=t.showIndex,r=t.thickness,c=t.showSeriesCount,d=t.displayOverflow;this.isHorizontal=t.isHorizontal;const{isHorizontal:h,showValue:u}=this;let f,p;const g=l.x[this.xAxisIndex],m=l.y[this.yAxisIndex],[b,C]=h?[m.minIndex,m.maxIndex]:[g.minIndex,g.maxIndex],y=ve(b)&&ve(C),w=y?b:0,T=y?C:this.data.length-1,k=T-w+1,M=i.chartWidth-(s.left+s.right),Z=i.chartHeight-(s.top+s.bottom),S=i.x1+s.left,x=i.y2-s.bottom,L=ne.calculateX(0,g.graphMin,g.graphMax,M),I=ne.calculateY(0,m.graphMin,m.graphMax,Z),V=h?S+L:S,v=h?x:x+I,E=h?Z:M,G=E/(k||1);let R;t.cPadRatio>=1||t.cPadRatio<=0?R=2:R=Math.max(E*(t.cPadRatio/2)/k,2);let W,N,P;W=G>R*2?G-R*2:G,W=this.isExistGrp?W:W/c;const D=this.calculateBarSize(r,W);N=h?null:D,P=h?D:null;const H=h?(W-P)/2:(W-N)/2,B=this.isExistGrp?1:a+1;this.size.cat=G,this.size.bar=W,this.size.cPad=R,this.size.bPad=H,this.size.w=N,this.size.h=P,this.size.ix=B,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.filteredCount=k,this.visibleStartIndex=w;for(let U=w;U<=T;U++){const ee=U-w,$=this.data[U];if($){const te=h?v-G*ee-R:V+G*ee+R;if(h?(f=V,p=Math.round(te-(W*B-(P+H)))):(f=Math.round(te+(W*B-(N+H))),p=v),h){const le=$.b?$.o:$.x,ce=d&&le>g.graphMax?g.graphMax:le;N=ne.calculateX(ce,g.graphMin,g.graphMax,M,-L),$.b&&(f=ne.calculateX($.b,g.graphMin,g.graphMax,M,V-L));const be=le>0?-1:1;N=le&&N!==null&&Math.abs(N)===0?be:N}else{const le=$.b?$.o:$.y,ce=d&&le>m.graphMax?m.graphMax:le;P=ne.calculateY(ce,m.graphMin,m.graphMax,Z,-I),$.b&&(p=ne.calculateY($.b,m.graphMin,m.graphMax,Z,v-I));const be=le>0?-1:1;P=le&&P!==null&&Math.abs(P)===0?be:P}const J=$.dataColor||this.color,q=t==null?void 0:t.legendHitInfo,j=(Y=t==null?void 0:t.selectLabel)==null?void 0:Y.option,ae=(O=t==null?void 0:t.selectItem)==null?void 0:O.option,he=((A=(_=t==null?void 0:t.selectLabel)==null?void 0:_.selected)==null?void 0:A.dataIndex)??[],{dataIndex:se,seriesID:fe}=((Q=t==null?void 0:t.selectItem)==null?void 0:Q.selected)??{};let ge=!1;if(q?ge=(q==null?void 0:q.sId)!==this.sId:j!=null&&j.use&&(j!=null&&j.useSeriesOpacity)?ge=he.length&&!he.includes(U):yt(se)&&(ae!=null&&ae.useSeriesOpacity)&&(this.isExistGrp?ge=se!==U:ge=se!==U||fe!==this.sId),typeof J!="string")n.fillStyle=ne.createGradient(n,h,{x:f,y:p,w:N,h:P},J,ge,t.unSelectedOpacity);else{const le=J.includes("rgba")?z.getOpacity(J):1,ce=ge?t.unSelectedOpacity:le;n.fillStyle=z.colorStringToRgba(J,ce)}this.drawBar({ctx:n,positions:{x:f,y:p,w:N,h:P}}),u.use&&this.drawValueLabels({context:n,data:$,positions:{x:f,y:p,h:P,w:N},isHighlight:!1,textColor:$.dataTextColor,index:U})}}}itemHighlight(t,n,i,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 p=ne.createGradient(r,this.isHorizontal,{x:c,y:d,w:h,h:u},f,!1,s);r.fillStyle=p,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:i}),r.restore()}findGraphData(t,n,i,s){if(typeof i=="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(i,c));return l[d]&&(a.data=l[d],a.index=d,a.hit=this.isPointInBar(t,l[d]),a.directHit=a.hit),a}return n?this.findGraphRangeCount(t):this.findGraphRange(t)}binarySearchBar(t,n){const[i,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=Math.min(r+c-1,a.length-1);for(;d<=h;){const u=Math.floor((d+h)/2),f=a[u];if(!f){console.warn(`[EVUI][Bar] binarySearchBar: gdata[${u}] is falsy`);break}const{xp:p,yp:g,w:m,h:b}=f,C=p+m,y=g+b;if(n?y<=s&&s<=g:p<=i&&i<=C)return l.data=f,l.index=f.index,l.hit=this.isPointInBar(t,f),l.directHit=l.hit,l;(n?!(y<s):p+4<i)?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:i,isHighlight:s,textColor:l,index:a}){const r=this.isHorizontal,{fontSize:c,textColor:d,align:h,formatter:u,decimalPoint:f}=this.showValue,{x:p,y:g,w:m,h:b}=i,C=t;C.save(),C.beginPath(),C.font=`normal normal normal ${c}px Roboto`,C.fillStyle=l||d,C.lineWidth=1,C.textBaseline="middle",C.textAlign=r&&h!=="center"?"left":"center";let y;const w=yt(this.stackIndex);w?y=n.o:y=(r?n.x:n.y)??"";let T;u&&(T=u(y,{label:r?n.y:n.x,index:a})),(!u||typeof T!="string")&&(T=z.labelSignFormat(y,f)??"");const k=y<0,M=Math.round(C.measureText(T).width),Z=c,S=r&&h!=="end"?10:4,x=k?p-S:p+S,L=k?g+S:g-S,I=p+m/2,V=s?g+b/2:g-b/2,v=r?V+c*.1:V,E=Math.abs(m),G=Math.abs(b),R=E-S,X=G-S,W=M<=E&&E>=Z;switch(h){case"start":{if(r){if(M<R&&Z<G){const N=k?x-M:x;C.fillText(T,N,v)}}else if(W&&Z+S<=G){const N=k?g+Z/2+S:g-Z/2-S;C.fillText(T,I,N)}break}case"center":{r?M<R&&Z<G&&C.fillText(T,I,v):W&&Z<X&&C.fillText(T,I,g+b/2);break}case"out":{if(w){console.warn("[EVUI][Bar Chart] In case of Stack Bar Chart, 'out' of 'showValue''s align is not supported.");return}if(r){const N=this.chartRect.x1+this.labelOffset.left,P=this.chartRect.x2-this.labelOffset.right;if(Z<this.size.bar)if(k){const D=p-S+m-M;D>N&&C.fillText(T,D,v)}else{const D=p+S+m;D+M<P&&C.fillText(T,D,v)}}else{const N=this.chartRect.y1+this.labelOffset.top,P=this.chartRect.y2-this.labelOffset.bottom;if(M<=this.size.bar)if(k){const D=g+b+S+Z/2;D+Z/2<=P&&C.fillText(T,I,D)}else{const D=g+b-S-Z/2;D-Z/2>=N&&C.fillText(T,I,D)}}break}default:case"end":{if(r){if(M<R&&Z<G){const N=k?p+m+S:p+m-M-S;C.fillText(T,N,v)}}else if(k){const N=g+b-Z/2-S;N>L&&W&&Z+S<=G&&C.fillText(T,I,N)}else W&&Z+S<=G&&C.fillText(T,I,g+b+Z/2+S);break}}C.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:i,borderRadius:s}=this,l="stackIndex"in this,a=s&&s>0,{x:r,y:c,w:d}=n,h=i?-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[i,s]=t,{xp:l,yp:a,w:r,h:c}=n,d=l+r,h=a+c;return l<=i&&i<=d&&h<=s&&s<=a}drawRoundedRect(t,n){const{chartRect:i,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(i.x1+s.left,i.y1,i.chartWidth-s.right,i.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 jS extends Hr{computeGeometry(t){if(!this.show)return;const n=t.chartRect,i=t.labelOffset,s=t.axesSteps,l=t.showIndex,a=t.isHorizontal,r=t.thickness,c=t.showSeriesCount;let d,h;const u=s.x[this.xAxisIndex],f=s.y[this.yAxisIndex],p=n.chartWidth-(i.left+i.right),g=n.chartHeight-(i.top+i.bottom),m=n.x1+i.left,b=n.y2-i.bottom,C=n.x2-i.right,w=(a?g:p)/(this.data.length||1),T=2;let k;this.isExistGrp?k=w-T*2:k=(w-T*2)/c;const Z=typeof r=="string"&&/[0-9]+px/.test(r)?Math.min(k,Number(r.replace("px",""))):typeof r=="number"&&r<=1&&r>=0?Math.ceil(k*r):k;let S=a?null:Z,x=a?null:Z,L=a?Z:null;const I=a?(k-L)/2:(k-S)/2,V=this.isExistGrp?1:l+1;this.size.cat=w,this.size.bar=k,this.size.cPad=T,this.size.bPad=I,this.size.w=S,this.size.ix=V,this.chartRect=n,this.labelOffset=i,this.borderRadius=t.borderRadius,this.data.forEach(v=>{a?(d=m,h=ne.calculateY(v.y,f.graphMin,f.graphMax,g,b)):(d=ne.calculateSubX(v.x,u.graphMin,u.graphMax,p,m),d<m?(x-=m-d,d=d+S<m?null:m):d+S>C&&(x-=x-(C-d)),d>=C&&(d=null),d!==null&&(d+=Math.ceil(k*V)-Math.round(S+I)),h=b),a?v.b?(S=ne.calculateX(v.x-v.b,u.graphMin,u.graphMax,p),d=ne.calculateX(v.b,u.graphMin,u.graphMax,p,m)):S=ne.calculateX(v.x,u.graphMin,u.graphMax,p):v.b?(L=ne.calculateY(v.y-v.b,f.graphMin,f.graphMax,g),h=ne.calculateY(v.b,f.graphMin,f.graphMax,g,b)):L=ne.calculateY(v.y,f.graphMin,f.graphMax,g),d!==null&&h!==null&&typeof(v.dataColor||this.color)!="string"&&(S=S!==x?x:S),x=S,v.xp=d,v.yp=h,v.w=S,v.h=a?-L:L})}draw(t){if(!this.show)return;this.computeGeometry(t);const n=t.ctx,i=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],p=l.y[this.yAxisIndex],g=i.chartWidth-(s.left+s.right),m=i.chartHeight-(s.top+s.bottom),b=i.x1+s.left,C=i.y2-s.bottom,y=i.x2-s.right,T=(r?m:g)/(this.data.length||1),k=2;let M;this.isExistGrp?M=T-k*2:M=(T-k*2)/d;const S=typeof c=="string"&&/[0-9]+px/.test(c)?Math.min(M,Number(c.replace("px",""))):typeof c=="number"&&c<=1&&c>=0?Math.ceil(M*c):M;let x=r?null:S,L=r?null:S,I=r?S:null;const V=r?(M-I)/2:(M-x)/2,v=this.isExistGrp?1:a+1;this.size.cat=T,this.size.bar=M,this.size.cPad=k,this.size.bPad=V,this.size.w=x,this.size.ix=v,this.chartRect=i,this.labelOffset=s,this.borderRadius=t.borderRadius,this.data.forEach((E,G)=>{if(n.beginPath(),r?(h=b,u=ne.calculateY(E.y,p.graphMin,p.graphMax,m,C)):(h=ne.calculateSubX(E.x,f.graphMin,f.graphMax,g,b),h<b?(L-=b-h,h=h+x<b?null:b):h+x>y&&(L-=L-(y-h)),h>=y&&(h=null),h!==null&&(h+=Math.ceil(M*v)-Math.round(x+V)),u=C),r?E.b?(x=ne.calculateX(E.x-E.b,f.graphMin,f.graphMax,g),h=ne.calculateX(E.b,f.graphMin,f.graphMax,g,b)):x=ne.calculateX(E.x,f.graphMin,f.graphMax,g):E.b?(I=ne.calculateY(E.y-E.b,p.graphMin,p.graphMax,m),u=ne.calculateY(E.b,p.graphMin,p.graphMax,m,C)):I=ne.calculateY(E.y,p.graphMin,p.graphMax,m),h!==null&&u!==null){const R=E.dataColor||this.color,X=R.includes("rgba")?z.getOpacity(R):1,W=this.state==="downplay"?t.unSelectedOpacity:X;typeof R!="string"?(x=x!==L?L:x,n.fillStyle=ne.createGradient(n,r,{x:h,y:u,w:x,h:I},R,this.state==="downplay",t.unSelectedOpacity)):n.fillStyle=z.colorStringToRgba(R,W),this.drawBar({ctx:n,positions:{x:h,y:u,w:x,h:I}}),this.showValue.use&&this.drawValueLabels({context:n,data:E,positions:{x:h,y:u,h:I,w:x},isHighlight:!1,index:G})}L=x})}}class QS{constructor(t,n,i){const s=Mo({},FS,n);Object.keys(s).forEach(l=>{this[l]=s[l]}),this.name===void 0&&(this.name=`series-${i}`),this.color===void 0&&(this.color=Ht[i%Ht.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,i){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")?z.getOpacity(r):1,d=this.isDownplay?i: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=z.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 i={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&&(i.type=this.type,i.data=this.data,i.hit=!0,i.color=this.color,i.index=0),i}itemHighlight(t,n){var a,r;const i=n,s=this.isSelect?this.radius+5:this.radius;i.save(),i.shadowOffsetX=0,i.shadowOffsetY=0,i.shadowBlur=4;const l=((a=t==null?void 0:t.data)==null?void 0:a.dataColor)||this.color;i.fillStyle=l,i.shadowColor=l,i.beginPath(),i.moveTo(this.centerX,this.centerY),i.arc(this.centerX,this.centerY,s,this.startAngle,this.endAngle),i.lineTo(this.centerX,this.centerY),i.fill(),(r=this.showValue)!=null&&r.use&&this.drawValueLabels(i),i.closePath(),i.restore()}drawValueLabels(t){const n=t,i=this.data.o,{fontSize:s,textColor:l,formatter:a}=this.showValue;let r;a&&(r=a({value:i,percentage:this.data.percentage})),(!a||typeof r!="string")&&(r=z.labelSignFormat(i));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 p=l.includes("rgba")?z.getOpacity(l):1,g=this.state==="downplay"?this.unSelectedOpacity:p;n.font=`normal normal normal ${s}px Roboto`,n.fillStyle=z.colorStringToRgba(l,g),n.lineWidth=1,n.textAlign="center",n.textBaseline="middle";const m=d/2+this.doughnutHoleSize,b=(this.endAngle-this.startAngle)/2+this.startAngle,C=m*Math.cos(b)+this.centerX,y=m*Math.sin(b)+this.centerY;n.fillText(r,C,y),n.restore()}}}class $S{constructor(t,n,i,s,l){const a=Mo({},AS,n);Object.keys(a).forEach(r=>{this[r]=a[r]}),this.isHorizontal=s,this.isGradient=l,this.createColorState(i),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=[],i=/[^0-9]&[^,]/g,{min:s,max:l,rangeCount:a,colorsByRange:r,error:c,stroke:d}=t,h=s.includes("#")?z.hexToRgb(s):s.replace(i,""),u=l.includes("#")?z.hexToRgb(l):l.replace(i,""),[f,p,g]=h.split(","),[m,b,C]=u.split(",");if(this.isGradient)n.push({minColor:{minR:f,minG:p,minB:g},maxColor:{maxR:m,maxG:b,maxB:C},rangeCount:a,start:0,end:100,selectedValue:null});else if(r.length)r.forEach(({color:y,label:w},T)=>{n.push({id:`color#${T}`,color:y,label:w,state:"normal",show:!0})});else{const y=Math.floor((f-m)/(a-1)),w=Math.floor((p-b)/(a-1)),T=Math.floor((g-C)/(a-1));for(let k=0;k<a;k++){const M=+f-y*k,Z=+p-w*k,S=+g-T*k;n.push({id:`color#${k}`,color:`rgb(${M},${Z},${S})`,state:"normal",show:!0})}}this.colorState=n,this.errorColor=c,this.stroke=d}getColorForGradient(t){const{minColor:n,maxColor:i}=this.colorState[0],{minR:s,minG:l,minB:a}=n,{maxR:r,maxG:c,maxB:d}=i,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:i,interval:s,decimalPoint:l}=this.valueOpt,a=this.colorState.length-1;if(n&&t<0)return a;const r=Math.floor(+(t-i).toFixed(l)/s);return r>=a?n?a-1:a:r}getItemInfo(t){const{min:n,max:i}=this.valueOpt,s={show:!1,opacity:1,dataColor:null,id:null,isHighlight:null};if(this.isGradient){const l=Je(t-n,i-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+(i-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,i,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,i),t.arcTo(n+s,i,n+s,i+l,d),t.arcTo(n+s,i+l,n,i+l,d),t.arcTo(n,i+l,n,i,d),t.arcTo(n,i,n+s,i,d),t.stroke(),t.fill()}else t.strokeRect(n,i,s,l),t.fillRect(n,i,s,l)}else{const r=z.aliasPixel(1);t.fillRect(n,i-r,s+r,l+r)}t.closePath()}}calculateXY(t,n,i,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||to(r)&&to(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"?i+this.size.w*a:i-this.size.h*(a+1))}return l}computeGeometry(t){if(!this.show)return;const{chartRect:n,labelOffset:i,selectItem:s,axesSteps:l}=t,a=n.chartWidth-(i.left+i.right),r=n.chartHeight-(i.top+i.bottom),c=n.x1+i.left,d=n.y2-i.bottom,h=l.x[this.xAxisIndex],u=l.y[this.yAxisIndex];this.size.w=a/h.oriSteps,this.size.h=r/u.oriSteps,this.currentLabelInfo={x:{steps:h.oriSteps,min:h.graphMin,max:h.graphMax},y:{steps:u.oriSteps,min:u.graphMin,max:u.graphMax}},this.data.forEach((f,p)=>{var T;let m=this.calculateXY("x",f.x,c,h),b=this.calculateXY("y",f.y,d,u),C=this.size.w,y=this.size.h;const w=f.o;if(m!==null&&b!==null&&w!==null&&w!==void 0){const{show:k,dataColor:M,id:Z}=this.getItemInfo(w);if(f.dataColor||(f.dataColor=M),f.cId=Z,k){let S=this.stroke;const x=s==null?void 0:s.option,L=(x==null?void 0:x.use)&&(x==null?void 0:x.showBorder),I=p===((T=s==null?void 0:s.selected)==null?void 0:T.dataIndex);if(L&&I&&(S={show:x==null?void 0:x.showBorder,...x==null?void 0:x.borderStyle}),S.show&&S.lineWidth>0){const{lineWidth:V}=S,v=V*2;v<Math.floor(C)&&v<Math.floor(y)&&(m+=V,b+=V,C-=v,y-=v)}m+=1,f.xp=m,f.yp=b,f.w=C,f.h=y}}})}draw(t){if(!this.show)return;this.computeGeometry(t);const{ctx:n,chartRect:i,labelOffset:s,selectLabel:l,legendHitInfo:a,selectItem:r,axesSteps:c}=t,d=i.chartWidth-(s.left+s.right),h=i.chartHeight-(s.top+s.bottom),u=i.x1+s.left,f=i.y2-s.bottom,p=c.x[this.xAxisIndex],g=c.y[this.yAxisIndex];this.size.w=d/p.oriSteps,this.size.h=h/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 m=(b,C,y)=>{var w,T;if(!a){let k;const{option:M,selected:Z}=r,{option:S,selected:x}=l,L=yt(Z==null?void 0:Z.dataIndex)&&(Z==null?void 0:Z.dataIndex)>-1,I=((w=x==null?void 0:x.label)==null?void 0:w.length)>0;return L?k=M.useSeriesOpacity?y!==(Z==null?void 0:Z.dataIndex):!1:I&&(k=S.useSeriesOpacity?!((T=x==null?void 0:x.label)!=null&&T.includes(this.getItemLabel(l,b))):!1),k?.1:C}return C};this.data.forEach((b,C)=>{var S;let w=this.calculateXY("x",b.x,u,p),T=this.calculateXY("y",b.y,f,g),k=this.size.w,M=this.size.h;const Z=b.o;if(w!==null&&T!==null&&Z!==null&&Z!==void 0){const{show:x,opacity:L,dataColor:I,id:V}=this.getItemInfo(Z);let v=L;L===1&&z.getColorStringType(b.dataColor)==="RGBA"&&(v=z.getOpacity(b.dataColor));const E=m(b,v,C);if(b.dataColor||(b.dataColor=I),b.cId=V,n.save(),x){n.fillStyle=z.colorStringToRgba(b.dataColor,E);let G=this.stroke;const R=r==null?void 0:r.option,X=(R==null?void 0:R.use)&&(R==null?void 0:R.showBorder),W=C===((S=r==null?void 0:r.selected)==null?void 0:S.dataIndex);X&&W&&(G={show:R==null?void 0:R.showBorder,...R==null?void 0:R.borderStyle});let N=!1;if(G.show&&G.lineWidth>0){const{color:P,lineWidth:D,opacity:H}=G,B=D*2;N=B<Math.floor(k)&&B<Math.floor(M),n.strokeStyle=N?z.colorStringToRgba(P,E===1?H:E):void 0,N?(n.lineWidth=D,w+=D,T+=D,k-=B,M-=B):n.lineWidth=0}w+=1,this.drawItem(n,w,T,k,M,{...G,show:N}),n.restore(),this.showValue.use&&this.drawValueLabels({context:n,data:b})}}})}drawOverlay(t){if(!this.show)return;const{overlayCtx:n,chartRect:i,labelOffset:s,axesSteps:l}=t;if(!n)return;const a=i.x1+s.left,r=i.y2-s.bottom,c=l.x[this.xAxisIndex],d=l.y[this.yAxisIndex];this.data.forEach(h=>{const u=this.calculateXY("x",h.x,a,c),f=this.calculateXY("y",h.y,r,d),p=h.o;if(u!==null&&f!==null&&p!==null&&p!==void 0){const{show:g,isHighlight:m}=this.getItemInfo(p);g&&m&&this.itemHighlight({data:h},n)}})}drawValueLabels({context:t,data:n}){const{fontSize:i,textColor:s,align:l,formatter:a,decimalPoint:r}=this.showValue,{xp:c,yp:d,w:h,h:u,o:f}=n,p=t;p.save(),p.beginPath(),p.font=`normal normal normal ${i}px Roboto`,p.fillStyle=s,p.lineWidth=1,p.textBaseline="middle",p.textAlign=l!=="center"?"left":"center";let g;a&&(g=a(f)),(!a||typeof g!="string")&&(g=z.labelSignFormat(f,r));const m=Math.round(p.measureText(g).width),b=i,C=c+h/2,y=d+u/2;if(!(m>=h||b>=u||g<0)){switch(l){case"top":{const w=C-m/2,T=y-b/2;p.fillText(g,w,T);break}case"right":{const w=c+h-m;p.fillText(g,w,y);break}case"bottom":{const w=C-m/2,T=y+b/2;p.fillText(g,w,T);break}case"left":p.fillText(g,c,y);break;default:{const w=C-m/2;p.fillText(g,w,y);break}}p.restore()}}getAdjustedBounds({xp:t,yp:n,width:i,height:s}){const a=Math.max(0,i),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:i,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:p,yep:g}=this.getAdjustedBounds({xp:r,yp:c,width:d,height:h});return u>=i&&f<=s&&p>=l&&g<=a})}itemHighlight(t,n){var m;const i=t.data,s=n,{stroke:l,shadow:a}=this.highlight,r=i.xp,c=i.yp,d=i.w,h=i.h,u=i.cId;let f;if(this.isGradient){const{min:b,max:C}=this.valueOpt,y=Je(i.o-b,C-b),{start:w,end:T}=this.colorState[0];f=w<=y&&y<=T||i.o===-1}else f=(m=this.colorState.find(({id:b})=>b===u))==null?void 0:m.show;if(r===null||c===null||!f)return;s.save();const p=z.getColorStringType(i.dataColor)==="RGBA"?t.dataColor:z.colorStringToRgba(i.dataColor,1);s.fillStyle=p,a.use&&(s.shadowOffsetX=a.offsetX,s.shadowOffsetY=a.offsetY,s.shadowBlur=a.blur,s.shadowColor=a.color);const g={color:"",lineWidth:1,opacity:1,radius:0,show:!0};if(l.use){const{color:b,width:C,radius:y}=l;g.show=!0,g.radius=y,s.lineWidth=C,g.lineWidth=C,s.strokeStyle=b||p,g.color=b||p}else g.show=!1,s.strokeStyle=p,g.color=p;this.drawItem(s,r-.5,c-.5,d+1,h+1,g),s.restore(),this.showValue.use&&this.drawValueLabels({context:s,data:i})}findGraphData(t){const n=t[0],i=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<=i&&i<=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:i,yep:s,range:l}){const a=this.labels,r=1,c={xsp:Math.min(t,n),ysp:Math.min(i,s),width:Math.ceil(Math.abs(n-t)),height:Math.ceil(Math.abs(s-i))};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:p,y2:g}=l,m=(f-u)/d,b=(g-p)/h,C={xsp:t,xep:n,ysp:i,yep:s},y=(w,T,k)=>{let M,Z,S;w==="x"?(Z=m,S=u+r):(Z=b,S=p),a[w].findIndex((L,I)=>(M=S+Z*I,M<=T&&T<=M+Z))>-1?C[k]=["xsp","ysp"].includes(k)?M:M+Z:T<S&&(C[k]=S)};y("x",Math.min(t,n),"xsp"),y("x",Math.max(t,n),"xep"),y("y",Math.min(i,s),"ysp"),y("y",Math.max(i,s),"yep"),c.xsp=Math.min(C.xsp,C.xep),c.ysp=Math.min(C.ysp,C.yep),c.width=Math.abs(C.xep-C.xsp),c.height=Math.abs(C.yep-C.ysp)}return c}getFilteredLabel(t,n,i,s){return t.length!==n?t.filter(l=>i<=l&&l<=s):t}findSelectionRange(t){const{xsp:n,ysp:i,width:s,height:l,range:a}=t;let r=null;const{x1:c,x2:d,y1:h,y2:u}=a,{x:f,y:p}=this.labels;if(f.length&&p.length){const{x:{steps:g,min:m,max:b},y:{steps:C,min:y,max:w}}=this.currentLabelInfo,T=g||f.length,k=C||p.length,M=(d-c)/T,Z=(u-h)/k,S=n+s,x=i+l,L={min:Math.floor((n-c)/M),max:Math.floor((S-c-M)/M)},I=k-1,V={min:I-Math.round((x-h-Z)/Z),max:I-Math.round((i-h)/Z)},v=this.getFilteredLabel(f,T,m,b),E=this.getFilteredLabel(p,k,y,w);r={xMin:v[L.min],xMax:v[L.max],yMin:E[V.min],yMax:E[V.max]}}return r}getItemLabel(t,n){const{option:i,selected:s}=t;let l=this.isHorizontal?n.y:n.x;return i!=null&&i.useBothAxis&&(s!=null&&s.targetAxis)&&(l=(s==null?void 0:s.targetAxis)==="yAxis"?n.y:n.x),l}}const zr={Store:OS,Series:{createSeriesSet(e,t,n,i){let s=Object.keys(e);this.options.overlapping.use&&(s=this.getOverlappingSeriesKeys(e,t,i)),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})})},reconcileSeriesSet(e,t,n,i,s){let l=Object.keys(e);this.options.overlapping.use&&(l=this.getOverlappingSeriesKeys(e,t,i));const a=s||{},r={};for(let c=0;c<l.length;c++){const d=l[c],h=e[d],u=h.type||t,f=a[d];f&&this.canReuseSeries(f,u,h,n)?(this.seriesInfo.charts[u].push(d),f.show=f._freshShow,this.resetSeriesGroupMeta(f),r[d]=f):r[d]=this.addSeries({type:u,id:d,opt:h,index:c,isHorizontal:n})}this.seriesList=r},computeReconcileKey(e,t,n){var i,s;return{type:e,isHorizontal:n,timeMode:e==="bar"&&!!t.timeMode,realTime:e==="scatter"&&!!((i=this.options.realTimeScatter)!=null&&i.use),heatMapColor:e==="heatMap"?this.options.heatMapColor:null,isGradient:e==="heatMap"&&((s=this.options.legend)==null?void 0:s.type)==="gradient"}},canReuseSeries(e,t,n,i){const s=e._reconcileKey;if(!s||e._optSnapshot===void 0)return!1;const l=this.computeReconcileKey(t,n,i);return s.type!==l.type||s.isHorizontal!==l.isHorizontal||s.timeMode!==l.timeMode||s.realTime!==l.realTime||s.heatMapColor!==l.heatMapColor||s.isGradient!==l.isGradient?!1:_e(e._optSnapshot,n)},resetSeriesGroupMeta(e){e.isExistGrp=!1,e.stackIndex=0,e.groupIndex=null,e.bsId=null,e.bsIds=[],e.isOverlapping=!1},getOverlappingSeriesKeys(e,t,n){const i=[],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);i.push({key:a,overlappingIdx:d})}else s.push({key:a})}),i.sort((a,r)=>r.overlappingIdx-a.overlappingIdx),[...i,...s].map(({key:a})=>a)},addSeries(e){var r;const{type:t,id:n,opt:i,index:s,isHorizontal:l}=e;let a=!1;if(t==="line")this.seriesInfo.charts.line.push(n),a=new US(n,i,s);else if(t==="scatter")this.seriesInfo.charts.scatter.push(n),a=new JS(n,i,s,(r=this.options.realTimeScatter)==null?void 0:r.use);else if(t==="bar")this.seriesInfo.charts.bar.push(n),i.timeMode?a=new jS(n,i,s,l):a=new Hr(n,i,s,l);else if(t==="pie")this.seriesInfo.charts.pie.push(n),a=new QS(n,i,s);else if(t==="heatMap"){this.seriesInfo.charts.heatMap.push(n);const{heatMapColor:c,legend:d}=this.options,h=d.type==="gradient";a=new $S(n,i,c,l,h)}return a&&(a._reconcileKey=this.computeReconcileKey(t,i,l),a._optSnapshot=i,a._freshShow=a.show),a},addGroupInfo(e){e.forEach((t,n)=>{let i=0;t.reduce((s,l,a)=>{const r=this.seriesList[l];return r.stackIndex=a+i,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||i--,r.show?l:s},t[0])})}}};class pi{constructor(t,n,i,s){const l=He({},n,Br);Object.keys(l).forEach(a=>{this[a]=l[a]}),this.type=t,this.ctx=i,this.units=HS[this.type],this.options=s,this.position||(this.position=t==="x"?"bottom":"left")}calculateLabelRange(t,n,i,s){let l,a,r;t==="x"?(l=n.chartWidth,r=Math.floor(s*1.2),a=[i.left,i.right]):(l=n.chartHeight,a=[i.top,i.bottom],r=s+Math.floor(l*.1));const c=l-(a[0]+a[1]),d=1,h=Math.max(Math.floor(c/r),1);return{min:d,max:h}}calculateScaleRange(t,n){var d;let i,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"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min),this.autoScaleRatio&&(i=Math.ceil(i*(this.autoScaleRatio+1))),this.startToZero&&(s=0),i===s&&(i+=1,l=!0);const r=this.getLabelFormat(s),c=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:r,maxLabel:c,size:z.calcTextSizeCanvas(c,z.getLabelStyle(this.labelStyle),(d=this.labelStyle)==null?void 0:d.padding)}}getLabelWidthHasMaxLength(t,n,i=[]){const s=z.getLabelStyle(this.labelStyle);return[...(t??[]).map(r=>this.getLabelFormat(r)),...i].reduce((r,c)=>{var h;const d=((h=z.calcTextSizeCanvas(c,s))==null?void 0:h.width)??0;return Math.max(r,d)},0)}calculateSteps(t){const{maxValue:n,minValue:i}=t;let{maxSteps:s}=t,l=this.getInterval(t),a=i,r;for(;a<n;)a+=l;const c=a,d=i,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 i=this.title;if(!(i!=null&&i.use)||isNaN(i.fontSize))return;const s=this.ctx;s.save(),s.font=z.getLabelStyle(i),s.fillStyle=i.color,s.textAlign=i.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+i.fontSize+c):(r=l.yTop-i.fontSize-c,a=l.xLeft),a>0&&r>0&&s.fillText(i.text,a,r),s.restore()}draw(t,n,i,s,l,a){var T,k,M,Z,S,x,L,I,V,v,E,G,R,X,W,N,P,D,H,B;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=i.steps,u=i.graphMin,f=i.graphMax,p=i.interval,g=d[this.units.rectStart],m=d[this.units.rectEnd],b=d[this.units.rectOffset(this.position)],C=d[this.units.rectOffsetCounter(this.position)],y=5;let w;if(this.drawAxisTitle(t,n),r.font=z.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,w=z.aliasPixel(r.lineWidth),r.beginPath(),r.strokeStyle=this.axisLineColor,this.type==="x"?(r.moveTo(g,b+w),r.lineTo(m,b+w)):(r.moveTo(b+w,g),r.lineTo(b+w,m)),r.stroke(),r.closePath()),!(h===0||u===null)){if((T=this.labelStyle)!=null&&T.show){const Y=m-g,O=Y/h,_=[],A=i.interval;let Q=null,U=null,ee=g,$=u;if(this.type==="x"&&(c!=null&&c.axesX[0].flow)&&a.length!==h+1){const J=Math.floor(u/A)*A;J!==+u&&($=J+A,ee+=Y/(f-u)*($-u))}r.strokeStyle=this.gridLineColor,r.lineWidth=1,w=z.aliasPixel(r.lineWidth);let te;for(let J=0;J<=h;J++)if(Q=Math.round(ee+O*J),Q<=m||this.type!=="x"||!(c!=null&&c.axesX[0].flow)||a.length===h+1){r.beginPath(),_[J]=$+J*p,_[J]===0&&this.zeroLineColor?r.strokeStyle=this.zeroLineColor:r.strokeStyle=this.gridLineColor,U=Q+w,te=this.getLabelFormat(Math.min(f,_[J]),{prev:_[J-1]??""});const j=((M=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:M.use)&&((S=(Z=this.options)==null?void 0:Z.selectLabel)==null?void 0:S.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((x=l==null?void 0:l.dataIndex)==null?void 0:x.length)&&!(l!=null&&l.label.map(fe=>this.getLabelFormat(Math.min(f,fe),{prev:_[J-1]??""})).includes(te));let ae;J===h&&this.lastLabelFontStyle?(r.font=z.getLabelStyle(this.lastLabelFontStyle),ae=this.lastLabelFontStyle.color):J===0&&this.firstLabelFontStyle?(r.font=z.getLabelStyle(this.firstLabelFontStyle),ae=this.firstLabelFontStyle.color):(r.font=z.getLabelStyle(this.labelStyle),ae=this.labelStyle.color);let he=1;z.getColorStringType(ae)==="RGBA"&&(he=z.getOpacity(ae)),r.fillStyle=z.colorStringToRgba(ae,j?(L=this.options)==null?void 0:L.unSelectedOpacity:he);let se;if(this.type==="x"){if(se=this.position==="top"?b-10:b+10,((I=c==null?void 0:c.brush)!=null&&I.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),Q,se),!j&&((V=c==null?void 0:c.selectItem)!=null&&V.showLabelTip)&&(s!=null&&s.label)&&!((v=this.options)!=null&&v.horizontal)){const fe=this.getLabelFormat(Math.min(f,s.label+0*p));if(fe===te){const ge=Math.round(r.measureText((E=this.labelStyle)==null?void 0:E.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(r.measureText(fe).width)+10,height:ge,x:Q,y:se+(ge-2),borderRadius:2,arrowSize:3,text:te,backgroundColor:(R=(G=c==null?void 0:c.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:R.backgroundColor,textColor:(W=(X=c==null?void 0:c.selectItem)==null?void 0:X.labelTipStyle)==null?void 0:W.textColor})}}this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(U,b),r.lineTo(U,b+y),r.stroke(),r.closePath()),(J!==0||c!=null&&c.axesX[0].flow)&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(U,b),r.lineTo(U,C),r.stroke(),r.closePath())}else se=this.position==="left"?b-10:b+10,((N=c==null?void 0:c.brush)!=null&&N.showLabel||!(c!=null&&c.brush))&&r.fillText(this.checkFixWidth(te),se,Q),J===h&&(U-=1),this.showAxisTick&&(r.beginPath(),r.strokeStyle=this.axisLineColor,r.moveTo(b+(this.axisLineWidth??1),U),r.lineTo(b-y,U),r.stroke(),r.closePath()),J!==0&&this.showGrid&&(r.beginPath(),r.strokeStyle=this.gridLineColor,r.moveTo(b,U),r.lineTo(C,U),r.stroke(),r.closePath())}}if((P=this.plotBands)!=null&&P.length||(D=this.plotLines)!=null&&D.length){const Y=t.chartWidth-(n.left+n.right),O=t.chartHeight-(n.top+n.bottom),_=w+1,A=d.x1,Q=d.x2+_,U=d.y1-_,ee=d.y2;(H=this.plotBands)==null||H.forEach($=>{const te=He({},$,Ao),{from:J,to:q,label:j}=te,ae=z.isNullOrUndefined(J)?u:Math.max(J,u),he=z.isNullOrUndefined(q)?f:Math.min(q,f);this.setPlotBandStyle(te);let se,fe;if(this.type==="x"){if(se=ne.calculateX(ae,u,f,Y,A),fe=ne.calculateX(he,u,f,Y,A),se===null||fe===null)return;this.drawXPlotBand(se,fe,A,Q,U,ee)}else{if(se=ne.calculateY(ae,u,f,O,ee),fe=ne.calculateY(he,u,f,O,ee),se===null||fe===null)return;this.drawYPlotBand(se,fe,A,Q,U,ee)}if(j.show){const ge=this.getNormalizedLabelOptions(t,j),le=this.getPlotBandLabelPosition(se,fe,ge,Q,U);this.drawPlotLabel(ge,le)}r.restore()}),(B=this.plotLines)==null||B.forEach($=>{if(typeof+$.value!="number")return;const te=He({},$,Fo),{value:J,label:q}=te;let j;if(this.type==="x"){if(j=ne.calculateX(J,u,f,Y,A),j===null)return;this.setPlotLineStyle(te),this.drawXPlotLine(j,A,Q,U,ee)}else{if(j=ne.calculateY(J,u,f,O,ee),j===null)return;this.setPlotLineStyle(te),this.drawYPlotLine(j,A,Q,U,ee)}if(q.show){const ae=this.getNormalizedLabelOptions(t,q),he=this.getPlotLineLabelPosition(j,ae,Q,U);this.drawPlotLabel(ae,he)}r.restore()})}}}setPlotLineStyle(t){const n=this.ctx,{color:i,lineWidth:s}=t;n.beginPath(),n.save(),n.lineWidth=s,n.strokeStyle=i,t.segments&&n.setLineDash(t.segments)}setPlotBandStyle(t){const n=this.ctx,{color:i}=t;n.beginPath(),n.save(),n.fillStyle=i}drawXPlotBand(t,n,i,s,l,a){const r=this.ctx,c=d=>d||d>i||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,i,s,l){const a=this.ctx;if(!t||t<n||t>i){a.closePath(),a.restore();return}let r=t;r+=z.aliasPixel(a.lineWidth),a.moveTo(r,l),a.lineTo(r,s),a.stroke(),a.restore(),a.closePath()}drawYPlotLine(t,n,i,s,l){const a=this.ctx;if(!t||t>l||t<s){a.closePath(),a.restore();return}let r=t;r+=z.aliasPixel(a.lineWidth),a.moveTo(n,r),a.lineTo(i,r),a.stroke(),a.restore(),a.closePath()}drawYPlotBand(t,n,i,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(i,t),r.lineTo(i,n),r.lineTo(s,n),r.lineTo(s,t),r.lineTo(i,t),r.fill(),r.restore(),r.closePath()}getNormalizedLabelOptions(t,n){const i=He({},n,Dr),s=this.ctx,{maxWidth:l}=i,a=i.fontSize>20?20:i.fontSize;let r=i.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&&i.textOverflow==="ellipsis"&&(r=z.truncateLabelWithEllipsis(i.text,d,s),c=s.measureText(r).width),{label:r,fontSize:a,labelWidth:c,labelBoxPadding:a/4,labelHalfWidth:c/2,labelHalfHeight:a/2,...i}}getPlotBandLabelPosition(t,n,i,s,l){const{fontSize:a,labelWidth:r,labelHalfWidth:c,labelHalfHeight:d,labelBoxPadding:h,textAlign:u,verticalAlign:f}=i;if(a<=0)return{textX:0,textY:0};let p,g;if(this.type==="x")switch(g=l-h-a,u){case"left":p=t+c+h;break;case"right":p=n-c-h;break;case"center":default:p=(n-t)/2+t;break}else switch(p=s+r+h,f){case"top":g=n+d+h;break;case"bottom":g=t-d-h;break;case"middle":default:g=(t-n)/2+n;break}return{textX:p,textY:g}}getPlotLineLabelPosition(t,n,i,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=i+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:i,textY:s}=n,{label:l,fontSize:a,fontColor:r,fillColor:c,lineColor:d,lineWidth:h,labelBoxPadding:u,labelWidth:f,labelHalfWidth:p,labelHalfHeight:g}=t;if(a<=0)return;const m=this.ctx;m.save(),m.beginPath(),m.font=z.getLabelStyle(t);let b=0,C=0,y=0,w=0;this.type==="x"?(b=s-u,C=s+a,y=i-p-u,w=i+p+u):(b=s-g-u,C=s+g+u,y=i-f,w=i+u),m.fillStyle=c,m.strokeStyle=d,m.lineWidth=h,m.moveTo(y,C),m.lineTo(y,b),m.lineTo(w,b),m.lineTo(w,C),m.lineTo(y,C),m.fill(),h>0&&m.stroke(),m.fillStyle=r,m.fillText(l,i,s),m.closePath()}checkFixWidth(t){const{fixWidth:n,fitDir:i}=this.labelStyle;return ve(n)&&n>0?z.truncateLabelWithEllipsis(t,n,this.ctx,i):t}}function qS(e){if(typeof e=="string"&&Ct[e])return{ms:Ct[e].size,unit:e,time:1};if(typeof e=="object"&&e!==null&&e.unit&&e.time>0){const t=Ct[e.unit];return t?{ms:e.time*t.size,unit:e.unit,time:e.time}:null}return typeof e=="number"&&e>0&&Number.isFinite(e)?{ms:e,unit:null,time:null}:null}function eC(e,t){if(!t.unit)return Ne(e.valueOf()+t.ms);const n=t.time||1;switch(t.unit){case"month":return e.add(n,"month");case"quarter":return e.add(n*3,"month");case"year":return e.add(n,"year");case"week":return e.add(n*7,"day");default:return Ne(e.valueOf()+t.ms)}}function tC(e,t){return t.unit?eC(Ne(e),t).valueOf():e+t.ms}function nC(e,t){if(!t.unit)return Math.ceil(e/t.ms)*t.ms;const n=t.time||1,i=Ne(e);if(["millisecond","second","minute","hour"].includes(t.unit)){const s=i.startOf("day").valueOf(),l=Ct[t.unit].size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="day"){const s=i.startOf("year").valueOf(),l=Ct.day.size*n,a=e-s;return s+Math.ceil(a/l)*l}if(t.unit==="week"){let s=i.startOf("year");const l=s.day();s=s.subtract((l+6)%7,"day");const a=s.valueOf(),r=Ct.week.size*n,c=e-a;return a+Math.ceil(c/r)*r}if(t.unit==="month"){const s=i.startOf("year"),l=i.startOf("month"),a=i.month(),r=l.valueOf()>=e?a:a+1,c=Math.ceil(r/n)*n;return s.add(c,"month").valueOf()}if(t.unit==="quarter"){const s=i.startOf("year"),l=Math.floor(i.month()/3),r=i.month(l*3).startOf("month").valueOf()>=e?l:l+1,c=Math.ceil(r/n)*n;return s.add(c*3,"month").valueOf()}if(t.unit==="year"){const s=i.startOf("year"),l=2e3,a=s.valueOf()>=e?i.year()-l:i.year()+1-l,r=Math.ceil(a/n)*n;return Ne(`${l+r}-01-01`).startOf("day").valueOf()}return e}function iC(e,t,n){const i=[];let s=nC(e,n);const l=1e4;for(;s<=t&&i.length<l;)i.push(s),s=tC(s,n);return i}function Fr(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)?e:null;const t=Ne(e).valueOf();return Number.isFinite(t)?t:null}class sC extends pi{normalizeTimeValue(t){return Fr(t)}calculateScaleRange(t,n){const i=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(i)||typeof i=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null))return{min:null,max:null,minLabel:"",maxLabel:"",size:z.calcTextSizeCanvas("",z.getLabelStyle(this.labelStyle))};let l=i;Array.isArray(i)&&i.length===2?l=[this.normalizeTimeValue(i[0]),this.normalizeTimeValue(i[1])]:typeof i=="function"&&(l=(...h)=>{const[u,f]=i(...h);return[this.normalizeTimeValue(u),this.normalizeTimeValue(f)]});const a=this.range,r=n!=null&&n.use?{...n,range:l}:n,c={...t,min:this.normalizeTimeValue(t==null?void 0:t.min),max:this.normalizeTimeValue(t==null?void 0:t.max)};let d;try{n!=null&&n.use||(this.range=l),d=super.calculateScaleRange(c,r)}finally{this.range=a}return{...d,min:this.normalizeTimeValue(d.min),max:this.normalizeTimeValue(d.max)}}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return Ne(t).format(this.timeFormat)}getInterval(t){const n=this.normalizeTimeValue(t.maxValue),i=this.normalizeTimeValue(t.minValue),s=t.maxSteps;if(this.interval){let l;if(typeof this.interval=="string"?l=Ct[this.interval].size:typeof this.interval=="object"?l=this.interval.time*Ct[this.interval.unit].size:typeof this.interval=="number"&&(l=this.interval),l>0&&Number.isFinite(l))return l}return Math.ceil((n-i)/s)}calculateSteps(t){const n=this.normalizeTimeValue(t.minValue),i=this.normalizeTimeValue(t.maxValue),s=Math.max(1,t.maxSteps??1);if(n==null||i==null)return{steps:0,interval:0,baseInterval:0,graphMin:null,graphMax:null,ticks:[]};const l=+n,a=+i;if(l>=a)return{steps:0,interval:0,baseInterval:0,graphMin:l,graphMax:a,ticks:[]};const r=qS(this.interval);let c;r?c=r:c={ms:Math.max(1,Math.ceil((a-l)/Math.max(1,s))),unit:null,time:null};const d=Math.ceil((a-l)/c.ms);let h=!this.fixedSteps&&d>s?Math.max(1,Math.floor(d/s)):1,u,f;const p=h+1e4;for(;h<=p;){const g=c.unit?{ms:c.ms*h,unit:c.unit,time:(c.time||1)*h}:{ms:c.ms*h,unit:null,time:null};if(f=g.ms,u=iC(l,a,g),u.length<=s||this.fixedSteps)break;h++}return{steps:Math.max(0,u.length-1),interval:f,baseInterval:c.ms,graphMin:l,graphMax:a,ticks:u}}draw(t,n,i,s,l){var y,w,T,k,M,Z,S,x,L,I,V,v,E,G,R,X,W,N,P,D;const a=this.ctx,r=this.options,c={x1:t.x1+n.left,x2:t.x2-n.right,y1:t.y1+n.top,y2:t.y2-n.bottom},d=i.graphMin,h=i.graphMax,u=i.ticks,f=c[this.units.rectStart],p=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],m=c[this.units.rectOffsetCounter(this.position)],b=5;let C=0;if(this.drawAxisTitle(t,n),a.font=z.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?(a.textAlign="center",a.textBaseline=this.position==="top"?"bottom":"top"):(a.textAlign=this.position==="left"?"right":"left",a.textBaseline="middle"),this.showAxis&&(a.lineWidth=this.axisLineWidth,C=z.aliasPixel(a.lineWidth),a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+C),a.lineTo(p,g+C)):(a.moveTo(g+C,f),a.lineTo(g+C,p)),a.stroke(),a.closePath()),!(!(u!=null&&u.length)||d===null)){if((y=this.labelStyle)!=null&&y.show){const H=c.x2-c.x1,B=c.y2-c.y1;a.strokeStyle=this.gridLineColor,a.lineWidth=1,C=z.aliasPixel(a.lineWidth);let Y;for(let O=0;O<u.length;O++){const _=u[O];let A;if(this.type==="x"?A=ne.calculateX(_,d,h,H,c.x1):A=ne.calculateY(_,d,h,B,c.y2),A===null)continue;_===0&&this.zeroLineColor?a.strokeStyle=this.zeroLineColor:a.strokeStyle=this.gridLineColor;const U=A+C;Y=this.getLabelFormat(_,{prev:u[O-1]??""});const ee=((T=(w=this.options)==null?void 0:w.selectLabel)==null?void 0:T.use)&&((M=(k=this.options)==null?void 0:k.selectLabel)==null?void 0:M.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((Z=l==null?void 0:l.dataIndex)==null?void 0:Z.length)&&!(l!=null&&l.label.map(q=>this.getLabelFormat(q,{prev:u[O-1]??""})).includes(Y));let $;O===u.length-1&&this.lastLabelFontStyle?(a.font=z.getLabelStyle(this.lastLabelFontStyle),$=this.lastLabelFontStyle.color):O===0&&this.firstLabelFontStyle?(a.font=z.getLabelStyle(this.firstLabelFontStyle),$=this.firstLabelFontStyle.color):(a.font=z.getLabelStyle(this.labelStyle),$=this.labelStyle.color);let te=1;z.getColorStringType($)==="RGBA"&&(te=z.getOpacity($)),a.fillStyle=z.colorStringToRgba($,ee?(S=this.options)==null?void 0:S.unSelectedOpacity:te);let J;if(this.type==="x"){if(J=this.position==="top"?g-10:g+10,((x=r==null?void 0:r.brush)!=null&&x.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),A,J),!ee&&((L=r==null?void 0:r.selectItem)!=null&&L.showLabelTip)&&(s!=null&&s.label)&&!((I=this.options)!=null&&I.horizontal)){const q=this.getLabelFormat(s.label);if(q===Y){const j=Math.round(a.measureText((V=this.labelStyle)==null?void 0:V.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(q).width)+10,height:j,x:A,y:J+(j-2),borderRadius:2,arrowSize:3,text:Y,backgroundColor:(E=(v=r==null?void 0:r.selectItem)==null?void 0:v.labelTipStyle)==null?void 0:E.backgroundColor,textColor:(R=(G=r==null?void 0:r.selectItem)==null?void 0:G.labelTipStyle)==null?void 0:R.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(U,g),a.lineTo(U,g+b),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(U,g),a.lineTo(U,m),a.stroke(),a.closePath())}else{J=this.position==="left"?g-10:g+10,((X=r==null?void 0:r.brush)!=null&&X.showLabel||!(r!=null&&r.brush))&&a.fillText(this.checkFixWidth(Y),J,A);let q=U;O===u.length-1&&(q-=1),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),q),a.lineTo(g-b,q),a.stroke(),a.closePath()),this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,q),a.lineTo(m,q),a.stroke(),a.closePath())}}}if((W=this.plotBands)!=null&&W.length||(N=this.plotLines)!=null&&N.length){const H=t.chartWidth-(n.left+n.right),B=t.chartHeight-(n.top+n.bottom),Y=C+1,O=c.x1,_=c.x2+Y,A=c.y1-Y,Q=c.y2;(P=this.plotBands)==null||P.forEach(U=>{const ee=He({},U,Ao),{from:$,to:te,label:J}=ee,q=z.isNullOrUndefined($)?d:Math.max($,d),j=z.isNullOrUndefined(te)?h:Math.min(te,h);this.setPlotBandStyle(ee);let ae,he;if(this.type==="x"){if(ae=ne.calculateX(q,d,h,H,O),he=ne.calculateX(j,d,h,H,O),ae===null||he===null)return;this.drawXPlotBand(ae,he,O,_,A,Q)}else{if(ae=ne.calculateY(q,d,h,B,Q),he=ne.calculateY(j,d,h,B,Q),ae===null||he===null)return;this.drawYPlotBand(ae,he,O,_,A,Q)}if(J.show){const se=this.getNormalizedLabelOptions(t,J),fe=this.getPlotBandLabelPosition(ae,he,se,_,A);this.drawPlotLabel(se,fe)}a.restore()}),(D=this.plotLines)==null||D.forEach(U=>{if(!Number.isFinite(+U.value))return;const ee=He({},U,Fo),{value:$,label:te}=ee;let J;if(this.type==="x"){if(J=ne.calculateX($,d,h,H,O),J===null)return;this.setPlotLineStyle(ee),this.drawXPlotLine(J,O,_,A,Q)}else{if(J=ne.calculateY($,d,h,B,Q),J===null)return;this.setPlotLineStyle(ee),this.drawYPlotLine(J,O,_,A,Q)}if(te.show){const q=this.getNormalizedLabelOptions(t,te),j=this.getPlotLineLabelPosition(J,q,_,A);this.drawPlotLabel(q,j)}a.restore()})}}}}class oC extends pi{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 i=this.adjustedDecimalPoint??this.decimalPoint;return z.labelSignFormat(t,i)}getInterval(t){if(this.interval)return this.interval;let n=0;const i=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(i),r=Math.abs(s)/a,c=Math.abs(i)/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(i)/(h||1))}else n=(i-s)/l;return this.decimalPoint?n:Math.ceil(n)}getExactInterval(t,n){if(!Number.isFinite(t)||t<=0)return{interval:1,steps:1};const i=Math.max(1,n);let s=null,l=0,a=1/0;for(let r=i;r>=1;r--){const c=t/r;let d=1;for(let h=0;h<=12;h++,d*=10){const u=c*d;if(Math.abs(u-Math.round(u))<1e-6){h<a&&c<t&&(a=h,s=Math.round(u)/d,l=r);break}}if(a===0)break}return l>0?{interval:s,steps:l}:{interval:parseFloat((t/i).toFixed(12)),steps:i}}getStepsWithNiceScale({max:t,min:n,maxSteps:i}){const s=t-n;if(!Number.isFinite(s)||s<=0)return{max:n+1,min:n,interval:1,steps:1};const l=s/i,a=Math.floor(Math.log10(l)),r=Math.ceil(Math.log10(s));let c=t,d=n,h=0,u=0,f=1/0;for(let p=a;p<=r;p++){const g=10**p;for(const m of KS){const b=m*g;if(b>=l){const C=b*1e-10,y=Math.floor((n+C)/b)*b,w=Math.ceil((t-y-C)/b),T=y+b*w;if(w<=i&&T>=t-C){const k=n-y+(T-t);k<f&&(c=T,d=y,h=b,u=w,f=k)}}}}if(!(h>0)||u<=0){const p=Math.max(1,i),g=s/p||1;return{max:t,min:n,interval:g,steps:p}}return{max:c,min:d,interval:h,steps:u}}getDecimalPointFromInterval(t){if(!Number.isFinite(t)||t===0)return 0;const n=Math.abs(t),i=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<=i;c+=1)if(a(n,c))return c;return i}getLegacyOneMaxScale(t){return this.decimalPoint?t>2?{interval:.2,steps:5}:{interval:.5,steps:2}:{interval:1,steps:1}}calculateSteps(t){const{minValue:n,maxValue:i}=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 w=this.getDecimalPointFromInterval(y);w!=null&&!Number.isNaN(w)?this.adjustedDecimalPoint=w:typeof this.getAutoDecimalPointFromInterval=="function"?this.adjustedDecimalPoint=this.getAutoDecimalPointFromInterval(y):this.adjustedDecimalPoint=0}else this.adjustedDecimalPoint=this.decimalPoint},p=(y,w)=>Math.max(1,Math.round(y/w+u)),g=({min:y,max:w,interval:T})=>{let k=0,M=0;return y>=0?(k=+y,M=Math.ceil(w/T)*T):w>=0?(k=Math.floor(y/T)*T,M=Math.ceil(w/T)*T):(M=+w,k=Math.floor(y/T)*T),{graphMin:k,graphMax:M}};if(l&&c){const y=d,w=h,T=r,M=(w-y)/T;if(Math.abs(M-Math.round(M))<u&&M<=s||this.fixedSteps){const S=Math.round(M);return f(T),{steps:S,interval:T,graphMin:y,graphMax:w}}}if(l){const y=d,w=h,T=w-y,{interval:k,steps:M}=this.getExactInterval(T,s);return f(k),{steps:M,interval:k,graphMin:y,graphMax:w}}if(c){let y=r,w=0,T=0,k=0,M=0;for({graphMin:w,graphMax:T}=g({min:n,max:i,interval:y}),k=T-w,M=p(k,y);M>s;)y+=r,{graphMin:w,graphMax:T}=g({min:n,max:i,interval:y}),k=T-w,M=p(k,y);return f(y),{steps:M,interval:y,graphMin:w,graphMax:T}}const m=this.startToZero&&n>=0?0:n,b=this.startToZero&&i<=0?0:i;if(m===0&&b===1){const y=this.getLegacyOneMaxScale(s);return f(y.interval),{steps:y.steps,interval:y.interval,graphMin:m,graphMax:b}}const C=this.getStepsWithNiceScale({min:m,max:b,maxSteps:s});return f(C.interval),{steps:C.steps,interval:C.interval,graphMin:C.min,graphMax:C.max}}calculateScaleRange(t,n){var u;let i,s,l=!1;const a=n!=null&&n.use?n==null?void 0:n.range:this.range;if(!(Array.isArray(a)||typeof a=="function")&&((t==null?void 0:t.min)==null||(t==null?void 0:t.max)==null)){const f=this.getLabelFormat(0),p=this.getLabelFormat(1,{isMaxValueSameAsMin:!0});return{min:0,max:1,minLabel:f,maxLabel:p,size:z.calcTextSizeCanvas(p,z.getLabelStyle(this.labelStyle))}}Array.isArray(a)&&(a==null?void 0:a.length)===2?this.options.type==="heatMap"?(i=a[1]>+t.max?+t.max:a[1],s=a[0]<+t.min?+t.min:a[0]):(i=a[1],s=a[0]):typeof a=="function"?[s,i]=a(t.min,t.max):(i=t.max,s=t.min);const c=Array.isArray(this.range)&&this.range.length===2;if(this.autoScaleRatio&&!c){const f=i,p=i*(this.autoScaleRatio+1);if(i=this.decimalPoint?p:Math.ceil(p),i>0&&s<0){const g=f-i;s+=g}else if(i<0&&s<0){const g=s*(this.autoScaleRatio+1);s=this.decimalPoint?g:Math.ceil(g)}}this.startToZero&&!c&&(s>0&&(s=0),i<0&&(i=0)),i===s&&(i+=1,l=!0);const d=this.getLabelFormat(s),h=this.getLabelFormat(i,{isMaxValueSameAsMin:l});return{min:s,max:i,minLabel:d,maxLabel:h,size:z.calcTextSizeCanvas(h,z.getLabelStyle(this.labelStyle),(u=this.labelStyle)==null?void 0:u.padding)}}}class lC extends pi{calculateScaleRange(t){let n,i,s=!1;Array.isArray(this.range)&&this.range.length===2?(n=this.range[1],i=this.range[0]):typeof range=="function"?[i,n]=this.range(t.min,t.max):(n=t.max,i=t.min);const l=z.calculateMagnitude(n-i);n=Math.ceil(n/10**l)*10**l,this.startToZero&&(i=0),n===i&&(n+=1,s=!0);const a=this.getLabelFormat(i),r=this.getLabelFormat(n,{isMaxValueSameAsMin:s});return{min:i,max:n,minLabel:a,maxLabel:r,size:z.calcTextSizeCanvas(r,z.getLabelStyle(this.labelStyle))}}calculateSteps(t,n){const i=t.maxValue,s=t.minValue,l=t.maxSteps,a=z.calculateMagnitude(i-s);let r=this.getInterval(t),c;const d=i,h=s,u=d-h;for(c=Math.round(u/r),i===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 i=this.formatter(t,n);if(typeof i=="string")return i}return z.labelSignFormat(t,this.decimalPoint)}getInterval(t){const n=t.maxValue,i=t.minValue;return 10**z.calculateMagnitude(n-i)}}const Ko=new WeakMap;class aC extends pi{constructor(t,n,i,s,l){super(t,n,i,l),this.labels=s}getMaxWidth(t,n){var s;const i=(s=this.labelStyle)==null?void 0:s.maxWidth;if(i==null)return n;if(typeof i=="string"){const l=i.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 i}getStepMinMax(t,n){return this.labelStyle.alignToGridLine?t:n!=null&&n.use?(Ko.has(this.labels)||Ko.set(this.labels,z.getStringMinMax(this.labels)),Ko.get(this.labels)):z.getStringMinMax(this.labels)}calculateScaleRange(t,n,i){const s=this.getStepMinMax(t,n);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,p]=h;ve(f)&&ve(p)&&(r=f<r?r:f,c=p>c?c:p,l=this.labels[c],a=this.labels[r],d=c-r+1)}else if(typeof h=="function"){const[f,p]=h(a,l);r=f<r?r:f,c=p>c?c:p,l=this.labels[c],a=this.labels[r],d=c-r+1}const u=this.getMaxWidth(i,i.chartWidth/(d+2));return{min:a,max:l,minIndex:r,maxIndex:c,minLabel:this.getLabelFormat(a,u),maxLabel:this.getLabelFormat(l,u),size:z.calcTextSizeCanvas(this.getLabelFormat(l,u),z.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:i,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:i,minIndex:s,maxIndex:l}}draw(t,n,i,s,l){var y,w,T,k,M,Z,S,x,L,I,V;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=i.steps,h=i.indexInterval,u=i.minIndex,f=c[this.units.rectStart],p=c[this.units.rectEnd],g=c[this.units.rectOffset(this.position)],m=c[this.units.rectOffsetCounter(this.position)],b=this.getMaxWidth(t,t.chartWidth/(d+2)),C=5;if(this.drawAxisTitle(t,n),(y=this.labelStyle)!=null&&y.show){a.font=z.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 v=z.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(f,g+v),a.lineTo(p,g+v)):(a.moveTo(g+v,f),a.lineTo(g+v,p)),a.stroke(),d===0)return;const E=(p-f)/d,G=this.labelStyle.alignToGridLine;let R=null,X=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let W,N,P;for(P=0;P<d;P+=h){const D=u+P,H=this.labels[D];R=Math.round(f+E*P),X=R+v,W=this.getLabelFormat(H,b);const{selectLabel:B,selectItem:Y,horizontal:O}=this.options;let _;l!=null&&l.targetAxis?_=(l==null?void 0:l.targetAxis)==="yAxis"?"y":"x":_=O?"y":"x";const A=(B==null?void 0:B.use)&&(B==null?void 0:B.useLabelOpacity)&&_===this.type&&((w=l==null?void 0:l.dataIndex)==null?void 0:w.length)&&!((T=l==null?void 0:l.dataIndex)!=null&&T.includes(D));let Q;P===d-1&&this.lastLabelFontStyle?(a.font=z.getLabelStyle(this.lastLabelFontStyle),Q=this.lastLabelFontStyle.color):P===0&&this.firstLabelFontStyle?(a.font=z.getLabelStyle(this.firstLabelFontStyle),Q=this.firstLabelFontStyle.color):(a.font=z.getLabelStyle(this.labelStyle),Q=this.labelStyle.color);let U=1;if(z.getColorStringType(Q)==="RGBA"&&(U=z.getOpacity(Q)),a.fillStyle=z.colorStringToRgba(Q,A?(k=this.options)==null?void 0:k.unSelectedOpacity:U),this.type==="x"){N=this.position==="top"?g-10:g+10;const ee=G?R:R+E/2;if(a.fillText(this.checkFixWidth(W),ee,N),!A&&(Y!=null&&Y.showLabelTip)&&(s!=null&&s.label)&&!O){const $=s.label;if($===W){const te=Math.round(a.measureText((M=this.labelStyle)==null?void 0:M.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText($).width)+10,height:te,x:R+E/2,y:N+(te-2),borderRadius:2,arrowSize:3,text:W,backgroundColor:(Z=Y==null?void 0:Y.labelTipStyle)==null?void 0:Z.backgroundColor,textColor:(S=Y==null?void 0:Y.labelTipStyle)==null?void 0:S.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(R+E/2,g),a.lineTo(R+E/2,g+C),a.stroke(),a.closePath()),P>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(X,g),a.lineTo(X,m),a.stroke(),a.closePath())}else{N=this.position==="left"?g-10:g+10;const ee=G?R:R+E/2;a.fillText(this.checkFixWidth(W),N,ee),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(g+(this.axisLineWidth??1),ee),a.lineTo(g-C,ee),a.stroke(),a.closePath()),P>0&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(g,X),a.lineTo(m,X),a.stroke(),a.closePath())}a.stroke()}if(this.showLastLabel){const D=u+d-1;if(u+Math.floor((d-1)/h)*h!==D){const B=Math.round(f+E*(d-1)),Y=G?B:B+E/2,O=this.getLabelFormat(r[D],b);a.font=this.lastLabelFontStyle?z.getLabelStyle(this.lastLabelFontStyle):z.getLabelStyle(this.labelStyle),a.fillStyle=this.lastLabelFontStyle?this.lastLabelFontStyle.color:this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(O),Y,N):a.fillText(this.checkFixWidth(O),N,Y),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),Y),a.lineTo(g-C,Y)),a.stroke(),a.closePath())}}if(G&&!this.showLastLabel){const D=y0(+r[1],+r[0]),H=Oo(+r[r.length-1],D);if(isNaN(H))return;R=Math.round(f+E*this.labels.length),X=R+v;const B=this.getLabelFormat(`${H}`,b),Y=R+E/2;a.font=z.getLabelStyle(this.labelStyle),a.fillStyle=this.labelStyle.color,this.type==="x"?a.fillText(this.checkFixWidth(B),R,N):a.fillText(this.checkFixWidth(B),N,R),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(Y,g),a.lineTo(Y,g+C)):(a.moveTo(g+(this.axisLineWidth??1),X),a.lineTo(g-C,X)),a.stroke(),a.closePath())}a.closePath()}if((x=this.plotBands)!=null&&x.length||(L=this.plotLines)!=null&&L.length){const v=z.aliasPixel(a.lineWidth)+1,E=c.x1+v,G=c.x2,R=c.y1+v,X=c.y2,W=(p-f)/(this.labelStyle.show?r.length:1);(I=this.plotBands)==null||I.forEach(N=>{if(!N.from&&!N.to)return;const P=He({},N,Ao),{from:D=0,to:H=r.length,label:B}=P,Y=Math.round(f+W*D),O=Math.round(f+W*H);if(this.setPlotBandStyle(P),this.type==="x"?this.drawXPlotBand(Y,O,E,G,R,X):this.drawYPlotBand(Y,O,E,G,R,X),B.show){const _=this.getNormalizedLabelOptions(t,B),A=this.getPlotBandLabelPosition(Y,O,_,G,R);this.drawPlotLabel(_,A)}a.restore()}),(V=this.plotLines)==null||V.forEach(N=>{if(!N.value)return;const P=He({},N,Fo),{value:D,label:H}=P,B=Math.round(f+W*D)+W/2;if(this.setPlotLineStyle(P),this.type==="x"?this.drawXPlotLine(B,E,G,R,X):this.drawYPlotLine(B,E,G,R,X),H.show){const Y=this.getNormalizedLabelOptions(t,H),O=this.getPlotLineLabelPosition(B,Y,G,R);this.drawPlotLabel(Y,O)}a.restore()})}}getLabelFormat(t,n,i={}){if(this.formatter){const s=this.formatter(t,i);if(typeof s=="string")return s}return this.labelStyle.fitWidth?this.fittingString(t,n):t}fittingString(t,n){const i=this.ctx;i.save(),i.font=z.getLabelStyle(this.labelStyle);const s=this.labelStyle.fitDir;return z.truncateLabelWithEllipsis(t,n,i,s)}getLabelWidthHasMaxLength(t,n,i=[]){const s=z.getLabelStyle(this.labelStyle),l=(t==null?void 0:t.length)??0,a=this.getMaxWidth(n,(n==null?void 0:n.chartWidth)/(l+2));return[...(t??[]).map(d=>this.getLabelFormat(d,a)),...i].reduce((d,h)=>{var f;const u=((f=z.calcTextSizeCanvas(h,s))==null?void 0:f.width)??0;return Math.max(d,u)},0)}}class rC extends pi{constructor(t,n,i,s,l){super(t,n,i),this.labels=s,this.options=l}getLabelFormat(t,n={}){if(this.formatter){const i=this.formatter(t,n);if(typeof i=="string")return i}return Ne(t).format(this.timeFormat)}calculateScaleRange(t,n,i){const s=super.calculateScaleRange(t,n,i),l=this.labels;if(!(l!=null&&l.length))return{...s,minIndex:0,maxIndex:-1};let a=0,r=l.length-1;const{min:c,max:d}=s;if(Number.isFinite(c)&&Number.isFinite(d)){const h=l.findIndex(f=>f>=c);let u=-1;for(let f=l.length-1;f>=0;f-=1)if(l[f]<=d){u=f;break}h===-1||u===-1||u<h?(a=0,r=-1):(a=h,r=u)}else{const h=n!=null&&n.use?n==null?void 0:n.range:this.range;h!=null&&console.warn("[EVUI][TimeCategoryScale] axis range가 유효한 min/max 숫자로 해석되지 않아 전체 라벨 범위로 폴백합니다. range 설정을 확인하세요:",h)}return{...s,minIndex:a,maxIndex:r}}getInterval(t){const n=t.maxValue,i=t.minValue,s=t.maxSteps;if(this.interval){if(typeof this.interval=="string")return Ct[this.interval].size;if(typeof this.interval=="object")return this.interval.time*Ct[this.interval.unit].size;if(typeof this.interval=="number")return this.interval}return Math.ceil((n-i)/s)}calculateSteps(t){const{maxValue:n,minValue:i,maxSteps:s,minIndex:l,maxIndex:a}=t,r=this.getInterval(t);let c=r,d=i,h;for(;d<n;)d+=c;const u=d>n?n:d,f=i,p=u-f;h=Math.round(p/c)+1;const g=h;for(n===1&&(c=.2,h=5);h>s;)c*=2,h=Math.round(p/c),c=Math.ceil(p/h);return u-f>h*c&&(c=Math.ceil((u-f)/h)),{steps:h,oriSteps:g,interval:c,rawInterval:r,graphMin:f,graphMax:u,minIndex:l,maxIndex:a}}draw(t,n,i,s,l){var E,G,R,X,W,N,P,D,H,B,Y,O,_,A,Q,U;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=i.steps,h=i.graphMin,u=i.graphMax,f=i.rawInterval,p=i.oriSteps;let g=c[this.units.rectStart];const m=c[this.units.rectEnd],b=c[this.units.rectOffset(this.position)],C=c[this.units.rectOffsetCounter(this.position)],y=5;this.drawAxisTitle(t,n),a.font=z.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 w=z.aliasPixel(a.lineWidth);if(a.beginPath(),a.strokeStyle=this.axisLineColor,this.type==="x"?(a.moveTo(g,b+w),a.lineTo(m,b+w)):(a.moveTo(b+w,g),a.lineTo(b+w,m)),a.stroke(),a.closePath(),d===0||h===null)return;const T=this.labelStyle.alignToGridLine,k=(m-g)/(p||1);this.categoryMode&&!T&&(g+=Math.ceil(k/2)-2);const M=[];let Z=null,S=null;a.beginPath(),a.strokeStyle=this.gridLineColor;let x,L,I;const V=d<=2?Math.max(1,p-1):Math.round(p/d),v=V===p?p:p-1;for(I=0;I<=v;I+=V){M[I]=Ne(h).valueOf()+I*f,Z=Math.round(g+k*I),S=Z+w;let ee;for(let q=0;q<M.length;q++)M[q]!==void 0&&q!==I&&(ee=M[q]);x=this.getLabelFormat(Math.min(u,M[I]),{prev:ee});const $=((G=(E=this.options)==null?void 0:E.selectLabel)==null?void 0:G.use)&&((X=(R=this.options)==null?void 0:R.selectLabel)==null?void 0:X.useLabelOpacity)&&this.options.horizontal===(this.type==="y")&&((W=l==null?void 0:l.dataIndex)==null?void 0:W.length)&&!(l!=null&&l.label.map(q=>this.getLabelFormat(Math.min(u,q),{prev:ee})).includes(x)),te=this.labelStyle.color;let J=1;if(z.getColorStringType(te)==="RGBA"&&(J=z.getOpacity(te)),a.fillStyle=z.colorStringToRgba(te,$?(N=this.options)==null?void 0:N.unSelectedOpacity:J),this.type==="x"){if(L=this.position==="top"?b-10:b+10,a.fillText(this.checkFixWidth(x),Z,L),!$&&((D=(P=this.options)==null?void 0:P.selectItem)!=null&&D.showLabelTip)&&(s!=null&&s.label)&&!((H=this.options)!=null&&H.horizontal)){const q=this.getLabelFormat(Math.min(u,s.label+0*f));if(q===x){const j=Math.round(a.measureText((B=this.labelStyle)==null?void 0:B.fontSize).width);z.showLabelTip({ctx:this.ctx,width:Math.round(a.measureText(q).width)+10,height:j,x:Z,y:L+(j-2),borderRadius:2,arrowSize:3,text:x,backgroundColor:(_=(O=(Y=this.options)==null?void 0:Y.selectItem)==null?void 0:O.labelTipStyle)==null?void 0:_.backgroundColor,textColor:(U=(Q=(A=this.options)==null?void 0:A.selectItem)==null?void 0:Q.labelTipStyle)==null?void 0:U.textColor})}}this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(S,b),a.lineTo(S,b+y),a.stroke(),a.closePath()),I<p&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(S,b),a.lineTo(S,C),a.stroke(),a.closePath())}else L=this.position==="left"?b-10:b+10,a.fillText(this.checkFixWidth(x),L,Z),this.showAxisTick&&(a.beginPath(),a.strokeStyle=this.axisLineColor,a.moveTo(b+(this.axisLineWidth??1),S),a.lineTo(b-y,S),a.stroke(),a.closePath()),I<p&&this.showGrid&&(a.beginPath(),a.strokeStyle=this.gridLineColor,a.moveTo(b,S),a.lineTo(C,S),a.stroke(),a.closePath());a.stroke()}if(this.categoryMode&&T&&I*V===p){const ee=Ne(r[1]).diff(Ne(r[0])),$=this.getLabelFormat(Ne(M[p-1]+ee));Z=Math.round(g+k*p),S=Z+w,this.type==="x"?(a.fillText(this.checkFixWidth($),Z,L),this.showGrid&&(a.moveTo(S,b),a.lineTo(S,C))):(a.fillText(this.checkFixWidth($),L,Z),this.showGrid&&(a.moveTo(b,S),a.lineTo(C,S))),a.stroke()}a.closePath()}}const cC={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`}},dC={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 i;const e=(i=this.options.legend)==null?void 0:i.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,z.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,i=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/i),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,i=Math.max(t-this.visibleRowCount*this.legendItemHeight-n,0);this.legendTopSpacer.style.height=`${n}px`,this.legendBottomSpacer.style.height=`${i}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(i=>{i==null||i.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:i}=t,{min:s,max:l,interval:a,existError:r,decimalPoint:c}=i,d=n.length,h=r?d-2:d-1;for(let u=0;u<d;u++){const{id:f,color:p,label:g=""}=n[u],m=s+a*u;let b=m+a;u<h?b-=.1**c:b=l+.1**c;let C=g;if(!C)if(C=`${m.toFixed(c)} - ${b.toFixed(c)}`,s===void 0||l===void 0)if(u===0)C="0";else break;else{if(m>l)break;a<=1&&c===0&&(C=m)}this.addLegend({cId:f,color:p,name:C,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,p;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=z.rgbaAdjustHalfOpacity(r),c.style.border=`1px solid ${r}`):c.style.backgroundColor=r,d.style.color=a,h&&h.length)for(const g of h){const m=(p=(f=this.options.legend.table)==null?void 0:f.columns[g.dataset.type])==null?void 0:p.style;g.style.color=m!=null&&m.color?m.color:a}u.show=!0,l.dataset.inactive=!1},i=()=>{(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 b;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 C=Array.from(this.legendBoxDOM.getElementsByClassName(e.container));C.every(T=>T.dataset.inactive==="false")?(C.forEach(T=>{t(T,a.inactive)}),i(),n(c,a.color),this.seriesInfo.count=1):u?(t(c,a.inactive),this.seriesInfo.count--):u||(n(c,a.color),this.seriesInfo.count++),C.every(T=>T.dataset.inactive==="true")&&(C.forEach(T=>{n(T,a.color)}),s(),this.seriesInfo.count=C.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 C=[...this.brushSeries.list];C[r]=this.seriesList,this.brushSeries.list=C,this.brushSeries.chartIdx=r}((b=this.options.eventBehavior)==null?void 0:b.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const p=Object.values(this.seriesList).filter(C=>C.show).map(C=>C.sId),g=p.length===Object.values(this.seriesList).length,m={e:l,data:{seriesIds:g?[]:p,isActiveAll:g}};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(p=>p.id===h);u>-1&&(d.colorState[u].show=!1),l.dataset.inactive=!0},n=(l,a)=>{var f,p;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=(p=l==null?void 0:l.series)==null?void 0:p.color,c.style.color=a;const u=d.colorState.findIndex(g=>g.id===h);u>-1&&(d.colorState[u].show=!0),l.dataset.inactive=!1},i=()=>{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 C;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(k=>k.dataset.inactive==="false")?(y.forEach(k=>{t(k,a.inactive)}),i(),n(c,a.color)):u?t(c,a.inactive):u||n(c,a.color),y.every(k=>k.dataset.inactive==="true")&&(y.forEach(k=>{n(k,a.color)}),s())}if(a.clickMode!=="active"){if(u&&f===1)return;u?t(c,a.inactive):n(c,a.color)}((C=this.options.eventBehavior)==null?void 0:C.legendClick)!=="emitOnly"&&this.update({updateSeries:!1,updateSelTip:{update:!0,keepDomain:!0}});const p=r.colorState.filter(y=>y.show),g=p.map(y=>+y.id.split("#")[1]),m=r.colorState.length===p.length,b={e:l,data:{seriesIndices:m?[]:g,isActiveAll:m}};typeof this.listeners["click-legend"]=="function"&&this.listeners["click-legend"](b)},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,i=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=`${i}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 i,s,l,a,r;const e=(l=(s=(i=this.options)==null?void 0:i.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,p=(r=t==null?void 0:t[f])==null?void 0:r[u];h.textContent=this.getFormattedValue(e[u],p)}}}},forceUpdateLegend(){this.destroyLegend(),this.initLegend()},resetLegend(){var t,n;const e=this.legendBoxDOM;if(e){if(this.useTable){const i=this.legendTableDOM;for(;i.hasChildNodes();)i.removeChild(i.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"),i=document.createElement("span"),s=document.createElement("div");n.className="ev-chart-legend-container",n.dataset.inactive=!e.show,n.series=e,i.className="ev-chart-legend-color",e.type==="line"&&e.point&&!e.fill&&(i.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?(i.style.height="8px",i.style.backgroundColor=e.show?z.rgbaAdjustHalfOpacity(l):t.inactive,i.style.border=`1px solid ${l}`):i.style.backgroundColor=l,i.dataset.type="color",s.style.color=t.color,s.textContent=e.name,s.setAttribute("title",e.name),s.dataset.type="name",n.appendChild(i),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,p,g;const t=this.options.legend,n=(h=t==null?void 0:t.table)==null?void 0:h.columns,i=(u=this.getAggregations())==null?void 0:u[e==null?void 0:e.sId];if(!i||!n)return;const s=document.createElement("tr");s.className="ev-chart-legend--table__row",s.dataset.inactive=!e.show,z.setDOMStyle(s,(p=(f=t.table)==null?void 0:f.style)==null?void 0:p.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=z.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?z.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",z.setDOMStyle(c,(g=n==null?void 0:n.name)==null?void 0:g.style),e.show||(c.style.color=t.inactive),s.appendChild(c);const d=Object.keys(n);d==null||d.forEach(m=>{var b;if(m!=="name"&&n[m].use){const C=this.getFormattedValue(n[m],i[m]),y=document.createElement("td");y.className="ev-chart-legend--table__value",y.style.color=e.show?t.color:t.inactive,y.textContent=C,y.dataset.type=m.toString(),z.setDOMStyle(y,(b=n[m])==null?void 0:b.style),e.show||(y.style.color=t.inactive),s.appendChild(y)}}),this.legendTableDOM.appendChild(s),e.show&&this.seriesInfo.count++},setLegendPosition(){var g,m,b,C,y,w,T,k,M;const e=this.options,t=(g=e==null?void 0:e.legend)==null?void 0:g.position,n=(m=this.wrapperDOM)==null?void 0:m.style,i=(b=this.legendDOM)==null?void 0:b.style,s=(C=this.legendBoxDOM)==null?void 0:C.style,l=(y=this.resizeDOM)==null?void 0:y.style;let a,r;const c=(w=e==null?void 0:e.title)!=null&&w.show?(T=e==null?void 0:e.title)==null?void 0:T.height:0,d=c+((k=e==null?void 0:e.legend)==null?void 0:k.height),{top:h=0,bottom:u=0,left:f=0,right:p=0}=((M=e==null?void 0:e.legend)==null?void 0:M.padding)??{};if(!(!n||!i))switch(s.padding=`${h}px ${p}px ${u}px ${f}px`,t){case"top":n.padding=`${d}px 0 0 0`,a=this.chartDOM.getBoundingClientRect(),r=parseInt(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top=`${c}px`,i.right="",i.bottom="",i.left="",i.width=`${a.width}px`,i.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`,i.paddingLeft="10px",i.top=`${c}px`,i.right="0px",i.bottom="",i.left="",i.width=`${e.legend.width}px`,i.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(i.paddingTop)+parseInt(i.paddingBottom),s.width="100%",s.height=`${e.legend.height-r}px`,i.top="",i.right="",i.bottom="0px",i.left="0px",i.width=`${a.width}px`,i.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",i.top=`${c}px`,i.right="",i.bottom="",i.left="0px",i.width=`${e.legend.width}px`,i.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 i=0;i<t.length;i++)e.position==="top"||e.position==="bottom"?(t[i].style.width=`${e.width-8}px`,t[i].style.margin="0 4px"):t[i].style.width="100%"},onMouseMove(e){e.stopPropagation(),e.preventDefault();const t=this.wrapperDOM.getBoundingClientRect(),n=this.wrapperDOM.offsetWidth,i=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>i-r&&(h=i-r),this.ghostDOM.style.top=`${h}px`;break;case"bottom":h=e.clientY-t.top,h<r+s?h=r+s:h>i-d&&(h=i-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,i=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":i.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":i.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":i.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":i.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}i.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,i=(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;!i||!t||(n&&(n.display="none"),i.display="none",i.width="0",i.height="0",t.padding=`${s}px 0 0 0`)},getFormattedValue({formatter:e,decimalPoint:t},n){if(n==null)return"Null";let i;return e&&(i=e(+n)),(!e||typeof i!="string")&&(i=z.labelSignFormat(+n,t)),i}},Ar=28,hC={width:70,height:60},uC={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 i=Object.values(this.seriesList);if(!i.length)return;const{colorState:s}=i[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 i=this.getSelectedValue(e);i=this.isSide?100-i:i;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&&i>c||!n&&i<r)return;a[0][s]=i,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:i,valueOpt:s}=n[0],l=i[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:i,height:s}=this.containerDOM.getBoundingClientRect(),l=!this.isSide,a=l?t:n,r=l?i:s;let c=l?e.clientX:e.clientY;c<a?c=a:c>a+r&&(c=a+r);const d=c-a;return+Je(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 i=e.getElementsByClassName("ev-chart-legend-thumb")[0].children;if(i&&i.length)for(const s of i)s.style.opacity=1}},createLegendOverlay(e,t){this.clearOverlay();const n=this.legendHandleSize,{min:i,max:s}=t;if(i===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(i+(s-i)*(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 p=f.children;if(p&&p.length)for(const g of p)g.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 i=document.createElement("div");return i.className=`ev-chart-legend-handle ${e}`,i.dataset.type="handle",i.appendChild(n),i},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>Ar?Ar:t;const n=this.legendHandleSize,i=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(i),this.containerDOM.appendChild(s)},setLegendStyle(e){const t=this.isSide?"top":"right",n=this.legendHandleSize,{valueOpt:i,colorState:s}=e,{min:l,max:a,decimalPoint:r}=i,{start:c,end:d}=s[0],h=e.getColorForGradient(c),u=e.getColorForGradient(d);let f=`linear-gradient(to ${t}, `;f+=`${h}, ${u})`;const p=Math.floor(n/2)+14;let g=`width:${n}px;height:${n}px;`,m,b,C,y=`background:${f};`;this.isSide?(g+=`margin-top:-${n/2}px;`,m=`left:${p}px;transform:translateY(-50%);top:`,b=`top:${100-d}%;`,C=`top:${100-c}%;`,y+=`top:${100-d}%;height:${d-c}%;`):(g+=`margin-left:-${n/2}px;`,m=`top:-${p}px;transform:translateX(-50%);left:`,b=`left:${c}%;`,C=`left:${d}%;`,y+=`left:${c}%;width:${d-c}%;`);const w=(l+(a-l)*(c/100)).toFixed(r),T=(l+(a-l)*(d/100)).toFixed(r),k=this.containerDOM.getElementsByClassName("ev-chart-legend-thumb")[0];k.style.cssText=y;const M=k.getElementsByClassName("ev-chart-legend-label");M[0].style.cssText=`${m}0%;`,M[1].style.cssText=`${m}100%;`,l!==void 0&&a!==void 0&&(M[0].innerText=this.isSide?T:w,M[1].innerText=this.isSide?w:T);const Z=this.containerDOM.getElementsByClassName("ev-chart-legend-handle");Z[0].style.cssText=g+b,Z[1].style.cssText=g+C;const S=this.containerDOM.getElementsByClassName("ev-chart-legend-handle-btn-color");S[0].style.backgroundColor=this.isSide?u:h,S[1].style.backgroundColor=this.isSide?h:u},setLegendPosition(){var b,C,y,w;const e=this.options,t=(b=e==null?void 0:e.legend)==null?void 0:b.position,{width:n,height:i}=hC,s=this.legendHandleSize,l=(C=e==null?void 0:e.title)!=null&&C.show?(y=e==null?void 0:e.title)==null?void 0:y.height:0,a=l+i,{top:r=0,bottom:c=0,left:d=0,right:h=0}=((w=e==null?void 0:e.legend)==null?void 0:w.padding)??{},u=this.wrapperDOM.style;if(!u)return;let f,p,g,m;switch(t){case"top":u.padding=`${a}px 0 0 0`,m=this.chartDOM.getBoundingClientRect(),p=`padding:${s+7}px ${h}px ${c}px ${d}px;`,p+="width:100%",p+=`height${i}px;`,f=`width:${m.width}px;`,f+=`height:${i}px;`,f+=`top:${l}px;`;break;case"right":u.padding=`${l}px ${n}px 0 0`,m=this.chartDOM.getBoundingClientRect(),p=`padding:${r}px ${h}px ${c}px ${d}px;`,p+=`width:${n}px;`,p+="height:100%;",p+=`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 ${i}px 0`,m=this.chartDOM.getBoundingClientRect(),p=`padding:${s+7}px ${h}px ${c}px ${d}px;`,p+="width:100%;",p+=`height:${i}px;`,f=`width:${m.width}px;`,f+=`height:${i}px;`,f+="bottom:0px;left:0px;";break;case"left":u.padding=`${l}px 0 0 ${n}px`,m=this.chartDOM.getBoundingClientRect(),p=`padding:${r}px ${h}px ${c}px ${d}px;`,p+="display:absolute;",p+="bottom:0px;",p+=`width:${n}px;`,p+="height:100%;",p+=`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 T=m.width/2;g=`left:${m.width/2-T/2}px;`,g+=`width:${T}px;`,g+=`height:${s}px;`,g+="padding:4px 0;",g+="margin:0 4px;"}else{const T=m.height/2;g=`top:${m.height/2-T/2}px;`,g+="left:5px;",g+=`width:${s}px;`,g+=`height:${T}px;`,g+="padding:0 4px;",g+="margin:4px 0;"}this.containerDOM.style.cssText=g,this.legendBoxDOM.style.cssText=p,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,i=(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=`${i}px 0 0 0`)}},fC={initScrollbar(){var e,t,n,i,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=(i=this.options.axesY)==null?void 0:i[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],i=He({},(s=e==null?void 0:e[0])==null?void 0:s.scrollbar,Br.scrollbar);Object.keys(i).forEach(h=>{n[h]=i[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.updateScrollbarAnchorEdge(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.initScrollbarRange(t),this.updateScrollbarAnchorEdge(t),this.createScrollbarLayout(t),this.createScrollbar(t),this.createScrollEvent(t),n.isInit=!0)},initScrollbarRange(e){var i;const t=this.scrollbar[e],n=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;if((i=t.range)!=null&&i.length&&n.length){const[s,l]=t.range;if(ve(s)&&ve(l)){const a=this.getScrollbarLimits(e);if(!a)return;const{limitMin:r,limitMax:c}=a,d=l-s,h=c-r;if(d>=h)t.range[0]=r,t.range[1]=c;else{let u=+s<r?r:+s,f=u+d;f>c&&(f=c,u=f-d,u<r&&(u=r)),t.range[0]=u,t.range[1]=f}}}},updateScrollbarInfo(e,t){var r,c,d,h,u,f,p,g,m,b,C,y,w,T,k;const{axesX:n,axesY:i}=this.options,s=e==="x"?n:i;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)||to((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=!_e((f=s==null?void 0:s[0])==null?void 0:f.range,(p=l==null?void 0:l[0])==null?void 0:p.range);if(a||t){const M=e==="x"?(b=(m=(g=this.options.axesX)==null?void 0:g[0])==null?void 0:m.scrollbar)==null?void 0:b.resetPosition:(w=(y=(C=this.options.axesY)==null?void 0:C[0])==null?void 0:y.scrollbar)==null?void 0:w.resetPosition;if(a){const Z=(T=s==null?void 0:s[0])==null?void 0:T.range,S=this.scrollbar[e].range;if(!M&&(Z!=null&&Z.length)&&(S!=null&&S.length)){const x=Z[1]-Z[0],L=this.scrollbar[e].anchorEdge,I=L?this.getScrollbarLimits(e):null;L==="start"&&I?this.scrollbar[e].range=[I.limitMin,I.limitMin+x]:L==="end"&&I?this.scrollbar[e].range=[I.limitMax-x,I.limitMax]:this.scrollbar[e].range=[S[0],S[0]+x]}else this.scrollbar[e].range=Z!=null&&Z.length?[...Z]:null}this.initScrollbarRange(e),a&&this.updateScrollbarAnchorEdge(e)}this.scrollbar[e].use=!!((k=s==null?void 0:s[0].scrollbar)!=null&&k.use)},updateScrollbarPosition(e){var t,n,i,s;(t=this.scrollbar.x)!=null&&t.use&&((n=this.scrollbar.x)!=null&&n.isInit)&&this.setScrollbarPosition("x",e),(i=this.scrollbar.y)!=null&&i.use&&((s=this.scrollbar.y)!=null&&s.isInit)&&this.setScrollbarPosition("y",e)},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 i=document.createElement("div");i.className="ev-chart-scrollbar-button ev-chart-scrollbar-button-down",i.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",i.appendChild(s),e.appendChild(t),e.appendChild(i)},setScrollbarPosition(e,t){var Z,S;const n=this.scrollbar[e];if(!n.use||!n.range)return;const i=n.dom,s=this.chartRect,l=t??this.labelOffset,a={x1:s.x1+l.left,x2:s.x2-l.right,y1:s.y1+l.top,y2:s.y2-l.bottom},r=(Z=this.options.title)!=null&&Z.show?(S=this.options.title)==null?void 0:S.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,p=this.getScrollbarThumbSize(e,f),g=Math.max(0,f-p.size);p.position=Math.min(Math.max(p.position,0),g);let m="display: block;",b,C,y,w,T=`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;`,b="top: 0;",b+=`left: ${u}px;`,b+=`width: ${f}px;`,b+="height: 100%;",C=`width: ${p.size}px;`,C+="height: 100%;",C+=`left: ${p.position+u}px`,T+="transform:rotate(90deg);top: 0;",y=`${T}right:0;`,w=`${T}left:0;`):(m=`top: ${a.y1+r}px;`,m+=`left: ${a.x2+10}px;`,m+=`width: ${d}px;`,m+=`height: ${h}px;`,b=`top: ${u}px;`,b+="left: 0;",b+="width: 100%;",b+=`height: ${f}px;`,C="width: 100%;",C+=`height: ${p.size}px;`,C+=`bottom: ${p.position+u}px`,T+="left:0;",y=`${T}top: 0;`,w=`${T}bottom: 0;`),i.style.cssText=m;const k=i.getElementsByClassName("ev-chart-scrollbar-track");k[0].style.cssText=b,k[0].style.backgroundColor=n.background;const M=i.getElementsByClassName("ev-chart-scrollbar-thumb");if(M[0].style.cssText=C,M[0].style.backgroundColor=n.thumbStyle.background,M[0].style.borderRadius=`${n.thumbStyle.radius}px`,n.showButton){const x=i.getElementsByClassName("ev-chart-scrollbar-button-up"),L=Math.floor(f-p.size),I=Math.floor(p.position)>L?.5:1;x[0].style.cssText=`background-color: ${n.background};${y}`,x[0].style.opacity=I,x[0].children[0].style.display="block";const V=i.getElementsByClassName("ev-chart-scrollbar-button-down");V[0].style.cssText=`background-color: ${n.background};${w}`,V[0].style.opacity=Math.floor(p.position)<0?.5:1,V[0].children[0].style.display="block"}},getScrollbarThumbSize(e,t){var u,f,p,g;const n=this.scrollbar[e],[i,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,b=s-i+1;r=m.length;const C=t/r;a=C*b,h=C*i}else{const m=e==="x"?this.axesX:this.axesY,b=(u=this.minMax[e])==null?void 0:u[0],C=+b.max-+b.min,y=+s-+i;l==="time"&&(c=(g=m==null?void 0:m[0])==null?void 0:g.getInterval({minValue:b.min,maxValue:b.max,maxSteps:(p=(f=this.labelRange[e])==null?void 0:f[0])==null?void 0:p.max})),r=Math.ceil(C/c)+1,d=+b.min;const w=t/r,T=y/c+1,k=+i-d;a=w*T,h=w*(k/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:i,range:s,interval:l,steps:a}=n,r=i+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,p=!1;t?(u=d+l,f=h+l,p=f>=r):(u=d-l,f=h-l,p=u<i),p||(n.range=[u,f],this.updateScrollbarAnchorEdge(e),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:u>1,updateByScrollbar:!0}))},getScrollbarLimits(e){var l,a;const t=this.scrollbar[e];if((t==null?void 0:t.type)==="step"){const r=this.options.type==="heatMap"?this.data.labels[e]:this.data.labels;return r!=null&&r.length?{limitMin:0,limitMax:r.length-1}:null}const n=(a=(l=this.minMax)==null?void 0:l[e])==null?void 0:a[0];if((n==null?void 0:n.min)==null||(n==null?void 0:n.max)==null)return null;const i=+n.min,s=+n.max;return!Number.isFinite(i)||!Number.isFinite(s)?null:{limitMin:i,limitMax:s}},updateScrollbarAnchorEdge(e){const t=this.scrollbar[e];if(!t)return;const n=t.range,i=this.getScrollbarLimits(e);if(!Array.isArray(n)||n.length!==2||!i){t.anchorEdge=null;return}n[0]<=i.limitMin?t.anchorEdge="start":n[1]>=i.limitMax?t.anchorEdge="end":t.anchorEdge=null},createScrollEvent(){var t,n,i;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(),p=c==="x",g=p?s.clientX:-s.clientY,m=p?u:-f;d=g>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=ns(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,p,g,m,b,C;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:w,clientHeight:T}=a,k=y<=0,M=Math.ceil(y)+T>=w,Z=s.deltaY<0,S=s.deltaY>0;if(!(k&&Z||M&&S))return}s.preventDefault();const r=1;if((p=this.scrollbar.x)!=null&&p.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&&((g=this.scrollbar.x)!=null&&g.use)?this.updateScrollbarRange("x",s.deltaX>0):d>c&&((m=this.scrollbar.y)!=null&&m.use)&&this.updateScrollbarRange("y",s.deltaY<0);return}if((b=this.scrollbar.x)!=null&&b.use&&c>r){this.updateScrollbarRange("x",s.deltaX>0);return}(C=this.scrollbar.y)!=null&&C.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)&&((i=this.overlayCanvas)==null||i.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:i,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(),p=n==="x",g=p?d:h,m=p?u:f,b=m/i,C=a+(i-1)*r;let y=p?e.clientX:e.clientY;y<g?y=g:y>g+m&&(y=g+m);let w;if(p?w=y-g-l:w=g+m-y-l,w<=0)return;let T,k;const M=Math.round(Math.abs(w)/b)*r,[Z,S]=s;if(w>0){const x=a+(M-+Z);T=+Z+x,k=T+(+S-+Z)}T<a||k>C||(this.scrollbar[n].range=[T,k],this.updateScrollbarAnchorEdge(n),this.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},lightUpdate:T>1,updateByScrollbar:!0}))},stopScrolling(e){const n=this.getScrollbarContainerDOM(e.target).dataset.type,i=this.scrollbar[n];if(i.scrolling){i.scrolling=!1;const s=i.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,i,s;const t=this.scrollbar[e].dom;t&&(t.remove(),this.scrollbar[e]={isInit:!1},!((n=this.scrollbar.x)!=null&&n.use)&&!((i=this.scrollbar.y)!=null&&i.use)&&((s=this.overlayCanvas)==null||s.removeEventListener("wheel",this.onScrollbarWheel,{passive:!1})))}};function mC(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")}function Kr(e,t,n){let i,s,l,a,r,c,d=0,h=!1,u=!1,f=!0;const p=!t&&t!==0&&typeof root.requestAnimationFrame=="function";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0,mC(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 g(L){const I=i,V=s;return i=s=void 0,d=L,a=e.apply(V,I),a}function m(L,I){return p?(window.cancelAnimationFrame(r),window.requestAnimationFrame(L)):setTimeout(L,I)}function b(L){if(p)return window.cancelAnimationFrame(L);clearTimeout(L)}function C(L){return d=L,r=m(T,t),h?g(L):a}function y(L){const I=L-c,V=L-d,v=t-I;return u?Math.min(v,l-V):v}function w(L){const I=L-c,V=L-d;return c===void 0||I>=t||I<0||u&&V>=l}function T(){const L=Date.now();if(w(L))return k(L);r=m(T,y(L))}function k(L){return r=void 0,f&&i?g(L):(i=s=void 0,a)}function M(){r!==void 0&&b(r),d=0,i=c=s=r=void 0}function Z(){return r===void 0?a:k(Date.now())}function S(){return r!==void 0}function x(...L){const I=Date.now(),V=w(I);if(i=L,s=this,c=I,V){if(r===void 0)return C(c);if(u)return r=m(T,t),g(c)}return r===void 0&&(r=m(T,t)),a}return x.cancel=M,x.flush=Z,x.pending=S,x}const pC="Expected a function";function gC(e,t,n){let i=!0,s=!0;if(typeof e!="function")throw new TypeError(pC);return Kr(e,t,{leading:i,maxWait:t,trailing:s})}const bC={createEventFunctions(){var n,i,s,l;this.onMouseMove=a=>{var y,w;if((y=this.dragInfo)!=null&&y.isMove||this.isMobile)return;const r={e:a},{indicator:c,tooltip:d,type:h}=this.options,u=this.getMousePosition(a),f=this.findHitItem(u);d!=null&&d.showAllValueInRange&&(f!=null&&f.items)&&this.addNotHitInfo(f);const p=this.overlayCtx,g=Object.keys(f.items),m=g.length>0;let b="";if(m){b=`h=${f.hitId}`;const T=g.slice().sort();for(let k=0;k<T.length;k++){const M=T[k];b+=`|${M}:${f.items[M].index}`}}const C=b!==""&&b===this._lastHoverSig&&this.tooltipDOM&&this.tooltipDOM.style.display!=="none";if(this.overlayClear(),m){if(d.use&&this.isInitTooltip)if(this.drawItemsHighlight(f,p),typeof(d==null?void 0:d.returnValue)=="function"){const k=[];for(let M=0;M<g.length;M++){const Z=g[M],S=f.items[Z];k.push({sId:Z,data:S.data,color:S.color,name:S.name,dataId:S.id,index:S.index})}this.hideTooltipDOM(),d.returnValue(k,a)}else(w=d==null?void 0:d.formatter)!=null&&w.html?(C||this.drawCustomTooltip(f==null?void 0:f.items),this.setCustomTooltipLayoutPosition(f,a)):(this.setTooltipLayoutPosition(f,a),h==="scatter"?this.drawTooltipForScatter(f,this.tooltipCtx):h==="heatMap"?this.drawToolTipForHeatMap(f,this.tooltipCtx):this.drawTooltip(f,this.tooltipCtx));const T=Object.values(this.seriesList||{}).some(k=>k.type==="line");if(d.use&&(h==="line"||T)){const k=this.drawIndicatorForTooltip(f,c.color),M=k==null?void 0:k.labelValue,Z=this.getTimeLabel(u);r.hoveredLabel={horizontal:this.options.horizontal,label:Z,mousePosition:[a.clientX,a.clientY],dataLabel:M}}}else d.use&&this.isInitTooltip&&(typeof(d==null?void 0:d.returnValue)=="function"&&d.returnValue([],a),this.hideTooltipDOM());if(this._lastHoverSig=b,this.dragInfoBackup&&this.drawSelectionArea(this.dragInfoBackup),!r.hoveredLabel&&!this.isNotUseIndicator()){const T=Object.values(this.seriesList||{}).some(M=>M.type==="line");(h!=="line"&&!T||!d.use||!Object.keys(f.items).length)&&this.drawIndicator(u,c.color);const k=this.getTimeLabel(u);r.hoveredLabel={horizontal:this.options.horizontal,label:k,mousePosition:[a.clientX,a.clientY]}}else r.hoveredLabel||(r.hoveredLabel={label:""});typeof this.listeners["mouse-move"]=="function"&&(h!=="pie"&&(r.curMouseTargetVal=this.getCurMouseTargetVal(u,f)),this.listeners["mouse-move"](r))},this.onMouseLeave=a=>{const{tooltip:r,dragSelection:c}=this.options;r.throttledMove&&this.onMouseMove.cancel(),(!c.use||!c.keepDisplay)&&this.overlayClear(),r.use&&this.isInitTooltip&&(typeof(r==null?void 0:r.returnValue)=="function"&&r.returnValue([],a),this.tooltipClear()),this._lastHoverSig="",this.invalidateClientRectCache(),this.listeners["mouse-leave"]()},this.onDblClick=a=>{const r={e:a},c=this.getMousePosition(a),{type:d,selectItem:h,selectLabel:u,selectSeries:f}=this.options,p=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick),g=(u==null?void 0:u.use)&&(u==null?void 0:u.useClick),m=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick);p?r.eventTarget="item":g?r.eventTarget="label":m&&(r.eventTarget="series");const b=()=>{var M,Z;const w=this.findHitItem(c,!0),T=w.hitId??Object.keys(w.items)[0],k=w.items[T];k&&(r.label=k.label,r.value=(M=k.data)==null?void 0:M.o,r.seriesId=T,r.dataIndex=k.index,r.acc=(Z=k.data)==null?void 0:Z.acc)},C=w=>{var x,L;const T=this.findHitItem(c,!0),k=T.hitId??Object.keys(T.items)[0],M=T.items[k],{labelIndex:Z}=this.getLabelInfoByPosition(c,w),{dataIndex:S}=this.regulateSelectedLabelInfo(Z,w);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(S,w),M&&(r.label=M.label,r.seriesId=k,r.value=(x=M.data)==null?void 0:x.o,r.acc=(L=M.data)==null?void 0:L.acc,r.dataIndex=M.index)},y=()=>{var M,Z,S;const w=this.findHitItem(c,!0),T=w.hitId??Object.keys(w.items)[0],k=w.items[T];if(T!==null){const x=this.updateSelectedSeriesInfo(T,!0);k&&(r.label=k.label,r.value=(M=k.data)==null?void 0:M.o,r.seriesId=(Z=x.seriesId)==null?void 0:Z.at(0),r.acc=(S=k.data)==null?void 0:S.acc,r.dataIndex=k.index)}};switch(d){case"bar":{g?C(this.options.horizontal?"yAxis":"xAxis"):b();break}case"line":{p?b():g?C():m&&y();break}default:{b();break}}typeof this.listeners["dbl-click"]=="function"&&this.listeners["dbl-click"](r)},this.onClick=a=>{var w;if(this.isMouseMove){this.isMouseMove=!1;return}const r={e:a},c=this.getMousePosition(a),{type:d,selectItem:h,selectLabel:u,selectSeries:f}=this.options,p=(h==null?void 0:h.use)&&(h==null?void 0:h.useClick),g=(u==null?void 0:u.use)&&(u==null?void 0:u.useClick),m=(f==null?void 0:f.use)&&(f==null?void 0:f.useClick),b=()=>{const T=this.getHitItemByPosition(c,!1,void 0,!1,!0);({label:r.label,value:r.value,sId:r.seriesId,dataIndex:r.dataIndex,acc:r.acc}=T),T!=null&&T.sId&&(r.selected={eventTarget:"item",seriesId:this.isDeselectItem(T)?null:T.sId,dataIndex:this.isDeselectItem(T)?null:T.dataIndex})},C=T=>{var Z,S,x,L;const{labelIndex:k}=this.getLabelInfoByPosition(c,T),{dataIndex:M}=this.regulateSelectedLabelInfo(k,T);this.defaultSelectInfo=this.getSelectedLabelInfoWithLabelData(M,T),T&&(this.defaultSelectInfo.targetAxis=M!=null&&M.length?T:null),r.selected={eventTarget:"label",...Ze(this.defaultSelectInfo)},r.label=(S=(Z=this.defaultSelectInfo)==null?void 0:Z.label)==null?void 0:S.at(0),r.dataIndex=(L=(x=this.defaultSelectInfo)==null?void 0:x.dataIndex)==null?void 0:L.at(0)},y=()=>{const T=this.findHitItem(c,!0),k=T.hitId??Object.keys(T.items)[0],M=T.items[k];if(!Yt(k)){const Z=this.updateSelectedSeriesInfo(k,!1);this.defaultSelectInfo.seriesId=Z.seriesId,r.selected={eventTarget:"series",...Ze(this.defaultSelectInfo)},r.label=M.label,r.dataIndex=M.index}};switch(d){default:case"bar":{p?b():g&&C(this.options.horizontal?"yAxis":"xAxis");break}case"line":{p?b():g?C():m&&y();break}case"heatMap":{const T=!!this.options.horizontal;if(p&&g){const{useBothAxis:k}=u,M=this.getCurMouseLocation(c);if(M==="chartBackground")this.clearSelectedLabelInfo(),r.deselected={eventTarget:"label"},b();else if(M==="yAxis"||M==="xAxis"){if(this.clearSelectedItemInfo(),r.deselected={eventTarget:"item"},!k&&M!==(T?"yAxis":"xAxis"))return;C(M)}}else if(p)b();else if(g){const{useBothAxis:k}=u,M=this.getCurMouseLocation(c);if((M==="yAxis"||M==="xAxis")&&!k&&M!==(T?"yAxis":"xAxis"))return;M!=="canvas"&&C(k?M:null)}break}case"pie":{p&&b();break}case"scatter":{if(p&&b(),(w=this.options.dragSelection)!=null&&w.use&&this.isMobile){let T=this.setTouchInfo(a);this.overlayClear(),this.options.dragSelection.keepDisplay&&(a.layerX<T.range.x1||a.layerY<T.range.y1||a.layerX>T.range.x2||a.layerY>T.range.y2)?this.isTouchOverlay=!1:(T=this.setTouchBoxDimensions(T),this.isTouchOverlay=!0,this.drawSelectionArea(T)),this.options.dragSelection.keepDisplay||setTimeout(()=>{this.isTouchOverlay=!1,this.overlayClear()},100),r.e=a,r.touchInfo=T,r.data=this.findSelectedItems(T),r.range=this.getSelectionRange(T),typeof this.listeners["drag-select"]=="function"&&this.listeners["drag-select"](r)}break}}typeof this.listeners.click=="function"&&(this.dragInfoBackup||this.listeners.click(r))},this.onMouseDown=a=>{const{dragSelection:r,type:c}=this.options;r.use&&(c==="scatter"||c==="line"||c==="heatMap")&&(this.removeSelectionArea(),this.dragStart(a,c))},this.onWheel=a=>{var b,C,y,w;if(!(((C=(b=this.tooltipDOM)==null?void 0:b.style)==null?void 0:C.display)==="block"))return;const c=((y=this.vsState)==null?void 0:y.scrollEl)||(this.options.tooltip.htmlScrollTarget?(w=this.tooltipDOM)==null?void 0:w.querySelector(this.options.tooltip.htmlScrollTarget):null)||this.tooltipBodyDOM;if(!c||c.scrollHeight<=c.clientHeight){this.hideTooltipDOM();return}const{scrollTop:d,scrollHeight:h,clientHeight:u}=c,f=d<=0,p=Math.ceil(d)+u>=h,g=a.deltaY<0,m=a.deltaY>0;a.preventDefault(),!(f&&g)&&!(p&&m)&&(c.scrollTop+=a.deltaY)};const e=(n=this.options)==null?void 0:n.tooltip,t=!!((i=e==null?void 0:e.formatter)!=null&&i.html)&&!!(e!=null&&e.virtualScroll)&&e.virtualScroll.use!==!1;(e!=null&&e.useScrollbar||t)&&this.overlayCanvas.addEventListener("wheel",this.onWheel,{passive:!1}),(l=(s=this.options)==null?void 0:s.tooltip)!=null&&l.throttledMove&&(this.onMouseMove=gC(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=a=>this.dragTouchSelectionDestroy(a),window.addEventListener("click",this.dragTouchSelectionEvent),this.invalidateRectOnScroll=()=>this.invalidateClientRectCache(),window.addEventListener("scroll",this.invalidateRectOnScroll,{capture:!0,passive:!0})},dragStart(e,t){let[n,i]=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),i<a.y1&&(i=a.y1),i>a.y2&&(i=a.y2),this.dragInfo={xcp:n,ycp:i,range:a};const r=d=>{d.preventDefault();const[h,u]=this.getMousePosition(d),f=this.dragInfo,{xcp:p,ycp:g,range:m}=f;let b,C;if(f.isMove=!0,this.isMouseMove=!0,h<m.x1?b=m.x1:h>m.x2?b=m.x2:b=h,u<m.y1?C=a.y1:u>m.y2?C=m.y2:C=u,t==="heatMap"){const y={xcp:p,xep:b,ycp:g,yep:C,range:m},{xsp:w,ysp:T,width:k,height:M}=this.getDragInfoForHeatMap(y);f.xsp=w,f.ysp=T,f.width=k,f.height=M}else f.xsp=Math.min(p,b),f.ysp=t==="scatter"?Math.min(g,C):m.y1,f.width=Math.ceil(Math.abs(b-p)),f.height=t==="scatter"?Math.ceil(Math.abs(C-g)):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 p={e:d,data:this.findSelectedItems(h),range:t==="heatMap"?this.getSelectionRangeForHeatMap(h):this.getSelectionRange(h)};if(this.dragInfoBackup=He({},h),typeof this.listeners["drag-select"]=="function"&&!((f=(u=this.options)==null?void 0:u.zoom)!=null&&f.use))this.listeners["drag-select"](p);else{const{xsp:g,range:m,width:b}=h,C=g-m.x1;p.range.dragSelectionInfo={dragXsp:C,dragXep:C+b,exceptAxesYChartWidth:m.x2-m.x1,exceptAxesXChartHeight:m.y2-m.y1,chartRange:m,chartTitle:this.options.title.text},this.options.zoom.getRangeInfo(p)}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:i,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,_e(h,s))l.fillRect(e,t,n,i);else{const u=s.x2-s.x1,f=s.y2-s.y1,p=h.x2-h.x1,g=h.y2-h.y1,m=(e-s.x1)/u,b=(t-s.y1)/f,C=h.x1+p*m,y=h.y1+g*b,w=n/u,T=i/f,k=p*w,M=g*T;l.fillRect(C,y,k,M)}l.globalAlpha=1},removeSelectionArea(){this.dragInfoBackup=null,this.overlayClear()},getMousePosition(e){const t=e.originalEvent||e,n=this.getOverlayClientRect();return[t.clientX-n.left,t.clientY-n.top,n.width,n.height]},getCurMouseTargetVal(e,t){const n=this.getCurMouseLocation(e),i={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]&&(i.dataIdx=l[a].index,i.maxDataVal=r,i.originVal=t)}}else if(n==="xAxis"||n==="yAxis"){const{axesX:s,axesY:l}=this.options,a=(c,d,h)=>{i.labelIdx=d,i.labelVal=c[0].type==="time"?Ne(h).format(c[0].timeFormat):h,i.originVal=c[0].type==="time"?Ne(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 i},setTouchInfo(e){let[t,n]=this.getMousePosition(e);const i=this.chartRect,s=this.labelOffset,l={x1:i.x1+s.left,x2:i.x2-s.right,y1:i.y1+s.top,y2:i.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:i,ycp:s,range:l}=e;let a=i-n,r=s-n,c=t,d=t;return this.boxOverflow={x1:!1,x2:!1,y1:!1,y2:!1},i<l.x1+n&&(a=l.x1,c=n-(l.x1-i),this.boxOverflow.x1=!0),i>l.x2-n&&(c=n-(i-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,t=!1){var k,M,Z,S;(k=this.ensureHitCoordsFresh)==null||k.call(this);const n=Object.keys(this.seriesList),i={},s=!!this.options.horizontal,l=this.tooltipCtx,[a,r]=e;let c=null,d="",h=0,u="",f=null,p=null,g=1/0,m=!1,b=null,C=1/0;const y=this.findClosestDataIndex(e,n,t);if(y===-1&&!this.isNotUseIndicator())return{items:i,hitId:c,maxTip:[d,u],maxHighlight:null};const w=n.every(x=>this.seriesList[x].type==="bar");for(let x=0;x<n.length;x++){const L=n[x],I=this.seriesList[L];if(I.findGraphData&&I.show){const V=I.findGraphData(e,s,y,!w);if(V!=null&&V.data){let v;if(V.data.o===null&&I.interpolation!=="zero"?I.isExistGrp||(v=s?V.data.x:V.data.y):isNaN(V.data.o)||(v=V.data.o),v!=null){const E=this.getFormattedTooltipLabel({dataId:I.id,seriesId:L,seriesName:I.name,itemData:V.data}),G=l?l.measureText(E).width:1;V.id=I.id,V.name=E,V.axis={x:I.xAxisIndex,y:I.yAxisIndex},V.label=s?(M=V.data)==null?void 0:M.y:(Z=V.data)==null?void 0:Z.x,i[L]=V;const R=this.getFormattedTooltipValue({dataId:I.id,seriesId:L,seriesName:E,value:v,itemData:V.data});if(V.data.formatted=R,h<G&&(d=E,h=G),u.length<=`${R}`.length&&(u=`${R}`),(f===null||f<=v)&&(f=v,p=L),V.hit&&V.data.xp!==void 0&&V.data.yp!==void 0){const X=(V.data.xp-e[0])**2+(V.data.yp-e[1])**2;V.directHit?((!m||X<g)&&(g=X,c=L),m=!0):!m&&X<g&&(g=X,c=L)}if(c===null&&V.data.xp!==void 0&&V.data.yp!==void 0&&V.data.xp!==null&&V.data.yp!==null){const X=z.calcBoxDistance(V.data,a,r);X<C&&(C=X,b=L)}}}}}c===null&&(c=b!==null?b:Object.keys(i)[0]);const T=f!==null?[p,f]:null;if(t&&Object.keys(i).length===0&&y!==-1){const x=n.find(I=>{var v;const V=this.seriesList[I];return(V==null?void 0:V.show)&&((v=V==null?void 0:V.data)==null?void 0:v.length)>0}),L=x?(S=this.seriesList[x].data)==null?void 0:S[y]:null;L&&(i[""]={id:"",name:"",label:s?L.y:L.x,index:y,axis:{x:0,y:0},data:{o:void 0,x:L.x,y:L.y}},c="")}return{items:i,hitId:c,maxTip:[d,u],maxHighlight:T}},buildLabelValidMask(e){var s,l;const t=e??Object.keys(this.seriesList);let n=0;for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];r!=null&&r.show&&((s=r.data)==null?void 0:s.length)>n&&(n=r.data.length)}const i=new Uint8Array(n);for(let a=0;a<t.length;a++){const r=this.seriesList[t[a]];if(r!=null&&r.show&&r.data){const{data:c}=r;for(let d=0;d<c.length;d++){const h=(l=c[d])==null?void 0:l.o;h!=null&&(i[d]=1)}}}return this.labelValidMask=i,i},findClosestDataIndex(e,t,n=!1){var m;const[i,s]=e,l=!!this.options.horizontal,a=l?s:i,r=t.find(b=>{var y;const C=this.seriesList[b];return(C==null?void 0:C.show)&&((y=C==null?void 0:C.data)==null?void 0:y.length)>0});if(!r||!((m=this.seriesList[r])!=null&&m.data))return-1;const c=this.seriesList[r].data;let d=50;if(c.length>1){const b=[];for(let C=1;C<c.length;C++){const y=c[C-1],w=c[C];if(y&&w){let T,k;l?(T=y.h?y.yp+y.h/2:y.yp,k=w.h?w.yp+w.h/2:w.yp):(T=y.w?y.xp+y.w/2:y.xp,k=w.w?w.xp+w.w/2:w.xp),T!==null&&k!==null&&b.push(Math.abs(k-T))}}b.length>0&&(d=b.reduce((C,y)=>C+y,0)/b.length)}let h=1/0,u=-1,f=this.labelValidMask;!n&&(!f||f.length<c.length)&&(f=this.buildLabelValidMask(t));for(let b=0;b<c.length;b++)if(n||f[b]===1){const y=c[b];if(y){let w;if(l?w=y.h?y.yp+y.h/2:y.yp:w=y.w?y.xp+y.w/2:y.xp,w!==null){const T=Math.abs(a-w);T<h&&(h=T,u=b)}}}if(u===-1)return-1;const g=Math.max(d,6);return h>=g?t.some(C=>{const y=this.seriesList[C];if(y!=null&&y.show){const w=y.passingValue,T=y.interpolation,k=y.hasPassingValueInData;return T==="linear"||T==="none"&&!!w&&k}return!1})?u:-1:u},getFormattedTooltipLabel({dataId:e,seriesId:t,seriesName:n,itemData:i}){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:i})),r},getFormattedTooltipValue({dataId:e,seriesId:t,seriesName:n,value:i,itemData:s}){var u;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:(u=r==null?void 0:r.formatter)==null?void 0:u.value,d=s!==null&&typeof s=="object"&&c;if(d){this._tooltipValueCache||(this._tooltipValueCache=new WeakMap);const f=this._tooltipValueCache.get(s);if(f!==void 0){const p=f[t];if(p!==void 0)return p}}let h=i;if(c&&(l.type==="pie"?h=c({value:i,name:n,percentage:s==null?void 0:s.percentage,seriesId:t,dataId:e}):l.type==="heatMap"?h=c({x:s==null?void 0:s.x,y:s==null?void 0:s.y,value:i>-1?i:"error",seriesId:t,dataId:e}):h=c({x:a?i:s==null?void 0:s.x,y:a?s==null?void 0:s.y:i,o:s==null?void 0:s.o,name:n,seriesId:t,dataId:e})),i&&(!c||typeof h!="string")&&(l.type==="heatMap"?h=i<0?"error":Qt(i):h=Qt(i)),d){let f=this._tooltipValueCache.get(s);f||(f=Object.create(null),this._tooltipValueCache.set(s,f)),f[t]=h}return h},addNotHitInfo(e){var c,d,h,u,f,p;const t=this.tooltipCtx,n=!!this.options.horizontal,i=Object.keys(e.items)[0],s=n?(h=(d=(c=e.items)==null?void 0:c[i])==null?void 0:d.data)==null?void 0:h.y:(p=(f=(u=e.items)==null?void 0:u[i])==null?void 0:f.data)==null?void 0:p.x;let l="",a="";const r=Object.keys(this.seriesList);for(let g=0;g<r.length;g++){const m=r[g],b=this.seriesList[m];if(b!=null&&b.show){const C=b.data.find(S=>n?(S==null?void 0:S.y)===s:(S==null?void 0:S.x)===s),y=this.getFormattedTooltipLabel({dataId:b.id,seriesId:m,seriesName:b.name,itemData:C}),w=this.getFormattedTooltipValue({dataId:b.id,seriesId:m,seriesName:y,value:C==null?void 0:C.o,itemData:C});if(C&&C.o!==null&&C.o!==void 0&&!e.items[m]){const S={};S.color=b.color,S.hit=!1,S.name=y,S.axis={x:b.xAxisIndex,y:b.yAxisIndex},S.index=n?b.yAxisIndex:b.xAxisIndex,S.data=C,S.data.formatted=w,e.items[m]=S}const T=t?t.measureText(l).width:1,k=t?t.measureText(y).width:1;T<k&&(l=y);const M=t?t.measureText(a).width:1,Z=t?t.measureText(`${w}`).width:1;M<Z&&(a=`${w}`)}}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:i,horizontal:s}=this.options,l=Ze(this.defaultSelectInfo);switch(l.dataIndex=e,i){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)??{},i=t===null||((a=this.defaultSelectInfo)==null?void 0:a.targetAxis)===t?{...this.defaultSelectInfo,targetAxis:t}:{dataIndex:[],targetAxis:t},s=Ze(i);if(i.dataIndex.includes(e)){const r=i.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)??{},i=this.defaultSelectInfo??{seriesId:[]};typeof i.seriesId=="string"&&(i.seriesId=[i.seriesId]);const s=Ze(i);if(i.seriesId.includes(e)){if(!t){const a=i.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:i}=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=i?a.data.y:a.data.x;let c;if(i){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),i?(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){var i;(i=this.ensureHitCoordsFresh)==null||i.call(this);const t=[],n=Object.keys(this.seriesList);for(let s=0;s<n.length;s++){const l=n[s],a=this.seriesList[l],r=a.findItems;if(r){const c=r.call(a,e);c&&c.length&&t.push({seriesName:a.name,seriesId:l,items:c})}}return t},getSelectionRange({xsp:e,ysp:t,width:n,height:i,range:s}){var w,T,k,M;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+i,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),p=this.getRatioInRange(s.y1,s.y2,c),g=this.getRatioInRange(s.y1,s.y2,t),m=this.isMobile&&((w=this.boxOverflow)!=null&&w.x1)?Math.min(this.minMax.x[0].min,l.graphMin):Math.max(l.graphMin+d*u,l.graphMin),b=this.isMobile&&((T=this.boxOverflow)!=null&&T.x2)?Math.max(this.minMax.x[0].max,l.graphMax):Math.min(l.graphMin+d*f,l.graphMax),C=this.isMobile&&((k=this.boxOverflow)!=null&&k.y2)?Math.min(this.minMax.y[0].min,a.graphMin):Math.max(a.graphMin+h*(1-p),a.graphMin),y=this.isMobile&&((M=this.boxOverflow)!=null&&M.y1)?Math.max(this.minMax.y[0].max,a.graphMax):Math.min(a.graphMin+h*(1-g),a.graphMax);return{xMin:+m.toFixed(3),xMax:+b.toFixed(3),yMin:+C.toFixed(3),yMax:+y.toFixed(3)}},getRatioInRange(e,t,n){const i=t-e;return(n-e)/i},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 i=Object.keys(this.seriesList)[0],{xMin:s,xMax:l,yMin:a,yMax:r}=this.seriesList[i].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.dataIndex)===((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.dataIndex)},getCurMouseLocation(e){const[t,n]=e,i={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=i[this.axesX[0].units.rectStart],l=i[this.axesX[0].units.rectEnd],a=i[this.axesY[0].units.rectStart],r=i[this.axesY[0].units.rectEnd];return St(t,this.chartRect.x1,i.x1)&&St(n,a,r)?"yAxis":St(t,s,l)&&St(n,i.y2,this.chartRect.y2)?"xAxis":St(t,i.x1,i.x2)&&St(n,i.y1,i.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}},_o=8,fs=50,gi=17,yC=8,xC={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=Kr(()=>{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,i=(t==null?void 0:t.fontFamily)??"Roboto";return`normal normal lighter ${Math.max(n,0)}px ${i}`},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:i=16}=((l=(s=this.options)==null?void 0:s.tooltip)==null?void 0:l.rowPadding)??{};return{t:e,l:i,b:n,r:t}},setTooltipLayoutPosition(e,t){var B,Y,O,_,A,Q,U;const n=this.tooltipCtx,i=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(),p=e.hitId,g=l[p].data,m=l[p].axis,b=(B=u.formatter)==null?void 0:B.title;this.axesX.length&&this.axesY.length&&u.showHeader&&(b?this.tooltipHeaderDOM.textContent=b({x:g.x,y:g.y}):this.tooltipHeaderDOM.textContent=this.options.horizontal?this.axesY[m.y].getLabelFormat(g.y):this.axesX[m.x].getLabelFormat(g.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?(O=(Y=l[e.hitId])==null?void 0:Y.data)==null?void 0:O.y:(A=(_=l[e.hitId])==null?void 0:_.data)==null?void 0:A.x,w=(y==null?void 0:y.length)>a.length?y:a,T=Math.round(n.measureText(w).width),k=Math.round(n.measureText(r).width),M=T+k+h.l+h.r+f+fs+gi,Z=M>u.maxWidth?u.maxWidth:M;let S=u.textOverflow==="wrap"?0:d;if(u.textOverflow==="wrap"){const ee=u.maxWidth-(Math.round(n.measureText(r).width)+h.l+h.r+f+fs+gi);Object.values(l).map(te=>te.name).forEach(te=>{if(n.measureText(te).width>ee){let J="";for(let q=0;q<te.length;q++){const j=te[q],ae=`${J}${j}`;n.measureText(ae).width>ee?(J=j,S+=1):J=ae}}S+=1}),n.restore()}const x=h.t+S*this.getTextHeight()+d*_o+h.b;let L;u.useScrollbar&&x>u.maxHeight?(this.tooltipBodyDOM.style.overflowY="auto",L=u.maxHeight):(this.tooltipBodyDOM.style.overflowY="hidden",L=x),this.tooltipCanvas.width=Z*this.pixelRatio,this.tooltipCanvas.height=x*this.pixelRatio,this.tooltipCanvas.style.width=`${Z}px`,this.tooltipCanvas.style.height=`${x}px`,this.tooltipHeaderDOM.style.width=`${Z}px`,this.tooltipHeaderDOM.style.height="auto",this.tooltipDOM.style.height="auto",this.tooltipBodyDOM.style.height=`${L+6}px`,this.tooltipDOM.style.display="block";const I=document.body.clientWidth,V=document.body.clientHeight,v=20,E=((Q=this.tooltipDOM)==null?void 0:Q.offsetHeight)||((U=this.tooltipHeaderDOM)==null?void 0:U.offsetHeight)+L+yC,G=I-Z-v,R=V-E-v,X=i+v,W=s+v,N=i-Z-v,P=s-E-v,D=X>G?N:X,H=W>R?P:W;this.tooltipDOM.style.transform=`translate3d(${D}px, ${H}px, 0)`},drawSeriesColorShape(e,t,n){var a,r;const i=(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=i/2;e.arc(s,l-c/2,c,0,2*Math.PI),e.fill()}else{const c=i;e.fillRect(s-c/3,l-c/1.2,c,c)}},drawTooltip(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),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+=z.aliasPixel(u),f+=z.aliasPixel(f),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=gi),u+=a.l,f+=a.t,n.font=this.getFontStyle("contents");const p=[];l.forEach(b=>{p.push({id:b,data:i[b].data,color:i[b].color,name:i[b].name,dataId:i[b].id})}),c.sortByValue&&p.sort((b,C)=>{let y=b.data.o,w=C.data.o;return y==null&&(y=r?b.data.x:b.data.y),w==null&&(w=r?C.data.x:C.data.y),w-y}),this.setTooltipDOMStyle(c);const g=this.tooltipDOM.offsetWidth;let m=1;for(let b=0;b<p.length;b++){const C=p[b].data,y=p[b].color,w=p[b].name,T=C.formatted;let k=u+4,M=f+m*d;k+=z.aliasPixel(k),M+=z.aliasPixel(M),n.beginPath(),typeof y!="string"?n.fillStyle=ne.createGradient(n,r,{x:k-4,y:M,w:12,h:-12},y):n.fillStyle=y;const Z={id:p[b].id,name:p[b].name,value:T,dataId:p[b].dataId};this.drawSeriesColorShape(n,c.colorShape,{x:k,y:M}),n.fillStyle=typeof c.fontColor.label=="function"?c.fontColor.label(Z):c.fontColor.label??c.fontColor;const S=c.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-h-fs,x=k+h,L=M;if(S>n.measureText(w).width)n.fillText(w,x,L);else if(c.textOverflow==="wrap"){let I="",V=L;for(let v=0;v<w.length;v++){const E=w[v],G=`${I}${E}`;n.measureText(G).width>S?(n.fillText(I,x,V),I=E,m+=1,V+=d):I=G}n.fillText(I,x,V)}else{const I=z.truncateLabelWithEllipsis(w,S,n);n.fillText(I,x,L)}n.save(),n.fillStyle=typeof c.fontColor.value=="function"?c.fontColor.value(Z):c.fontColor.value??c.fontColor,n.textAlign="right",n.fillText(T,g-a.r,M),n.restore(),n.closePath(),f+=_o,m+=1}n.restore()},drawToolTipForHeatMap(e,t){const n=t,i=e.items,s=e.hitId,l=i[s].data,a=i[s].axis,r=i[s].color,c=this.getBoxPadding(),d=this.options.horizontal,h=this.options.tooltip,u=Object.values(this.seriesList)[0],f=this.getTextHeight(),p=this.getColorMargin();let g=!1,m=l.formatted;const{colorState:b,isGradient:C}=u;if(C){const{min:M,max:Z}=u.valueOpt,S=Je(l.o-M,Z-M),{start:x,end:L}=b[0];g=x<=S&&S<=L||l.o===-1}else{const M=b.find(({id:Z})=>Z===l.cId);g=M==null?void 0:M.show,m=(M==null?void 0:M.label)??m}if(!g){this.tooltipClear();return}this.axesX.length&&this.axesY.length&&h.showHeader?this.tooltipHeaderDOM.style.visibility="visible":this.tooltipHeaderDOM.style.display="none",this.setTooltipDOMStyle(h);const y=this.tooltipDOM.offsetWidth;n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(c.r+=gi);const w=c.l+2,T=c.t+f+2;n.font=this.getFontStyle("contents"),n.beginPath(),typeof r!="string"?n.fillStyle=ne.createGradient(n,d,{x:w,y:T,w:12,h:-12},r):n.fillStyle=r;const k={id:e.hitId,name:l.y,value:m,dataId:i[s].id};this.drawSeriesColorShape(n,h.colorShape,{x:w,y:T}),n.fillStyle=typeof h.fontColor.label=="function"?h.fontColor.label(k):h.fontColor.label??h.fontColor,this.axesY.length&&n.fillText(this.axesY[a.y].getLabelFormat(l.y),w+p,T),n.textAlign="right",n.fillStyle=typeof h.fontColor.value=="function"?h.fontColor.value(k):h.fontColor.value??h.fontColor,n.fillText(m,y-c.r,T),n.closePath()},drawTooltipForScatter(e,t){const n=t,i=e.items,[,s]=e.maxTip,l=this.alignSeriesList(Object.keys(i)),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+=z.aliasPixel(h),u+=z.aliasPixel(u),n.save(),n.scale(this.pixelRatio,this.pixelRatio),this.tooltipBodyDOM.style.overflowY==="auto"&&(a.r+=gi),h+=a.l,u+=a.t,n.font=this.getFontStyle("contents");const f=[];l.forEach(m=>{f.push({data:i[m].data,color:i[m].color,name:i[m].name})}),r.sortByValue&&f.sort((m,b)=>{let C=m.data.o,y=b.data.o;return C==null&&(C=m.data.y),y==null&&(y=b.data.y),y-C}),this.setTooltipDOMStyle(r);const p=this.tooltipDOM.offsetWidth;let g=1;for(let m=0;m<f.length;m++){const b=f[m].data,C=f[m].color,y=f[m].name,w=b.formatted;let T=h+4,k=u+g*c;T+=z.aliasPixel(T),k+=z.aliasPixel(k),n.beginPath(),typeof C!="string"?n.fillStyle=ne.createGradient(n,!1,{x:T-4,y:k,w:12,h:-12},C):n.fillStyle=C;const M={id:e.hitId,name:f[m].name,value:w,dataId:f[m].dataId};this.drawSeriesColorShape(n,r.colorShape,{x:T,y:k}),n.fillStyle=typeof r.fontColor.label=="function"?r.fontColor.label(M):r.fontColor.label??r.fontColor;const Z=r.maxWidth-Math.round(n.measureText(s).width)-a.l-a.r-d-fs,S=T+d,x=k;if(Z>n.measureText(y).width)n.fillText(y,S,x);else if(r.textOverflow==="wrap"){let L="",I=x;for(let V=0;V<y.length;V++){const v=y[V],E=`${L}${v}`;n.measureText(E).width>Z?(n.fillText(L,S,I),L=v,g+=1,I+=c):L=E}n.fillText(L,S,I)}else{const L=z.truncateLabelWithEllipsis(y,Z,n);n.fillText(L,S,x)}n.save(),n.textAlign="right",n.fillStyle=typeof r.fontColor.value=="function"?r.fontColor.value(M):r.fontColor.value??r.fontColor,n.fillText(w,p-a.r,k),n.restore(),n.closePath(),u+=_o,g+=1}n.restore()},setCustomTooltipLayoutPosition(e,t){var w,T;const n=t.pageX,i=t.pageY,s=(w=this.tooltipDOM.getElementsByClassName("ev-chart-tooltip-custom"))==null?void 0:w[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=(T=this.tooltipDOM)==null?void 0:T.getBoundingClientRect(),h=20,u=r-l-h,f=c-(d==null?void 0:d.height)-h,p=n+h,g=i+h,m=n-l-h,b=i-(d==null?void 0:d.height)-h,C=p>u?m:p,y=g>f?b:g;this.tooltipDOM.style.transform=`translate3d(${C}px, ${y}px, 0)`},drawCustomTooltip(e){var l,a,r,c,d;const t=(l=this.options)==null?void 0:l.tooltip;if(!((a=t==null?void 0:t.formatter)!=null&&a.html))return;const n=Object.keys(e).length;if((r=this._shouldVirtualizeCustomTooltip)!=null&&r.call(this,n)&&this.drawCustomTooltipVirtual(e))return;(c=this._teardownCustomTooltipVirtualScroll)==null||c.call(this),this.tooltipDOM.innerHTML="";const i=[];Object.keys(e).forEach(h=>{i.push({sId:h,data:e[h].data,color:e[h].color,name:e[h].name,dataId:e[h].id,index:e[h].index})});const s=z.htmlToElement(t.formatter.html(i));s&&this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((d=t.fontColor)==null?void 0:d.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 i=this.seriesList[n];i.itemHighlight(e.items[n],t,e.items[n].index,(s=this.options)==null?void 0:s.unSelectedOpacity),z.isDoughnutHole(i.type)&&this.drawDoughnutHole(t)})},drawIndicator(e,t){var d;const n=this.overlayCtx,[i,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;i>=l.x1-a&&i<=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(i+.5,l.y1),n.lineTo(i+.5,l.y2)),n.stroke(),n.restore(),n.closePath())},getTimeLabel(e){var u,f,p,g;const t=this.options;if(t.syncHover===!1||!t.horizontal&&!t.axesX.every(({type:m})=>m==="time")||t.horizontal&&!t.axesY.every(({type:m})=>m==="time"))return null;const n=+((u=this.data.labels)==null?void 0:u[0]),i=+((f=this.data.labels)==null?void 0:f[this.data.labels.length-1]);if(n==null||i==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?(p=t.axesY)==null?void 0:p.every(m=>m.categoryMode):(g=t.axesX)==null?void 0:g.every(m=>m.categoryMode)){const m=this.data.labels.length;if(!m)return null;let b;if(t.horizontal){const y=a.y2-a.y1;b=(l-a.y1)/y}else{const y=a.x2-a.x1;b=(s-a.x1)/y}const C=Math.min(Math.max(Math.floor(b*m),0),m-1);return+this.data.labels[C]}if(t.horizontal){const m=a.y2-a.y1,C=(l-a.y1)*(i-n)/m+n;return Math.round(C)}const c=a.x2-a.x1,h=(s-a.x1)*(i-n)/c+n;return Math.round(h)},drawSyncedIndicator({horizontal:e,label:t,mousePosition:n,dataLabel:i}){var g,m;if(!this._canDrawSyncedIndicator(e,n))return;if(i){this.drawSyncedIndicatorForTooltip({dataLabel:i,mousePosition:n});return}const s=+((g=this.data.labels)==null?void 0:g[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.getChartDOMClientRect();if(St(a,h,u)&&St(r,d,c))return;this.overlayClear();const p={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 C=(p.y2-p.y1)*(t-s)/(l-s)+p.y1;this.drawIndicator([p.x2,C],this.options.indicator.color)}else{const C=(p.x2-p.x1)*(t-s)/(l-s)+p.x1;this.drawIndicator([C,p.y2],this.options.indicator.color)}},_canDrawSyncedIndicator(e,t){return!t||!!e!=!!this.options.horizontal?!1:this._isTimeBasedSyncEnabled(e)&&this._hasValidTimeRange()},_isTimeBasedSyncEnabled(e){var n,i;return this.options.syncHover===!1||!((i=(n=this.data)==null?void 0:n.labels)!=null&&i.length)?!1:e?this.options.axesY.every(({type:s})=>s==="time"):this.options.axesX.every(({type:s})=>s==="time")},_hasValidTimeRange(){var n,i;const e=+((n=this.data.labels)==null?void 0:n[0]),t=+((i=this.data.labels)==null?void 0:i[this.data.labels.length-1]);return e!=null&&t!=null},drawSyncedIndicatorForTooltip({dataLabel:e,mousePosition:t}){var u,f,p,g,m,b,C,y,w,T,k,M,Z;if(!((u=this.data)!=null&&u.labels)||!e)return;const n=this.data.labels.findIndex(S=>(S==null?void 0:S.valueOf())===(e==null?void 0:e.valueOf()));if(n===-1){this.overlayClear();return}const{horizontal:i}=this.options,s=this.getChartDOMClientRect(),[l,a]=t;if(St(l,s.left,s.right)&&St(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(i){const S=c.y2-c.y1,x=(f=this.options.axesY)==null?void 0:f.some(V=>V.categoryMode),L=(p=this.options.axesY)==null?void 0:p.some(V=>V.type==="time");let I;if(x)I=c.y1+S*(n+.5)/d;else if(L){const V=(m=(g=this.axesSteps)==null?void 0:g.y)==null?void 0:m[0],v=(V==null?void 0:V.graphMin)??+((b=this.data.labels)==null?void 0:b[0]),E=(V==null?void 0:V.graphMax)??+((C=this.data.labels)==null?void 0:C[this.data.labels.length-1]);I=c.y1+S*(+e-v)/(E-v)}else I=c.y1+S*n/(d-1);h=[c.x2,I]}else{const S=c.x2-c.x1,x=(y=this.options.axesX)==null?void 0:y.some(V=>V.categoryMode),L=(w=this.options.axesX)==null?void 0:w.some(V=>V.type==="time");let I;if(x)I=c.x1+S*(n+.5)/d;else if(L){const V=(k=(T=this.axesSteps)==null?void 0:T.x)==null?void 0:k[0],v=(V==null?void 0:V.graphMin)??+((M=this.data.labels)==null?void 0:M[0]),E=(V==null?void 0:V.graphMax)??+((Z=this.data.labels)==null?void 0:Z[this.data.labels.length-1]);I=c.x1+S*(+e-v)/(E-v)}else I=c.x1+S*n/(d-1);h=[I,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,i=[];return t.forEach(s=>{s.slice().reverse().forEach(l=>{const a=n[l];a&&a.showLegend&&e.includes(l)&&i.push(l)})}),Object.keys(n).forEach(s=>{const l=n[s];!l.isExistGrp&&l.showLegend&&e.includes(s)&&i.push(s)}),i},tooltipDestroy(){var e;(e=this._teardownCustomTooltipVirtualScroll)==null||e.call(this),this.tooltipDOM&&(this.tooltipDOM.remove(),this.tooltipDOM=null),this.isInitTooltip=!1}},SC=480,CC=28,kC=5,wC=50,IC={_shouldVirtualizeCustomTooltip(e){var i,s;if(this._vsDetectFailed)return!1;const t=(i=this.options)==null?void 0:i.tooltip;if(!((s=t==null?void 0:t.formatter)!=null&&s.html))return!1;const n=t.virtualScroll;return!n||n.use===!1?!1:n.use===!0?e>0:e>=(n.threshold??wC)},_findCustomTooltipContainer(e,t){if(!e||!e.querySelectorAll)return null;const n=e.querySelectorAll("[data-evui-tooltip-row]");if(n.length===t&&n.length>0){const s=n[0].parentElement;let l=!!s;for(let a=1;a<n.length;a++)if(n[a].parentElement!==s){l=!1;break}if(l)return s}const i=[e];for(;i.length;){const s=i.shift();if(s.children&&s.children.length===t)return s;if(s.children)for(let l=0;l<s.children.length;l++)i.push(s.children[l])}return null},_createVirtualScrollAnatomy(){const e=document.createElement("div");e.className="ev-chart-tooltip-virtual__spacer",e.setAttribute("aria-hidden","true");const t=document.createElement("div");t.className="ev-chart-tooltip-virtual__viewport";const n=document.createElement("div");return n.className="ev-chart-tooltip-virtual__spacer",n.setAttribute("aria-hidden","true"),{topSpacer:e,viewport:t,bottomSpacer:n}},_recomputeCustomTooltipPrefixSums(){const e=this.vsState,t=e.heights.length;e.prefixSums.length!==t+1&&(e.prefixSums=new Array(t+1));let n=0;e.prefixSums[0]=0;for(let i=0;i<t;i++)n+=e.heights[i],e.prefixSums[i+1]=n;e.totalHeight=n},_computeCustomTooltipVisibleRange(){const e=this.vsState,t=e.heights.length;if(!t)return{start:0,end:-1};const n=e.scrollEl.clientHeight||e.maxHeight,i=e.scrollEl.scrollTop;let s=0,l=t;for(;s<l;){const d=s+l>>>1;e.prefixSums[d+1]>i?l=d:s=d+1}const a=Math.max(0,s-e.overscan),r=i+n;for(s=a,l=t;s<l;){const d=s+l>>>1;e.prefixSums[d]>=r?l=d:s=d+1}const c=Math.min(t-1,s+e.overscan);return{start:a,end:c}},_syncCustomTooltipSpacers(){const e=this.vsState,t=e.prefixSums[e.range.start]||0,n=Math.max(0,e.totalHeight-(e.prefixSums[e.range.end+1]||e.totalHeight)),i=`${t}px`,s=`${n}px`;e.topSpacer.style.height!==i&&(e.topSpacer.style.height=i),e.bottomSpacer.style.height!==s&&(e.bottomSpacer.style.height=s)},_renderVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.items.length)return;const t=this._computeCustomTooltipVisibleRange();if(e.range.start===t.start&&e.range.end===t.end)e.range=t;else{for(;e.viewport.firstChild;)e.viewport.removeChild(e.viewport.firstChild);const s=document.createDocumentFragment();for(let l=t.start;l<=t.end;l++){const a=e.items[l];a&&s.appendChild(a)}e.viewport.appendChild(s),e.range=t}this._syncCustomTooltipSpacers();let i=!1;for(let s=t.start;s<=t.end;s++)if(!e.measured[s]){i=!0;break}if(i){const s=e.measureDepth||0;if(s<2){e.measureDepth=s+1;try{this._measureVisibleCustomTooltipRows()}finally{e.measureDepth=s}}}},_measureVisibleCustomTooltipRows(){const e=this.vsState;if(!e||!e.viewport)return;const t=e.viewport.children,n=t.length;if(!n)return;const i=e.range.start,s=e.prefixSums[i]||0;let l=!1,a=0,r=0;for(let c=0;c<n;c++){const d=e.range.start+c,h=t[c].offsetHeight;h>0&&(h!==e.heights[d]&&(e.heights[d]=h,l=!0),e.measured[d]=!0),e.isRow[d]&&h>0&&(a+=h,r+=1)}if(r>0){const c=a/r;if(e.learnedAverageHeight=c,c>0&&Math.abs(c-e.estimatedRowHeight)>.5){e.estimatedRowHeight=c;for(let d=0;d<e.heights.length;d++)e.isRow[d]&&!e.measured[d]&&e.heights[d]!==c&&(e.heights[d]=c,l=!0)}}if(l){this._recomputeCustomTooltipPrefixSums();const d=(e.prefixSums[i]||0)-s;d!==0&&(e.suppressScroll=!0,e.scrollEl.scrollTop+=d,requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.vsState&&(this.vsState.suppressScroll=!1)})})),this._renderVisibleCustomTooltipRows()}else this._syncCustomTooltipSpacers()},drawCustomTooltipVirtual(e){var y,w,T;const t=(y=this.options)==null?void 0:y.tooltip;if(!((w=t==null?void 0:t.formatter)!=null&&w.html))return!1;const n=[];Object.keys(e).forEach(k=>{n.push({sId:k,data:e[k].data,color:e[k].color,name:e[k].name,dataId:e[k].id,index:e[k].index})});let i;try{i=t.formatter.html(n)}catch(k){return console.warn("[evui] tooltip.formatter.html threw, falling back:",k),!1}const s=z.htmlToElement(i);if(!s||!s.children)return!1;const l=this._findCustomTooltipContainer(s,n.length);if(!l)return this._vsDetectFailed=!0,this._vsWarnedFallback||(this._vsWarnedFallback=!0,console.warn("[evui] tooltip.virtualScroll: formatter.html 반환 구조에서 row를 식별하지 못해 가상 스크롤을 건너뜁니다. 시리즈당 wrapper element에 `data-evui-tooltip-row` 속성을 추가하거나, row 컨테이너 직속 자식이 시리즈 수와 일치하도록 마크업을 정리하세요.")),!1;const a=Array.from(l.children);if(!a.length)return!1;const r=k=>!!(k.hasAttribute&&k.hasAttribute("data-evui-tooltip-row")),c=a.some(r),d=a.map(k=>c?r(k):!0);for(let k=0;k<a.length;k++){const M=a[k];M.parentNode&&M.parentNode.removeChild(M)}for(;l.firstChild;)l.removeChild(l.firstChild);const{topSpacer:h,viewport:u,bottomSpacer:f}=this._createVirtualScrollAnatomy();l.appendChild(h),l.appendChild(u),l.appendChild(f);const p=t.maxHeight||SC;l.style.maxHeight=`${p}px`,l.style.overflowY="auto",l.style.overflowX="hidden",l.style.overflowAnchor="none",this._teardownCustomTooltipVirtualScroll();const g=t.virtualScroll||{},m=this._vsLearnedAverageHeight,b=m??g.estimatedRowHeight??CC;this.vsState={scrollEl:l,topSpacer:h,viewport:u,bottomSpacer:f,items:a,isRow:d,heights:new Array(a.length).fill(b),measured:new Array(a.length).fill(!1),prefixSums:[],totalHeight:0,range:{start:0,end:-1},estimatedRowHeight:b,overscan:g.overscan??kC,maxHeight:p,rafPending:!1,suppressScroll:!1,learnedAverageHeight:m,resizeObserver:null,onScroll:null},this._recomputeCustomTooltipPrefixSums();const C=()=>{this.vsState&&(this.vsState.suppressScroll||this.vsState.rafPending||(this.vsState.rafPending=!0,requestAnimationFrame(()=>{this.vsState&&(this.vsState.rafPending=!1,this._renderVisibleCustomTooltipRows())})))};if(l.addEventListener("scroll",C,{passive:!0}),this.vsState.onScroll=C,typeof ResizeObserver<"u"){let k=l.clientWidth;const M=new ResizeObserver(()=>{if(!this.vsState)return;const Z=l.clientWidth;Z!==k&&(k=Z,this.vsState.measured.fill(!1),this.vsState.heights.fill(this.vsState.estimatedRowHeight),this._recomputeCustomTooltipPrefixSums(),this._renderVisibleCustomTooltipRows())});M.observe(l),this.vsState.resizeObserver=M}for(;this.tooltipDOM.firstChild;)this.tooltipDOM.removeChild(this.tooltipDOM.firstChild);return this.tooltipDOM.appendChild(s),this.tooltipDOM.style.overflowY="hidden",this.tooltipDOM.style.backgroundColor=t.backgroundColor,this.tooltipDOM.style.border=`1px solid ${t.borderColor}`,this.tooltipDOM.style.color=((T=t.fontColor)==null?void 0:T.title)??t.fontColor,this._renderVisibleCustomTooltipRows(),!0},_teardownCustomTooltipVirtualScroll(){const e=this.vsState;e&&(e.scrollEl&&e.onScroll&&e.scrollEl.removeEventListener("scroll",e.onScroll),e.resizeObserver&&e.resizeObserver.disconnect(),e.learnedAverageHeight&&(this._vsLearnedAverageHeight=e.learnedAverageHeight),this.vsState=null)}},LC={pieDataSet:[],drawPie(e,t=this.bufferCtx){var T;const n=this.chartRect,i=this.pieDataSet,s=this.options,l=this.options.padding,a=!!s.doughnutHoleSize;let r,c,d,h=1.5*Math.PI,u,f,p;const g=n.width/2,m=n.height/2,b=g-(l.left+l.right),C=m-(l.bottom+l.top);if(typeof b=="number"&&b<0||typeof C=="number"&&C<0)return;const y=Math.min(b,C)*s.doughnutHoleSize,w=Math.min(b,C);for(let k=0;k<i.length;k++){const M=i[k];if(!M)return;let Z=w-(w-y)/i.length*k;if((T=s==null?void 0:s.pieStroke)!=null&&T.use&&(Z-=s.pieStroke.lineWidth),Z<0)return;if(M.or=Z,k<i.length-1?M.ir=w-(w-y)/i.length*(k+1):M.ir=1,M.total){for(let S=0;S<M.data.length;S++)if(r=M.data[S],c=r.value,p=c/M.total*100,d=2*Math.PI*(c/M.total),u=h+d,r.sa=h,r.ea=u,f=this.seriesList[r.id],c){const x={...s.pieStroke};M.data.length===1&&s.pieStroke.use&&(x.use=!1,t.lineWidth=s.pieStroke.lineWidth,t.strokeStyle=s.pieStroke.color,t.arc(g,m,Z,0,2*Math.PI),t.stroke());const{selectInfo:L,legendHitInfo:I,unSelectedOpacity:V}=e;f.isSelect=(L==null?void 0:L.sId)===r.id,f.isDownplay=I&&I.sId!==r.id,f.type=a?"doughnut":"pie",f.centerX=g,f.centerY=m,f.radius=Z,f.doughnutHoleSize=Z*(s.doughnutHoleSize??0),f.startAngle=h,f.endAngle=u,f.data={o:c,percentage:p},f.draw(t,x,V),h+=d}}}},drawSunburst(e,t=this.bufferCtx){var m;const{width:n,height:i}=this.chartRect,s=this.pieDataSet,l=this.options,a=this.options.padding;this.calculateAngle();let r,c;const d=n/2,h=i/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 p=Math.min(u,f)*l.doughnutHoleSize,g=Math.min(u,f);for(let b=0;b<s.length;b++){const C=s[b];if(!C)return;let y=g-(g-p)/s.length*b;if((m=l==null?void 0:l.pieStroke)!=null&&m.use&&(y-=l.pieStroke.lineWidth),y<0)return;C.or=y,b<s.length-1?C.ir=g-(g-p)/s.length*(b+1):C.ir=1;for(let w=0;w<C.data.length;w++)if(r=C.data[w],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 T={...l.pieStroke};C.data.length===1&&l.pieStroke.use&&(T.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:k,legendHitInfo:M,unSelectedOpacity:Z}=e;c.isSelect=(k==null?void 0:k.sId)===r.id,c.isDownplay=M&&M.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,T,Z)}}},drawDoughnutHole(e=this.bufferCtx){var h;const t=this.options,{width:n,height:i}=this.chartRect,s=this.options.padding,l=n/2,a=i/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}},TC={drawTips(e,t=this.bufferCtx){var u,f,p,g,m,b,C,y;const n=this.options;let i=null;const s=!!n.horizontal,l=n.maxTip,a=n.selectItem,r=n.selectLabel;let c,d;typeof((u=n.tooltip)==null?void 0:u.formatter)=="function"?i=(f=n.tooltip)==null?void 0:f.formatter:typeof((g=(p=n.tooltip)==null?void 0:p.formatter)==null?void 0:g.value)=="function"&&(i=(b=(m=n.tooltip)==null?void 0:m.formatter)==null?void 0:b.value),r.use&&r.showTip&&(d=n.type==="heatMap"?this.drawLabelTipForHeatMap(t):this.drawTipForSelectedLabel(t));const h=w=>{e.forEach(T=>{if(T){const k=this.seriesList[T==null?void 0:T.sId];if(!(k!=null&&k.show))return;const M=this.calculateTipInfo(k,"sel",T);if(M&&M.dp!==null){let Z=!1;if(l.use&&(c==null?void 0:c.dp)===M.dp&&(Z=!0),w.showTextTip||w.showTip){if(w.tipText==="label"){const S=s?n.axesY[0]:n.axesX[0],x=M.label;M.text=S.type==="time"?Ne(x).format(S.timeFormat):x}else M.text=Qt(M.value);this.drawTextTip({opt:w,tipType:"sel",seriesOpt:k,isSamePos:Z,ctx:t,...M})}w.showIndicator&&this.drawFixedIndicator({opt:w,seriesOpt:k,ctx:t,...M})}T&&(T!=null&&T.label)&&(T==null?void 0:T.label)===0&&(this.lastHitInfo=T)}})};if(e&&!d&&(a.use?h(a):r.use&&n.type==="line"&&h(r)),l.use&&!d){const w=s?this.axesSteps.y[0]:this.axesSteps.x[0],T=w==null?void 0:w.minIndex,k=w==null?void 0:w.maxIndex,M=(y=(C=s?this.axesY[0]:this.axesX[0])==null?void 0:C.labels)==null?void 0:y.length,Z=Number.isFinite(M)?M-1:k,S=Number.isFinite(T)&&Number.isFinite(k),x=S&&k<T,L=S&&(T>0||k<Z);let I,V=null;x?I=void 0:L?(V=this.getVisibleWindowMaxSeries(T,k),I=V==null?void 0:V.sId):I=this.minMax[s?"x":"y"][0].maxSID;const v=I?this.seriesList[I]:null;v&&(c=this.calculateTipInfo(v,"max",V),l.use&&c&&c.dp!==null&&(i?c.text=i({seriesId:v.sId,x:s?c.value:void 0,y:s?void 0:c.value}):c.text=Qt(c.value),this.drawTextTip({opt:l,tipType:"max",seriesOpt:v,ctx:t,...c}),l.showIndicator&&this.drawFixedIndicator({opt:l,seriesOpt:v,ctx:t,...c})))}},calculateTipInfo(e,t,n){if(!e)return!1;const i=!!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,p=r.x2,g=r.y2,{type:m,size:b}=e,{maxDomain:C,maxDomainIndex:y}=e.minMax;if(C===null||y<0)return!1;const w=m==="bar"?n==null?void 0:n.index:n==null?void 0:n.domain,T=t==="max"&&n&&Number.isFinite(w)&&Number.isFinite(n.value);let k;T?k=w:k=m==="bar"?y:C,t==="sel"&&(n&&n.label!==null?(s.pos=m==="bar"?n.dataIndex:n.label,k=s.pos):s.pos!==null&&(k=s.pos));let M;T?M=n.value:M=i?e.minMax.maxX:e.minMax.maxY;let Z;if(t==="sel"){if(n&&n.label!==null)Z=n.label,n.value!==null?(M=n.useStack?n.acc:n.value,s.value=M):s.value!==null&&(M=s.value),s.label=Z;else if(s.value!==null)M=s.value,Z=s.label;else if(s.pos!==null){const E=m==="bar"?"getItemByLabelIndex":"getItemByLabel";if(typeof this[E]=="function"){const G=this[E](s.pos);M=G.useStack?G.acc:G.value,Z=G.label,s.value=M,s.label=Z}}}const S=i?h.graphMax:u.graphMax;if((t==="max"||t==="sel")&&M>S&&!this.options.displayOverflow)return!1;let x,L,I;if(m==="bar"){const E=i?this.scrollbar.y:this.scrollbar.x;if(E!=null&&E.use){const[G,R]=(E==null?void 0:E.range)??[];if(k>=G&&k<=R)k-=G??0;else return!1}else{const G=i?u:h,{minIndex:R,maxIndex:X}=G??{};if(Number.isFinite(R)&&Number.isFinite(X))if(k>=R&&k<=X)k-=R;else return!1}i?(L=Math.round(b.h/2),x=g-b.cat*k-b.cPad,I=x-(b.bar*b.ix-(b.h+b.bPad))-L):(L=Math.round(b.w/2),x=f+b.cat*k+b.cPad,I=x+(b.bar*b.ix-(b.w+b.bPad))+L)}else m==="line"?I=ne.calculateX(k,h.graphMin,h.graphMax,d-b.comboOffset,f+b.comboOffset/2):m==="scatter"&&(I=ne.calculateX(k,h.graphMin,h.graphMax,d,f));return{...{xArea:d,yArea:c,graphX:h,graphY:u,xsp:f,xep:p,ysp:g},...{dp:I,value:M,label:Z,type:m}}},drawFixedIndicator(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,ysp:c,dp:d,type:h,value:u,opt:f,seriesOpt:p}=e;let g=0;h==="line"?g+=3:h==="scatter"&&(g+=(p==null?void 0:p.pointSize)??0);let m;if(f.fixedPosTop)t?m=ne.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r):(m=ne.calculateY(s.graphMax,s.graphMin,s.graphMax,a,c),m-=g);else if(t){const b=Math.min(Math.max(u,i.graphMin),i.graphMax);m=ne.calculateX(b,i.graphMin,i.graphMax,l,r)}else{const b=Math.min(Math.max(u,s.graphMin),s.graphMax);m=ne.calculateY(b,s.graphMin,s.graphMax,a,c),m-=g}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(e=this.bufferCtx){var c,d;const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s,data:l,label:a}=this.defaultSelectInfo;let r=!1;if(s.length){r=!0;const h=this.chartRect,u=this.labelOffset,f={x1:h.x1+u.left,x2:h.x2-u.right,y1:h.y1+u.top,y2:h.y2-u.bottom},p=n?this.axesY[0]:this.axesX[0],g=n?this.axesX[0]:this.axesY[0],m=n?this.axesSteps.x[0]:this.axesSteps.y[0],b=n?ne.calculateX:ne.calculateY,C=n?ne.calculateY:ne.calculateX,y=n?this.scrollbar.y:this.scrollbar.x,w=h.chartWidth-(u.left+u.right),T=h.chartHeight-(u.top+u.bottom),k=n?w:T,M=f[g.units.rectStart];let Z=this.options.type==="bar"?4:6;Z*=n?1:-1;const S=Object.keys(this.seriesList??{}),x=S.filter(B=>this.seriesList[B].show),L=S.some(B=>this.seriesList[B].isExistGrp&&!this.seriesList[B].isOverlapping),I=((c=this.data.groups)==null?void 0:c[0])??[];let V,v,E,G,R,X,W,N,P,D=0,H=(d=p.labels)==null?void 0:d.length;if(p.labels){let B=p.labels.length;if(y!=null&&y.use){const{range:Y,interval:O,type:_}=y,[A,Q]=Y??[];if(ve(A)&&ve(Q))B=Math.floor((+Q-+A)/O)+1,D=_==="step"?A:p.labels.findIndex(U=>U===+A),H=_==="step"?Q:p.labels.findIndex(U=>U===+Q);else{const U=n?this.axesSteps.y[0]:this.axesSteps.x[0];Number.isFinite(U==null?void 0:U.minIndex)&&Number.isFinite(U==null?void 0:U.maxIndex)&&U.minIndex<U.maxIndex&&(D=U.minIndex,H=U.maxIndex,B=H-D+1)}}G=f[p.units.rectStart],R=f[p.units.rectEnd],X=(R-G)/B}else W=this.axesSteps.x[0],N=S.find(B=>{var Y;return((Y=this.seriesList[B])==null?void 0:Y.type)==="line"}),P=this.seriesList[N].size;l.forEach((B,Y)=>{var O;if(E=m.graphMax,!i.fixedPosTop){if(L){const _=x==null?void 0:x.reduce((U,ee)=>{var $,te;return I.includes(ee)&&((($=B[ee])==null?void 0:$.value)??B[ee])>0?U+(((te=B[ee])==null?void 0:te.value)??B[ee]):U},0),A=((O=x==null?void 0:x.filter(U=>!I.includes(U)))==null?void 0:O.map(U=>{var ee;return((ee=B[U])==null?void 0:ee.value)??B[U]}))??[],Q=(A==null?void 0:A.length)>0?A.reduce((U,ee)=>Math.max(U,ee??-1/0),-1/0):-1/0;E=_>0?Math.max(Q,_):Math.max(Q,0)}else if(x.length){const _=x.map(Q=>{var U;return((U=B[Q])==null?void 0:U.value)??B[Q]}),A=_.length>0?_.reduce((Q,U)=>Math.max(Q,U??-1/0),-1/0):-1/0;E=A>0||this.options.type!=="bar"?A:0}}if(p.labels){if(s[Y]<D||s[Y]>H)return;const _=s[Y]-D;V=Math.round(G+X*_)+X/2}else V=C(a[Y],W.graphMin,W.graphMax,w-P.comboOffset,f.x1+P.comboOffset/2);v=b(E,m.graphMin,m.graphMax,k,M)+Z,this.showTip({context:e,x:n?v:V,y:n?V:v,opt:i,isSamePos:!1})})}return r},drawLabelTipForHeatMap(e=this.bufferCtx){const t=this.options,n=!!t.horizontal,i=t.selectLabel,{dataIndex:s}=this.defaultSelectInfo;let l=!1;if(s){l=!0;const a=this.chartRect,r=this.labelOffset,c={x1:a.x1+r.left,x2:a.x2-r.right,y1:a.y1+r.top,y2:a.y2-r.bottom},d=n?this.axesY[0]:this.axesX[0],h=c[d.units.rectStart],f=(c[d.units.rectEnd]-h)/d.labels.length,p=n?this.axesX[0]:this.axesY[0],g=6*(n?1:-1),m=c[p.units.rectEnd]+g;s==null||s.forEach(b=>{const y=Math.round(h+f*b)+f/2;this.showTip({context:e,x:n?m:y,y:n?y:m,opt:i,isSamePos:!1})})}return l},drawTextTip(e){const t=!!this.options.horizontal,n=e.ctx??this.bufferCtx,{graphX:i,graphY:s,xArea:l,yArea:a,xsp:r,xep:c,ysp:d}=e,{dp:h,value:u,text:f,opt:p,type:g,tipType:m,isSamePos:b,seriesOpt:C}=e,y=4,w=4,{fontSize:T,fontFamily:k,fontWeight:M,height:Z}=p.tipStyle,S=`normal normal ${M} ${T}px ${k}`;let x=1;g==="line"?x+=6:g==="scatter"?x+=C==null?void 0:C.pointSize:g==="bar"&&(x+=4);let L,I=h;if(p.fixedPosTop)t?(L=ne.calculateX(i.graphMax,i.graphMin,i.graphMax,l,r),L+=x):(L=ne.calculateY(s.graphMax,s.graphMin,s.graphMax,a,d),L-=x);else if(t){const E=Math.min(Math.max(u,i.graphMin),i.graphMax);L=ne.calculateX(E,i.graphMin,i.graphMax,l,r),L=u<0?L-x:L+x}else{const E=g==="bar"&&u<0?0:u,G=Math.min(Math.max(E,s.graphMin),s.graphMax);L=ne.calculateY(G,s.graphMin,s.graphMax,a,d),L=E<0?L+x:L-x}let V="center";n.save(),n.font=S;const v=Math.round(Math.max(n.measureText(f).width+12,40));t||(h+v/2>c-10?(V="right",I-=v/2-y*2):h-v/2<r+10&&(V="left",I+=v/2-y*2)),n.restore(),(p.showTextTip||m==="max")&&this.showTextTip({context:n,type:V,width:v,height:Z,x:t?L+v/2:I,y:t?I+Z/2:L,opt:p,arrowSize:y,borderRadius:w,text:f,textStyle:S,isNegative:u<0}),p.showTip&&m==="sel"&&this.showTip({context:n,x:t?L:h,y:t?h:L,opt:p,isSamePos:b})},showTextTip(e){const t=!!this.options.horizontal,{type:n,width:i,height:s,x:l,y:a,arrowSize:r,borderRadius:c,text:d,opt:h,textStyle:u,isNegative:f}=e,p=e.context;let g=l-i/2,m=l+i/2;const b=a-s,C=a;f&&t&&(g=l-i/2-i,m=l-i/2),p.save(),p.font=u,p.fillStyle=h.tipBackground??h.tipStyle.background,p.shadowBlur=0,p.beginPath(),p.moveTo(g+c,b),p.quadraticCurveTo(g,b,g,b+c),p.lineTo(g,C-c),p.quadraticCurveTo(g,C,g+c,C),p.lineTo(m-c,C),p.quadraticCurveTo(m,C,m,C-c),p.lineTo(m,b+c),p.quadraticCurveTo(m,b,m-c,b),p.lineTo(g+c,b),p.closePath(),p.fill(),p.beginPath(),t?(f?(p.moveTo(m,C),p.lineTo(m,b+c+r/2),p.lineTo(m+r,C-s/2),p.lineTo(m,C-c-r/2)):(p.moveTo(g,b),p.lineTo(g,b+c+r/2),p.lineTo(g-r,C-s/2),p.lineTo(g,C-c-r/2)),p.closePath(),p.fill()):(f?n==="left"?(p.lineTo(g+c+r,C+r),p.lineTo(g+c+r*2,C)):n==="right"?(p.lineTo(m-r*2-c,C),p.lineTo(m-r-c,C+r)):(p.lineTo(l-r,C),p.lineTo(l,C+r),p.lineTo(l+r,C)):f||(n==="left"?(p.moveTo(g,b),p.lineTo(g+c+r,C+r),p.lineTo(g+c+r*2,C)):n==="right"?(p.moveTo(m,b),p.lineTo(m-r*2-c,C),p.lineTo(m-r-c,C+r)):(p.lineTo(l-r,C),p.lineTo(l,C+r),p.lineTo(l+r,C))),p.closePath(),p.fill()),p.restore(),p.save(),p.font=u,p.fillStyle=h.tipTextColor??h.tipStyle.textColor,p.textBaseline="middle",p.textAlign="center",p.fillText(`${d}`,g+i/2,b+s/2),p.restore()},showTip(e){const t=!!this.options.horizontal,{x:n,y:i,opt:s,isSamePos:l}=e,a=e.context,c=i-(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()}},MC={initBlitState(){var e;this._blitPrev=null,this._blitDiag=null,this.pointsLayerA=null,this.pointsLayerB=null,this.pointsLayerACtx=null,this.pointsLayerBCtx=null,this.curPointsLayer="A",this.pointsLayerValid=!1,this._blitCarry=0,this._framesSinceFullRedraw=0,this._pointsLayerStamp=null,this._pointsLayerOptionsRef=null,this._hitCoordsDirty=!1,(e=this.options.realTimeScatter)!=null&&e.use&&this.createPointsLayers()},createPointsLayers(){this.pointsLayerA||(this.pointsLayerA=document.createElement("canvas"),this.pointsLayerB=document.createElement("canvas"),this.pointsLayerACtx=this.pointsLayerA.getContext("2d"),this.pointsLayerBCtx=this.pointsLayerB.getContext("2d"),this.curPointsLayer="A",this.pointsLayerValid=!1)},getPointsLayers(){const e=this.curPointsLayer==="A";return{src:e?this.pointsLayerA:this.pointsLayerB,srcCtx:e?this.pointsLayerACtx:this.pointsLayerBCtx,dst:e?this.pointsLayerB:this.pointsLayerA,dstCtx:e?this.pointsLayerBCtx:this.pointsLayerACtx,dstName:e?"B":"A"}},pointsLayersSized(){return!this.pointsLayerA||!this.bufferCanvas?!1:this.pointsLayerA.width===this.bufferCanvas.width&&this.pointsLayerA.height===this.bufferCanvas.height&&this.pointsLayerA.width>1&&this.pointsLayerA.height>1},collectStripDuplicatePoints(e,t){var s,l,a;const n=((l=(s=this.seriesInfo)==null?void 0:s.charts)==null?void 0:l.scatter)??[],i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?r--:r++){const c=this.seriesList[n[r]];if(!(c!=null&&c.show))continue;const d=(a=c.data[c.sId])==null?void 0:a.dataGroup;if(d)for(let h=0;h<t.length;h++){const u=d[t[h]];if(u!=null&&u.data)for(let f=0;f<u.data.length;f++){const p=u.data[f];e.set(p.k??z.coordinateKey(p.x,p.y),c.sId)}}}},getBlitScatterSeriesList(){var n,i;const e=((i=(n=this.seriesInfo)==null?void 0:n.charts)==null?void 0:i.scatter)??[],t=[];for(let s=0;s<e.length;s++){const l=this.seriesList[e[s]];l!=null&&l.show&&t.push({sId:e[s],series:l,xi:l.xAxisIndex??0,yi:l.yAxisIndex??0})}return t},getBlitScatterSeries(){return this.getBlitScatterSeriesList()[0]??null},areBlitSeriesAligned(e){var n,i,s,l;if(!e||e.length<1)return!1;const t=(i=(n=this.dataSet)==null?void 0:n[e[0].sId])==null?void 0:i.lastTick;if(!t)return!1;for(let a=1;a<e.length;a++){const r=(l=(s=this.dataSet)==null?void 0:s[e[a].sId])==null?void 0:l.lastTick;if(!r||r.gapCount!==t.gapCount||r.toTime!==t.toTime||r.endIndex!==t.endIndex||r.length!==t.length)return!1}return!0},evaluateBlitGate(e){var m,b,C,y,w,T,k,M,Z,S,x,L,I,V,v;const t=this.options,n=this._blitPrev,i=this.isInit===!0&&((m=t.realTimeScatter)==null?void 0:m.use)===!0&&!t.brush&&this.updateSeries!==!0&&!e&&!((C=(b=this.scrollbar)==null?void 0:b.x)!=null&&C.use||(w=(y=this.scrollbar)==null?void 0:y.y)!=null&&w.use),s=this.getBlitScatterSeriesList(),l=this.areBlitSeriesAligned(s),a=!((T=t.selectItem)!=null&&T.use&&(((k=this.defaultSelectItemInfo)==null?void 0:k.dataIndex)!=null||((M=this.lastHitInfo)==null?void 0:M.dataIndex)!=null))&&!((Z=t.selectSeries)!=null&&Z.use&&this.defaultSelectInfo)&&!this.legendHover,r={modeOk:i,seriesAligned:l,selectionOk:a,scatterOnly:this.hasOnlyVisibleScatter(),hasPrev:!!n,optionsStable:!!n&&n.optionsRef===this.options,yFixed:!1,xWidthStable:!1,xAreaStable:!1,labelOffsetStable:!1,xMonotonic:!1,deviceStable:!1,gapOk:!1};let c=0,d=0,h=0;const u=s[0]??null,f=u?(x=(S=this.axesSteps)==null?void 0:S.x)==null?void 0:x[u.xi]:null,p=u?(I=(L=this.axesSteps)==null?void 0:L.y)==null?void 0:I[u.yi]:null;if(u&&f&&p&&this.chartRect&&this.labelOffset){const E=this.chartRect,G=E.chartWidth-(this.labelOffset.left+this.labelOffset.right);n&&(r.yFixed=p.graphMin===n.graphMinY&&p.graphMax===n.graphMaxY,r.xWidthStable=f.graphMax-f.graphMin===n.graphMaxX-n.graphMinX,r.xAreaStable=G===n.xArea,r.labelOffsetStable=this.labelOffset.left===n.labelOffsetLeft&&this.labelOffset.right===n.labelOffsetRight,c=f.graphMin-n.graphMinX,r.xMonotonic=Number.isFinite(c)&&c>0,r.deviceStable=this.pixelRatio===n.pixelRatio&&E.chartWidth===n.chartWidth&&E.chartHeight===n.chartHeight&&E.x1===n.x1&&E.y2===n.y2);const R=(v=(V=this.dataSet)==null?void 0:V[u.sId])==null?void 0:v.lastTick;R&&(d=R.gapCount??0,h=R.length??0,r.gapOk=d>0&&d<h)}return{ok:r.modeOk&&r.seriesAligned&&r.selectionOk&&r.scatterOnly&&r.hasPrev&&r.optionsStable&&r.yFixed&&r.xWidthStable&&r.xAreaStable&&r.labelOffsetStable&&r.xMonotonic&&r.deviceStable&&r.gapOk,parts:r,shiftMs:c,gapCount:d,length:h,scatterList:s}},hasOnlyVisibleScatter(){var n,i;const e=((n=this.seriesInfo)==null?void 0:n.charts)??{},t=Object.keys(e);for(let s=0;s<t.length;s++){if(t[s]==="scatter")continue;const l=e[t[s]];for(let a=0;a<l.length;a++)if((i=this.seriesList[l[a]])!=null&&i.show)return!1}return!0},snapshotBlitState(){var s,l,a,r,c;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeries();if(!e)return null;const t=(a=(l=this.axesSteps)==null?void 0:l.x)==null?void 0:a[e.xi],n=(c=(r=this.axesSteps)==null?void 0:r.y)==null?void 0:c[e.yi];if(!t||!n||!this.chartRect||!this.labelOffset)return null;const i=this.chartRect;return{sId:e.sId,graphMinX:t.graphMin,graphMaxX:t.graphMax,graphMinY:n.graphMin,graphMaxY:n.graphMax,xArea:i.chartWidth-(this.labelOffset.left+this.labelOffset.right),labelOffsetLeft:this.labelOffset.left,labelOffsetRight:this.labelOffset.right,pixelRatio:this.pixelRatio,chartWidth:i.chartWidth,chartHeight:i.chartHeight,x1:i.x1,y2:i.y2,optionsRef:this.options}},recordBlitDiag(e,t,n){var s;if(typeof window>"u"||!window.__EVUI_BLIT_DEBUG__)return;(s=this.options.realTimeScatter)!=null&&s.use&&(window.__EVUI_BLIT_CHART__=this),this._blitDiag||(this._blitDiag={ticks:0,eligible:0,blitted:0,fail:{},rate:0,lastShiftMs:0,lastGap:0});const i=this._blitDiag;if(i.ticks++,i.lastShiftMs=e.shiftMs,i.lastGap=e.gapCount,e.ok)i.eligible++;else{const l=Object.keys(e.parts);for(let a=0;a<l.length;a++)e.parts[l[a]]||(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}if(e.ok&&!t&&n){const l=Object.keys(n);for(let a=0;a<l.length;a++)n[l[a]]&&(i.fail[l[a]]=(i.fail[l[a]]||0)+1)}t&&i.blitted++,i.rate=i.blitted/i.ticks,window.__EVUI_BLIT_DIAG__=i},drawChartBlitFastPath(e,t){var B,Y,O,_;const n=t.scatterList??this.getBlitScatterSeriesList(),i=n[0]??null,s=(Y=(B=this.dataSet)==null?void 0:B[i==null?void 0:i.sId])==null?void 0:Y.lastTick;if(!i||!s)return!1;const l=this.pixelRatio,a=this.chartRect,r=this.labelOffset,c=this.axesSteps.x[i.xi],d=a.chartWidth-(r.left+r.right),h=c.graphMax-c.graphMin;if(!(h>0)||!(d>0))return!1;const p=d/h*t.shiftMs*l+this._blitCarry,g=Math.floor(p);if(g<1)return!1;let m=s.maxDirtyAge,b=typeof i.series.pointSize=="number"?i.series.pointSize:i.series.pointSize.value;for(let A=1;A<n.length;A++){const Q=(_=(O=this.dataSet)==null?void 0:O[n[A].sId])==null?void 0:_.lastTick;Q&&Q.maxDirtyAge>m&&(m=Q.maxDirtyAge);const U=n[A].series.pointSize,ee=typeof U=="number"?U:U.value;ee>b&&(b=ee)}if(m>s.gapCount+1)return!1;const C=this.bufferCanvas.width,y=this.bufferCanvas.height;if(g>=C)return!1;this._blitCarry=p-g;const{src:w,dst:T,dstCtx:k,dstName:M}=this.getPointsLayers();k.setTransform(1,0,0,1,0,0),k.clearRect(0,0,C,y),k.drawImage(w,g,0,C-g,y,0,0,C-g,y);const Z=Math.ceil(b*l)+1,S=(a.x1+r.left+d)*l,x=d/h*1e3*l,{gapCount:L,endIndex:I,length:V}=s,v=Z+Math.ceil(4*l),E=Math.max(2,Math.ceil((v+Z+2)/Math.max(1e-6,x))),G=Math.min(V,L+E),R=S-G*x,X=Math.max(0,Math.floor(R+v));k.clearRect(X,0,C-X,y);const W=new Array(G);for(let A=0;A<G;A++){let Q=(I-A)%V;Q<0&&(Q+=V),W[A]=Q}const N=this.options.coordinateDedupe!==!1&&n.length>1,P=N?new Map:null;N&&this.collectStripDuplicatePoints(P,W);const D={chartRect:a,labelOffset:r,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity,duple:P,coordinateDedupe:N};k.save(),k.beginPath(),k.rect(X,0,C-X,y),k.clip(),k.setTransform(l,0,0,l,0,0);const H=!!this.options.seriesReverse;for(let A=0;A<n.length;A++)(H?n[n.length-1-A]:n[A]).series.realTimeScatterDrawStrip(k,W,D);k.restore(),k.setTransform(1,0,0,1,0,0),this.curPointsLayer=M;for(let A=0;A<n.length;A++)n[A].series.refreshRtTotalCount();return this.drawStaticLayer(this.bufferCtx,e),this.compositePointsLayer(T,b),!0},compositePointsLayer(e,t){const n=this.pixelRatio,i=this.chartRect,s=this.labelOffset,l=i.chartWidth-(s.left+s.right),a=i.chartHeight-(s.top+s.bottom),r=i.x1+s.left,c=i.y2-s.bottom,d=c-a,h=r+l,u=(r-t)*n,f=(d-t)*n,p=(h+t)*n,g=(c+t)*n;this.bufferCtx.save(),this.bufferCtx.setTransform(1,0,0,1,0,0),this.bufferCtx.beginPath(),this.bufferCtx.rect(u,f,p-u,g-f),this.bufferCtx.clip(),this.bufferCtx.drawImage(e,0,0),this.bufferCtx.restore()},computePointsLayerStamp(){var s,l,a,r,c,d,h;if(!((s=this.options.realTimeScatter)!=null&&s.use))return null;const e=this.getBlitScatterSeriesList();if(!e.length||!this.chartRect||!this.labelOffset||!this.axesSteps)return null;const t=this.chartRect,n=this.labelOffset,i=[this.pixelRatio,(l=this.bufferCanvas)==null?void 0:l.width,(a=this.bufferCanvas)==null?void 0:a.height,t.chartWidth,t.chartHeight,t.x1,t.y2,n.left,n.right,n.top,n.bottom];for(let u=0;u<e.length;u++){const{sId:f,xi:p,yi:g}=e[u],m=(c=(r=this.dataSet)==null?void 0:r[f])==null?void 0:c.lastTick,b=(d=this.axesSteps.x)==null?void 0:d[p],C=(h=this.axesSteps.y)==null?void 0:h[g];if(!b||!C)return null;i.push(f,m?`${m.seq}/${m.toTime}/${m.endIndex}/${m.length}`:"nt",b.graphMin,b.graphMax,C.graphMin,C.graphMax)}return i.join("|")},maybeRebuildPointsLayer(e=!1){var n;if(!((n=this.options.realTimeScatter)!=null&&n.use))return!1;const t=this.computePointsLayerStamp();return!e&&t&&this.pointsLayerValid&&this._pointsLayerStamp===t&&this._pointsLayerOptionsRef===this.options?!1:(this.rebuildPointsLayer(),this._pointsLayerStamp=this.pointsLayerValid?t:null,this._pointsLayerOptionsRef=this.pointsLayerValid?this.options:null,this.pointsLayerValid)},canRouteFallbackViaLayer(e){var n,i,s,l,a;const t=this.options;return!((n=t.realTimeScatter)!=null&&n.use)||e||(i=t.selectItem)!=null&&i.use&&(((s=this.defaultSelectItemInfo)==null?void 0:s.dataIndex)!=null||((l=this.lastHitInfo)==null?void 0:l.dataIndex)!=null)||(a=t.selectSeries)!=null&&a.use&&this.defaultSelectInfo||!this.pointsLayersSized()||!this.hasOnlyVisibleScatter()?!1:this.getBlitScatterSeriesList().length>0},ensureHitCoordsFresh(){var n,i,s;if(!this._hitCoordsDirty||!((n=this.options.realTimeScatter)!=null&&n.use)||!this.chartRect||!this.labelOffset||!this.axesSteps)return;const e=this.getBlitScatterSeriesList(),t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow};for(let l=0;l<e.length;l++)(s=(i=e[l].series).refreshRtHitCoords)==null||s.call(i,t);this._hitCoordsDirty=!1},getMaxVisibleScatterPointSize(){const e=this.getBlitScatterSeriesList();let t=0;for(let n=0;n<e.length;n++){const i=e[n].series.pointSize,s=typeof i=="number"?i:(i==null?void 0:i.value)??0;s>t&&(t=s)}return t},rebuildPointsLayer(){var h,u,f;if(!((h=this.options.realTimeScatter)!=null&&h.use)||!this.pointsLayersSized()){this.pointsLayerValid=!1;return}const e=this.getBlitScatterSeriesList();if(!e.length){this.pointsLayerValid=!1;return}const t=this.pixelRatio,n=this.curPointsLayer==="A",i=n?this.pointsLayerA:this.pointsLayerB,s=n?this.pointsLayerACtx:this.pointsLayerBCtx;s.setTransform(1,0,0,1,0,0),s.clearRect(0,0,i.width,i.height),s.setTransform(t,0,0,t,0,0);const l=((f=(u=this.seriesInfo)==null?void 0:u.charts)==null?void 0:f.scatter)??[],a=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(l),r=new Map;a&&this.collectDuplicatePoints(r,l);const c={ctx:s,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,displayOverflow:this.options.displayOverflow,duple:r,coordinateDedupe:a,selectInfo:null,legendHitInfo:null,unSelectedOpacity:this.options.unSelectedOpacity},d=!!this.options.seriesReverse;for(let p=0;p<e.length;p++){const g=d?e[e.length-1-p]:e[p];g.series.computeGeometry(c),g.series.realTimeScatterDraw(c)}s.setTransform(1,0,0,1,0,0),this.pointsLayerValid=!0}},_r=2,vC=["type","horizontal","sunburst","coordinateDedupe","unSelectedOpacity","displayOverflow","thickness","cPadRatio","borderRadius","seriesReverse","maxTip","padding","heatMapColor"],RC=["sId","type","name","show","color","fill","fillColor","fillOpacity","pointFill","point","lineWidth","thickness","pointSize","pointStyle","interpolation","passingValue","hasPassingValueInData","segments","combo","xAxisIndex","yAxisIndex","stackIndex","groupIndex","isExistGrp","showValue"];function st(e){if(e===null)return null;const t=typeof e;if(t==="number"||t==="string"||t==="boolean")return e;if(t==="function"||t==="undefined"||t==="symbol"||t==="bigint")return;if(Array.isArray(e))return e.map(i=>st(i)??null);const n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){const i={};return Object.keys(e).forEach(s=>{const l=st(e[s]);l!==void 0&&(i[s]=l)}),i}}function Ur(e,t){const n={};return e&&t.forEach(i=>{const s=st(e[i]);s!==void 0&&(n[i]=s)}),n}function Jr(e,t){if(t==="time")return Fr(e);if(typeof e=="number")return e;if(t==="step"){const n=Number(e);return Number.isFinite(n)?n:null}return null}function VC(e,t={}){const n=e.data??[];if(e.type==="pie")return{value:n.map(d=>typeof(d==null?void 0:d.value)=="number"?d.value:null)};const i=t.x??"linear",s=t.y??"linear",l=new Array(n.length),a=new Array(n.length),r=new Array(n.length),c=new Array(n.length);for(let d=0;d<n.length;d++){const h=n[d]??{};l[d]=Jr(h.x,i),a[d]=Jr(h.y,s),r[d]=typeof h.o=="number"?h.o:null,c[d]=typeof h.b=="number"?h.b:null}return{x:l,y:a,o:r,b:c}}function EC(e){var s,l,a,r,c,d,h,u;const t=e.options??{},n=e.defaultSelectInfo,i=e.defaultSelectItemInfo;return{selectSeries:{use:!!((s=t.selectSeries)!=null&&s.use),selected:{seriesId:st(n==null?void 0:n.seriesId)??[]}},selectItem:{use:!!((l=t.selectItem)!=null&&l.use),useSeriesOpacity:!!((a=t.selectItem)!=null&&a.useSeriesOpacity),showBorder:!!((r=t.selectItem)!=null&&r.showBorder),borderStyle:st((c=t.selectItem)==null?void 0:c.borderStyle)??null,selected:i?{dataIndex:i.dataIndex??null,seriesID:i.seriesID??null}:null},selectLabel:{use:!!((d=t.selectLabel)!=null&&d.use),useSeriesOpacity:!!((h=t.selectLabel)!=null&&h.useSeriesOpacity),useBothAxis:!!((u=t.selectLabel)!=null&&u.useBothAxis),selected:{dataIndex:st(n==null?void 0:n.dataIndex)??[],label:st(n==null?void 0:n.label)??[],targetAxis:(n==null?void 0:n.targetAxis)??null}}}}function GC(e,t=0){var a,r,c,d,h;const n={},i=e.seriesList??{};Object.keys(i).forEach(u=>{var m,b,C,y,w,T;const f=i[u];if(!f||typeof f.hasRenderableValue=="function"&&!f.isExistGrp&&!f.hasRenderableValue())return;const p=((C=(b=(m=e.options)==null?void 0:m.axesX)==null?void 0:b[f.xAxisIndex??0])==null?void 0:C.type)??"linear",g=((T=(w=(y=e.options)==null?void 0:y.axesY)==null?void 0:w[f.yAxisIndex??0])==null?void 0:T.type)??"linear";n[u]={...Ur(f,RC),data:VC(f,{x:p,y:g})},f.type==="heatMap"&&f.labels&&(n[u].labels=st(f.labels)??{})});const s={},l=((a=e.seriesInfo)==null?void 0:a.charts)??{};return Object.keys(l).forEach(u=>{s[u]=(l[u]??[]).filter(f=>n[f])}),{version:_r,epoch:t,pixelRatio:e.pixelRatio??1,chartRect:st(e.chartRect)??{},labelOffset:st(e.labelOffset)??{},axesSteps:{x:st((r=e.axesSteps)==null?void 0:r.x)??[],y:st((c=e.axesSteps)==null?void 0:c.y)??[]},options:{...Ur(e.options,vC),isGradient:((h=(d=e.options)==null?void 0:d.legend)==null?void 0:h.type)==="gradient"},selection:EC(e),seriesOrder:s,series:n}}function WC(e){const t={},n=[],i=e.series??{};return Object.keys(i).forEach(s=>{const l=i[s].data??{},a={};let r=0;Object.keys(l).forEach(c=>{const d=l[c]??[];r=d.length;const h=new Float64Array(d.length);for(let u=0;u<d.length;u++)h[u]=typeof d[u]=="number"?d[u]:NaN;a[c]=h,n.push(h.buffer)}),a.length=r,t[s]=a}),{columns:t,transferList:n}}const jr="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBxdD10eXBlb2YgZ2xvYmFsPT0ib2JqZWN0IiYmZ2xvYmFsJiZnbG9iYWwuT2JqZWN0PT09T2JqZWN0JiZnbG9iYWwsQWU9dHlwZW9mIHNlbGY9PSJvYmplY3QiJiZzZWxmJiZzZWxmLk9iamVjdD09PU9iamVjdCYmc2VsZix5dD1xdHx8QWV8fEZ1bmN0aW9uKCJyZXR1cm4gdGhpcyIpKCksT3Q9eXQuU3ltYm9sLFp0PU9iamVjdC5wcm90b3R5cGUsRGU9WnQuaGFzT3duUHJvcGVydHksemU9WnQudG9TdHJpbmcsTXQ9T3Q/T3QudG9TdHJpbmdUYWc6dm9pZCAwO2Z1bmN0aW9uIEVlKGUpe3ZhciB0PURlLmNhbGwoZSxNdCksbj1lW010XTt0cnl7ZVtNdF09dm9pZCAwO3ZhciBzPSEwfWNhdGNoe312YXIgaT16ZS5jYWxsKGUpO3JldHVybiBzJiYodD9lW010XT1uOmRlbGV0ZSBlW010XSksaX12YXIgQmU9T2JqZWN0LnByb3RvdHlwZSxIZT1CZS50b1N0cmluZztmdW5jdGlvbiBMZShlKXtyZXR1cm4gSGUuY2FsbChlKX12YXIgTmU9IltvYmplY3QgTnVsbF0iLEdlPSJbb2JqZWN0IFVuZGVmaW5lZF0iLEt0PU90P090LnRvU3RyaW5nVGFnOnZvaWQgMDtmdW5jdGlvbiAkdChlKXtyZXR1cm4gZT09bnVsbD9lPT09dm9pZCAwP0dlOk5lOkt0JiZLdCBpbiBPYmplY3QoZSk/RWUoZSk6TGUoZSl9ZnVuY3Rpb24gU3QoZSl7cmV0dXJuIGUhPW51bGwmJnR5cGVvZiBlPT0ib2JqZWN0In12YXIgTnQ9QXJyYXkuaXNBcnJheTtmdW5jdGlvbiBmdChlKXt2YXIgdD10eXBlb2YgZTtyZXR1cm4gZSE9bnVsbCYmKHQ9PSJvYmplY3QifHx0PT0iZnVuY3Rpb24iKX1mdW5jdGlvbiBKdChlKXtyZXR1cm4gZX12YXIgamU9IltvYmplY3QgQXN5bmNGdW5jdGlvbl0iLFllPSJbb2JqZWN0IEZ1bmN0aW9uXSIsV2U9IltvYmplY3QgR2VuZXJhdG9yRnVuY3Rpb25dIixGZT0iW29iamVjdCBQcm94eV0iO2Z1bmN0aW9uIEd0KGUpe2lmKCFmdChlKSlyZXR1cm4hMTt2YXIgdD0kdChlKTtyZXR1cm4gdD09WWV8fHQ9PVdlfHx0PT1qZXx8dD09RmV9dmFyIGp0PXl0WyJfX2NvcmUtanNfc2hhcmVkX18iXSxRdD1mdW5jdGlvbigpe3ZhciBlPS9bXi5dKyQvLmV4ZWMoanQmJmp0LmtleXMmJmp0LmtleXMuSUVfUFJPVE98fCIiKTtyZXR1cm4gZT8iU3ltYm9sKHNyYylfMS4iK2U6IiJ9KCk7ZnVuY3Rpb24ga2UoZSl7cmV0dXJuISFRdCYmUXQgaW4gZX12YXIgVmU9RnVuY3Rpb24ucHJvdG90eXBlLFhlPVZlLnRvU3RyaW5nO2Z1bmN0aW9uIFVlKGUpe2lmKGUhPW51bGwpe3RyeXtyZXR1cm4gWGUuY2FsbChlKX1jYXRjaHt9dHJ5e3JldHVybiBlKyIifWNhdGNoe319cmV0dXJuIiJ9dmFyIHFlPS9bXFxeJC4qKz8oKVtcXXt9fF0vZyxaZT0vXlxbb2JqZWN0IC4rP0NvbnN0cnVjdG9yXF0kLyxLZT1GdW5jdGlvbi5wcm90b3R5cGUsSmU9T2JqZWN0LnByb3RvdHlwZSxRZT1LZS50b1N0cmluZyx0bj1KZS5oYXNPd25Qcm9wZXJ0eSxlbj1SZWdFeHAoIl4iK1FlLmNhbGwodG4pLnJlcGxhY2UocWUsIlxcJCYiKS5yZXBsYWNlKC9oYXNPd25Qcm9wZXJ0eXwoZnVuY3Rpb24pLio/KD89XFxcKCl8IGZvciAuKz8oPz1cXFxdKS9nLCIkMS4qPyIpKyIkIik7ZnVuY3Rpb24gbm4oZSl7aWYoIWZ0KGUpfHxrZShlKSlyZXR1cm4hMTt2YXIgdD1HdChlKT9lbjpaZTtyZXR1cm4gdC50ZXN0KFVlKGUpKX1mdW5jdGlvbiBzbihlLHQpe3JldHVybiBlPT1udWxsP3ZvaWQgMDplW3RdfWZ1bmN0aW9uIFl0KGUsdCl7dmFyIG49c24oZSx0KTtyZXR1cm4gbm4obik/bjp2b2lkIDB9dmFyIHRlPU9iamVjdC5jcmVhdGUsb249ZnVuY3Rpb24oKXtmdW5jdGlvbiBlKCl7fXJldHVybiBmdW5jdGlvbih0KXtpZighZnQodCkpcmV0dXJue307aWYodGUpcmV0dXJuIHRlKHQpO2UucHJvdG90eXBlPXQ7dmFyIG49bmV3IGU7cmV0dXJuIGUucHJvdG90eXBlPXZvaWQgMCxufX0oKTtmdW5jdGlvbiBlZShlLHQsbil7c3dpdGNoKG4ubGVuZ3RoKXtjYXNlIDA6cmV0dXJuIGUuY2FsbCh0KTtjYXNlIDE6cmV0dXJuIGUuY2FsbCh0LG5bMF0pO2Nhc2UgMjpyZXR1cm4gZS5jYWxsKHQsblswXSxuWzFdKTtjYXNlIDM6cmV0dXJuIGUuY2FsbCh0LG5bMF0sblsxXSxuWzJdKX1yZXR1cm4gZS5hcHBseSh0LG4pfWZ1bmN0aW9uIHJuKGUsdCl7dmFyIG49LTEscz1lLmxlbmd0aDtmb3IodHx8KHQ9QXJyYXkocykpOysrbjxzOyl0W25dPWVbbl07cmV0dXJuIHR9dmFyIGFuPTgwMCxsbj0xNixjbj1EYXRlLm5vdztmdW5jdGlvbiBobihlKXt2YXIgdD0wLG49MDtyZXR1cm4gZnVuY3Rpb24oKXt2YXIgcz1jbigpLGk9bG4tKHMtbik7aWYobj1zLGk+MCl7aWYoKyt0Pj1hbilyZXR1cm4gYXJndW1lbnRzWzBdfWVsc2UgdD0wO3JldHVybiBlLmFwcGx5KHZvaWQgMCxhcmd1bWVudHMpfX1mdW5jdGlvbiBmbihlKXtyZXR1cm4gZnVuY3Rpb24oKXtyZXR1cm4gZX19dmFyIF90PWZ1bmN0aW9uKCl7dHJ5e3ZhciBlPVl0KE9iamVjdCwiZGVmaW5lUHJvcGVydHkiKTtyZXR1cm4gZSh7fSwiIix7fSksZX1jYXRjaHt9fSgpLHVuPV90P2Z1bmN0aW9uKGUsdCl7cmV0dXJuIF90KGUsInRvU3RyaW5nIix7Y29uZmlndXJhYmxlOiEwLGVudW1lcmFibGU6ITEsdmFsdWU6Zm4odCksd3JpdGFibGU6ITB9KX06SnQsZG49aG4odW4pLHBuPTkwMDcxOTkyNTQ3NDA5OTEsZ249L14oPzowfFsxLTldXGQqKSQvO2Z1bmN0aW9uIG5lKGUsdCl7dmFyIG49dHlwZW9mIGU7cmV0dXJuIHQ9dD8/cG4sISF0JiYobj09Im51bWJlciJ8fG4hPSJzeW1ib2wiJiZnbi50ZXN0KGUpKSYmZT4tMSYmZSUxPT0wJiZlPHR9ZnVuY3Rpb24gV3QoZSx0LG4pe3Q9PSJfX3Byb3RvX18iJiZfdD9fdChlLHQse2NvbmZpZ3VyYWJsZTohMCxlbnVtZXJhYmxlOiEwLHZhbHVlOm4sd3JpdGFibGU6ITB9KTplW3RdPW59ZnVuY3Rpb24gUHQoZSx0KXtyZXR1cm4gZT09PXR8fGUhPT1lJiZ0IT09dH12YXIgeG49T2JqZWN0LnByb3RvdHlwZSx5bj14bi5oYXNPd25Qcm9wZXJ0eTtmdW5jdGlvbiBibihlLHQsbil7dmFyIHM9ZVt0XTsoISh5bi5jYWxsKGUsdCkmJlB0KHMsbikpfHxuPT09dm9pZCAwJiYhKHQgaW4gZSkpJiZXdChlLHQsbil9ZnVuY3Rpb24gbW4oZSx0LG4scyl7dmFyIGk9IW47bnx8KG49e30pO2Zvcih2YXIgcj0tMSxhPXQubGVuZ3RoOysrcjxhOyl7dmFyIG89dFtyXSxsPXZvaWQgMDtsPT09dm9pZCAwJiYobD1lW29dKSxpP1d0KG4sbyxsKTpibihuLG8sbCl9cmV0dXJuIG59dmFyIGllPU1hdGgubWF4O2Z1bmN0aW9uIHduKGUsdCxuKXtyZXR1cm4gdD1pZSh0PT09dm9pZCAwP2UubGVuZ3RoLTE6dCwwKSxmdW5jdGlvbigpe2Zvcih2YXIgcz1hcmd1bWVudHMsaT0tMSxyPWllKHMubGVuZ3RoLXQsMCksYT1BcnJheShyKTsrK2k8cjspYVtpXT1zW3QraV07aT0tMTtmb3IodmFyIG89QXJyYXkodCsxKTsrK2k8dDspb1tpXT1zW2ldO3JldHVybiBvW3RdPW4oYSksZWUoZSx0aGlzLG8pfX1mdW5jdGlvbiBzZShlLHQpe3JldHVybiBkbih3bihlLHQsSnQpLGUrIiIpfXZhciBNbj05MDA3MTk5MjU0NzQwOTkxO2Z1bmN0aW9uIG9lKGUpe3JldHVybiB0eXBlb2YgZT09Im51bWJlciImJmU+LTEmJmUlMT09MCYmZTw9TW59ZnVuY3Rpb24gRnQoZSl7cmV0dXJuIGUhPW51bGwmJm9lKGUubGVuZ3RoKSYmIUd0KGUpfWZ1bmN0aW9uIFNuKGUsdCxuKXtpZighZnQobikpcmV0dXJuITE7dmFyIHM9dHlwZW9mIHQ7cmV0dXJuKHM9PSJudW1iZXIiP0Z0KG4pJiZuZSh0LG4ubGVuZ3RoKTpzPT0ic3RyaW5nIiYmdCBpbiBuKT9QdChuW3RdLGUpOiExfWZ1bmN0aW9uIHJlKGUpe3JldHVybiBzZShmdW5jdGlvbih0LG4pe3ZhciBzPS0xLGk9bi5sZW5ndGgscj1pPjE/bltpLTFdOnZvaWQgMCxhPWk+Mj9uWzJdOnZvaWQgMDtmb3Iocj1lLmxlbmd0aD4zJiZ0eXBlb2Ygcj09ImZ1bmN0aW9uIj8oaS0tLHIpOnZvaWQgMCxhJiZTbihuWzBdLG5bMV0sYSkmJihyPWk8Mz92b2lkIDA6cixpPTEpLHQ9T2JqZWN0KHQpOysrczxpOyl7dmFyIG89bltzXTtvJiZlKHQsbyxzLHIpfXJldHVybiB0fSl9dmFyIFRuPU9iamVjdC5wcm90b3R5cGU7ZnVuY3Rpb24gYWUoZSl7dmFyIHQ9ZSYmZS5jb25zdHJ1Y3RvcixuPXR5cGVvZiB0PT0iZnVuY3Rpb24iJiZ0LnByb3RvdHlwZXx8VG47cmV0dXJuIGU9PT1ufWZ1bmN0aW9uIEluKGUsdCl7Zm9yKHZhciBuPS0xLHM9QXJyYXkoZSk7KytuPGU7KXNbbl09dChuKTtyZXR1cm4gc312YXIgdm49IltvYmplY3QgQXJndW1lbnRzXSI7ZnVuY3Rpb24gbGUoZSl7cmV0dXJuIFN0KGUpJiYkdChlKT09dm59dmFyIGNlPU9iamVjdC5wcm90b3R5cGUsQ249Y2UuaGFzT3duUHJvcGVydHksT249Y2UucHJvcGVydHlJc0VudW1lcmFibGUsa3Q9bGUoZnVuY3Rpb24oKXtyZXR1cm4gYXJndW1lbnRzfSgpKT9sZTpmdW5jdGlvbihlKXtyZXR1cm4gU3QoZSkmJkNuLmNhbGwoZSwiY2FsbGVlIikmJiFPbi5jYWxsKGUsImNhbGxlZSIpfTtmdW5jdGlvbiAkbigpe3JldHVybiExfXZhciBoZT10eXBlb2YgZXhwb3J0cz09Im9iamVjdCImJmV4cG9ydHMmJiFleHBvcnRzLm5vZGVUeXBlJiZleHBvcnRzLGZlPWhlJiZ0eXBlb2YgbW9kdWxlPT0ib2JqZWN0IiYmbW9kdWxlJiYhbW9kdWxlLm5vZGVUeXBlJiZtb2R1bGUsX249ZmUmJmZlLmV4cG9ydHM9PT1oZSx1ZT1fbj95dC5CdWZmZXI6dm9pZCAwLFBuPXVlP3VlLmlzQnVmZmVyOnZvaWQgMCxkZT1Qbnx8JG4sUm49IltvYmplY3QgQXJndW1lbnRzXSIsQW49IltvYmplY3QgQXJyYXldIixEbj0iW29iamVjdCBCb29sZWFuXSIsem49IltvYmplY3QgRGF0ZV0iLEVuPSJbb2JqZWN0IEVycm9yXSIsQm49IltvYmplY3QgRnVuY3Rpb25dIixIbj0iW29iamVjdCBNYXBdIixMbj0iW29iamVjdCBOdW1iZXJdIixObj0iW29iamVjdCBPYmplY3RdIixHbj0iW29iamVjdCBSZWdFeHBdIixqbj0iW29iamVjdCBTZXRdIixZbj0iW29iamVjdCBTdHJpbmddIixXbj0iW29iamVjdCBXZWFrTWFwXSIsRm49IltvYmplY3QgQXJyYXlCdWZmZXJdIixrbj0iW29iamVjdCBEYXRhVmlld10iLFZuPSJbb2JqZWN0IEZsb2F0MzJBcnJheV0iLFhuPSJbb2JqZWN0IEZsb2F0NjRBcnJheV0iLFVuPSJbb2JqZWN0IEludDhBcnJheV0iLHFuPSJbb2JqZWN0IEludDE2QXJyYXldIixabj0iW29iamVjdCBJbnQzMkFycmF5XSIsS249IltvYmplY3QgVWludDhBcnJheV0iLEpuPSJbb2JqZWN0IFVpbnQ4Q2xhbXBlZEFycmF5XSIsUW49IltvYmplY3QgVWludDE2QXJyYXldIix0aT0iW29iamVjdCBVaW50MzJBcnJheV0iLFg9e307WFtWbl09WFtYbl09WFtVbl09WFtxbl09WFtabl09WFtLbl09WFtKbl09WFtRbl09WFt0aV09ITAsWFtSbl09WFtBbl09WFtGbl09WFtEbl09WFtrbl09WFt6bl09WFtFbl09WFtCbl09WFtIbl09WFtMbl09WFtObl09WFtHbl09WFtqbl09WFtZbl09WFtXbl09ITE7ZnVuY3Rpb24gZWkoZSl7cmV0dXJuIFN0KGUpJiZvZShlLmxlbmd0aCkmJiEhWFskdChlKV19ZnVuY3Rpb24gbmkoZSl7cmV0dXJuIGZ1bmN0aW9uKHQpe3JldHVybiBlKHQpfX12YXIgcGU9dHlwZW9mIGV4cG9ydHM9PSJvYmplY3QiJiZleHBvcnRzJiYhZXhwb3J0cy5ub2RlVHlwZSYmZXhwb3J0cyxUdD1wZSYmdHlwZW9mIG1vZHVsZT09Im9iamVjdCImJm1vZHVsZSYmIW1vZHVsZS5ub2RlVHlwZSYmbW9kdWxlLGlpPVR0JiZUdC5leHBvcnRzPT09cGUsVnQ9aWkmJnF0LnByb2Nlc3MsZ2U9ZnVuY3Rpb24oKXt0cnl7dmFyIGU9VHQmJlR0LnJlcXVpcmUmJlR0LnJlcXVpcmUoInV0aWwiKS50eXBlcztyZXR1cm4gZXx8VnQmJlZ0LmJpbmRpbmcmJlZ0LmJpbmRpbmcoInV0aWwiKX1jYXRjaHt9fSgpLHhlPWdlJiZnZS5pc1R5cGVkQXJyYXkseWU9eGU/bmkoeGUpOmVpO2Z1bmN0aW9uIHNpKGUsdCl7dmFyIG49TnQoZSkscz0hbiYma3QoZSksaT0hbiYmIXMmJmRlKGUpLHI9IW4mJiFzJiYhaSYmeWUoZSksYT1ufHxzfHxpfHxyLG89YT9JbihlLmxlbmd0aCxTdHJpbmcpOltdLGw9by5sZW5ndGg7Zm9yKHZhciBjIGluIGUpYSYmKGM9PSJsZW5ndGgifHxpJiYoYz09Im9mZnNldCJ8fGM9PSJwYXJlbnQiKXx8ciYmKGM9PSJidWZmZXIifHxjPT0iYnl0ZUxlbmd0aCJ8fGM9PSJieXRlT2Zmc2V0Iil8fG5lKGMsbCkpfHxvLnB1c2goYyk7cmV0dXJuIG99ZnVuY3Rpb24gb2koZSx0KXtyZXR1cm4gZnVuY3Rpb24obil7cmV0dXJuIGUodChuKSl9fWZ1bmN0aW9uIHJpKGUpe3ZhciB0PVtdO2lmKGUhPW51bGwpZm9yKHZhciBuIGluIE9iamVjdChlKSl0LnB1c2gobik7cmV0dXJuIHR9dmFyIGFpPU9iamVjdC5wcm90b3R5cGUsbGk9YWkuaGFzT3duUHJvcGVydHk7ZnVuY3Rpb24gY2koZSl7aWYoIWZ0KGUpKXJldHVybiByaShlKTt2YXIgdD1hZShlKSxuPVtdO2Zvcih2YXIgcyBpbiBlKXM9PSJjb25zdHJ1Y3RvciImJih0fHwhbGkuY2FsbChlLHMpKXx8bi5wdXNoKHMpO3JldHVybiBufWZ1bmN0aW9uIGJlKGUpe3JldHVybiBGdChlKT9zaShlKTpjaShlKX12YXIgSXQ9WXQoT2JqZWN0LCJjcmVhdGUiKTtmdW5jdGlvbiBoaSgpe3RoaXMuX19kYXRhX189SXQ/SXQobnVsbCk6e30sdGhpcy5zaXplPTB9ZnVuY3Rpb24gZmkoZSl7dmFyIHQ9dGhpcy5oYXMoZSkmJmRlbGV0ZSB0aGlzLl9fZGF0YV9fW2VdO3JldHVybiB0aGlzLnNpemUtPXQ/MTowLHR9dmFyIHVpPSJfX2xvZGFzaF9oYXNoX3VuZGVmaW5lZF9fIixkaT1PYmplY3QucHJvdG90eXBlLHBpPWRpLmhhc093blByb3BlcnR5O2Z1bmN0aW9uIGdpKGUpe3ZhciB0PXRoaXMuX19kYXRhX187aWYoSXQpe3ZhciBuPXRbZV07cmV0dXJuIG49PT11aT92b2lkIDA6bn1yZXR1cm4gcGkuY2FsbCh0LGUpP3RbZV06dm9pZCAwfXZhciB4aT1PYmplY3QucHJvdG90eXBlLHlpPXhpLmhhc093blByb3BlcnR5O2Z1bmN0aW9uIGJpKGUpe3ZhciB0PXRoaXMuX19kYXRhX187cmV0dXJuIEl0P3RbZV0hPT12b2lkIDA6eWkuY2FsbCh0LGUpfXZhciBtaT0iX19sb2Rhc2hfaGFzaF91bmRlZmluZWRfXyI7ZnVuY3Rpb24gd2koZSx0KXt2YXIgbj10aGlzLl9fZGF0YV9fO3JldHVybiB0aGlzLnNpemUrPXRoaXMuaGFzKGUpPzA6MSxuW2VdPUl0JiZ0PT09dm9pZCAwP21pOnQsdGhpc31mdW5jdGlvbiBndChlKXt2YXIgdD0tMSxuPWU9PW51bGw/MDplLmxlbmd0aDtmb3IodGhpcy5jbGVhcigpOysrdDxuOyl7dmFyIHM9ZVt0XTt0aGlzLnNldChzWzBdLHNbMV0pfX1ndC5wcm90b3R5cGUuY2xlYXI9aGksZ3QucHJvdG90eXBlLmRlbGV0ZT1maSxndC5wcm90b3R5cGUuZ2V0PWdpLGd0LnByb3RvdHlwZS5oYXM9YmksZ3QucHJvdG90eXBlLnNldD13aTtmdW5jdGlvbiBNaSgpe3RoaXMuX19kYXRhX189W10sdGhpcy5zaXplPTB9ZnVuY3Rpb24gUnQoZSx0KXtmb3IodmFyIG49ZS5sZW5ndGg7bi0tOylpZihQdChlW25dWzBdLHQpKXJldHVybiBuO3JldHVybi0xfXZhciBTaT1BcnJheS5wcm90b3R5cGUsVGk9U2kuc3BsaWNlO2Z1bmN0aW9uIElpKGUpe3ZhciB0PXRoaXMuX19kYXRhX18sbj1SdCh0LGUpO2lmKG48MClyZXR1cm4hMTt2YXIgcz10Lmxlbmd0aC0xO3JldHVybiBuPT1zP3QucG9wKCk6VGkuY2FsbCh0LG4sMSksLS10aGlzLnNpemUsITB9ZnVuY3Rpb24gdmkoZSl7dmFyIHQ9dGhpcy5fX2RhdGFfXyxuPVJ0KHQsZSk7cmV0dXJuIG48MD92b2lkIDA6dFtuXVsxXX1mdW5jdGlvbiBDaShlKXtyZXR1cm4gUnQodGhpcy5fX2RhdGFfXyxlKT4tMX1mdW5jdGlvbiBPaShlLHQpe3ZhciBuPXRoaXMuX19kYXRhX18scz1SdChuLGUpO3JldHVybiBzPDA/KCsrdGhpcy5zaXplLG4ucHVzaChbZSx0XSkpOm5bc11bMV09dCx0aGlzfWZ1bmN0aW9uIHV0KGUpe3ZhciB0PS0xLG49ZT09bnVsbD8wOmUubGVuZ3RoO2Zvcih0aGlzLmNsZWFyKCk7Kyt0PG47KXt2YXIgcz1lW3RdO3RoaXMuc2V0KHNbMF0sc1sxXSl9fXV0LnByb3RvdHlwZS5jbGVhcj1NaSx1dC5wcm90b3R5cGUuZGVsZXRlPUlpLHV0LnByb3RvdHlwZS5nZXQ9dmksdXQucHJvdG90eXBlLmhhcz1DaSx1dC5wcm90b3R5cGUuc2V0PU9pO3ZhciBtZT1ZdCh5dCwiTWFwIik7ZnVuY3Rpb24gJGkoKXt0aGlzLnNpemU9MCx0aGlzLl9fZGF0YV9fPXtoYXNoOm5ldyBndCxtYXA6bmV3KG1lfHx1dCksc3RyaW5nOm5ldyBndH19ZnVuY3Rpb24gX2koZSl7dmFyIHQ9dHlwZW9mIGU7cmV0dXJuIHQ9PSJzdHJpbmcifHx0PT0ibnVtYmVyInx8dD09InN5bWJvbCJ8fHQ9PSJib29sZWFuIj9lIT09Il9fcHJvdG9fXyI6ZT09PW51bGx9ZnVuY3Rpb24gQXQoZSx0KXt2YXIgbj1lLl9fZGF0YV9fO3JldHVybiBfaSh0KT9uW3R5cGVvZiB0PT0ic3RyaW5nIj8ic3RyaW5nIjoiaGFzaCJdOm4ubWFwfWZ1bmN0aW9uIFBpKGUpe3ZhciB0PUF0KHRoaXMsZSkuZGVsZXRlKGUpO3JldHVybiB0aGlzLnNpemUtPXQ/MTowLHR9ZnVuY3Rpb24gUmkoZSl7cmV0dXJuIEF0KHRoaXMsZSkuZ2V0KGUpfWZ1bmN0aW9uIEFpKGUpe3JldHVybiBBdCh0aGlzLGUpLmhhcyhlKX1mdW5jdGlvbiBEaShlLHQpe3ZhciBuPUF0KHRoaXMsZSkscz1uLnNpemU7cmV0dXJuIG4uc2V0KGUsdCksdGhpcy5zaXplKz1uLnNpemU9PXM/MDoxLHRoaXN9ZnVuY3Rpb24gYnQoZSl7dmFyIHQ9LTEsbj1lPT1udWxsPzA6ZS5sZW5ndGg7Zm9yKHRoaXMuY2xlYXIoKTsrK3Q8bjspe3ZhciBzPWVbdF07dGhpcy5zZXQoc1swXSxzWzFdKX19YnQucHJvdG90eXBlLmNsZWFyPSRpLGJ0LnByb3RvdHlwZS5kZWxldGU9UGksYnQucHJvdG90eXBlLmdldD1SaSxidC5wcm90b3R5cGUuaGFzPUFpLGJ0LnByb3RvdHlwZS5zZXQ9RGk7dmFyIHdlPW9pKE9iamVjdC5nZXRQcm90b3R5cGVPZixPYmplY3QpLHppPSJbb2JqZWN0IE9iamVjdF0iLEVpPUZ1bmN0aW9uLnByb3RvdHlwZSxCaT1PYmplY3QucHJvdG90eXBlLE1lPUVpLnRvU3RyaW5nLEhpPUJpLmhhc093blByb3BlcnR5LExpPU1lLmNhbGwoT2JqZWN0KTtmdW5jdGlvbiBOaShlKXtpZighU3QoZSl8fCR0KGUpIT16aSlyZXR1cm4hMTt2YXIgdD13ZShlKTtpZih0PT09bnVsbClyZXR1cm4hMDt2YXIgbj1IaS5jYWxsKHQsImNvbnN0cnVjdG9yIikmJnQuY29uc3RydWN0b3I7cmV0dXJuIHR5cGVvZiBuPT0iZnVuY3Rpb24iJiZuIGluc3RhbmNlb2YgbiYmTWUuY2FsbChuKT09TGl9ZnVuY3Rpb24gR2koKXt0aGlzLl9fZGF0YV9fPW5ldyB1dCx0aGlzLnNpemU9MH1mdW5jdGlvbiBqaShlKXt2YXIgdD10aGlzLl9fZGF0YV9fLG49dC5kZWxldGUoZSk7cmV0dXJuIHRoaXMuc2l6ZT10LnNpemUsbn1mdW5jdGlvbiBZaShlKXtyZXR1cm4gdGhpcy5fX2RhdGFfXy5nZXQoZSl9ZnVuY3Rpb24gV2koZSl7cmV0dXJuIHRoaXMuX19kYXRhX18uaGFzKGUpfXZhciBGaT0yMDA7ZnVuY3Rpb24ga2koZSx0KXt2YXIgbj10aGlzLl9fZGF0YV9fO2lmKG4gaW5zdGFuY2VvZiB1dCl7dmFyIHM9bi5fX2RhdGFfXztpZighbWV8fHMubGVuZ3RoPEZpLTEpcmV0dXJuIHMucHVzaChbZSx0XSksdGhpcy5zaXplPSsrbi5zaXplLHRoaXM7bj10aGlzLl9fZGF0YV9fPW5ldyBidChzKX1yZXR1cm4gbi5zZXQoZSx0KSx0aGlzLnNpemU9bi5zaXplLHRoaXN9ZnVuY3Rpb24gbXQoZSl7dmFyIHQ9dGhpcy5fX2RhdGFfXz1uZXcgdXQoZSk7dGhpcy5zaXplPXQuc2l6ZX1tdC5wcm90b3R5cGUuY2xlYXI9R2ksbXQucHJvdG90eXBlLmRlbGV0ZT1qaSxtdC5wcm90b3R5cGUuZ2V0PVlpLG10LnByb3RvdHlwZS5oYXM9V2ksbXQucHJvdG90eXBlLnNldD1raTt2YXIgU2U9dHlwZW9mIGV4cG9ydHM9PSJvYmplY3QiJiZleHBvcnRzJiYhZXhwb3J0cy5ub2RlVHlwZSYmZXhwb3J0cyxUZT1TZSYmdHlwZW9mIG1vZHVsZT09Im9iamVjdCImJm1vZHVsZSYmIW1vZHVsZS5ub2RlVHlwZSYmbW9kdWxlLFZpPVRlJiZUZS5leHBvcnRzPT09U2UsSWU9Vmk/eXQuQnVmZmVyOnZvaWQgMDtJZSYmSWUuYWxsb2NVbnNhZmU7ZnVuY3Rpb24gWGkoZSx0KXtyZXR1cm4gZS5zbGljZSgpfXZhciB2ZT15dC5VaW50OEFycmF5O2Z1bmN0aW9uIFVpKGUpe3ZhciB0PW5ldyBlLmNvbnN0cnVjdG9yKGUuYnl0ZUxlbmd0aCk7cmV0dXJuIG5ldyB2ZSh0KS5zZXQobmV3IHZlKGUpKSx0fWZ1bmN0aW9uIHFpKGUsdCl7dmFyIG49VWkoZS5idWZmZXIpO3JldHVybiBuZXcgZS5jb25zdHJ1Y3RvcihuLGUuYnl0ZU9mZnNldCxlLmxlbmd0aCl9ZnVuY3Rpb24gWmkoZSl7cmV0dXJuIHR5cGVvZiBlLmNvbnN0cnVjdG9yPT0iZnVuY3Rpb24iJiYhYWUoZSk/b24od2UoZSkpOnt9fWZ1bmN0aW9uIEtpKGUpe3JldHVybiBmdW5jdGlvbih0LG4scyl7Zm9yKHZhciBpPS0xLHI9T2JqZWN0KHQpLGE9cyh0KSxvPWEubGVuZ3RoO28tLTspe3ZhciBsPWFbKytpXTtpZihuKHJbbF0sbCxyKT09PSExKWJyZWFrfXJldHVybiB0fX12YXIgSmk9S2koKTtmdW5jdGlvbiBYdChlLHQsbil7KG4hPT12b2lkIDAmJiFQdChlW3RdLG4pfHxuPT09dm9pZCAwJiYhKHQgaW4gZSkpJiZXdChlLHQsbil9ZnVuY3Rpb24gUWkoZSl7cmV0dXJuIFN0KGUpJiZGdChlKX1mdW5jdGlvbiBVdChlLHQpe2lmKCEodD09PSJjb25zdHJ1Y3RvciImJnR5cGVvZiBlW3RdPT0iZnVuY3Rpb24iKSYmdCE9Il9fcHJvdG9fXyIpcmV0dXJuIGVbdF19ZnVuY3Rpb24gdHMoZSl7cmV0dXJuIG1uKGUsYmUoZSkpfWZ1bmN0aW9uIGVzKGUsdCxuLHMsaSxyLGEpe3ZhciBvPVV0KGUsbiksbD1VdCh0LG4pLGM9YS5nZXQobCk7aWYoYyl7WHQoZSxuLGMpO3JldHVybn12YXIgZj1yP3IobyxsLG4rIiIsZSx0LGEpOnZvaWQgMCxoPWY9PT12b2lkIDA7aWYoaCl7dmFyIHA9TnQobCksZD0hcCYmZGUobCksdT0hcCYmIWQmJnllKGwpO2Y9bCxwfHxkfHx1P050KG8pP2Y9bzpRaShvKT9mPXJuKG8pOmQ/KGg9ITEsZj1YaShsKSk6dT8oaD0hMSxmPXFpKGwpKTpmPVtdOk5pKGwpfHxrdChsKT8oZj1vLGt0KG8pP2Y9dHMobyk6KCFmdChvKXx8R3QobykpJiYoZj1aaShsKSkpOmg9ITF9aCYmKGEuc2V0KGwsZiksaShmLGwscyxyLGEpLGEuZGVsZXRlKGwpKSxYdChlLG4sZil9ZnVuY3Rpb24gRHQoZSx0LG4scyxpKXtlIT09dCYmSmkodCxmdW5jdGlvbihyLGEpe2lmKGl8fChpPW5ldyBtdCksZnQocikpZXMoZSx0LGEsbixEdCxzLGkpO2Vsc2V7dmFyIG89cz9zKFV0KGUsYSkscixhKyIiLGUsdCxpKTp2b2lkIDA7bz09PXZvaWQgMCYmKG89ciksWHQoZSxhLG8pfX0sYmUpfWZ1bmN0aW9uIENlKGUsdCxuLHMsaSxyKXtyZXR1cm4gZnQoZSkmJmZ0KHQpJiYoci5zZXQodCxlKSxEdChlLHQsdm9pZCAwLENlLHIpLHIuZGVsZXRlKHQpKSxlfXZhciBucz1yZShmdW5jdGlvbihlLHQsbixzKXtEdChlLHQsbixzKX0pLE9lPXNlKGZ1bmN0aW9uKGUpe3JldHVybiBlLnB1c2godm9pZCAwLENlKSxlZShucyx2b2lkIDAsZSl9KTtmdW5jdGlvbiB4dChlKXtyZXR1cm4gZT09bnVsbH1mdW5jdGlvbiBpcyhlKXtyZXR1cm4gZT09PXZvaWQgMH12YXIgc3M9cmUoZnVuY3Rpb24oZSx0LG4pe0R0KGUsdCxuKX0pLG9zPXR5cGVvZiBnbG9iYWxUaGlzPCJ1Ij9nbG9iYWxUaGlzOnR5cGVvZiB3aW5kb3c8InUiP3dpbmRvdzp0eXBlb2YgZ2xvYmFsPCJ1Ij9nbG9iYWw6dHlwZW9mIHNlbGY8InUiP3NlbGY6e30scnM9e2V4cG9ydHM6e319OyhmdW5jdGlvbihlLHQpeyhmdW5jdGlvbihuLHMpe2UuZXhwb3J0cz1zKCl9KShvcyxmdW5jdGlvbigpe3ZhciBuPTFlMyxzPTZlNCxpPTM2ZTUscj0ibWlsbGlzZWNvbmQiLGE9InNlY29uZCIsbz0ibWludXRlIixsPSJob3VyIixjPSJkYXkiLGY9IndlZWsiLGg9Im1vbnRoIixwPSJxdWFydGVyIixkPSJ5ZWFyIix1PSJkYXRlIix4PSJJbnZhbGlkIERhdGUiLFM9L14oXGR7NH0pWy0vXT8oXGR7MSwyfSk/Wy0vXT8oXGR7MCwyfSlbVHRcc10qKFxkezEsMn0pPzo/KFxkezEsMn0pPzo/KFxkezEsMn0pP1suOl0/KFxkKyk/JC8sYj0vXFsoW15cXV0rKV18WXsxLDR9fE17MSw0fXxEezEsMn18ZHsxLDR9fEh7MSwyfXxoezEsMn18YXxBfG17MSwyfXxzezEsMn18WnsxLDJ9fFNTUy9nLE89e25hbWU6ImVuIix3ZWVrZGF5czoiU3VuZGF5X01vbmRheV9UdWVzZGF5X1dlZG5lc2RheV9UaHVyc2RheV9GcmlkYXlfU2F0dXJkYXkiLnNwbGl0KCJfIiksbW9udGhzOiJKYW51YXJ5X0ZlYnJ1YXJ5X01hcmNoX0FwcmlsX01heV9KdW5lX0p1bHlfQXVndXN0X1NlcHRlbWJlcl9PY3RvYmVyX05vdmVtYmVyX0RlY2VtYmVyIi5zcGxpdCgiXyIpLG9yZGluYWw6ZnVuY3Rpb24oQSl7dmFyIHk9WyJ0aCIsInN0IiwibmQiLCJyZCJdLGc9QSUxMDA7cmV0dXJuIlsiK0ErKHlbKGctMjApJTEwXXx8eVtnXXx8eVswXSkrIl0ifX0sVD1mdW5jdGlvbihBLHksZyl7dmFyICQ9U3RyaW5nKEEpO3JldHVybiEkfHwkLmxlbmd0aD49eT9BOiIiK0FycmF5KHkrMS0kLmxlbmd0aCkuam9pbihnKStBfSxJPXtzOlQsejpmdW5jdGlvbihBKXt2YXIgeT0tQS51dGNPZmZzZXQoKSxnPU1hdGguYWJzKHkpLCQ9TWF0aC5mbG9vcihnLzYwKSxtPWclNjA7cmV0dXJuKHk8PTA/IisiOiItIikrVCgkLDIsIjAiKSsiOiIrVChtLDIsIjAiKX0sbTpmdW5jdGlvbiBBKHksZyl7aWYoeS5kYXRlKCk8Zy5kYXRlKCkpcmV0dXJuLUEoZyx5KTt2YXIgJD0xMiooZy55ZWFyKCkteS55ZWFyKCkpKyhnLm1vbnRoKCkteS5tb250aCgpKSxtPXkuY2xvbmUoKS5hZGQoJCxoKSx3PWctbTwwLFA9eS5jbG9uZSgpLmFkZCgkKyh3Py0xOjEpLGgpO3JldHVybisoLSgkKyhnLW0pLyh3P20tUDpQLW0pKXx8MCl9LGE6ZnVuY3Rpb24oQSl7cmV0dXJuIEE8MD9NYXRoLmNlaWwoQSl8fDA6TWF0aC5mbG9vcihBKX0scDpmdW5jdGlvbihBKXtyZXR1cm57TTpoLHk6ZCx3OmYsZDpjLEQ6dSxoOmwsbTpvLHM6YSxtczpyLFE6cH1bQV18fFN0cmluZyhBfHwiIikudG9Mb3dlckNhc2UoKS5yZXBsYWNlKC9zJC8sIiIpfSx1OmZ1bmN0aW9uKEEpe3JldHVybiBBPT09dm9pZCAwfX0sdj0iZW4iLE09e307TVt2XT1PO3ZhciBfPSIkaXNEYXlqc09iamVjdCIsQz1mdW5jdGlvbihBKXtyZXR1cm4gQSBpbnN0YW5jZW9mIFl8fCEoIUF8fCFBW19dKX0sUj1mdW5jdGlvbiBBKHksZywkKXt2YXIgbTtpZigheSlyZXR1cm4gdjtpZih0eXBlb2YgeT09InN0cmluZyIpe3ZhciB3PXkudG9Mb3dlckNhc2UoKTtNW3ddJiYobT13KSxnJiYoTVt3XT1nLG09dyk7dmFyIFA9eS5zcGxpdCgiLSIpO2lmKCFtJiZQLmxlbmd0aD4xKXJldHVybiBBKFBbMF0pfWVsc2V7dmFyIHo9eS5uYW1lO01bel09eSxtPXp9cmV0dXJuISQmJm0mJih2PW0pLG18fCEkJiZ2fSxCPWZ1bmN0aW9uKEEseSl7aWYoQyhBKSlyZXR1cm4gQS5jbG9uZSgpO3ZhciBnPXR5cGVvZiB5PT0ib2JqZWN0Ij95Ont9O3JldHVybiBnLmRhdGU9QSxnLmFyZ3M9YXJndW1lbnRzLG5ldyBZKGcpfSxEPUk7RC5sPVIsRC5pPUMsRC53PWZ1bmN0aW9uKEEseSl7cmV0dXJuIEIoQSx7bG9jYWxlOnkuJEwsdXRjOnkuJHUseDp5LiR4LCRvZmZzZXQ6eS4kb2Zmc2V0fSl9O3ZhciBZPWZ1bmN0aW9uKCl7ZnVuY3Rpb24gQShnKXt0aGlzLiRMPVIoZy5sb2NhbGUsbnVsbCwhMCksdGhpcy5wYXJzZShnKSx0aGlzLiR4PXRoaXMuJHh8fGcueHx8e30sdGhpc1tfXT0hMH12YXIgeT1BLnByb3RvdHlwZTtyZXR1cm4geS5wYXJzZT1mdW5jdGlvbihnKXt0aGlzLiRkPWZ1bmN0aW9uKCQpe3ZhciBtPSQuZGF0ZSx3PSQudXRjO2lmKG09PT1udWxsKXJldHVybiBuZXcgRGF0ZShOYU4pO2lmKEQudShtKSlyZXR1cm4gbmV3IERhdGU7aWYobSBpbnN0YW5jZW9mIERhdGUpcmV0dXJuIG5ldyBEYXRlKG0pO2lmKHR5cGVvZiBtPT0ic3RyaW5nIiYmIS9aJC9pLnRlc3QobSkpe3ZhciBQPW0ubWF0Y2goUyk7aWYoUCl7dmFyIHo9UFsyXS0xfHwwLFc9KFBbN118fCIwIikuc3Vic3RyaW5nKDAsMyk7cmV0dXJuIHc/bmV3IERhdGUoRGF0ZS5VVEMoUFsxXSx6LFBbM118fDEsUFs0XXx8MCxQWzVdfHwwLFBbNl18fDAsVykpOm5ldyBEYXRlKFBbMV0seixQWzNdfHwxLFBbNF18fDAsUFs1XXx8MCxQWzZdfHwwLFcpfX1yZXR1cm4gbmV3IERhdGUobSl9KGcpLHRoaXMuaW5pdCgpfSx5LmluaXQ9ZnVuY3Rpb24oKXt2YXIgZz10aGlzLiRkO3RoaXMuJHk9Zy5nZXRGdWxsWWVhcigpLHRoaXMuJE09Zy5nZXRNb250aCgpLHRoaXMuJEQ9Zy5nZXREYXRlKCksdGhpcy4kVz1nLmdldERheSgpLHRoaXMuJEg9Zy5nZXRIb3VycygpLHRoaXMuJG09Zy5nZXRNaW51dGVzKCksdGhpcy4kcz1nLmdldFNlY29uZHMoKSx0aGlzLiRtcz1nLmdldE1pbGxpc2Vjb25kcygpfSx5LiR1dGlscz1mdW5jdGlvbigpe3JldHVybiBEfSx5LmlzVmFsaWQ9ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy4kZC50b1N0cmluZygpIT09eH0seS5pc1NhbWU9ZnVuY3Rpb24oZywkKXt2YXIgbT1CKGcpO3JldHVybiB0aGlzLnN0YXJ0T2YoJCk8PW0mJm08PXRoaXMuZW5kT2YoJCl9LHkuaXNBZnRlcj1mdW5jdGlvbihnLCQpe3JldHVybiBCKGcpPHRoaXMuc3RhcnRPZigkKX0seS5pc0JlZm9yZT1mdW5jdGlvbihnLCQpe3JldHVybiB0aGlzLmVuZE9mKCQpPEIoZyl9LHkuJGc9ZnVuY3Rpb24oZywkLG0pe3JldHVybiBELnUoZyk/dGhpc1skXTp0aGlzLnNldChtLGcpfSx5LnVuaXg9ZnVuY3Rpb24oKXtyZXR1cm4gTWF0aC5mbG9vcih0aGlzLnZhbHVlT2YoKS8xZTMpfSx5LnZhbHVlT2Y9ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy4kZC5nZXRUaW1lKCl9LHkuc3RhcnRPZj1mdW5jdGlvbihnLCQpe3ZhciBtPXRoaXMsdz0hIUQudSgkKXx8JCxQPUQucChnKSx6PWZ1bmN0aW9uKFosbnQpe3ZhciBIPUQudyhtLiR1P0RhdGUuVVRDKG0uJHksbnQsWik6bmV3IERhdGUobS4keSxudCxaKSxtKTtyZXR1cm4gdz9IOkguZW5kT2YoYyl9LFc9ZnVuY3Rpb24oWixudCl7cmV0dXJuIEQudyhtLnRvRGF0ZSgpW1pdLmFwcGx5KG0udG9EYXRlKCJzIiksKHc/WzAsMCwwLDBdOlsyMyw1OSw1OSw5OTldKS5zbGljZShudCkpLG0pfSxOPXRoaXMuJFcsVT10aGlzLiRNLGo9dGhpcy4kRCxvdD0ic2V0IisodGhpcy4kdT8iVVRDIjoiIik7c3dpdGNoKFApe2Nhc2UgZDpyZXR1cm4gdz96KDEsMCk6eigzMSwxMSk7Y2FzZSBoOnJldHVybiB3P3ooMSxVKTp6KDAsVSsxKTtjYXNlIGY6dmFyIHE9dGhpcy4kbG9jYWxlKCkud2Vla1N0YXJ0fHwwLHJ0PShOPHE/Tis3Ok4pLXE7cmV0dXJuIHoodz9qLXJ0OmorKDYtcnQpLFUpO2Nhc2UgYzpjYXNlIHU6cmV0dXJuIFcob3QrIkhvdXJzIiwwKTtjYXNlIGw6cmV0dXJuIFcob3QrIk1pbnV0ZXMiLDEpO2Nhc2UgbzpyZXR1cm4gVyhvdCsiU2Vjb25kcyIsMik7Y2FzZSBhOnJldHVybiBXKG90KyJNaWxsaXNlY29uZHMiLDMpO2RlZmF1bHQ6cmV0dXJuIHRoaXMuY2xvbmUoKX19LHkuZW5kT2Y9ZnVuY3Rpb24oZyl7cmV0dXJuIHRoaXMuc3RhcnRPZihnLCExKX0seS4kc2V0PWZ1bmN0aW9uKGcsJCl7dmFyIG0sdz1ELnAoZyksUD0ic2V0IisodGhpcy4kdT8iVVRDIjoiIiksej0obT17fSxtW2NdPVArIkRhdGUiLG1bdV09UCsiRGF0ZSIsbVtoXT1QKyJNb250aCIsbVtkXT1QKyJGdWxsWWVhciIsbVtsXT1QKyJIb3VycyIsbVtvXT1QKyJNaW51dGVzIixtW2FdPVArIlNlY29uZHMiLG1bcl09UCsiTWlsbGlzZWNvbmRzIixtKVt3XSxXPXc9PT1jP3RoaXMuJEQrKCQtdGhpcy4kVyk6JDtpZih3PT09aHx8dz09PWQpe3ZhciBOPXRoaXMuY2xvbmUoKS5zZXQodSwxKTtOLiRkW3pdKFcpLE4uaW5pdCgpLHRoaXMuJGQ9Ti5zZXQodSxNYXRoLm1pbih0aGlzLiRELE4uZGF5c0luTW9udGgoKSkpLiRkfWVsc2UgeiYmdGhpcy4kZFt6XShXKTtyZXR1cm4gdGhpcy5pbml0KCksdGhpc30seS5zZXQ9ZnVuY3Rpb24oZywkKXtyZXR1cm4gdGhpcy5jbG9uZSgpLiRzZXQoZywkKX0seS5nZXQ9ZnVuY3Rpb24oZyl7cmV0dXJuIHRoaXNbRC5wKGcpXSgpfSx5LmFkZD1mdW5jdGlvbihnLCQpe3ZhciBtLHc9dGhpcztnPU51bWJlcihnKTt2YXIgUD1ELnAoJCksej1mdW5jdGlvbihVKXt2YXIgaj1CKHcpO3JldHVybiBELncoai5kYXRlKGouZGF0ZSgpK01hdGgucm91bmQoVSpnKSksdyl9O2lmKFA9PT1oKXJldHVybiB0aGlzLnNldChoLHRoaXMuJE0rZyk7aWYoUD09PWQpcmV0dXJuIHRoaXMuc2V0KGQsdGhpcy4keStnKTtpZihQPT09YylyZXR1cm4geigxKTtpZihQPT09ZilyZXR1cm4geig3KTt2YXIgVz0obT17fSxtW29dPXMsbVtsXT1pLG1bYV09bixtKVtQXXx8MSxOPXRoaXMuJGQuZ2V0VGltZSgpK2cqVztyZXR1cm4gRC53KE4sdGhpcyl9LHkuc3VidHJhY3Q9ZnVuY3Rpb24oZywkKXtyZXR1cm4gdGhpcy5hZGQoLTEqZywkKX0seS5mb3JtYXQ9ZnVuY3Rpb24oZyl7dmFyICQ9dGhpcyxtPXRoaXMuJGxvY2FsZSgpO2lmKCF0aGlzLmlzVmFsaWQoKSlyZXR1cm4gbS5pbnZhbGlkRGF0ZXx8eDt2YXIgdz1nfHwiWVlZWS1NTS1ERFRISDptbTpzc1oiLFA9RC56KHRoaXMpLHo9dGhpcy4kSCxXPXRoaXMuJG0sTj10aGlzLiRNLFU9bS53ZWVrZGF5cyxqPW0ubW9udGhzLG90PW0ubWVyaWRpZW0scT1mdW5jdGlvbihudCxILEssRil7cmV0dXJuIG50JiYobnRbSF18fG50KCQsdykpfHxLW0hdLnNsaWNlKDAsRil9LHJ0PWZ1bmN0aW9uKG50KXtyZXR1cm4gRC5zKHolMTJ8fDEyLG50LCIwIil9LFo9b3R8fGZ1bmN0aW9uKG50LEgsSyl7dmFyIEY9bnQ8MTI/IkFNIjoiUE0iO3JldHVybiBLP0YudG9Mb3dlckNhc2UoKTpGfTtyZXR1cm4gdy5yZXBsYWNlKGIsZnVuY3Rpb24obnQsSCl7cmV0dXJuIEh8fGZ1bmN0aW9uKEspe3N3aXRjaChLKXtjYXNlIllZIjpyZXR1cm4gU3RyaW5nKCQuJHkpLnNsaWNlKC0yKTtjYXNlIllZWVkiOnJldHVybiBELnMoJC4keSw0LCIwIik7Y2FzZSJNIjpyZXR1cm4gTisxO2Nhc2UiTU0iOnJldHVybiBELnMoTisxLDIsIjAiKTtjYXNlIk1NTSI6cmV0dXJuIHEobS5tb250aHNTaG9ydCxOLGosMyk7Y2FzZSJNTU1NIjpyZXR1cm4gcShqLE4pO2Nhc2UiRCI6cmV0dXJuICQuJEQ7Y2FzZSJERCI6cmV0dXJuIEQucygkLiRELDIsIjAiKTtjYXNlImQiOnJldHVybiBTdHJpbmcoJC4kVyk7Y2FzZSJkZCI6cmV0dXJuIHEobS53ZWVrZGF5c01pbiwkLiRXLFUsMik7Y2FzZSJkZGQiOnJldHVybiBxKG0ud2Vla2RheXNTaG9ydCwkLiRXLFUsMyk7Y2FzZSJkZGRkIjpyZXR1cm4gVVskLiRXXTtjYXNlIkgiOnJldHVybiBTdHJpbmcoeik7Y2FzZSJISCI6cmV0dXJuIEQucyh6LDIsIjAiKTtjYXNlImgiOnJldHVybiBydCgxKTtjYXNlImhoIjpyZXR1cm4gcnQoMik7Y2FzZSJhIjpyZXR1cm4gWih6LFcsITApO2Nhc2UiQSI6cmV0dXJuIFooeixXLCExKTtjYXNlIm0iOnJldHVybiBTdHJpbmcoVyk7Y2FzZSJtbSI6cmV0dXJuIEQucyhXLDIsIjAiKTtjYXNlInMiOnJldHVybiBTdHJpbmcoJC4kcyk7Y2FzZSJzcyI6cmV0dXJuIEQucygkLiRzLDIsIjAiKTtjYXNlIlNTUyI6cmV0dXJuIEQucygkLiRtcywzLCIwIik7Y2FzZSJaIjpyZXR1cm4gUH1yZXR1cm4gbnVsbH0obnQpfHxQLnJlcGxhY2UoIjoiLCIiKX0pfSx5LnV0Y09mZnNldD1mdW5jdGlvbigpe3JldHVybiAxNSotTWF0aC5yb3VuZCh0aGlzLiRkLmdldFRpbWV6b25lT2Zmc2V0KCkvMTUpfSx5LmRpZmY9ZnVuY3Rpb24oZywkLG0pe3ZhciB3LFA9dGhpcyx6PUQucCgkKSxXPUIoZyksTj0oVy51dGNPZmZzZXQoKS10aGlzLnV0Y09mZnNldCgpKSpzLFU9dGhpcy1XLGo9ZnVuY3Rpb24oKXtyZXR1cm4gRC5tKFAsVyl9O3N3aXRjaCh6KXtjYXNlIGQ6dz1qKCkvMTI7YnJlYWs7Y2FzZSBoOnc9aigpO2JyZWFrO2Nhc2UgcDp3PWooKS8zO2JyZWFrO2Nhc2UgZjp3PShVLU4pLzYwNDhlNTticmVhaztjYXNlIGM6dz0oVS1OKS84NjRlNTticmVhaztjYXNlIGw6dz1VL2k7YnJlYWs7Y2FzZSBvOnc9VS9zO2JyZWFrO2Nhc2UgYTp3PVUvbjticmVhaztkZWZhdWx0Onc9VX1yZXR1cm4gbT93OkQuYSh3KX0seS5kYXlzSW5Nb250aD1mdW5jdGlvbigpe3JldHVybiB0aGlzLmVuZE9mKGgpLiREfSx5LiRsb2NhbGU9ZnVuY3Rpb24oKXtyZXR1cm4gTVt0aGlzLiRMXX0seS5sb2NhbGU9ZnVuY3Rpb24oZywkKXtpZighZylyZXR1cm4gdGhpcy4kTDt2YXIgbT10aGlzLmNsb25lKCksdz1SKGcsJCwhMCk7cmV0dXJuIHcmJihtLiRMPXcpLG19LHkuY2xvbmU9ZnVuY3Rpb24oKXtyZXR1cm4gRC53KHRoaXMuJGQsdGhpcyl9LHkudG9EYXRlPWZ1bmN0aW9uKCl7cmV0dXJuIG5ldyBEYXRlKHRoaXMudmFsdWVPZigpKX0seS50b0pTT049ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5pc1ZhbGlkKCk/dGhpcy50b0lTT1N0cmluZygpOm51bGx9LHkudG9JU09TdHJpbmc9ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy4kZC50b0lTT1N0cmluZygpfSx5LnRvU3RyaW5nPWZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuJGQudG9VVENTdHJpbmcoKX0sQX0oKSxHPVkucHJvdG90eXBlO3JldHVybiBCLnByb3RvdHlwZT1HLFtbIiRtcyIscl0sWyIkcyIsYV0sWyIkbSIsb10sWyIkSCIsbF0sWyIkVyIsY10sWyIkTSIsaF0sWyIkeSIsZF0sWyIkRCIsdV1dLmZvckVhY2goZnVuY3Rpb24oQSl7R1tBWzFdXT1mdW5jdGlvbih5KXtyZXR1cm4gdGhpcy4kZyh5LEFbMF0sQVsxXSl9fSksQi5leHRlbmQ9ZnVuY3Rpb24oQSx5KXtyZXR1cm4gQS4kaXx8KEEoeSxZLEIpLEEuJGk9ITApLEJ9LEIubG9jYWxlPVIsQi5pc0RheWpzPUMsQi51bml4PWZ1bmN0aW9uKEEpe3JldHVybiBCKDFlMypBKX0sQi5lbj1NW3ZdLEIuTHM9TSxCLnA9e30sQn0pfSkocnMpO2Z1bmN0aW9uIGR0KGUpe3JldHVybiB0eXBlb2YgZT09Im51bWJlciImJiFOdW1iZXIuaXNOYU4oZSl9ZnVuY3Rpb24gcHQoLi4uZSl7cmV0dXJuIGUuZXZlcnkoZHQpfWZ1bmN0aW9uICRlKGUsdCl7Y29uc3Qgbj1lL3QqMTAwO3JldHVybiFwdChlLHQsbil8fGU9PT0wfHx0PT09MD8wOm4udG9GaXhlZCgyKX1mdW5jdGlvbiBhcyhlKXtyZXR1cm4gcHQoZSk/MWU2KmU6MH1mdW5jdGlvbiBscyhlKXtyZXR1cm4gcHQoZSk/MWU5KmU6MH1mdW5jdGlvbiBjcyhlKXtyZXR1cm4gcHQoZSk/MWUxMiplOjB9ZnVuY3Rpb24gaHMoZSl7cmV0dXJuIHB0KGUpPzFlMTUqZTowfWZ1bmN0aW9uIF9lKGUpe3JldHVybiBlPT1udWxsfWxldCB2dD1udWxsO2Z1bmN0aW9uIGZzKCl7cmV0dXJuIHZ0fHwodHlwZW9mIGRvY3VtZW50PCJ1Ij92dD1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJjYW52YXMiKS5nZXRDb250ZXh0KCIyZCIpOnR5cGVvZiBPZmZzY3JlZW5DYW52YXM8InUiJiYodnQ9bmV3IE9mZnNjcmVlbkNhbnZhcygxLDEpLmdldENvbnRleHQoIjJkIikpLHZ0KX1jb25zdCBDdD1uZXcgTWFwLHVzPTUxMjt2YXIgUT17aGV4VG9SZ2IoZSl7aWYoIWUpcmV0dXJuITE7Y29uc3QgdD0vXiM/KFthLWZcZF17Mn0pKFthLWZcZF17Mn0pKFthLWZcZF17Mn0pJC9pLmV4ZWMoZSksbj1wYXJzZUludCh0WzFdLDE2KSxzPXBhcnNlSW50KHRbMl0sMTYpLGk9cGFyc2VJbnQodFszXSwxNik7cmV0dXJuYCR7bn0sJHtzfSwke2l9YH0sZ2V0Q29sb3JTdHJpbmdUeXBlKGUpe2lmKCFlKXJldHVybiIiO2NvbnN0IHQ9ZS5yZXBsYWNlKC8gL2csIiIpLG49L14jKD86W0EtRmEtZjAtOV17M30pezEsMn0kLy5leGVjKHQpLHM9L15yZ2JbKF0oPzpccyowKig/OlxkXGQ/KD86XC5cZCspPyg/OlxzKiUpP3xcLlxkK1xzKiV8MTAwKD86XC4wKik/XHMqJXwoPzoxXGRcZHwyWzAtNF1cZHwyNVswLTVdKSg/OlwuXGQrKT8pXHMqKD86LCg/IVspXSl8KD89WyldKSkpezN9WyldJC8uZXhlYyh0KSxpPS9ecmdiYVsoXSg/OlxzKjAqKD86XGRcZD8oPzpcLlxkKyk/KD86XHMqJSk/fFwuXGQrXHMqJXwxMDAoPzpcLjAqKT9ccyolfCg/OjFcZFxkfDJbMC00XVxkfDI1WzAtNV0pKD86XC5cZCspPylccyosKXszfVxzKjAqKD86XC5cZCt8MT8pXHMqWyldJC8uZXhlYyh0KTtsZXQgcj0iIjtyZXR1cm4gbj9yPSJIRVgiOnM/cj0iUkdCIjppP3I9IlJHQkEiOnI9Ik5PTkUiLHJ9LGNvbG9yU3RyaW5nVG9SZ2JhKGUsdD0xKXtjb25zdCBuPWAke2V9fCR7dH1gLHM9Q3QuZ2V0KG4pO2lmKHMhPT12b2lkIDApcmV0dXJuIHM7Y29uc3QgaT1lLnJlcGxhY2UoLyAvZywiIikscj10aGlzLmdldENvbG9yU3RyaW5nVHlwZShpKTtsZXQgYT0iIjtzd2l0Y2gocil7Y2FzZSJIRVgiOmE9YHJnYmEoJHt0aGlzLmhleFRvUmdiKGkpfSwke3R9KWA7YnJlYWs7Y2FzZSJSR0IiOmE9aS5yZXBsYWNlKCIpIixgLCAke3R9KWApLnJlcGxhY2UoInJnYiIsInJnYmEiKTticmVhaztjYXNlIlJHQkEiOntjb25zdCBvPWkucmVwbGFjZSgvXi4qLCguKylcKS8sIiQxIik7YT1pLnJlcGxhY2UoYCR7b30pYCxgJHt0fSlgKTticmVha31kZWZhdWx0OmE9YHJnYmEoMCwgMCwgMCwgJHt0fSlgO2JyZWFrfXJldHVybiBDdC5zaXplPj11cyYmQ3QuZGVsZXRlKEN0LmtleXMoKS5uZXh0KCkudmFsdWUpLEN0LnNldChuLGEpLGF9LGdldE9wYWNpdHkoZSl7Y29uc3QgdD1lPT1udWxsP3ZvaWQgMDplLnJlcGxhY2UoLyAvZywiIik7cmV0dXJuIHRoaXMuZ2V0Q29sb3JTdHJpbmdUeXBlKHQpPT09IlJHQkEiP3QucmVwbGFjZSgvXi4qLCguKylcKS8sIiQxIik6IjEifSxjYWxjdWxhdGVNYWduaXR1ZGUoZSl7cmV0dXJuIE1hdGguZmxvb3IoTWF0aC5sb2coZSkvTWF0aC5MTjEwKX0sYWxpYXNQaXhlbChlKXtyZXR1cm4gZSUyPT09MD8wOi41fSxjb29yZGluYXRlS2V5KGUsdCl7cmV0dXJuYCR7ZX18JHt0fWB9LGdldExhYmVsU3R5bGUoZSl7Y29uc3R7Zm9udFN0eWxlOnQ9Im5vcm1hbCIsZm9udFdlaWdodDpuPSJub3JtYWwiLGZvbnRTaXplOnM9IjEyIixmb250RmFtaWx5Omk9IlJvYm90byJ9PWU7cmV0dXJuYCR7dH0gbm9ybWFsICR7bn0gJHtzfXB4ICR7aX1gfSxsYWJlbFNpZ25Gb3JtYXQoZSx0PW51bGwpe2NvbnN0IG49aHMoMSkscz1jcygxKSxpPWxzKDEpLHI9YXMoMSksYT0xZTM7bGV0IG87aWYoIXB0KGUpKXJldHVybiBlO2NvbnN0IGw9ZTwwLGM9TWF0aC5hYnMoZSksZj0oaCxwLGQpPT57bGV0IHU7cmV0dXJuIGglcD09PTA/dT14dCh0KT9gJHtoL3B9JHtkfWA6YCR7KGgvcCkudG9GaXhlZCh0KX0ke2R9YDp1PWAkeyhoL3ApLnRvRml4ZWQoMSl9JHtkfWAsbD9gLSR7dX1gOnV9O2lmKGM+PW4pbz1mKGMsbiwiUCIpO2Vsc2UgaWYoYz49cylvPWYoYyxzLCJUIik7ZWxzZSBpZihjPj1pKW89ZihjLGksIkciKTtlbHNlIGlmKGM+PXIpbz1mKGMsciwiTSIpO2Vsc2UgaWYoYz49YSlvPWYoYywxZTMsIksiKTtlbHNle2NvbnN0IGg9eHQodCk/YzpjLnRvRml4ZWQodCk7bz1sP2AtJHtofWA6YCR7aH1gfXJldHVybiBvfSxjYWxjVGV4dFNpemUoZSx0LG49MCl7Y29uc3Qgcz1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJzcGFuIiksaT1gdmlzaWJpbGl0eTpoaWRkZW47IHBvc2l0aW9uOmFic29sdXRlOyB0b3A6LTEwMDAwcHg7IGZvbnQ6ICR7dH07IHBhZGRpbmc6IDAgJHtufXB4YDtzLnNldEF0dHJpYnV0ZSgic3R5bGUiLGkpLHMuc3R5bGUuZm9udD10LHMudGV4dENvbnRlbnQ9ZSxkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHMpO2NvbnN0IHI9cy5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxhPXIud2lkdGh8fDIsbz1yLmhlaWdodHx8MjtyZXR1cm4gcy5yZW1vdmUoKSx7d2lkdGg6YSxoZWlnaHQ6b319LGNhbGNUZXh0U2l6ZUNhbnZhcyhlLHQpe2lmKCFlKXJldHVybnt3aWR0aDoyLGhlaWdodDoyfTtjb25zdCBuPWZzKCk7bi5zYXZlKCksbi5mb250PXQ7Y29uc3Qgcz1uLm1lYXN1cmVUZXh0KGUpLGk9dC5tYXRjaCgvKFxkKyg/OlwuXGQrKT8pcHgvKSxhPShpP051bWJlcihpWzFdKToxNCkqMS4yO3JldHVybiBuLnJlc3RvcmUoKSx7d2lkdGg6TWF0aC5tYXgoTWF0aC5jZWlsKHMud2lkdGgpLDIpLGhlaWdodDpNYXRoLm1heChNYXRoLmNlaWwoYSksMil9fSxnZXRTdHJpbmdNaW5NYXgoZSl7Y29uc3QgdD17bWluOmVbMF0sbWF4OmVbMF19O3JldHVybiBlLmZvckVhY2gobj0+e3ZhciBzLGk7KChzPXQ9PW51bGw/dm9pZCAwOnQubWF4KT09bnVsbD92b2lkIDA6cy5sZW5ndGgpPChuPT1udWxsP3ZvaWQgMDpuLmxlbmd0aCkmJih0Lm1heD1uKSwoKGk9dD09bnVsbD92b2lkIDA6dC5taW4pPT1udWxsP3ZvaWQgMDppLmxlbmd0aCk+KG49PW51bGw/dm9pZCAwOm4ubGVuZ3RoKSYmKHQubWluPW4pfSksdH0sdHJ1bmNhdGVMYWJlbFdpdGhFbGxpcHNpcyhlLHQsbixzPSJyaWdodCIpe2lmKCFlKXJldHVybiIiO2lmKCF0KXJldHVybiBlO2NvbnN0IGk9IuKApiIscj1uLm1lYXN1cmVUZXh0KGkpLndpZHRoO2xldCBhPWUsbz1uLm1lYXN1cmVUZXh0KGEpLndpZHRoO2lmKG88PXR8fG88PXIpcmV0dXJuIGU7bGV0IGw9YS5sZW5ndGg7Zm9yKDtvPj10LXImJmwtLSA+MDspYT1zPT09InJpZ2h0Ij9hLnN1YnN0cmluZygwLGwpOmEuc3Vic3RyaW5nKDEsYS5sZW5ndGgpLG89bi5tZWFzdXJlVGV4dChhKS53aWR0aDtyZXR1cm4gcz09PSJyaWdodCI/YStpOmkrYX0sc2hvd0xhYmVsVGlwKGUpe2NvbnN0e2N0eDp0LHdpZHRoOm4saGVpZ2h0OnMseDppLHk6cixhcnJvd1NpemU6YSxib3JkZXJSYWRpdXM6byx0ZXh0OmwsYmFja2dyb3VuZENvbG9yOmMsdGV4dENvbG9yOmZ9PWUsaD1pLW4vMixwPWkrbi8yLGQ9ci1zLHU9cjt0LmJlZ2luUGF0aCgpLHQuc2F2ZSgpLHQuZmlsbFN0eWxlPWN8fCIjRTk2RTJDIix0LnN0cm9rZVN0eWxlPWN8fCIjRTk2RTJDIix0LnNoYWRvd0JsdXI9MCx0Lm1vdmVUbyhoK28sZCksdC5xdWFkcmF0aWNDdXJ2ZVRvKGgsZCxoLGQrbyksdC5saW5lVG8oaCx1LW8pLHQucXVhZHJhdGljQ3VydmVUbyhoLHUsaCtvLHUpLHQubGluZVRvKHAtbyx1KSx0LnF1YWRyYXRpY0N1cnZlVG8ocCx1LHAsdS1vKSx0LmxpbmVUbyhwLGQrbyksdC5xdWFkcmF0aWNDdXJ2ZVRvKHAsZCxwLW8sZCksdC5saW5lVG8oaS1hLGQpLHQubGluZVRvKGksZC1hKSx0LmxpbmVUbyhpK2EsZCksdC5saW5lVG8oaCtvLGQpLHQuY2xvc2VQYXRoKCksdC5maWxsKCksdC5yZXN0b3JlKCksdC5zYXZlKCksdC5mb250PSJub3JtYWwgbm9ybWFsIGJvbGQgMTJweCBSb2JvdG8iLHQuZmlsbFN0eWxlPWZ8fCIjRkZGIix0LnRleHRCYXNlbGluZT0ibWlkZGxlIix0LnRleHRBbGlnbj0iY2VudGVyIix0LmZpbGxUZXh0KGAke2x9YCxpLGQrcy8yKSx0LnJlc3RvcmUoKSx0LmJlZ2luUGF0aCgpfSxpc1BpZVR5cGUoZSl7cmV0dXJuIGU9PT0icGllInx8ZT09PSJkb3VnaG51dCJ8fGU9PT0ic3VuYnVyc3QifSxpc0RvdWdobnV0SG9sZShlKXtyZXR1cm4gZT09PSJkb3VnaG51dCJ8fGU9PT0ic3VuYnVyc3QifSxzZXRET01TdHlsZShlLHQpe3ZhciBuOyFlfHwhdHx8KG49T2JqZWN0LmtleXModCkpPT1udWxsfHxuLmZvckVhY2gocz0+e2Uuc3R5bGVbc109dFtzXX0pfSxjaGVja1NhZmVJbnRlZ2VyKGUpe3JldHVybiBlPD1OdW1iZXIuTUFYX1NBRkVfSU5URUdFUiYmZT49TnVtYmVyLk1JTl9TQUZFX0lOVEVHRVJ9LGh0bWxUb0VsZW1lbnQoZSl7Y29uc3QgdD1kb2N1bWVudC5jcmVhdGVFbGVtZW50KCJ0ZW1wbGF0ZSIpO3JldHVybiB0LmlubmVySFRNTD1lLnRyaW0oKSx0LmNvbnRlbnQuZmlyc3RDaGlsZH0saXNOdWxsT3JVbmRlZmluZWQoZSl7cmV0dXJuIGU9PW51bGx9LHJnYmFBZGp1c3RIYWxmT3BhY2l0eShlKXtjb25zdCB0PS9ecmdiXCgoXGQrKSxccyooXGQrKSxccyooXGQrKVwpJC8sbj0vXnJnYmFcKChcZCspLFxzKihcZCspLFxzKihcZCspLFxzKihbXGQuXSspXCkkLztpZih0LnRlc3QoZSkpe2NvbnN0WyxzLGkscl09ZS5tYXRjaCh0KTtyZXR1cm5gcmdiYSgke3N9LCAke2l9LCAke3J9LCAwLjUpYH1pZihuLnRlc3QoZSkpe2NvbnN0WyxzLGkscixhXT1lLm1hdGNoKG4pLG89KHBhcnNlRmxvYXQoYSkvMikudG9GaXhlZCgyKTtyZXR1cm5gcmdiYSgke3N9LCAke2l9LCAke3J9LCAke299KWB9cmV0dXJuIGUuc3RhcnRzV2l0aCgiIyIpJiZlLmxlbmd0aD43P2U6YCR7ZX04MGB9LGNhbGNCb3hEaXN0YW5jZShlLHQsbil7aWYoZS53IT09bnVsbCYmZS53IT09dm9pZCAwJiZlLmghPT1udWxsJiZlLmghPT12b2lkIDApe2NvbnN0IHM9ZS54cCxpPWUueXAscj1NYXRoLm1pbihzLHMrZS53KSxhPU1hdGgubWF4KHMscytlLncpLG89TWF0aC5taW4oaSxpK2UuaCksbD1NYXRoLm1heChpLGkrZS5oKSxjPU1hdGgubWF4KDAsci10LHQtYSksZj1NYXRoLm1heCgwLG8tbixuLWwpO3JldHVybiBjKmMrZipmfXJldHVybihlLnhwLXQpKioyKyhlLnlwLW4pKioyfX07Y29uc3QgUGU9WyJjcm9zcyIsImNyb3NzUm90Iiwic3RhciIsImxpbmUiXTt2YXIgdHQ9e2NhbGN1bGF0ZVgoZSx0LG4scyxpPTApe2lmKGU9PW51bGx8fGU+bnx8ZTx0KXJldHVybiBudWxsO2NvbnN0IHI9cy8obi10KTtyZXR1cm4gTWF0aC5jZWlsKGkrciooZS10KSl9LGNhbGN1bGF0ZVN1YlgoZSx0LG4scyxpPTApe2lmKGU9PW51bGwpcmV0dXJuIG51bGw7Y29uc3Qgcj1zLyhuLXQpO3JldHVybiBNYXRoLmNlaWwoaStyKihlLXQpKX0sY2FsY3VsYXRlWShlLHQsbixzLGk9MCl7bGV0IHI7aWYoZT09bnVsbHx8ZT5ufHxlPHQpcmV0dXJuIG51bGw7Y29uc3QgYT1zLyhuLXQpO3JldHVybiBpP3I9aS1hKihlLSh0fHwwKSk6cj0tKGEqKGUtKHR8fDApKSksTWF0aC5mbG9vcihyKX0sZHJhd1BvaW50KGUsdCxuLHMsaSl7aWYoIShpc05hTihuKXx8bjw9MCkpe2lmKHQ9PT0icmVjdCIpe2NvbnN0IHI9MS9NYXRoLlNRUlQyKm47ZS5maWxsUmVjdChzLXIsaS1yLDIqciwyKnIpLGUuc3Ryb2tlUmVjdChzLXIsaS1yLDIqciwyKnIpO3JldHVybn1lLmJlZ2luUGF0aCgpLHRoaXMuX2FwcGVuZFBvaW50UGF0aChlLHQsbixzLGkpLFBlLmluY2x1ZGVzKHQpfHxlLmZpbGwoKSxlLnN0cm9rZSgpfX0sX2FwcGVuZFBvaW50UGF0aChlLHQsbixzLGkpe2xldCByLGEsbyxsLGMsZixoLHAsZDtzd2l0Y2godCl7Y2FzZSJ0cmlhbmdsZSI6cj0zKm4vTWF0aC5zcXJ0KDMpLGw9cipNYXRoLnNxcnQoMykvMixlLm1vdmVUbyhzLXIvMixpK2wvMyksZS5saW5lVG8ocytyLzIsaStsLzMpLGUubGluZVRvKHMsaS0yKmwvMyksZS5jbG9zZVBhdGgoKTticmVhaztjYXNlInJlY3RSb3VuZGVkIjpmPW4vTWF0aC5TUVJUMixoPXMtZixwPWktZixkPU1hdGguU1FSVDIqbix0aGlzLnJvdW5kZWRSZWN0KGUsaCxwLGQsZCxuLzIpLGUuY2xvc2VQYXRoKCk7YnJlYWs7Y2FzZSJyZWN0Um90IjpjPTEvTWF0aC5TUVJUMipuLGUubW92ZVRvKHMtYyxpKSxlLmxpbmVUbyhzLGkrYyksZS5saW5lVG8ocytjLGkpLGUubGluZVRvKHMsaS1jKSxlLmNsb3NlUGF0aCgpO2JyZWFrO2Nhc2UiY3Jvc3MiOmUubW92ZVRvKHMsaStuKSxlLmxpbmVUbyhzLGktbiksZS5tb3ZlVG8ocy1uLGkpLGUubGluZVRvKHMrbixpKSxlLmNsb3NlUGF0aCgpO2JyZWFrO2Nhc2UiY3Jvc3NSb3QiOmE9TWF0aC5jb3MoTWF0aC5QSS80KSpuLG89TWF0aC5zaW4oTWF0aC5QSS80KSpuLGUubW92ZVRvKHMtYSxpLW8pLGUubGluZVRvKHMrYSxpK28pLGUubW92ZVRvKHMtYSxpK28pLGUubGluZVRvKHMrYSxpLW8pLGUuY2xvc2VQYXRoKCk7YnJlYWs7Y2FzZSJzdGFyIjplLm1vdmVUbyhzLGkrbiksZS5saW5lVG8ocyxpLW4pLGUubW92ZVRvKHMtbixpKSxlLmxpbmVUbyhzK24saSksYT1NYXRoLmNvcyhNYXRoLlBJLzQpKm4sbz1NYXRoLnNpbihNYXRoLlBJLzQpKm4sZS5tb3ZlVG8ocy1hLGktbyksZS5saW5lVG8ocythLGkrbyksZS5tb3ZlVG8ocy1hLGkrbyksZS5saW5lVG8ocythLGktbyksZS5jbG9zZVBhdGgoKTticmVhaztjYXNlImxpbmUiOmUubW92ZVRvKHMtbixpKSxlLmxpbmVUbyhzK24saSksZS5jbG9zZVBhdGgoKTticmVhaztkZWZhdWx0OmUubW92ZVRvKHMrbixpKSxlLmFyYyhzLGksbiwwLE1hdGguUEkqMik7YnJlYWt9fSxkcmF3UG9pbnRCYXRjaChlLHQsbixzKXtpZighKGlzTmFOKG4pfHxuPD0wfHwhc3x8IXMubGVuZ3RoKSl7aWYodD09PSJyZWN0Iil7Y29uc3QgaT0xL01hdGguU1FSVDIqbjtmb3IobGV0IHI9MDtyPHMubGVuZ3RoO3IrKyllLmZpbGxSZWN0KHNbcl0ueHAtaSxzW3JdLnlwLWksMippLDIqaSksZS5zdHJva2VSZWN0KHNbcl0ueHAtaSxzW3JdLnlwLWksMippLDIqaSk7cmV0dXJufWUuYmVnaW5QYXRoKCk7Zm9yKGxldCBpPTA7aTxzLmxlbmd0aDtpKyspdGhpcy5fYXBwZW5kUG9pbnRQYXRoKGUsdCxuLHNbaV0ueHAsc1tpXS55cCk7UGUuaW5jbHVkZXModCl8fGUuZmlsbCgpLGUuc3Ryb2tlKCl9fSxyb3VuZGVkUmVjdChlLHQsbixzLGkscil7Y29uc3QgYT1NYXRoLlBJLG89YS8yO2lmKHIpe2NvbnN0IGw9TWF0aC5taW4ocixpLzIscy8yKSxjPXQrbCxmPW4rbCxoPXQrcy1sLHA9bitpLWw7ZS5tb3ZlVG8odCxmKSxjPGgmJmY8cD8oZS5hcmMoYyxmLGwsLWEsLW8pLGUuYXJjKGgsZixsLC1vLDApLGUuYXJjKGgscCxsLDAsbyksZS5hcmMoYyxwLGwsbyxhKSk6YzxoPyhlLm1vdmVUbyhjLG4pLGUuYXJjKGgsZixsLC1vLG8pLGUuYXJjKGMsZixsLG8sYStvKSk6ZjxwPyhlLmFyYyhjLGYsbCwtYSwwKSxlLmFyYyhjLHAsbCwwLGEpKTplLmFyYyhjLGYsbCwtYSxhKSxlLmNsb3NlUGF0aCgpLGUubW92ZVRvKHQsbil9ZWxzZSBlLnJlY3QodCxuLHMsaSl9LGNyZWF0ZUdyYWRpZW50KGUsdCxuLHMsaSxyKXtjb25zdHt4OmEseTpvLHc6bCxoOmN9PW47bGV0IGY7dD9mPWUuY3JlYXRlTGluZWFyR3JhZGllbnQoYSwwLGErbCwwKTpmPWUuY3JlYXRlTGluZWFyR3JhZGllbnQoMCxvLDAsbytjKTtmb3IobGV0IGg9MDtoPHMubGVuZ3RoO2grKyl7Y29uc3QgcD1zW2hdWzBdPz8wLGQ9c1toXVsxXT8/InJnYmEoMjU1LCAyNTUsIDI1NSwgMCkiLHU9ZC5pbmNsdWRlcygicmdiYSIpP1EuZ2V0T3BhY2l0eShkKToxLHg9aT9yOnU7Zi5hZGRDb2xvclN0b3AocCxRLmNvbG9yU3RyaW5nVG9SZ2JhKGQseCkpfXJldHVybiBmfX07Y29uc3QgenQ9WyIjMmI5OWYwIiwiIzhhYzQ0OSIsIiMwMEM0QzUiLCIjZmZkZTAwIiwiI2ZmNzc4MSIsIiM4NDcwZmYiLCIjNzVjZDhlIiwiIzQ4ZDFjYyIsIiNmZWM2NGYiLCIjZmU5ODRmIiwiIzAwNTJmZiIsIiMwMGE0OGMiLCIjODNjZmRlIiwiI2RmZTMyZCIsIiNmZjdkNDAiLCIjOTljN2ZmIiwiI2E1ZmVlMyIsIiMwMzc5YzkiLCIjZWVmMDkzIiwiI2ZmYTg5MSIsIiMwMGM1Y2QiLCIjMDA5YmM3IiwiI2NhY2FmZiIsIiNmZmMxMjUiLCIjZGY2MjY0Il0sRXQ9e3Nob3c6ITAsaGlnaGxpZ2h0OntkZWZhdWx0U2l6ZTo0LG1heFNpemU6NixtYXhTaGFkb3dTaXplOjEwLG1heFNoYWRvd09wYWNpdHk6LjR9LHhBeGlzSW5kZXg6MCx5QXhpc0luZGV4OjAscG9pbnQ6ITAscG9pbnRIaWdobGlnaHQ6ITAscG9pbnRTaXplOjMscG9pbnRTdHlsZToiIixsaW5lV2lkdGg6MixmaWxsOiExLGZpbGxPcGFjaXR5Oi40LHNob3dMZWdlbmQ6ITAscGFzc2luZ1ZhbHVlOm51bGwsaW50ZXJwb2xhdGlvbjoibm9uZSJ9LGRzPXtzaG93OiEwLGhpZ2hsaWdodDp7cG9pbnRTaXplOjV9LHhBeGlzSW5kZXg6MCx5QXhpc0luZGV4OjAsY2F0ZWdvcnk6ITAsc2hvd0xlZ2VuZDohMCxzaG93VmFsdWU6e3VzZTohMSxmb250U2l6ZToxMix0ZXh0Q29sb3I6IiMwMDAwMDAiLGZvcm1hdHRlcjpudWxsLGRlY2ltYWxQb2ludDpudWxsfX0scHM9e3Nob3c6ITAseEF4aXNJbmRleDowLHlBeGlzSW5kZXg6MCxzaG93TGVnZW5kOiEwLHNob3dWYWx1ZTp7dXNlOiExLGZvbnRTaXplOjEyLHRleHRDb2xvcjoiIzAwMDAwMCIsZm9ybWF0dGVyOm51bGwsZGVjaW1hbFBvaW50OjB9LGhpZ2hsaWdodDp7c3Ryb2tlOnt1c2U6ITEsY29sb3I6bnVsbCx3aWR0aDoxLHJhZGl1czowfSxzaGFkb3c6e3VzZTohMCxvZmZzZXRYOjAsb2Zmc2V0WTowLGJsdXI6NCxjb2xvcjoiIzk1OTQ5NCJ9fX0sZ3M9Mix4cz1uZXcgU2V0KFsidHJpYW5nbGUiLCJyZWN0IiwicmVjdFJvdW5kZWQiLCJyZWN0Um90IiwiY3Jvc3MiLCJjcm9zc1JvdCIsInN0YXIiLCJsaW5lIl0pLFJlPU1hdGguUEkqMjtjbGFzcyB5c3tjb25zdHJ1Y3Rvcih0LG4scyl7Y29uc3QgaT1PZSh7fSxuLEV0KTtPYmplY3Qua2V5cyhpKS5mb3JFYWNoKHI9Pnt0aGlzW3JdPWlbcl19KSx0aGlzLm5hbWU9PT12b2lkIDAmJih0aGlzLm5hbWU9YHNlcmllcy0ke3N9YCksWyJjb2xvciIsInBvaW50RmlsbCIsImZpbGxDb2xvciJdLmZvckVhY2gocj0+e3RoaXNbcl09PT12b2lkIDAmJih0aGlzW3JdPXI9PT0icG9pbnRGaWxsIj90aGlzLmNvbG9yOnp0W3MlenQubGVuZ3RoXSl9KSx0aGlzLnR5cGU9ImxpbmUiLHRoaXMuc0lkPXQsdGhpcy5leHRlbnQ9e2Rvd25wbGF5OntvcGFjaXR5Oi4zLGxpbmVXaWR0aDoxfSxub3JtYWw6e29wYWNpdHk6MSxsaW5lV2lkdGg6MX0saGlnaGxpZ2h0OntvcGFjaXR5OjEsbGluZVdpZHRoOjJ9fSx0aGlzLmRhdGE9W10sdGhpcy5iZWZvcmVNb3VzZVhwPTAsdGhpcy5iZWZvcmVNb3VzZVlwPTAsdGhpcy5iZWZvcmVGaW5kSXRlbUluZGV4PS0xLHRoaXMuc2l6ZT17Y29tYm9PZmZzZXQ6MH19dXNlTGluZWFySW50ZXJwb2xhdGlvbigpe3JldHVybiB0aGlzLmludGVycG9sYXRpb249PT0ibGluZWFyInx8dGhpcy5pbnRlcnBvbGF0aW9uPT09Im5vbmUiJiYhIXRoaXMucGFzc2luZ1ZhbHVlJiZ0aGlzLmhhc1Bhc3NpbmdWYWx1ZUluRGF0YX1fZ2V0VmFsaWRHRGF0YSgpe2NvbnN0IHQ9dGhpcy5kYXRhLG49dGhpcy5fdmFsaWRHRGF0YUNhY2hlO2lmKG4mJm4uc3JjPT09dCYmbi5sZW5ndGg9PT10Lmxlbmd0aClyZXR1cm4gbi52YWx1ZTtjb25zdCBzPXQuZmlsdGVyKGk9PiFRLmlzTnVsbE9yVW5kZWZpbmVkKGkueCkpO3JldHVybiB0aGlzLl92YWxpZEdEYXRhQ2FjaGU9e3NyYzp0LGxlbmd0aDp0Lmxlbmd0aCx2YWx1ZTpzfSxzfWNvbXB1dGVHZW9tZXRyeSh0KXtpZighdGhpcy5zaG93KXJldHVybjtjb25zdCBuPXQuc2NhbGVWZXJzaW9uIT1udWxsJiZ0LmRhdGFFcG9jaCE9bnVsbDtpZihuJiZ0aGlzLl9sYXN0RGF0YUVwb2NoPT09dC5kYXRhRXBvY2gmJnRoaXMuX2xhc3RTY2FsZVZlcnNpb249PT10LnNjYWxlVmVyc2lvbiYmdGhpcy5fbGFzdEdlb21EYXRhPT09dGhpcy5kYXRhKXJldHVybjtjb25zdHtjaGFydFJlY3Q6cyxsYWJlbE9mZnNldDppLGF4ZXNTdGVwczpyLGRpc3BsYXlPdmVyZmxvdzphfT10LG89dGhpcy51c2VMaW5lYXJJbnRlcnBvbGF0aW9uKCk7bGV0IGw9MDtjb25zdCBjPXIueFt0aGlzLnhBeGlzSW5kZXhdLGY9ci55W3RoaXMueUF4aXNJbmRleF07bGV0IGg9cy5jaGFydFdpZHRoLShpLmxlZnQraS5yaWdodCk7Y29uc3QgcD1zLmNoYXJ0SGVpZ2h0LShpLnRvcCtpLmJvdHRvbSk7dGhpcy5jb21ibyYmKGw9aC8odGhpcy5kYXRhLmxlbmd0aHx8MSksaC09bCx0aGlzLnNpemUuY29tYm9PZmZzZXQ9bCk7Y29uc3QgZD1zLngxK2kubGVmdCtsLzIsdT1zLnkyLWkuYm90dG9tLHg9Yy5ncmFwaE1pbixTPWMuZ3JhcGhNYXgsYj1mLmdyYXBoTWluLE89Zi5ncmFwaE1heCxUPWgvKFMteCksST1wLyhPLWIpLHY9Ynx8MCxNPUM9PkM9PW51bGx8fEM8eHx8Qz5TP251bGw6TWF0aC5jZWlsKGQrVCooQy14KSksXz1DPT57Y29uc3QgUj1hJiZDPk8/TzpDO3JldHVybiBSPT1udWxsfHxSPGJ8fFI+Tz9udWxsOk1hdGguZmxvb3IodT91LUkqKFItdik6LShJKihSLXYpKSl9O2ZvcihsZXQgQz0wO0M8dGhpcy5kYXRhLmxlbmd0aDtDKyspe2NvbnN0IFI9dGhpcy5kYXRhW0NdO2xldCBCPU0oUi54KSxEPV8oUi55KTt0aGlzLmlzRXhpc3RHcnAmJm8mJlIubz09PW51bGwmJihEPV8oUi5iPz8wKSksQiE9PW51bGwmJihCKz1RLmFsaWFzUGl4ZWwoQikpLFIueHA9QixSLnlwPUR9biYmKHRoaXMuX2xhc3REYXRhRXBvY2g9dC5kYXRhRXBvY2gsdGhpcy5fbGFzdFNjYWxlVmVyc2lvbj10LnNjYWxlVmVyc2lvbix0aGlzLl9sYXN0R2VvbURhdGE9dGhpcy5kYXRhKX1oYXNSZW5kZXJhYmxlVmFsdWUoKXtyZXR1cm4gdGhpcy5kYXRhLnNvbWUodD0+dC5vIT09bnVsbCYmdC5vIT09dm9pZCAwKX1kcmF3KHQpe3ZhciBXLE4sVSxqLG90LHEscnQsWixudDtpZighdGhpcy5zaG93KXJldHVybjtjb25zdHtjdHg6bixjaGFydFJlY3Q6cyxsYWJlbE9mZnNldDppLGF4ZXNTdGVwczpyLHNlbGVjdExhYmVsOmEsc2VsZWN0U2VyaWVzOm8sbGVnZW5kSGl0SW5mbzpsLGlzQnJ1c2g6Yyx1blNlbGVjdGVkT3BhY2l0eTpmLGRpc3BsYXlPdmVyZmxvdzpofT10O2lmKHRoaXMuY29tcHV0ZUdlb21ldHJ5KHQpLCF0aGlzLmhhc1JlbmRlcmFibGVWYWx1ZSgpJiYhdGhpcy5pc0V4aXN0R3JwKXJldHVybjtjb25zdCBwPWE9PW51bGw/dm9pZCAwOmEub3B0aW9uLGQ9KHA9PW51bGw/dm9pZCAwOnAudXNlKSYmKHA9PW51bGw/dm9pZCAwOnAudXNlU2VyaWVzT3BhY2l0eSksdT0oKFc9YT09bnVsbD92b2lkIDA6YS5zZWxlY3RlZCk9PW51bGw/dm9pZCAwOlcuZGF0YUluZGV4KT8/W107bGV0IHg7aWYobCl4PXRoaXMuZXh0ZW50WyhsPT1udWxsP3ZvaWQgMDpsLnNJZCk9PT10aGlzLnNJZD8iaGlnaGxpZ2h0IjoiZG93bnBsYXkiXTtlbHNlIGlmKChOPW89PW51bGw/dm9pZCAwOm8ub3B0aW9uKSE9bnVsbCYmTi51c2UmJigoaj0oVT1vPT1udWxsP3ZvaWQgMDpvLnNlbGVjdGVkKT09bnVsbD92b2lkIDA6VS5zZXJpZXNJZCkhPW51bGwmJmoubGVuZ3RoKSl7Y29uc3QgSD0ocT0ob3Q9bz09bnVsbD92b2lkIDA6by5zZWxlY3RlZCk9PW51bGw/dm9pZCAwOm90LnNlcmllc0lkKT09bnVsbD92b2lkIDA6cS5pbmNsdWRlcyh0aGlzLnNJZCk7eD10aGlzLmV4dGVudFtIPyJoaWdobGlnaHQiOiJkb3ducGxheSJdfWVsc2UgZCYmdS5sZW5ndGg/eD10aGlzLmV4dGVudC5kb3ducGxheTp4PXRoaXMuZXh0ZW50Lm5vcm1hbDt4PT09dGhpcy5leHRlbnQuZG93bnBsYXkmJih4PXsuLi54LG9wYWNpdHk6Zn0pO2NvbnN0IFM9SD0+SCE9bnVsbCYmSC5pbmNsdWRlcygicmdiYSIpP1EuZ2V0T3BhY2l0eShIKTp4Lm9wYWNpdHksYj10aGlzLmNvbG9yLE89UyhiKSxUPXRoaXMucG9pbnRGaWxsLEk9UyhUKSx2PXRoaXMuZXh0ZW50LmRvd25wbGF5P3RoaXMuZmlsbE9wYWNpdHkqeC5vcGFjaXR5OnRoaXMuZmlsbE9wYWNpdHksTT10aGlzLmxpbmVXaWR0aCp4LmxpbmVXaWR0aCxfPXRoaXMuX3JnYmFDYWNoZXx8KHRoaXMuX3JnYmFDYWNoZT17fSksQz0oSCxLLEYpPT57Y29uc3Qgaz1fW0hdO2lmKGshPT12b2lkIDAmJmsucz09PUsmJmsubz09PUYpcmV0dXJuIGsudjtjb25zdCBldD1RLmNvbG9yU3RyaW5nVG9SZ2JhKEssRik7cmV0dXJuIF9bSF09e3M6SyxvOkYsdjpldH0sZXR9O24uYmVnaW5QYXRoKCksbi5zYXZlKCksbi5saW5lSm9pbj0icm91bmQiLG4ubGluZVdpZHRoPU0sbi5zdHJva2VTdHlsZT1DKCJzdHJva2UiLGIsTyksdGhpcy5zZWdtZW50cyYmbi5zZXRMaW5lRGFzaCh0aGlzLnNlZ21lbnRzKTtjb25zdCBSPXRoaXMudXNlTGluZWFySW50ZXJwb2xhdGlvbigpO2xldCBCPTA7Y29uc3QgRD1yLnhbdGhpcy54QXhpc0luZGV4XSxZPXIueVt0aGlzLnlBeGlzSW5kZXhdO2xldCBHPXMuY2hhcnRXaWR0aC0oaS5sZWZ0K2kucmlnaHQpO2NvbnN0IEE9cy5jaGFydEhlaWdodC0oaS50b3AraS5ib3R0b20pO3RoaXMuY29tYm8mJihCPUcvKHRoaXMuZGF0YS5sZW5ndGh8fDEpLEctPUIsdGhpcy5zaXplLmNvbWJvT2Zmc2V0PUIpO2NvbnN0IHk9cy54MStpLmxlZnQrQi8yLGc9cy55Mi1pLmJvdHRvbSwkPUg9PnR0LmNhbGN1bGF0ZVgoSCxELmdyYXBoTWluLEQuZ3JhcGhNYXgsRyx5KSxtPUg9PnR0LmNhbGN1bGF0ZVkoaCYmSD5ZLmdyYXBoTWF4P1kuZ3JhcGhNYXg6SCxZLmdyYXBoTWluLFkuZ3JhcGhNYXgsQSxnKTtsZXQgdyxQPW51bGwsej1udWxsO2ZvcihsZXQgSD0wO0g8dGhpcy5kYXRhLmxlbmd0aDtIKyspe2NvbnN0IEs9dGhpcy5kYXRhW0hdLEY9Sy54cCxrPUsueXA7UiYmSy5vPT09bnVsbHx8KEY9PT1udWxsfHxrPT09bnVsbD93PXZvaWQgMDooeHQodz09bnVsbD92b2lkIDA6dy55KSYmIXRoaXMuaXNFeGlzdEdycHx8IVImJih4dCh3PT1udWxsP3ZvaWQgMDp3LnkpfHx4dChLLm8pKT8obi5tb3ZlVG8oRixrKSxQPUYsej1rKTooRiE9PVB8fGshPT16KSYmKG4ubGluZVRvKEYsayksUD1GLHo9ayksdz1LKSl9aWYobi5zdHJva2UoKSx0aGlzLnNlZ21lbnRzJiZuLnNldExpbmVEYXNoKFtdKSx0aGlzLmZpbGwmJnRoaXMuZGF0YS5sZW5ndGgpe24uYmVnaW5QYXRoKCk7Y29uc3QgSD10aGlzLmRhdGEuc29tZShWPT5WLm88MCksSz1IP20oMCk6cy55Mi1pLmJvdHRvbSxGPUMoImZpbGwiLHRoaXMuZmlsbENvbG9yfHxiLHYpO2lmKChydD10aGlzLmZpbGwpIT1udWxsJiZydC5ncmFkaWVudCl7bGV0IFY9dGhpcy5kYXRhWzBdLnlwLGF0PXRoaXMuZGF0YVswXS55O3RoaXMuZGF0YS5mb3JFYWNoKEw9PntMLnlwJiZMLnlwPD1WP1Y9TC55cDpMLnkmJkwueT49YXQmJihhdD1MLnkpfSk7Y29uc3QgaXQ9bi5jcmVhdGVMaW5lYXJHcmFkaWVudCgwLHMueTIsMCxWKSxFPXgub3BhY2l0eTwxP0Y6YjtpdC5hZGRDb2xvclN0b3AoMCxIP0U6RiksaXQuYWRkQ29sb3JTdG9wKC41LEYpLGl0LmFkZENvbG9yU3RvcCgxLEUpLG4uZmlsbFN0eWxlPWl0fWVsc2Ugbi5maWxsU3R5bGU9RjtsZXQgaz1udWxsLGV0PW51bGw7Y29uc3QgaHQ9W10sY3Q9dGhpcy5kYXRhLmxlbmd0aDtmb3IobGV0IFY9MDtWPGN0KzE7VisrKXtjb25zdCBhdD0oWj10aGlzLmRhdGFbVl0pPT1udWxsP3ZvaWQgMDpaLm87aWYoUiYmaXMoYXQpfHwhUiYmeHQoYXQpKXtpZihrIT09bnVsbCYmZXQhPT1udWxsKXtsZXQgaXQ9ay0xO2ZvcihsZXQgRT1WLTE7RT49aztFLS0pe2NvbnN0IEw9KG50PXRoaXMuZGF0YVtFXSk9PW51bGw/dm9pZCAwOm50Lm87aWYoIXh0KEwpJiZMIT09bnVsbCl7aXQ9RTticmVha319aHQucHVzaChbayxpdF0pLGs9bnVsbCxldD1udWxsfX1lbHNlIFImJmF0PT09bnVsbHx8KGs9az09PW51bGw/VjprKSxldD1WfWh0LmZvckVhY2goKFtWLGF0XSk9PntpZihWPT09YXQpe2NvbnN0IEU9dGhpcy5kYXRhW1ZdO2lmKEUueHA9PT1udWxsfHxFLnlwPT09bnVsbClyZXR1cm47bi5tb3ZlVG8oRS54cC1NLEUueXApLG4ubGluZVRvKEUueHArTSxFLnlwKSxuLmxpbmVUbyhFLnhwK00sbShFLmIpPz9LKTtyZXR1cm59bGV0IGl0PSExO2ZvcihsZXQgRT1WO0U8PWF0O0UrKyl7Y29uc3QgTD10aGlzLmRhdGFbRV07aWYoTC54cCE9PW51bGwmJkwueXAhPT1udWxsJiYoaXQ/TC5vIT09bnVsbCYmbi5saW5lVG8oTC54cCxMLnlwKToobi5tb3ZlVG8oTC54cCxMLnlwKSxpdD0hMCkpLEU9PT1hdClmb3IobGV0IHN0PWF0O3N0Pj1WO3N0LS0pe2NvbnN0IGx0PXRoaXMuZGF0YVtzdF0sTHQ9JChsdC54KTtpZihMdCE9PW51bGwmJmx0Lm8hPT1udWxsKXtjb25zdCB2cz1tKGx0LmIpPz9tKDApO24ubGluZVRvKEx0LHZzKX19fX0pLG4uZmlsbCgpfWlmKCFjKXtuLnN0cm9rZVN0eWxlPUMoInN0cm9rZSIsYixPKTtjb25zdCBIPUMoImZvY3VzIixULDEpLEs9QygiYmx1ciIsVCxJKTtsZXQgRj0hMTtpZih0aGlzLmludGVycG9sYXRpb249PT0ibGluZWFyIil7bGV0IEU9MDtmb3IobGV0IEw9MDtMPHRoaXMuZGF0YS5sZW5ndGgmJiEodGhpcy5kYXRhW0xdLm8hPT1udWxsJiYoRSsrLEU+MSkpO0wrKyk7Rj1FPT09MX1jb25zdCBrPXUubGVuZ3RoP25ldyBTZXQodSk6bnVsbCxldD10aGlzLnBvaW50U2l6ZSxodD10aGlzLnBvaW50U3R5bGUsY3Q9dGhpcy5kYXRhLFY9Y3QubGVuZ3RoLGF0PSF4cy5oYXMoaHQpLGl0PUU9Pntjb25zdCBMPWN0W0VdO2lmKEwueHA9PT1udWxsfHxMLnlwPT09bnVsbHx8TC5vPT09bnVsbClyZXR1cm4gMDtsZXQgSjtpZihGKUo9ITA7ZWxzZSBpZihSKUo9ITE7ZWxzZXtjb25zdCBsdD1FPjA/Y3RbRS0xXS5vOm51bGwsTHQ9RSsxPFY/Y3RbRSsxXS5vOm51bGw7Sj1sdD09bnVsbCYmTHQ9PW51bGx9Y29uc3Qgc3Q9az9rLmhhcyhFKTohMTtyZXR1cm4gdGhpcy5wb2ludHx8Snx8c3Q/c3QmJiFsPzI6MTowfTtpZihhdCl7bGV0IEU9ITEsTD1udWxsO2ZvcihsZXQgSj0wO0o8VjtKKyspe2NvbnN0IHN0PWl0KEopO2lmKHN0IT09MCl7Y29uc3QgbHQ9Y3RbSl07c3Q9PT0yPyhMPT09bnVsbCYmKEw9W10pLEwucHVzaChsdCkpOihFfHwobi5iZWdpblBhdGgoKSxFPSEwKSxuLm1vdmVUbyhsdC54cCtldCxsdC55cCksbi5hcmMobHQueHAsbHQueXAsZXQsMCxSZSkpfX1pZihFJiYobi5maWxsU3R5bGU9SyxuLmZpbGwoKSxuLnN0cm9rZSgpKSxMIT09bnVsbCl7bi5iZWdpblBhdGgoKTtmb3IobGV0IEo9MDtKPEwubGVuZ3RoO0orKyl7Y29uc3Qgc3Q9TFtKXTtuLm1vdmVUbyhzdC54cCtldCxzdC55cCksbi5hcmMoc3QueHAsc3QueXAsZXQsMCxSZSl9bi5maWxsU3R5bGU9SCxuLmZpbGwoKSxuLnN0cm9rZSgpfX1lbHNle2xldCBFPW51bGwsTD1udWxsO2ZvcihsZXQgSj0wO0o8VjtKKyspe2NvbnN0IHN0PWl0KEopO2lmKHN0IT09MCl7Y29uc3QgbHQ9Y3RbSl07c3Q9PT0yPyhMPT09bnVsbCYmKEw9W10pLEwucHVzaChsdCkpOihFPT09bnVsbCYmKEU9W10pLEUucHVzaChsdCkpfX1FIT09bnVsbCYmKG4uZmlsbFN0eWxlPUssdHQuZHJhd1BvaW50QmF0Y2gobixodCxldCxFKSksTCE9PW51bGwmJihuLmZpbGxTdHlsZT1ILHR0LmRyYXdQb2ludEJhdGNoKG4saHQsZXQsTCkpfX1uLnJlc3RvcmUoKX1pdGVtSGlnaGxpZ2h0KHQsbil7Y29uc3Qgcz10LmRhdGEsaT1uLHt4cDpyLHlwOmEsb309cztpLnNhdmUoKSxyIT09bnVsbCYmYSE9PW51bGwmJm8hPT1udWxsJiZ0aGlzLnBvaW50SGlnaGxpZ2h0JiYoaS5zdHJva2VTdHlsZT1RLmNvbG9yU3RyaW5nVG9SZ2JhKHRoaXMuY29sb3IsMCksaS5maWxsU3R5bGU9US5jb2xvclN0cmluZ1RvUmdiYSh0aGlzLmNvbG9yLHRoaXMuaGlnaGxpZ2h0Lm1heFNoYWRvd09wYWNpdHkpLHR0LmRyYXdQb2ludChpLHRoaXMucG9pbnRTdHlsZSx0aGlzLmhpZ2hsaWdodC5tYXhTaGFkb3dTaXplLHIsYSksaS5maWxsU3R5bGU9dGhpcy5jb2xvcix0dC5kcmF3UG9pbnQoaSx0aGlzLnBvaW50U3R5bGUsdGhpcy5oaWdobGlnaHQubWF4U2l6ZSxyLGEpLGkuZmlsbFN0eWxlPSIjZmZmIix0dC5kcmF3UG9pbnQoaSx0aGlzLnBvaW50U3R5bGUsdGhpcy5oaWdobGlnaHQuZGVmYXVsdFNpemUscixhKSksaS5yZXN0b3JlKCl9ZmluZEdyYXBoRGF0YSh0LG4scyxpKXt2YXIgcDtjb25zdCByPXRbMF0sYT10WzFdLG89e2RhdGE6bnVsbCxoaXQ6ITEsY29sb3I6dGhpcy5jb2xvcn0sbD10aGlzLl9nZXRWYWxpZEdEYXRhKCksYz10aGlzLnVzZUxpbmVhckludGVycG9sYXRpb24oKSxmPU1hdGgubWF4KCh0aGlzLnBvaW50U2l6ZT8/RXQucG9pbnRTaXplKStFdC5wb2ludFNpemUsRXQuaGlnaGxpZ2h0Lm1heFNpemUpLGg9ZD0+e2lmKCFkfHxkLnhwPT09dm9pZCAwfHxkLnlwPT09dm9pZCAwKXJldHVybiExO2NvbnN0IHU9ci1kLnhwLHg9YS1kLnlwO3JldHVybiB1KnUreCp4PD1mKmZ9O2lmKGwhPW51bGwmJmwubGVuZ3RoKWlmKHR5cGVvZiBzPT0ibnVtYmVyIiYmdGhpcy5zaG93KXtpZihvLmRhdGE9bFtzXSxvLmluZGV4PXMsby5kYXRhKXtjb25zdCBkPWxbc107ZC5vIT09bnVsbCYmZC5vIT09dm9pZCAwJiZkLnlwIT09bnVsbCYmZC55cCE9PXZvaWQgMCYmKE1hdGguYWJzKGEtZC55cCk8PTE1JiYoby5oaXQ9ITApLGgoZCkmJihvLmhpdD0hMCxvLmRpcmVjdEhpdD0hMCkpfX1lbHNlIGlmKHR5cGVvZiB0aGlzLmJlZm9yZUZpbmRJdGVtSW5kZXg9PSJudW1iZXIiJiZ0aGlzLmJlZm9yZUZpbmRJdGVtSW5kZXghPT0tMSYmdGhpcy5zaG93JiZpKW8uZGF0YT1sW3RoaXMuYmVmb3JlRmluZEl0ZW1JbmRleF0sby5pbmRleD10aGlzLmJlZm9yZUZpbmRJdGVtSW5kZXg7ZWxzZXtsZXQgZD0xLzAsdT0tMTtjb25zdCB4PVtdO2wuZm9yRWFjaCgoVCxJKT0+e1QueHAhPT1udWxsJiZULnlwIT09bnVsbCYmVC5vIT09bnVsbCYmeC5wdXNoKHsuLi5ULG9yaWdpbmFsSW5kZXg6SX0pfSkseC5sZW5ndGg9PT0wJiZsLmZvckVhY2goKFQsSSk9Pnt4LnB1c2goey4uLlQsb3JpZ2luYWxJbmRleDpJfSl9KTtsZXQgUz0wLGI9eC5sZW5ndGgtMTtmb3IoO1M8PWI7KXtjb25zdCBUPU1hdGguZmxvb3IoKFMrYikvMiksST14W1RdLHY9TWF0aC5hYnMoci1JLnhwKTtpZih2PGQmJihkPXYsdT1JLm9yaWdpbmFsSW5kZXgpLEkueHA8cil7aWYoUz1UKzEsUzx4Lmxlbmd0aCl7Y29uc3QgTT1NYXRoLmFicyhyLXhbU10ueHApO008ZCYmKGQ9TSx1PXhbU10ub3JpZ2luYWxJbmRleCl9fWVsc2UgaWYoSS54cD5yKXtpZihiPVQtMSxiPj0wKXtjb25zdCBNPU1hdGguYWJzKHIteFtiXS54cCk7TTxkJiYoZD1NLHU9eFtiXS5vcmlnaW5hbEluZGV4KX19ZWxzZSBicmVha31jb25zdCBPPXguZmluZEluZGV4KFQ9PlQub3JpZ2luYWxJbmRleD09PXUpO2lmKE8hPT0tMSlmb3IobGV0IFQ9TWF0aC5tYXgoMCxPLTIpO1Q8PU1hdGgubWluKHgubGVuZ3RoLTEsTysyKTtUKyspe2NvbnN0IEk9eFtUXSx2PU1hdGguYWJzKHItSS54cCk7djxkJiYoZD12LHU9SS5vcmlnaW5hbEluZGV4KX1pZih1IT09LTEpe2xldCBUPTUwO2lmKGwubGVuZ3RoPjEpe2NvbnN0IHY9W107Zm9yKGxldCBNPTE7TTxsLmxlbmd0aDtNKyspbFtNXS54cCE9PW51bGwmJmxbTS0xXS54cCE9PW51bGwmJnYucHVzaChNYXRoLmFicyhsW01dLnhwLWxbTS0xXS54cCkpO3YubGVuZ3RoPjAmJihUPXYucmVkdWNlKChNLF8pPT5NK18sMCkvdi5sZW5ndGgpfWNvbnN0IEk9TWF0aC5tYXgoVCwxKTtpZihkPD1JKW8uZGF0YT1sW3VdLG8uaW5kZXg9dTtlbHNle2xldCB2PSExLE09Yz8xLzA6STtjb25zdCBfPWM/eDpsO2ZvcihsZXQgQz0wO0M8Xy5sZW5ndGg7QysrKXtjb25zdCBSPU1hdGguYWJzKHItX1tDXS54cCk7Ujw9TSYmKHY9ITAsTT1SLHU9Yz9fW0NdLm9yaWdpbmFsSW5kZXg6Qyl9diYmKG8uZGF0YT1sW3VdLG8uaW5kZXg9dSl9aWYoby5kYXRhKXtjb25zdCB2PWxbdV07TWF0aC5hYnMoYS12LnlwKTw9MTUmJihvLmhpdD0hMCksaCh2KSYmKG8uaGl0PSEwLG8uZGlyZWN0SGl0PSEwKX19fXJldHVybiBpfHwodGhpcy5iZWZvcmVNb3VzZVhwPXIsdGhpcy5iZWZvcmVNb3VzZVlwPWEsdHlwZW9mIG8uaW5kZXg9PSJudW1iZXIiJiYodGhpcy5iZWZvcmVGaW5kSXRlbUluZGV4PW8uaW5kZXgpKSxjJiYoKHA9bz09bnVsbD92b2lkIDA6by5kYXRhKT09bnVsbD92b2lkIDA6cC5vKT09PW51bGwmJihvLmRhdGE9bnVsbCksb31maW5kQXBwcm94aW1hdGVEYXRhKHQpe3ZhciBwLGQ7Y29uc3Qgbj10WzBdLHM9dFsxXSxpPXtkYXRhOm51bGwsaGl0OiExLGNvbG9yOnRoaXMuY29sb3J9LHI9dGhpcy5kYXRhLmZpbHRlcih1PT4hUS5pc051bGxPclVuZGVmaW5lZCh1LngpKTtpZighci5sZW5ndGgpcmV0dXJuIGk7Y29uc3QgYT1yLmxlbmd0aD4xP01hdGguYWJzKCgocD1yWzFdKT09bnVsbD92b2lkIDA6cC54cCktKChkPXJbMF0pPT1udWxsP3ZvaWQgMDpkLnhwKSk6NTAsbz1NYXRoLm1heChhKi40LDEwKTtsZXQgbD0wLGM9ci5sZW5ndGgtMSxmPS0xLGg9MS8wO2Zvcig7bDw9Yzspe2NvbnN0IHU9TWF0aC5mbG9vcigobCtjKS8yKSx4PXJbdV0ueHA7aWYoeC1vPD1uJiZuPD14K28pe2NvbnN0IFM9TWF0aC5tYXgoMCx1LTIpLGI9TWF0aC5taW4oci5sZW5ndGgtMSx1KzIpO2ZvcihsZXQgTz1TO088PWI7TysrKWlmKHJbT10ueHAhPT1udWxsJiZyW09dLnlwIT09bnVsbCl7Y29uc3QgVD1NYXRoLnNxcnQoKG4tcltPXS54cCkqKjIrKHMtcltPXS55cCkqKjIpO1Q8aCYmKGg9VCxmPU8pfXJldHVybiBmIT09LTEmJihpLmRhdGE9cltmXSxpLmluZGV4PWYsaDw1JiYoaS5oaXQ9ITApKSxpfWVsc2UgaWYoeCtvPG4pe2lmKHU8YyYmbjxyW3UrMV0ueHApe2NvbnN0IFM9TWF0aC5hYnMoclt1XS54cC1uKSxiPU1hdGguYWJzKHJbdSsxXS54cC1uKTtpLmRhdGE9Uz5iP3JbdSsxXTpyW3VdLGkuaW5kZXg9Uz5iP3UrMTp1O2NvbnN0IE89aS5kYXRhO3JldHVybiBNYXRoLmFicyhzLU8ueXApPDEwJiYoaS5oaXQ9ITApLGl9bD11KzF9ZWxzZXtpZih1PjAmJm4+clt1LTFdLnhwKXtjb25zdCBTPU1hdGguYWJzKHJbdS0xXS54cC1uKSxiPU1hdGguYWJzKHJbdV0ueHAtbik7aS5kYXRhPVM+Yj9yW3VdOnJbdS0xXSxpLmluZGV4PVM+Yj91OnUtMTtjb25zdCBPPWkuZGF0YTtyZXR1cm4gTWF0aC5hYnMocy1PLnlwKTwxMCYmKGkuaGl0PSEwKSxpfWM9dS0xfX1yZXR1cm4gaX1maW5kSXRlbXMoe3hzcDp0LHdpZHRoOm59KXtjb25zdCBzPXQrbjtyZXR1cm4gdGhpcy5kYXRhLmZpbHRlcihpPT50LTE8PWkueHAmJmkueHA8PXMrMSl9fWNsYXNzIGJze2NvbnN0cnVjdG9yKHQsbixzLGkpe2NvbnN0IHI9T2Uoe30sbixkcyk7T2JqZWN0LmtleXMocikuZm9yRWFjaChhPT57dGhpc1thXT1yW2FdfSksdGhpcy5uYW1lPT09dm9pZCAwJiYodGhpcy5uYW1lPWBzZXJpZXMtJHtzfWApLHRoaXMuY29sb3I9PT12b2lkIDAmJih0aGlzLmNvbG9yPXp0W3MlenQubGVuZ3RoXSksdGhpcy50eXBlPSJiYXIiLHRoaXMuc0lkPXQsdGhpcy5kYXRhPVtdLHRoaXMuaXNIb3Jpem9udGFsPWksdGhpcy5zaXplPXtjYXQ6MCxiYXI6MCxjUGFkOjAsYlBhZDowLHc6MCxoOjAsaXg6MH19Y29tcHV0ZUdlb21ldHJ5KHQpe2lmKCF0aGlzLnNob3cpcmV0dXJuO2NvbnN0IG49dC5zY2FsZVZlcnNpb24hPW51bGwmJnQuZGF0YUVwb2NoIT1udWxsLHM9dC5zaG93SW5kZXg/PzAsaT10LnNob3dTZXJpZXNDb3VudD8/MDtpZihuJiZ0aGlzLl9sYXN0RGF0YUVwb2NoPT09dC5kYXRhRXBvY2gmJnRoaXMuX2xhc3RTY2FsZVZlcnNpb249PT10LnNjYWxlVmVyc2lvbiYmdGhpcy5fbGFzdFNob3dJbmRleD09PXMmJnRoaXMuX2xhc3RTaG93U2VyaWVzQ291bnQ9PT1pJiZ0aGlzLl9sYXN0R2VvbURhdGE9PT10aGlzLmRhdGEpcmV0dXJuO2NvbnN0IHI9dC5jaGFydFJlY3QsYT10LmxhYmVsT2Zmc2V0LG89dC5heGVzU3RlcHMsbD10LnNob3dJbmRleCxjPXQudGhpY2tuZXNzLGY9dC5zaG93U2VyaWVzQ291bnQ7dGhpcy5pc0hvcml6b250YWw9dC5pc0hvcml6b250YWw7Y29uc3R7aXNIb3Jpem9udGFsOmh9PXRoaXM7bGV0IHAsZDtjb25zdCB1PW8ueFt0aGlzLnhBeGlzSW5kZXhdLHg9by55W3RoaXMueUF4aXNJbmRleF07bGV0IFM9dGhpcy5kYXRhLmxlbmd0aDtjb25zdFtiLE9dPWg/W3gubWluSW5kZXgseC5tYXhJbmRleF06W3UubWluSW5kZXgsdS5tYXhJbmRleF07ZHQoYikmJmR0KE8pJiYoUz1PLWIrMSk7Y29uc3QgVD1yLmNoYXJ0V2lkdGgtKGEubGVmdCthLnJpZ2h0KSxJPXIuY2hhcnRIZWlnaHQtKGEudG9wK2EuYm90dG9tKSx2PXIueDErYS5sZWZ0LE09ci55Mi1hLmJvdHRvbSxfPXR0LmNhbGN1bGF0ZVgoMCx1LmdyYXBoTWluLHUuZ3JhcGhNYXgsVCksQz10dC5jYWxjdWxhdGVZKDAseC5ncmFwaE1pbix4LmdyYXBoTWF4LEkpLFI9aD92K186dixCPWg/TTpNK0MsRD1oP0k6VCxZPUQvKFN8fDEpO2xldCBHO3QuY1BhZFJhdGlvPj0xfHx0LmNQYWRSYXRpbzw9MD9HPTI6Rz1NYXRoLm1heChEKih0LmNQYWRSYXRpby8yKS9TLDIpO2xldCB5LGcsJDt5PVk+RyoyP1ktRyoyOlkseT10aGlzLmlzRXhpc3RHcnA/eTp5L2Y7Y29uc3QgbT10aGlzLmNhbGN1bGF0ZUJhclNpemUoYyx5KTtnPWg/bnVsbDptLCQ9aD9tOm51bGw7Y29uc3Qgdz1oPyh5LSQpLzI6KHktZykvMixQPXRoaXMuaXNFeGlzdEdycD8xOmwrMTt0aGlzLnNpemUuY2F0PVksdGhpcy5zaXplLmJhcj15LHRoaXMuc2l6ZS5jUGFkPUcsdGhpcy5zaXplLmJQYWQ9dyx0aGlzLnNpemUudz1nLHRoaXMuc2l6ZS5oPSQsdGhpcy5zaXplLml4PVAsdGhpcy5jaGFydFJlY3Q9cix0aGlzLmxhYmVsT2Zmc2V0PWEsdGhpcy5ib3JkZXJSYWRpdXM9dC5ib3JkZXJSYWRpdXMsdGhpcy5maWx0ZXJlZENvdW50PVM7Y29uc3Qgej1kdChiKT9iOjAsVz1kdChPKT9POnRoaXMuZGF0YS5sZW5ndGgtMTt0aGlzLnZpc2libGVTdGFydEluZGV4PXo7Zm9yKGxldCBOPXo7Tjw9VztOKyspe2NvbnN0IFU9Ti16LGo9dGhpcy5kYXRhW05dO2lmKGope2NvbnN0IG90PWg/Qi1ZKlUtRzpSK1kqVStHO2lmKGg/KHA9UixkPU1hdGgucm91bmQob3QtKHkqUC0oJCt3KSkpKToocD1NYXRoLnJvdW5kKG90Kyh5KlAtKGcrdykpKSxkPUIpLGgpe2NvbnN0IHE9ai5iP2oubzpqLngscnQ9dC5kaXNwbGF5T3ZlcmZsb3cmJnE+dS5ncmFwaE1heD91LmdyYXBoTWF4OnE7Zz10dC5jYWxjdWxhdGVYKHJ0LHUuZ3JhcGhNaW4sdS5ncmFwaE1heCxULC1fKSxqLmImJihwPXR0LmNhbGN1bGF0ZVgoai5iLHUuZ3JhcGhNaW4sdS5ncmFwaE1heCxULFItXykpO2NvbnN0IFo9cT4wPy0xOjE7Zz1xJiZnIT09bnVsbCYmTWF0aC5hYnMoZyk9PT0wP1o6Z31lbHNle2NvbnN0IHE9ai5iP2oubzpqLnkscnQ9dC5kaXNwbGF5T3ZlcmZsb3cmJnE+eC5ncmFwaE1heD94LmdyYXBoTWF4OnE7JD10dC5jYWxjdWxhdGVZKHJ0LHguZ3JhcGhNaW4seC5ncmFwaE1heCxJLC1DKSxqLmImJihkPXR0LmNhbGN1bGF0ZVkoai5iLHguZ3JhcGhNaW4seC5ncmFwaE1heCxJLEItQykpO2NvbnN0IFo9cT4wPy0xOjE7JD1xJiYkIT09bnVsbCYmTWF0aC5hYnMoJCk9PT0wP1o6JH1qLnhwPXAsai55cD1kLGoudz1nLGouaD1oPy0kOiQsai5pbmRleD1OfX1uJiYodGhpcy5fbGFzdERhdGFFcG9jaD10LmRhdGFFcG9jaCx0aGlzLl9sYXN0U2NhbGVWZXJzaW9uPXQuc2NhbGVWZXJzaW9uLHRoaXMuX2xhc3RTaG93SW5kZXg9cyx0aGlzLl9sYXN0U2hvd1Nlcmllc0NvdW50PWksdGhpcy5fbGFzdEdlb21EYXRhPXRoaXMuZGF0YSl9ZHJhdyh0KXt2YXIgVSxqLG90LHEscnQ7aWYoIXRoaXMuc2hvdylyZXR1cm47dGhpcy5jb21wdXRlR2VvbWV0cnkodCk7Y29uc3Qgbj10LmN0eCxzPXQuY2hhcnRSZWN0LGk9dC5sYWJlbE9mZnNldCxyPXQuYXhlc1N0ZXBzLGE9dC5zaG93SW5kZXgsbz10LnRoaWNrbmVzcyxsPXQuc2hvd1Nlcmllc0NvdW50LGM9dC5kaXNwbGF5T3ZlcmZsb3c7dGhpcy5pc0hvcml6b250YWw9dC5pc0hvcml6b250YWw7Y29uc3R7aXNIb3Jpem9udGFsOmYsc2hvd1ZhbHVlOmh9PXRoaXM7bGV0IHAsZDtjb25zdCB1PXIueFt0aGlzLnhBeGlzSW5kZXhdLHg9ci55W3RoaXMueUF4aXNJbmRleF0sW1MsYl09Zj9beC5taW5JbmRleCx4Lm1heEluZGV4XTpbdS5taW5JbmRleCx1Lm1heEluZGV4XSxPPWR0KFMpJiZkdChiKSxUPU8/UzowLEk9Tz9iOnRoaXMuZGF0YS5sZW5ndGgtMSx2PUktVCsxLE09cy5jaGFydFdpZHRoLShpLmxlZnQraS5yaWdodCksXz1zLmNoYXJ0SGVpZ2h0LShpLnRvcCtpLmJvdHRvbSksQz1zLngxK2kubGVmdCxSPXMueTItaS5ib3R0b20sQj10dC5jYWxjdWxhdGVYKDAsdS5ncmFwaE1pbix1LmdyYXBoTWF4LE0pLEQ9dHQuY2FsY3VsYXRlWSgwLHguZ3JhcGhNaW4seC5ncmFwaE1heCxfKSxZPWY/QytCOkMsRz1mP1I6UitELEE9Zj9fOk0seT1BLyh2fHwxKTtsZXQgZzt0LmNQYWRSYXRpbz49MXx8dC5jUGFkUmF0aW88PTA/Zz0yOmc9TWF0aC5tYXgoQSoodC5jUGFkUmF0aW8vMikvdiwyKTtsZXQgbSx3LFA7bT15PmcqMj95LWcqMjp5LG09dGhpcy5pc0V4aXN0R3JwP206bS9sO2NvbnN0IHo9dGhpcy5jYWxjdWxhdGVCYXJTaXplKG8sbSk7dz1mP251bGw6eixQPWY/ejpudWxsO2NvbnN0IFc9Zj8obS1QKS8yOihtLXcpLzIsTj10aGlzLmlzRXhpc3RHcnA/MTphKzE7dGhpcy5zaXplLmNhdD15LHRoaXMuc2l6ZS5iYXI9bSx0aGlzLnNpemUuY1BhZD1nLHRoaXMuc2l6ZS5iUGFkPVcsdGhpcy5zaXplLnc9dyx0aGlzLnNpemUuaD1QLHRoaXMuc2l6ZS5peD1OLHRoaXMuY2hhcnRSZWN0PXMsdGhpcy5sYWJlbE9mZnNldD1pLHRoaXMuYm9yZGVyUmFkaXVzPXQuYm9yZGVyUmFkaXVzLHRoaXMuZmlsdGVyZWRDb3VudD12LHRoaXMudmlzaWJsZVN0YXJ0SW5kZXg9VDtmb3IobGV0IFo9VDtaPD1JO1orKyl7Y29uc3QgbnQ9Wi1ULEg9dGhpcy5kYXRhW1pdO2lmKEgpe2NvbnN0IEs9Zj9HLXkqbnQtZzpZK3kqbnQrZztpZihmPyhwPVksZD1NYXRoLnJvdW5kKEstKG0qTi0oUCtXKSkpKToocD1NYXRoLnJvdW5kKEsrKG0qTi0odytXKSkpLGQ9RyksZil7Y29uc3QgRT1ILmI/SC5vOkgueCxMPWMmJkU+dS5ncmFwaE1heD91LmdyYXBoTWF4OkU7dz10dC5jYWxjdWxhdGVYKEwsdS5ncmFwaE1pbix1LmdyYXBoTWF4LE0sLUIpLEguYiYmKHA9dHQuY2FsY3VsYXRlWChILmIsdS5ncmFwaE1pbix1LmdyYXBoTWF4LE0sWS1CKSk7Y29uc3QgSj1FPjA/LTE6MTt3PUUmJnchPT1udWxsJiZNYXRoLmFicyh3KT09PTA/Sjp3fWVsc2V7Y29uc3QgRT1ILmI/SC5vOkgueSxMPWMmJkU+eC5ncmFwaE1heD94LmdyYXBoTWF4OkU7UD10dC5jYWxjdWxhdGVZKEwseC5ncmFwaE1pbix4LmdyYXBoTWF4LF8sLUQpLEguYiYmKGQ9dHQuY2FsY3VsYXRlWShILmIseC5ncmFwaE1pbix4LmdyYXBoTWF4LF8sRy1EKSk7Y29uc3QgSj1FPjA/LTE6MTtQPUUmJlAhPT1udWxsJiZNYXRoLmFicyhQKT09PTA/SjpQfWNvbnN0IEY9SC5kYXRhQ29sb3J8fHRoaXMuY29sb3Isaz10PT1udWxsP3ZvaWQgMDp0LmxlZ2VuZEhpdEluZm8sZXQ9KFU9dD09bnVsbD92b2lkIDA6dC5zZWxlY3RMYWJlbCk9PW51bGw/dm9pZCAwOlUub3B0aW9uLGh0PShqPXQ9PW51bGw/dm9pZCAwOnQuc2VsZWN0SXRlbSk9PW51bGw/dm9pZCAwOmoub3B0aW9uLGN0PSgocT0ob3Q9dD09bnVsbD92b2lkIDA6dC5zZWxlY3RMYWJlbCk9PW51bGw/dm9pZCAwOm90LnNlbGVjdGVkKT09bnVsbD92b2lkIDA6cS5kYXRhSW5kZXgpPz9bXSx7ZGF0YUluZGV4OlYsc2VyaWVzSUQ6YXR9PSgocnQ9dD09bnVsbD92b2lkIDA6dC5zZWxlY3RJdGVtKT09bnVsbD92b2lkIDA6cnQuc2VsZWN0ZWQpPz97fTtsZXQgaXQ9ITE7aWYoaz9pdD0oaz09bnVsbD92b2lkIDA6ay5zSWQpIT09dGhpcy5zSWQ6ZXQhPW51bGwmJmV0LnVzZSYmKGV0IT1udWxsJiZldC51c2VTZXJpZXNPcGFjaXR5KT9pdD1jdC5sZW5ndGgmJiFjdC5pbmNsdWRlcyhaKTpwdChWKSYmKGh0IT1udWxsJiZodC51c2VTZXJpZXNPcGFjaXR5KSYmKHRoaXMuaXNFeGlzdEdycD9pdD1WIT09WjppdD1WIT09Wnx8YXQhPT10aGlzLnNJZCksdHlwZW9mIEYhPSJzdHJpbmciKW4uZmlsbFN0eWxlPXR0LmNyZWF0ZUdyYWRpZW50KG4sZix7eDpwLHk6ZCx3LGg6UH0sRixpdCx0LnVuU2VsZWN0ZWRPcGFjaXR5KTtlbHNle2NvbnN0IEU9Ri5pbmNsdWRlcygicmdiYSIpP1EuZ2V0T3BhY2l0eShGKToxLEw9aXQ/dC51blNlbGVjdGVkT3BhY2l0eTpFO24uZmlsbFN0eWxlPVEuY29sb3JTdHJpbmdUb1JnYmEoRixMKX10aGlzLmRyYXdCYXIoe2N0eDpuLHBvc2l0aW9uczp7eDpwLHk6ZCx3LGg6UH19KSxoLnVzZSYmdGhpcy5kcmF3VmFsdWVMYWJlbHMoe2NvbnRleHQ6bixkYXRhOkgscG9zaXRpb25zOnt4OnAseTpkLGg6UCx3fSxpc0hpZ2hsaWdodDohMSx0ZXh0Q29sb3I6SC5kYXRhVGV4dENvbG9yLGluZGV4Olp9KX19fWl0ZW1IaWdobGlnaHQodCxuLHMsaSl7Y29uc3Qgcj10aGlzLnNob3dWYWx1ZSxhPXQuZGF0YSxvPW4sbD1hLnhwLGM9YS55cCxmPWEudyxoPWEuaDtvLnNhdmUoKSxvLnNoYWRvd09mZnNldFg9MCxvLnNoYWRvd09mZnNldFk9MCxvLnNoYWRvd0JsdXI9NDtjb25zdCBwPXQuZGF0YS5kYXRhQ29sb3J8fHRoaXMuY29sb3I7aWYodHlwZW9mIHAhPSJzdHJpbmciKXtjb25zdCBkPXR0LmNyZWF0ZUdyYWRpZW50KG8sdGhpcy5pc0hvcml6b250YWwse3g6bCx5OmMsdzpmLGh9LHAsITEsaSk7by5maWxsU3R5bGU9ZCxvLnNoYWRvd0NvbG9yPXBbcC5sZW5ndGgtMV1bMV19ZWxzZSBvLmZpbGxTdHlsZT1wLG8uc2hhZG93Q29sb3I9cDtvLmJlZ2luUGF0aCgpLHRoaXMuZHJhd0Jhcih7Y3R4Om8scG9zaXRpb25zOnt4OmwseTpjLHc6ZixoOnRoaXMuaXNIb3Jpem9udGFsPy1oOmh9fSksci51c2UmJnRoaXMuZHJhd1ZhbHVlTGFiZWxzKHtjb250ZXh0Om8sZGF0YTphLHBvc2l0aW9uczp7eDpsLHk6YyxoLHc6Zn0saXNIaWdobGlnaHQ6ITAsdGV4dENvbG9yOnQuZGF0YS5kYXRhVGV4dENvbG9yfHx0LmRhdGFUZXh0Q29sb3IsaW5kZXg6c30pLG8ucmVzdG9yZSgpfWZpbmRHcmFwaERhdGEodCxuLHMsaSl7aWYodHlwZW9mIHM9PSJudW1iZXIiJiZ0aGlzLnNob3cmJmkpe2NvbnN0IHI9dGhpcy5kYXRhLGE9e2RhdGE6bnVsbCxoaXQ6ITEsY29sb3I6dGhpcy5jb2xvcn0sbz10aGlzLnZpc2libGVTdGFydEluZGV4Pz8wLGw9bysodGhpcy5maWx0ZXJlZENvdW50Pz9yLmxlbmd0aCktMSxjPU1hdGgubWF4KG8sTWF0aC5taW4ocyxsKSk7cmV0dXJuIHJbY10mJihhLmRhdGE9cltjXSxhLmluZGV4PWMsYS5oaXQ9dGhpcy5pc1BvaW50SW5CYXIodCxyW2NdKSxhLmRpcmVjdEhpdD1hLmhpdCksYX1yZXR1cm4gbj90aGlzLmZpbmRHcmFwaFJhbmdlQ291bnQodCk6dGhpcy5maW5kR3JhcGhSYW5nZSh0KX1iaW5hcnlTZWFyY2hCYXIodCxuKXtjb25zdFtzLGldPXQscj17ZGF0YTpudWxsLGhpdDohMSxjb2xvcjp0aGlzLmNvbG9yfSxhPXRoaXMuZGF0YSxvPXRoaXMudmlzaWJsZVN0YXJ0SW5kZXg/PzAsbD10aGlzLmZpbHRlcmVkQ291bnQ/P2EubGVuZ3RoO2xldCBjPW8sZj1NYXRoLm1pbihvK2wtMSxhLmxlbmd0aC0xKTtmb3IoO2M8PWY7KXtjb25zdCBoPU1hdGguZmxvb3IoKGMrZikvMikscD1hW2hdO2lmKCFwKXtjb25zb2xlLndhcm4oYFtFVlVJXVtCYXJdIGJpbmFyeVNlYXJjaEJhcjogZ2RhdGFbJHtofV0gaXMgZmFsc3lgKTticmVha31jb25zdHt4cDpkLHlwOnUsdzp4LGg6U309cCxiPWQreCxPPXUrUztpZihuP088PWkmJmk8PXU6ZDw9cyYmczw9YilyZXR1cm4gci5kYXRhPXAsci5pbmRleD1wLmluZGV4LHIuaGl0PXRoaXMuaXNQb2ludEluQmFyKHQscCksci5kaXJlY3RIaXQ9ci5oaXQscjsobj8hKE88aSk6ZCs0PHMpP2M9aCsxOmY9aC0xfXJldHVybiByfWZpbmRHcmFwaFJhbmdlKHQpe3JldHVybiB0aGlzLmJpbmFyeVNlYXJjaEJhcih0LCExKX1maW5kR3JhcGhSYW5nZUNvdW50KHQpe3JldHVybiB0aGlzLmJpbmFyeVNlYXJjaEJhcih0LCEwKX1kcmF3VmFsdWVMYWJlbHMoe2NvbnRleHQ6dCxkYXRhOm4scG9zaXRpb25zOnMsaXNIaWdobGlnaHQ6aSx0ZXh0Q29sb3I6cixpbmRleDphfSl7Y29uc3Qgbz10aGlzLmlzSG9yaXpvbnRhbCx7Zm9udFNpemU6bCx0ZXh0Q29sb3I6YyxhbGlnbjpmLGZvcm1hdHRlcjpoLGRlY2ltYWxQb2ludDpwfT10aGlzLnNob3dWYWx1ZSx7eDpkLHk6dSx3OngsaDpTfT1zLGI9dDtiLnNhdmUoKSxiLmJlZ2luUGF0aCgpLGIuZm9udD1gbm9ybWFsIG5vcm1hbCBub3JtYWwgJHtsfXB4IFJvYm90b2AsYi5maWxsU3R5bGU9cnx8YyxiLmxpbmVXaWR0aD0xLGIudGV4dEJhc2VsaW5lPSJtaWRkbGUiLGIudGV4dEFsaWduPW8mJmYhPT0iY2VudGVyIj8ibGVmdCI6ImNlbnRlciI7bGV0IE87Y29uc3QgVD1wdCh0aGlzLnN0YWNrSW5kZXgpO1Q/Tz1uLm86Tz0obz9uLng6bi55KT8/IiI7bGV0IEk7aCYmKEk9aChPLHtsYWJlbDpvP24ueTpuLngsaW5kZXg6YX0pKSwoIWh8fHR5cGVvZiBJIT0ic3RyaW5nIikmJihJPVEubGFiZWxTaWduRm9ybWF0KE8scCk/PyIiKTtjb25zdCB2PU88MCxNPU1hdGgucm91bmQoYi5tZWFzdXJlVGV4dChJKS53aWR0aCksXz1sLEM9byYmZiE9PSJlbmQiPzEwOjQsUj12P2QtQzpkK0MsQj12P3UrQzp1LUMsRD1kK3gvMixZPWk/dStTLzI6dS1TLzIsRz1vP1krbCouMTpZLEE9TWF0aC5hYnMoeCkseT1NYXRoLmFicyhTKSxnPUEtQywkPXktQyxtPU08PUEmJkE+PV87c3dpdGNoKGYpe2Nhc2Uic3RhcnQiOntpZihvKXtpZihNPGcmJl88eSl7Y29uc3Qgdz12P1ItTTpSO2IuZmlsbFRleHQoSSx3LEcpfX1lbHNlIGlmKG0mJl8rQzw9eSl7Y29uc3Qgdz12P3UrXy8yK0M6dS1fLzItQztiLmZpbGxUZXh0KEksRCx3KX1icmVha31jYXNlImNlbnRlciI6e28/TTxnJiZfPHkmJmIuZmlsbFRleHQoSSxELEcpOm0mJl88JCYmYi5maWxsVGV4dChJLEQsdStTLzIpO2JyZWFrfWNhc2Uib3V0Ijp7aWYoVCl7Y29uc29sZS53YXJuKCJbRVZVSV1bQmFyIENoYXJ0XSBJbiBjYXNlIG9mIFN0YWNrIEJhciBDaGFydCwgJ291dCcgb2YgJ3Nob3dWYWx1ZScncyBhbGlnbiBpcyBub3Qgc3VwcG9ydGVkLiIpO3JldHVybn1pZihvKXtjb25zdCB3PXRoaXMuY2hhcnRSZWN0LngxK3RoaXMubGFiZWxPZmZzZXQubGVmdCxQPXRoaXMuY2hhcnRSZWN0LngyLXRoaXMubGFiZWxPZmZzZXQucmlnaHQ7aWYoXzx0aGlzLnNpemUuYmFyKWlmKHYpe2NvbnN0IHo9ZC1DK3gtTTt6PncmJmIuZmlsbFRleHQoSSx6LEcpfWVsc2V7Y29uc3Qgej1kK0MreDt6K008UCYmYi5maWxsVGV4dChJLHosRyl9fWVsc2V7Y29uc3Qgdz10aGlzLmNoYXJ0UmVjdC55MSt0aGlzLmxhYmVsT2Zmc2V0LnRvcCxQPXRoaXMuY2hhcnRSZWN0LnkyLXRoaXMubGFiZWxPZmZzZXQuYm90dG9tO2lmKE08PXRoaXMuc2l6ZS5iYXIpaWYodil7Y29uc3Qgej11K1MrQytfLzI7eitfLzI8PVAmJmIuZmlsbFRleHQoSSxELHopfWVsc2V7Y29uc3Qgej11K1MtQy1fLzI7ei1fLzI+PXcmJmIuZmlsbFRleHQoSSxELHopfX1icmVha31kZWZhdWx0OmNhc2UiZW5kIjp7aWYobyl7aWYoTTxnJiZfPHkpe2NvbnN0IHc9dj9kK3grQzpkK3gtTS1DO2IuZmlsbFRleHQoSSx3LEcpfX1lbHNlIGlmKHYpe2NvbnN0IHc9dStTLV8vMi1DO3c+QiYmbSYmXytDPD15JiZiLmZpbGxUZXh0KEksRCx3KX1lbHNlIG0mJl8rQzw9eSYmYi5maWxsVGV4dChJLEQsdStTK18vMitDKTticmVha319Yi5yZXN0b3JlKCl9Y2FsY3VsYXRlQmFyU2l6ZSh0LG4pe3JldHVybiB0eXBlb2YgdD09InN0cmluZyImJi9bMC05XStweC8udGVzdCh0KT9NYXRoLm1pbihuLE51bWJlcih0LnJlcGxhY2UoInB4IiwiIikpKTp0eXBlb2YgdD09Im51bWJlciImJnQ8PTEmJnQ+PTA/TWF0aC5jZWlsKG4qdCk6bn1kcmF3QmFyKHtjdHg6dCxwb3NpdGlvbnM6bn0pe2NvbnN0e2lzSG9yaXpvbnRhbDpzLGJvcmRlclJhZGl1czppfT10aGlzLHI9InN0YWNrSW5kZXgiaW4gdGhpcyxhPWkmJmk+MCx7eDpvLHk6bCx3OmN9PW4sZj1zPy1uLmg6bi5oO2lmKCEoYz09PTB8fGY9PT0wKSl7aWYodC5zYXZlKCksYSYmIXIpdHJ5e3RoaXMuZHJhd1JvdW5kZWRSZWN0KHQsbil9Y2F0Y2h7dC5maWxsUmVjdChvLGwsYyxmKX1lbHNlIHQuZmlsbFJlY3QobyxsLGMsZik7dC5yZXN0b3JlKCl9fWlzUG9pbnRJbkJhcih0LG4pe2NvbnN0W3MsaV09dCx7eHA6cix5cDphLHc6byxoOmx9PW4sYz1yK28sZj1hK2w7cmV0dXJuIHI8PXMmJnM8PWMmJmY8PWkmJmk8PWF9ZHJhd1JvdW5kZWRSZWN0KHQsbil7Y29uc3R7Y2hhcnRSZWN0OnMsbGFiZWxPZmZzZXQ6aSxpc0hvcml6b250YWw6cixib3JkZXJSYWRpdXM6YX09dGhpcyx7eDpvLHk6bH09bjtsZXR7dzpjLGg6Zn09bixoPWE7Y29uc3QgcD1uZXcgUGF0aDJEO3AucmVjdChzLngxK2kubGVmdCxzLnkxLHMuY2hhcnRXaWR0aC1pLnJpZ2h0LHMuY2hhcnRIZWlnaHQtaS5ib3R0b20pLHQuY2xpcChwKSx0LmJlZ2luUGF0aCgpLHQubW92ZVRvKG8sbCksTWF0aC5hYnMoYyk8aCoyJiYoaD1NYXRoLmFicyhjKS8yKSxNYXRoLmFicyhmKTxoKjImJihoPU1hdGguYWJzKGYpLzIpLHI/YzwwPyhjKz1oLHQubGluZVRvKG8rYyxsKSx0LmFyY1RvKG8rYy1oLGwsbytjLWgsbC1oLGgpLHQuYXJjVG8obytjLWgsbC1mLG8rYyxsLWYsaCksdC5saW5lVG8obyxsLWYpLHQubGluZVRvKG8sbCkpOihjLT1oLHQubGluZVRvKG8rYyxsKSx0LmFyY1RvKG8rYytoLGwsbytjK2gsbC1oLGgpLHQuYXJjVG8obytjK2gsbC1mLG8rYyxsLWYsaCksdC5saW5lVG8obyxsLWYpLHQubGluZVRvKG8sbCkpOmY+MD8oZi09aCx0LmxpbmVUbyhvK2MsbCksdC5saW5lVG8obytjLGwrZiksdC5hcmNUbyhvK2MsbCtmK2gsby1jK2gsbCtmK2gsaCksdC5hcmNUbyhvLGwrZitoLG8sbCtmLGgpLHQubGluZVRvKG8sbCkpOihmKz1oLHQubGluZVRvKG8rYyxsKSx0LmxpbmVUbyhvK2MsbCtmKSx0LmFyY1RvKG8rYyxsK2YtaCxvK2MtaCxsK2YtaCxoKSx0LmFyY1RvKG8sbCtmLWgsbyxsK2YsaCksdC5saW5lVG8obyxsKSksdC5maWxsKCksdC5jbG9zZVBhdGgoKX19Y2xhc3MgbXN7Y29uc3RydWN0b3IodCxuLHMsaSxyKXtjb25zdCBhPXNzKHt9LHBzLG4pO09iamVjdC5rZXlzKGEpLmZvckVhY2gobz0+e3RoaXNbb109YVtvXX0pLHRoaXMuaXNIb3Jpem9udGFsPWksdGhpcy5pc0dyYWRpZW50PXIsdGhpcy5jcmVhdGVDb2xvclN0YXRlKHMpLHRoaXMuc0lkPXQsdGhpcy5kYXRhPVtdLHRoaXMubGFiZWxzPXt4OltdLHk6W119LHRoaXMudmFsdWVPcHQ9e30sdGhpcy5zaXplPXt3OjAsaDowfSx0aGlzLnR5cGU9ImhlYXRNYXAiLHRoaXMuY3VycmVudExhYmVsSW5mbz17eDp7c3RlcHM6MCxtaW46MCxtYXg6MH0seTp7c3RlcHM6MCxtaW46MCxtYXg6MH19fWNyZWF0ZUNvbG9yU3RhdGUodCl7Y29uc3Qgbj1bXSxzPS9bXjAtOV0mW14sXS9nLHttaW46aSxtYXg6cixyYW5nZUNvdW50OmEsY29sb3JzQnlSYW5nZTpvLGVycm9yOmwsc3Ryb2tlOmN9PXQsZj1pLmluY2x1ZGVzKCIjIik/US5oZXhUb1JnYihpKTppLnJlcGxhY2UocywiIiksaD1yLmluY2x1ZGVzKCIjIik/US5oZXhUb1JnYihyKTpyLnJlcGxhY2UocywiIiksW3AsZCx1XT1mLnNwbGl0KCIsIiksW3gsUyxiXT1oLnNwbGl0KCIsIik7aWYodGhpcy5pc0dyYWRpZW50KW4ucHVzaCh7bWluQ29sb3I6e21pblI6cCxtaW5HOmQsbWluQjp1fSxtYXhDb2xvcjp7bWF4Ujp4LG1heEc6UyxtYXhCOmJ9LHJhbmdlQ291bnQ6YSxzdGFydDowLGVuZDoxMDAsc2VsZWN0ZWRWYWx1ZTpudWxsfSk7ZWxzZSBpZihvLmxlbmd0aClvLmZvckVhY2goKHtjb2xvcjpPLGxhYmVsOlR9LEkpPT57bi5wdXNoKHtpZDpgY29sb3IjJHtJfWAsY29sb3I6TyxsYWJlbDpULHN0YXRlOiJub3JtYWwiLHNob3c6ITB9KX0pO2Vsc2V7Y29uc3QgTz1NYXRoLmZsb29yKChwLXgpLyhhLTEpKSxUPU1hdGguZmxvb3IoKGQtUykvKGEtMSkpLEk9TWF0aC5mbG9vcigodS1iKS8oYS0xKSk7Zm9yKGxldCB2PTA7djxhO3YrKyl7Y29uc3QgTT0rcC1PKnYsXz0rZC1UKnYsQz0rdS1JKnY7bi5wdXNoKHtpZDpgY29sb3IjJHt2fWAsY29sb3I6YHJnYigke019LCR7X30sJHtDfSlgLHN0YXRlOiJub3JtYWwiLHNob3c6ITB9KX19dGhpcy5jb2xvclN0YXRlPW4sdGhpcy5lcnJvckNvbG9yPWwsdGhpcy5zdHJva2U9Y31nZXRDb2xvckZvckdyYWRpZW50KHQpe2NvbnN0e21pbkNvbG9yOm4sbWF4Q29sb3I6c309dGhpcy5jb2xvclN0YXRlWzBdLHttaW5SOmksbWluRzpyLG1pbkI6YX09bix7bWF4UjpvLG1heEc6bCxtYXhCOmN9PXMsZj0raS1NYXRoLmZsb29yKChpLW8pKnQvMTAwKSxoPStyLU1hdGguZmxvb3IoKHItbCkqdC8xMDApLHA9K2EtTWF0aC5mbG9vcigoYS1jKSp0LzEwMCk7cmV0dXJuYHJnYigke2Z9LCR7aH0sJHtwfSlgfWdldENvbG9ySW5kZXhCeVZhbHVlKHQpe2NvbnN0e2V4aXN0RXJyb3I6bixtaW46cyxpbnRlcnZhbDppLGRlY2ltYWxQb2ludDpyfT10aGlzLnZhbHVlT3B0LGE9dGhpcy5jb2xvclN0YXRlLmxlbmd0aC0xO2lmKG4mJnQ8MClyZXR1cm4gYTtjb25zdCBvPU1hdGguZmxvb3IoKyh0LXMpLnRvRml4ZWQocikvaSk7cmV0dXJuIG8+PWE/bj9hLTE6YTpvfWdldEl0ZW1JbmZvKHQpe2NvbnN0e21pbjpuLG1heDpzfT10aGlzLnZhbHVlT3B0LGk9e3Nob3c6ITEsb3BhY2l0eToxLGRhdGFDb2xvcjpudWxsLGlkOm51bGwsaXNIaWdobGlnaHQ6bnVsbH07aWYodGhpcy5pc0dyYWRpZW50KXtjb25zdCByPSRlKHQtbixzLW4pLHtzdGFydDphLGVuZDpvLHNlbGVjdGVkVmFsdWU6bH09dGhpcy5jb2xvclN0YXRlWzBdOyh0PDB8fGE8PXImJnI8PW8pJiYoaS5zaG93PSEwLGkuaXNIaWdobGlnaHQ9bCE9PW51bGwmJk1hdGguZmxvb3IodCk9PT1NYXRoLmZsb29yKG4rKHMtbikqKGwvMTAwKSksaS5kYXRhQ29sb3I9dDwwP3RoaXMuZXJyb3JDb2xvcjp0aGlzLmdldENvbG9yRm9yR3JhZGllbnQocikpfWVsc2V7Y29uc3Qgcj10aGlzLmdldENvbG9ySW5kZXhCeVZhbHVlKHQpLHtzaG93OmEsc3RhdGU6byxjb2xvcjpsLGlkOmN9PXRoaXMuY29sb3JTdGF0ZVtyXTtpLnNob3c9YSxpLm9wYWNpdHk9bz09PSJkb3ducGxheSI/LjE6MSxpLmRhdGFDb2xvcj10PDA/dGhpcy5lcnJvckNvbG9yOmwsaS5pZD1jfXJldHVybiBpfWRyYXdJdGVtKHQsbixzLGkscixhKXtpZih0LmJlZ2luUGF0aCgpLCEoaTwwfHxyPDApKXtpZihhLnNob3cpe2NvbnN0e3JhZGl1czpvfT1hO2lmKG8+MCl7Y29uc3QgbD1NYXRoLm1pbihpLHIpO2xldCBjPW87Yz5sLzImJihjPU1hdGguZmxvb3IobC8yKSksdC5tb3ZlVG8obitjLHMpLHQuYXJjVG8obitpLHMsbitpLHMrcixjKSx0LmFyY1RvKG4raSxzK3IsbixzK3IsYyksdC5hcmNUbyhuLHMrcixuLHMsYyksdC5hcmNUbyhuLHMsbitpLHMsYyksdC5zdHJva2UoKSx0LmZpbGwoKX1lbHNlIHQuc3Ryb2tlUmVjdChuLHMsaSxyKSx0LmZpbGxSZWN0KG4scyxpLHIpfWVsc2V7Y29uc3Qgbz1RLmFsaWFzUGl4ZWwoMSk7dC5maWxsUmVjdChuLHMtbyxpK28scitvKX10LmNsb3NlUGF0aCgpfX1jYWxjdWxhdGVYWSh0LG4scyxpKXtsZXQgcj1udWxsO2lmKHRoaXMubGFiZWxzW3RdJiZ0aGlzLmxhYmVsc1t0XS5sZW5ndGgpe2xldCBhPXRoaXMubGFiZWxzW3RdLmZpbmRJbmRleChwPT5wPT09bik7YT09PS0xJiYoYT10aGlzLmxhYmVsc1t0XS5maW5kSW5kZXgocD0+K3A9PStuKSk7Y29uc3R7bWluSW5kZXg6byxtYXhJbmRleDpsLGdyYXBoTWluOmMsZ3JhcGhNYXg6Zn09aTtpZihkdChsKSYmYT5sfHxkdChvKSYmYTxvfHxfZShvKSYmX2UobCkmJihuPGN8fG4+ZikpcmV0dXJuIG51bGw7Y29uc3QgaD1vPz90aGlzLmxhYmVsc1t0XS5maW5kSW5kZXgocD0+K3A9PStjKTthPi0xJiYoYS09aD4tMT9oOjAscj10PT09IngiP3MrdGhpcy5zaXplLncqYTpzLXRoaXMuc2l6ZS5oKihhKzEpKX1yZXR1cm4gcn1jb21wdXRlR2VvbWV0cnkodCl7aWYoIXRoaXMuc2hvdylyZXR1cm47Y29uc3R7Y2hhcnRSZWN0Om4sbGFiZWxPZmZzZXQ6cyxzZWxlY3RJdGVtOmksYXhlc1N0ZXBzOnJ9PXQsYT1uLmNoYXJ0V2lkdGgtKHMubGVmdCtzLnJpZ2h0KSxvPW4uY2hhcnRIZWlnaHQtKHMudG9wK3MuYm90dG9tKSxsPW4ueDErcy5sZWZ0LGM9bi55Mi1zLmJvdHRvbSxmPXIueFt0aGlzLnhBeGlzSW5kZXhdLGg9ci55W3RoaXMueUF4aXNJbmRleF07dGhpcy5zaXplLnc9YS9mLm9yaVN0ZXBzLHRoaXMuc2l6ZS5oPW8vaC5vcmlTdGVwcyx0aGlzLmN1cnJlbnRMYWJlbEluZm89e3g6e3N0ZXBzOmYub3JpU3RlcHMsbWluOmYuZ3JhcGhNaW4sbWF4OmYuZ3JhcGhNYXh9LHk6e3N0ZXBzOmgub3JpU3RlcHMsbWluOmguZ3JhcGhNaW4sbWF4OmguZ3JhcGhNYXh9fSx0aGlzLmRhdGEuZm9yRWFjaCgocCxkKT0+e3ZhciBJO2xldCB4PXRoaXMuY2FsY3VsYXRlWFkoIngiLHAueCxsLGYpLFM9dGhpcy5jYWxjdWxhdGVYWSgieSIscC55LGMsaCksYj10aGlzLnNpemUudyxPPXRoaXMuc2l6ZS5oO2NvbnN0IFQ9cC5vO2lmKHghPT1udWxsJiZTIT09bnVsbCYmVCE9PW51bGwmJlQhPT12b2lkIDApe2NvbnN0e3Nob3c6dixkYXRhQ29sb3I6TSxpZDpffT10aGlzLmdldEl0ZW1JbmZvKFQpO2lmKHAuZGF0YUNvbG9yfHwocC5kYXRhQ29sb3I9TSkscC5jSWQ9Xyx2KXtsZXQgQz10aGlzLnN0cm9rZTtjb25zdCBSPWk9PW51bGw/dm9pZCAwOmkub3B0aW9uLEI9KFI9PW51bGw/dm9pZCAwOlIudXNlKSYmKFI9PW51bGw/dm9pZCAwOlIuc2hvd0JvcmRlciksRD1kPT09KChJPWk9PW51bGw/dm9pZCAwOmkuc2VsZWN0ZWQpPT1udWxsP3ZvaWQgMDpJLmRhdGFJbmRleCk7aWYoQiYmRCYmKEM9e3Nob3c6Uj09bnVsbD92b2lkIDA6Ui5zaG93Qm9yZGVyLC4uLlI9PW51bGw/dm9pZCAwOlIuYm9yZGVyU3R5bGV9KSxDLnNob3cmJkMubGluZVdpZHRoPjApe2NvbnN0e2xpbmVXaWR0aDpZfT1DLEc9WSoyO0c8TWF0aC5mbG9vcihiKSYmRzxNYXRoLmZsb29yKE8pJiYoeCs9WSxTKz1ZLGItPUcsTy09Ryl9eCs9MSxwLnhwPXgscC55cD1TLHAudz1iLHAuaD1PfX19KX1kcmF3KHQpe2lmKCF0aGlzLnNob3cpcmV0dXJuO3RoaXMuY29tcHV0ZUdlb21ldHJ5KHQpO2NvbnN0e2N0eDpuLGNoYXJ0UmVjdDpzLGxhYmVsT2Zmc2V0Omksc2VsZWN0TGFiZWw6cixsZWdlbmRIaXRJbmZvOmEsc2VsZWN0SXRlbTpvLGF4ZXNTdGVwczpsfT10LGM9cy5jaGFydFdpZHRoLShpLmxlZnQraS5yaWdodCksZj1zLmNoYXJ0SGVpZ2h0LShpLnRvcCtpLmJvdHRvbSksaD1zLngxK2kubGVmdCxwPXMueTItaS5ib3R0b20sZD1sLnhbdGhpcy54QXhpc0luZGV4XSx1PWwueVt0aGlzLnlBeGlzSW5kZXhdO3RoaXMuc2l6ZS53PWMvZC5vcmlTdGVwcyx0aGlzLnNpemUuaD1mL3Uub3JpU3RlcHMsdGhpcy5jdXJyZW50TGFiZWxJbmZvPXt4OntzdGVwczpkLm9yaVN0ZXBzLG1pbjpkLmdyYXBoTWluLG1heDpkLmdyYXBoTWF4fSx5OntzdGVwczp1Lm9yaVN0ZXBzLG1pbjp1LmdyYXBoTWluLG1heDp1LmdyYXBoTWF4fX07Y29uc3QgeD0oUyxiLE8pPT57dmFyIFQsSTtpZighYSl7bGV0IHY7Y29uc3R7b3B0aW9uOk0sc2VsZWN0ZWQ6X309byx7b3B0aW9uOkMsc2VsZWN0ZWQ6Un09cixCPXB0KF89PW51bGw/dm9pZCAwOl8uZGF0YUluZGV4KSYmKF89PW51bGw/dm9pZCAwOl8uZGF0YUluZGV4KT4tMSxEPSgoVD1SPT1udWxsP3ZvaWQgMDpSLmxhYmVsKT09bnVsbD92b2lkIDA6VC5sZW5ndGgpPjA7cmV0dXJuIEI/dj1NLnVzZVNlcmllc09wYWNpdHk/TyE9PShfPT1udWxsP3ZvaWQgMDpfLmRhdGFJbmRleCk6ITE6RCYmKHY9Qy51c2VTZXJpZXNPcGFjaXR5PyEoKEk9Uj09bnVsbD92b2lkIDA6Ui5sYWJlbCkhPW51bGwmJkkuaW5jbHVkZXModGhpcy5nZXRJdGVtTGFiZWwocixTKSkpOiExKSx2Py4xOmJ9cmV0dXJuIGJ9O3RoaXMuZGF0YS5mb3JFYWNoKChTLGIpPT57dmFyIEM7bGV0IFQ9dGhpcy5jYWxjdWxhdGVYWSgieCIsUy54LGgsZCksST10aGlzLmNhbGN1bGF0ZVhZKCJ5IixTLnkscCx1KSx2PXRoaXMuc2l6ZS53LE09dGhpcy5zaXplLmg7Y29uc3QgXz1TLm87aWYoVCE9PW51bGwmJkkhPT1udWxsJiZfIT09bnVsbCYmXyE9PXZvaWQgMCl7Y29uc3R7c2hvdzpSLG9wYWNpdHk6QixkYXRhQ29sb3I6RCxpZDpZfT10aGlzLmdldEl0ZW1JbmZvKF8pO2xldCBHPUI7Qj09PTEmJlEuZ2V0Q29sb3JTdHJpbmdUeXBlKFMuZGF0YUNvbG9yKT09PSJSR0JBIiYmKEc9US5nZXRPcGFjaXR5KFMuZGF0YUNvbG9yKSk7Y29uc3QgQT14KFMsRyxiKTtpZihTLmRhdGFDb2xvcnx8KFMuZGF0YUNvbG9yPUQpLFMuY0lkPVksbi5zYXZlKCksUil7bi5maWxsU3R5bGU9US5jb2xvclN0cmluZ1RvUmdiYShTLmRhdGFDb2xvcixBKTtsZXQgeT10aGlzLnN0cm9rZTtjb25zdCBnPW89PW51bGw/dm9pZCAwOm8ub3B0aW9uLCQ9KGc9PW51bGw/dm9pZCAwOmcudXNlKSYmKGc9PW51bGw/dm9pZCAwOmcuc2hvd0JvcmRlciksbT1iPT09KChDPW89PW51bGw/dm9pZCAwOm8uc2VsZWN0ZWQpPT1udWxsP3ZvaWQgMDpDLmRhdGFJbmRleCk7JCYmbSYmKHk9e3Nob3c6Zz09bnVsbD92b2lkIDA6Zy5zaG93Qm9yZGVyLC4uLmc9PW51bGw/dm9pZCAwOmcuYm9yZGVyU3R5bGV9KTtsZXQgdz0hMTtpZih5LnNob3cmJnkubGluZVdpZHRoPjApe2NvbnN0e2NvbG9yOlAsbGluZVdpZHRoOnosb3BhY2l0eTpXfT15LE49eioyO3c9TjxNYXRoLmZsb29yKHYpJiZOPE1hdGguZmxvb3IoTSksbi5zdHJva2VTdHlsZT13P1EuY29sb3JTdHJpbmdUb1JnYmEoUCxBPT09MT9XOkEpOnZvaWQgMCx3PyhuLmxpbmVXaWR0aD16LFQrPXosSSs9eix2LT1OLE0tPU4pOm4ubGluZVdpZHRoPTB9VCs9MSx0aGlzLmRyYXdJdGVtKG4sVCxJLHYsTSx7Li4ueSxzaG93Ond9KSxuLnJlc3RvcmUoKSx0aGlzLnNob3dWYWx1ZS51c2UmJnRoaXMuZHJhd1ZhbHVlTGFiZWxzKHtjb250ZXh0Om4sZGF0YTpTfSl9fX0pfWRyYXdPdmVybGF5KHQpe2lmKCF0aGlzLnNob3cpcmV0dXJuO2NvbnN0e292ZXJsYXlDdHg6bixjaGFydFJlY3Q6cyxsYWJlbE9mZnNldDppLGF4ZXNTdGVwczpyfT10O2lmKCFuKXJldHVybjtjb25zdCBhPXMueDEraS5sZWZ0LG89cy55Mi1pLmJvdHRvbSxsPXIueFt0aGlzLnhBeGlzSW5kZXhdLGM9ci55W3RoaXMueUF4aXNJbmRleF07dGhpcy5kYXRhLmZvckVhY2goZj0+e2NvbnN0IGg9dGhpcy5jYWxjdWxhdGVYWSgieCIsZi54LGEsbCkscD10aGlzLmNhbGN1bGF0ZVhZKCJ5IixmLnksbyxjKSxkPWYubztpZihoIT09bnVsbCYmcCE9PW51bGwmJmQhPT1udWxsJiZkIT09dm9pZCAwKXtjb25zdHtzaG93OnUsaXNIaWdobGlnaHQ6eH09dGhpcy5nZXRJdGVtSW5mbyhkKTt1JiZ4JiZ0aGlzLml0ZW1IaWdobGlnaHQoe2RhdGE6Zn0sbil9fSl9ZHJhd1ZhbHVlTGFiZWxzKHtjb250ZXh0OnQsZGF0YTpufSl7Y29uc3R7Zm9udFNpemU6cyx0ZXh0Q29sb3I6aSxhbGlnbjpyLGZvcm1hdHRlcjphLGRlY2ltYWxQb2ludDpvfT10aGlzLnNob3dWYWx1ZSx7eHA6bCx5cDpjLHc6ZixoLG86cH09bixkPXQ7ZC5zYXZlKCksZC5iZWdpblBhdGgoKSxkLmZvbnQ9YG5vcm1hbCBub3JtYWwgbm9ybWFsICR7c31weCBSb2JvdG9gLGQuZmlsbFN0eWxlPWksZC5saW5lV2lkdGg9MSxkLnRleHRCYXNlbGluZT0ibWlkZGxlIixkLnRleHRBbGlnbj1yIT09ImNlbnRlciI/ImxlZnQiOiJjZW50ZXIiO2xldCB1O2EmJih1PWEocCkpLCghYXx8dHlwZW9mIHUhPSJzdHJpbmciKSYmKHU9US5sYWJlbFNpZ25Gb3JtYXQocCxvKSk7Y29uc3QgeD1NYXRoLnJvdW5kKGQubWVhc3VyZVRleHQodSkud2lkdGgpLFM9cyxiPWwrZi8yLE89YytoLzI7aWYoISh4Pj1mfHxTPj1ofHx1PDApKXtzd2l0Y2gocil7Y2FzZSJ0b3AiOntjb25zdCBUPWIteC8yLEk9Ty1TLzI7ZC5maWxsVGV4dCh1LFQsSSk7YnJlYWt9Y2FzZSJyaWdodCI6e2NvbnN0IFQ9bCtmLXg7ZC5maWxsVGV4dCh1LFQsTyk7YnJlYWt9Y2FzZSJib3R0b20iOntjb25zdCBUPWIteC8yLEk9TytTLzI7ZC5maWxsVGV4dCh1LFQsSSk7YnJlYWt9Y2FzZSJsZWZ0IjpkLmZpbGxUZXh0KHUsbCxPKTticmVhaztkZWZhdWx0Ontjb25zdCBUPWIteC8yO2QuZmlsbFRleHQodSxULE8pO2JyZWFrfX1kLnJlc3RvcmUoKX19Z2V0QWRqdXN0ZWRCb3VuZHMoe3hwOnQseXA6bix3aWR0aDpzLGhlaWdodDppfSl7Y29uc3QgYT1NYXRoLm1heCgwLHMpLG89TWF0aC5tYXgoMCxpKTtyZXR1cm57eHNwOk1hdGguZmxvb3IodCoxMDApLzEwMCx4ZXA6TWF0aC5jZWlsKCh0K2EpKjEwMCkvMTAwLHlzcDpNYXRoLmZsb29yKG4qMTAwKS8xMDAseWVwOk1hdGguY2VpbCgobitvKSoxMDApLzEwMH19ZmluZEl0ZW1zKHQpe2NvbnN0IG49dGhpcy5kYXRhLHt4c3A6cyx4ZXA6aSx5c3A6cix5ZXA6YX09dGhpcy5nZXRBZGp1c3RlZEJvdW5kcyh7eHA6dC54c3AseXA6dC55c3Asd2lkdGg6dC53aWR0aCxoZWlnaHQ6dC5oZWlnaHR9KTtyZXR1cm4gbi5maWx0ZXIoKHt4cDpvLHlwOmwsdzpjLGg6Zn0pPT57Y29uc3R7eHNwOmgseGVwOnAseXNwOmQseWVwOnV9PXRoaXMuZ2V0QWRqdXN0ZWRCb3VuZHMoe3hwOm8seXA6bCx3aWR0aDpjLGhlaWdodDpmfSk7cmV0dXJuIGg+PXMmJnA8PWkmJmQ+PXImJnU8PWF9KX1pdGVtSGlnaGxpZ2h0KHQsbil7dmFyIHg7Y29uc3Qgcz10LmRhdGEsaT1uLHtzdHJva2U6cixzaGFkb3c6YX09dGhpcy5oaWdobGlnaHQsbz1zLnhwLGw9cy55cCxjPXMudyxmPXMuaCxoPXMuY0lkO2xldCBwO2lmKHRoaXMuaXNHcmFkaWVudCl7Y29uc3R7bWluOlMsbWF4OmJ9PXRoaXMudmFsdWVPcHQsTz0kZShzLm8tUyxiLVMpLHtzdGFydDpULGVuZDpJfT10aGlzLmNvbG9yU3RhdGVbMF07cD1UPD1PJiZPPD1JfHxzLm89PT0tMX1lbHNlIHA9KHg9dGhpcy5jb2xvclN0YXRlLmZpbmQoKHtpZDpTfSk9PlM9PT1oKSk9PW51bGw/dm9pZCAwOnguc2hvdztpZihvPT09bnVsbHx8bD09PW51bGx8fCFwKXJldHVybjtpLnNhdmUoKTtjb25zdCBkPVEuZ2V0Q29sb3JTdHJpbmdUeXBlKHMuZGF0YUNvbG9yKT09PSJSR0JBIj90LmRhdGFDb2xvcjpRLmNvbG9yU3RyaW5nVG9SZ2JhKHMuZGF0YUNvbG9yLDEpO2kuZmlsbFN0eWxlPWQsYS51c2UmJihpLnNoYWRvd09mZnNldFg9YS5vZmZzZXRYLGkuc2hhZG93T2Zmc2V0WT1hLm9mZnNldFksaS5zaGFkb3dCbHVyPWEuYmx1cixpLnNoYWRvd0NvbG9yPWEuY29sb3IpO2NvbnN0IHU9e2NvbG9yOiIiLGxpbmVXaWR0aDoxLG9wYWNpdHk6MSxyYWRpdXM6MCxzaG93OiEwfTtpZihyLnVzZSl7Y29uc3R7Y29sb3I6Uyx3aWR0aDpiLHJhZGl1czpPfT1yO3Uuc2hvdz0hMCx1LnJhZGl1cz1PLGkubGluZVdpZHRoPWIsdS5saW5lV2lkdGg9YixpLnN0cm9rZVN0eWxlPVN8fGQsdS5jb2xvcj1TfHxkfWVsc2UgdS5zaG93PSExLGkuc3Ryb2tlU3R5bGU9ZCx1LmNvbG9yPWQ7dGhpcy5kcmF3SXRlbShpLG8tLjUsbC0uNSxjKzEsZisxLHUpLGkucmVzdG9yZSgpLHRoaXMuc2hvd1ZhbHVlLnVzZSYmdGhpcy5kcmF3VmFsdWVMYWJlbHMoe2NvbnRleHQ6aSxkYXRhOnN9KX1maW5kR3JhcGhEYXRhKHQpe2NvbnN0IG49dFswXSxzPXRbMV0saT17ZGF0YTpudWxsLGhpdDohMSxjb2xvcjpudWxsLGRhdGFDb2xvcjpudWxsLG5hbWU6bnVsbH0scj10aGlzLmRhdGEsYT1yLmZpbmRJbmRleChvPT57Y29uc3R7eHA6bCx5cDpjLHc6ZixofT1vO3JldHVybiBsPD1uJiZuPD1sK2YmJmM8PXMmJnM8PWMraH0pO2lmKGE+LTEpe2NvbnN0IG89clthXTtpLmRhdGE9byxpLmNvbG9yPW8uZGF0YUNvbG9yLGkuZGF0YUNvbG9yPW8uZGF0YUNvbG9yLGkuaW5kZXg9YSxpLmhpdD0hMH1yZXR1cm4gaX1maW5kQmxvY2tSYW5nZSh7eGNwOnQseGVwOm4seWNwOnMseWVwOmkscmFuZ2U6cn0pe2NvbnN0IGE9dGhpcy5sYWJlbHMsbz0xLGw9e3hzcDpNYXRoLm1pbih0LG4pLHlzcDpNYXRoLm1pbihzLGkpLHdpZHRoOk1hdGguY2VpbChNYXRoLmFicyhuLXQpKSxoZWlnaHQ6TWF0aC5jZWlsKE1hdGguYWJzKGktcykpfTtpZihhLngubGVuZ3RoJiZhLnkubGVuZ3RoKXtjb25zdCBjPXRoaXMuY3VycmVudExhYmVsSW5mby54LnN0ZXBzfHxhLngubGVuZ3RoLGY9dGhpcy5jdXJyZW50TGFiZWxJbmZvLnkuc3RlcHN8fGEueS5sZW5ndGgse3gxOmgseDI6cCx5MTpkLHkyOnV9PXIseD0ocC1oKS9jLFM9KHUtZCkvZixiPXt4c3A6dCx4ZXA6bix5c3A6cyx5ZXA6aX0sTz0oVCxJLHYpPT57bGV0IE0sXyxDO1Q9PT0ieCI/KF89eCxDPWgrbyk6KF89UyxDPWQpLGFbVF0uZmluZEluZGV4KChCLEQpPT4oTT1DK18qRCxNPD1JJiZJPD1NK18pKT4tMT9iW3ZdPVsieHNwIiwieXNwIl0uaW5jbHVkZXModik/TTpNK186STxDJiYoYlt2XT1DKX07TygieCIsTWF0aC5taW4odCxuKSwieHNwIiksTygieCIsTWF0aC5tYXgodCxuKSwieGVwIiksTygieSIsTWF0aC5taW4ocyxpKSwieXNwIiksTygieSIsTWF0aC5tYXgocyxpKSwieWVwIiksbC54c3A9TWF0aC5taW4oYi54c3AsYi54ZXApLGwueXNwPU1hdGgubWluKGIueXNwLGIueWVwKSxsLndpZHRoPU1hdGguYWJzKGIueGVwLWIueHNwKSxsLmhlaWdodD1NYXRoLmFicyhiLnllcC1iLnlzcCl9cmV0dXJuIGx9Z2V0RmlsdGVyZWRMYWJlbCh0LG4scyxpKXtyZXR1cm4gdC5sZW5ndGghPT1uP3QuZmlsdGVyKHI9PnM8PXImJnI8PWkpOnR9ZmluZFNlbGVjdGlvblJhbmdlKHQpe2NvbnN0e3hzcDpuLHlzcDpzLHdpZHRoOmksaGVpZ2h0OnIscmFuZ2U6YX09dDtsZXQgbz1udWxsO2NvbnN0e3gxOmwseDI6Yyx5MTpmLHkyOmh9PWEse3g6cCx5OmR9PXRoaXMubGFiZWxzO2lmKHAubGVuZ3RoJiZkLmxlbmd0aCl7Y29uc3R7eDp7c3RlcHM6dSxtaW46eCxtYXg6U30seTp7c3RlcHM6YixtaW46TyxtYXg6VH19PXRoaXMuY3VycmVudExhYmVsSW5mbyxJPXV8fHAubGVuZ3RoLHY9Ynx8ZC5sZW5ndGgsTT0oYy1sKS9JLF89KGgtZikvdixDPW4raSxSPXMrcixCPXttaW46TWF0aC5mbG9vcigobi1sKS9NKSxtYXg6TWF0aC5mbG9vcigoQy1sLU0pL00pfSxEPXYtMSxZPXttaW46RC1NYXRoLnJvdW5kKChSLWYtXykvXyksbWF4OkQtTWF0aC5yb3VuZCgocy1mKS9fKX0sRz10aGlzLmdldEZpbHRlcmVkTGFiZWwocCxJLHgsUyksQT10aGlzLmdldEZpbHRlcmVkTGFiZWwoZCx2LE8sVCk7bz17eE1pbjpHW0IubWluXSx4TWF4OkdbQi5tYXhdLHlNaW46QVtZLm1pbl0seU1heDpBW1kubWF4XX19cmV0dXJuIG99Z2V0SXRlbUxhYmVsKHQsbil7Y29uc3R7b3B0aW9uOnMsc2VsZWN0ZWQ6aX09dDtsZXQgcj10aGlzLmlzSG9yaXpvbnRhbD9uLnk6bi54O3JldHVybiBzIT1udWxsJiZzLnVzZUJvdGhBeGlzJiYoaSE9bnVsbCYmaS50YXJnZXRBeGlzKSYmKHI9KGk9PW51bGw/dm9pZCAwOmkudGFyZ2V0QXhpcyk9PT0ieUF4aXMiP24ueTpuLngpLHJ9fWZ1bmN0aW9uIEJ0KGUpe3JldHVybiBlPT09dm9pZCAwfHx0eXBlb2YgZT09Im51bWJlciImJk51bWJlci5pc05hTihlKT9udWxsOmV9ZnVuY3Rpb24gd3MoZSl7Y29uc3QgdD0oZT09bnVsbD92b2lkIDA6ZS5sZW5ndGgpPz8wLG49ZT09bnVsbD92b2lkIDA6ZS54LHM9ZT09bnVsbD92b2lkIDA6ZS55LGk9ZT09bnVsbD92b2lkIDA6ZS5vLHI9ZT09bnVsbD92b2lkIDA6ZS5iLGE9bmV3IEFycmF5KHQpO2ZvcihsZXQgbz0wO288dDtvKyspYVtvXT17eDpCdChuPT1udWxsP3ZvaWQgMDpuW29dKSx5OkJ0KHM9PW51bGw/dm9pZCAwOnNbb10pLG86QnQoaT09bnVsbD92b2lkIDA6aVtvXSksYjpCdChyPT1udWxsP3ZvaWQgMDpyW29dKX07cmV0dXJuIGF9ZnVuY3Rpb24gTXMoZSx0KXtjb25zdCBuPWUuc2VyaWVzPz97fSxzPWUub3B0aW9ucz8/e30saT17fTtsZXQgcj0wO3JldHVybiBPYmplY3Qua2V5cyhuKS5mb3JFYWNoKGE9Pntjb25zdCBvPW5bYV0sbD13cyh0PT1udWxsP3ZvaWQgMDp0W2FdKTtsZXQgYz1udWxsO3N3aXRjaChvLnR5cGUpe2Nhc2UibGluZSI6Yz1uZXcgeXMoby5zSWQ/P2EsbyxyKTticmVhaztjYXNlImJhciI6Yz1uZXcgYnMoby5zSWQ/P2EsbyxyLCEhcy5ob3Jpem9udGFsKTticmVhaztjYXNlImhlYXRNYXAiOmM9bmV3IG1zKG8uc0lkPz9hLG8scy5oZWF0TWFwQ29sb3IsISFzLmhvcml6b250YWwsISFzLmlzR3JhZGllbnQpO2JyZWFrO2RlZmF1bHQ6Yz1udWxsfWMmJihjLmRhdGE9bCxvLnR5cGU9PT0iaGVhdE1hcCImJm8ubGFiZWxzJiYoYy5sYWJlbHM9by5sYWJlbHMpLGlbYV09Yykscis9MX0pLGl9ZnVuY3Rpb24gU3MoZSx0LG4pe3ZhciBmLGgscCxkLHUseCxTLGIsTyxULEk7Y29uc3Qgcz1lLm9wdGlvbnM/P3t9LGk9ZS5zZXJpZXNPcmRlcj8/e30scj1lLnNlbGVjdGlvbj8/e30sYT17Y3R4Om4sY2hhcnRSZWN0OmUuY2hhcnRSZWN0LGxhYmVsT2Zmc2V0OmUubGFiZWxPZmZzZXQsYXhlc1N0ZXBzOmUuYXhlc1N0ZXBzLGlzSG9yaXpvbnRhbDohIXMuaG9yaXpvbnRhbCxkaXNwbGF5T3ZlcmZsb3c6cy5kaXNwbGF5T3ZlcmZsb3csdW5TZWxlY3RlZE9wYWNpdHk6cy51blNlbGVjdGVkT3BhY2l0eSxzZWxlY3RTZXJpZXM6e29wdGlvbjp7dXNlOigoZj1yLnNlbGVjdFNlcmllcyk9PW51bGw/dm9pZCAwOmYudXNlKT8/ITF9LHNlbGVjdGVkOigoaD1yLnNlbGVjdFNlcmllcyk9PW51bGw/dm9pZCAwOmguc2VsZWN0ZWQpPz9udWxsfSxzZWxlY3RJdGVtOntvcHRpb246e3VzZTooKHA9ci5zZWxlY3RJdGVtKT09bnVsbD92b2lkIDA6cC51c2UpPz8hMSx1c2VTZXJpZXNPcGFjaXR5OigoZD1yLnNlbGVjdEl0ZW0pPT1udWxsP3ZvaWQgMDpkLnVzZVNlcmllc09wYWNpdHkpPz8hMSxzaG93Qm9yZGVyOigodT1yLnNlbGVjdEl0ZW0pPT1udWxsP3ZvaWQgMDp1LnNob3dCb3JkZXIpPz8hMSxib3JkZXJTdHlsZTooKHg9ci5zZWxlY3RJdGVtKT09bnVsbD92b2lkIDA6eC5ib3JkZXJTdHlsZSk/P251bGx9LHNlbGVjdGVkOigoUz1yLnNlbGVjdEl0ZW0pPT1udWxsP3ZvaWQgMDpTLnNlbGVjdGVkKT8/bnVsbH0sc2VsZWN0TGFiZWw6e29wdGlvbjp7dXNlOigoYj1yLnNlbGVjdExhYmVsKT09bnVsbD92b2lkIDA6Yi51c2UpPz8hMSx1c2VTZXJpZXNPcGFjaXR5OigoTz1yLnNlbGVjdExhYmVsKT09bnVsbD92b2lkIDA6Ty51c2VTZXJpZXNPcGFjaXR5KT8/ITEsdXNlQm90aEF4aXM6KChUPXIuc2VsZWN0TGFiZWwpPT1udWxsP3ZvaWQgMDpULnVzZUJvdGhBeGlzKT8/ITF9LHNlbGVjdGVkOigoST1yLnNlbGVjdExhYmVsKT09bnVsbD92b2lkIDA6SS5zZWxlY3RlZCk/P251bGx9fTsoaS5saW5lPz9bXSkuZm9yRWFjaCh2PT57dmFyIE07cmV0dXJuKE09dFt2XSk9PW51bGw/dm9pZCAwOk0uZHJhdyh7Li4uYX0pfSksKGkuaGVhdE1hcD8/W10pLmZvckVhY2godj0+e3ZhciBNO3JldHVybihNPXRbdl0pPT1udWxsP3ZvaWQgMDpNLmRyYXcoey4uLmF9KX0pO2NvbnN0IG89aS5iYXI/P1tdO2xldCBsPTA7by5mb3JFYWNoKHY9Pnt2YXIgTTsoTT10W3ZdKSE9bnVsbCYmTS5zaG93JiYobCs9MSl9KTtsZXQgYz0wO28uZm9yRWFjaCh2PT57Y29uc3QgTT10W3ZdO00mJihNLmRyYXcoey4uLmEsdGhpY2tuZXNzOnMudGhpY2tuZXNzLGNQYWRSYXRpbzpzLmNQYWRSYXRpbyxib3JkZXJSYWRpdXM6cy5ib3JkZXJSYWRpdXMsc2hvd1Nlcmllc0NvdW50Omwsc2hvd0luZGV4OmN9KSxNLnNob3cmJihjKz0xKSl9KX1sZXQgd3Q9bnVsbCxIdD1udWxsO2Z1bmN0aW9uIFRzKGUsdCl7KCF3dHx8d3Qud2lkdGghPT1lfHx3dC5oZWlnaHQhPT10KSYmKHd0PW5ldyBPZmZzY3JlZW5DYW52YXMoZSx0KSxIdD13dC5nZXRDb250ZXh0KCIyZCIpKX1mdW5jdGlvbiBJcyhlKXtjb25zdHtlcG9jaDp0LHNuYXBzaG90Om4sY29sdW1uczpzfT1lLGk9bi5waXhlbFJhdGlvfHwxLHI9bi5jaGFydFJlY3Q/P3t9LGE9ci53aWR0aD8/MCxvPXIuaGVpZ2h0Pz8wLGw9TWF0aC5tYXgoMSxNYXRoLmZsb29yKGEqaSkpLGM9TWF0aC5tYXgoMSxNYXRoLmZsb29yKG8qaSkpO1RzKGwsYyksSHQuc2V0VHJhbnNmb3JtKGksMCwwLGksMCwwKSxIdC5jbGVhclJlY3QoMCwwLGEsbyk7Y29uc3QgZj1NcyhuLHMpLGg9cGVyZm9ybWFuY2Uubm93KCk7U3MobixmLEh0KTtjb25zdCBwPXBlcmZvcm1hbmNlLm5vdygpLWgsZD1wZXJmb3JtYW5jZS5ub3coKSx1PXd0LnRyYW5zZmVyVG9JbWFnZUJpdG1hcCgpLHg9cGVyZm9ybWFuY2Uubm93KCktZDtzZWxmLnBvc3RNZXNzYWdlKHt0eXBlOiJyZW5kZXJlZCIsZXBvY2g6dCxiaXRtYXA6dSxkcmF3TXM6cCxiaXRtYXBNczp4fSxbdV0pfXNlbGYub25tZXNzYWdlPWU9Pntjb25zdCB0PWUuZGF0YTtpZih0KXtpZih0LnR5cGU9PT0iaW5pdCIpe2xldCBuPXR5cGVvZiBPZmZzY3JlZW5DYW52YXM8InUiO2lmKG4pdHJ5e249ISFuZXcgT2Zmc2NyZWVuQ2FudmFzKDEsMSkuZ2V0Q29udGV4dCgiMmQiKX1jYXRjaHtuPSExfXNlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6bj8icmVhZHkiOiJ1bnN1cHBvcnRlZCIsdmVyc2lvbjpnc30pO3JldHVybn1pZih0LnR5cGU9PT0icmVuZGVyIil0cnl7SXModCl9Y2F0Y2gobil7c2VsZi5wb3N0TWVzc2FnZSh7dHlwZToicmVuZGVyLWVycm9yIixlcG9jaDp0LmVwb2NoLG1lc3NhZ2U6U3RyaW5nKG4mJm4ubWVzc2FnZXx8biksbmFtZTpuJiZuLm5hbWUsc3RhY2s6biYmbi5zdGFja30pfX19fSkoKTsK",ZC=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Qr=typeof self<"u"&&self.Blob&&new Blob([ZC(jr)],{type:"text/javascript;charset=utf-8"});function XC(e){let t;try{if(t=Qr&&(self.URL||self.webkitURL).createObjectURL(Qr),!t)throw"";const n=new Worker(t,{name:e==null?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker("data:text/javascript;base64,"+jr,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const mt={IDLE:"idle",INITIALIZING:"initializing",READY:"ready",FAILED:"failed"},NC=3e3,PC=2,BC=3,zt=()=>{},DC={onInitFailure:zt,onTimeout:zt,onRenderException:zt,onFallback:zt};function YC(){return typeof Worker<"u"&&typeof OffscreenCanvas<"u"&&typeof OffscreenCanvas.prototype.transferToImageBitmap=="function"}function OC(e){if(typeof structuredClone!="function")return!1;try{return structuredClone(e),!0}catch{return!1}}function HC(){return new XC}class zC{constructor(t={}){this.state=mt.IDLE,this.worker=null,this.version=t.version??_r,this.initTimeoutMs=t.initTimeoutMs??NC,this.maxInFlight=t.maxInFlight??PC,this.maxRenderErrors=t.maxRenderErrors??BC,this.hooks={...DC,...t.hooks||{}},this._timer=null,this._frameHandler=zt,this._errorHandler=zt,this._inFlight=0,this._renderErrorStreak=0,this._isEnabled=t.isEnabled||(()=>!1),this._isSupported=t.isSupported||YC,this._createWorker=t.createWorker||HC}start(){if(this.state!==mt.IDLE)return this.state;if(!this._isEnabled())return this.hooks.onFallback("opt-in-off"),this.state;if(!this._isSupported())return this.hooks.onFallback("unsupported"),this.state;let t;try{t=this._createWorker()}catch(n){return this.state=mt.FAILED,this.hooks.onInitFailure(n),this.hooks.onFallback("worker-create-failed"),this.state}return t?(this.worker=t,this.state=mt.INITIALIZING,t.onmessage=n=>this._handleMessage(n),t.onerror=()=>this._fail("worker-error"),this._timer=setTimeout(()=>this._handleTimeout(),this.initTimeoutMs),t.postMessage({type:"init",version:this.version}),this.state):(this.state=mt.FAILED,this.hooks.onInitFailure("worker-create-failed"),this.hooks.onFallback("worker-create-failed"),this.state)}isReady(){return this.state===mt.READY}shouldRenderOnWorker(t){return this.isReady()&&OC(t)}setFrameHandler(t){this._frameHandler=t||zt}setErrorHandler(t){this._errorHandler=t||zt}canAcceptRender(){return this.isReady()&&this._inFlight<this.maxInFlight}render(t,n,i){if(!this.canAcceptRender()||!this.worker)return!1;this._inFlight+=1;try{this.worker.postMessage({type:"render",epoch:t.epoch,snapshot:t,columns:n},i||[])}catch(s){return this._inFlight=0,this.hooks.onRenderException(s),this._fail("post-message-failed"),!1}return!0}destroy(){this._clearTimer(),this.worker&&(this.worker.terminate(),this.worker=null),this.state=mt.IDLE}_handleMessage(t){const n=t&&t.data;if(n)if(n.type==="ready"&&this.state===mt.INITIALIZING){if(n.version!==this.version){this._fail("version-mismatch");return}this._clearTimer(),this.state=mt.READY}else n.type==="unsupported"?this._fail("worker-unsupported"):n.type==="rendered"?(this._inFlight=Math.max(0,this._inFlight-1),this._renderErrorStreak=0,this._frameHandler(n)):n.type==="render-error"&&(this._inFlight=Math.max(0,this._inFlight-1),this.hooks.onRenderException(n),this._errorHandler(n),this._renderErrorStreak+=1,this._renderErrorStreak>=this.maxRenderErrors&&(this._inFlight=0,this._fail("render-error-threshold")))}_handleTimeout(){this.state===mt.INITIALIZING&&(this.hooks.onTimeout("init-timeout"),this._fail("init-timeout"))}_fail(t){this._clearTimer(),this.state=mt.FAILED,this.worker&&(this.worker.terminate(),this.worker=null);const n=this._inFlight>0;this._inFlight=0,this.hooks.onInitFailure(t),this.hooks.onFallback(t),n&&this._errorHandler()}_clearTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}}const FC=300;let Uo=class{constructor(t,n,i,s,l,a,r){Object.keys(zr).forEach(d=>Object.assign(this,zr[d])),i.brush||(Object.assign(this,xC),Object.assign(this,IC),Object.assign(this,bC),Object.assign(this,TC),Object.assign(this,dC),Object.assign(this,LC),Object.assign(this,cC),Object.assign(this,fC)),i.type==="heatMap"&&i.legend.type==="gradient"&&Object.assign(this,uC),this.isMobile=Zh(),this.brushSeries=r,this.target=t,this.data=n,this.options=i,this.listeners=s,this.wrapperDOM=document.createElement("div"),this.wrapperDOM.className=i.brush?"ev-chart-brush-wrapper":"ev-chart-wrapper",this.chartDOM=document.createElement("div"),this.chartDOM.className=i.brush?"ev-chart-brush-container":"ev-chart-container",this.wrapperDOM.appendChild(this.chartDOM),this.target.appendChild(this.wrapperDOM);const c=i.type==="pie";this.displayCanvas=document.createElement("canvas"),this.displayCanvas.setAttribute("style","display: block;"),this.displayCtx=this.displayCanvas.getContext("2d",{willReadFrequently:c}),this.bufferCanvas=document.createElement("canvas"),this.bufferCanvas.setAttribute("style","display: block;"),this.bufferCtx=this.bufferCanvas.getContext("2d",{willReadFrequently:c}),this.pixelRatio=window.devicePixelRatio||1,this.oldPixelRatio=this.pixelRatio,this.chartDOM.appendChild(this.displayCanvas),i.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",{willReadFrequently:c}),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,this.initBlitState(),this.renderWorkerGate=new zC({isEnabled:()=>!!this.options.workerRender,hooks:{onInitFailure:d=>eo.warn("[EvChart] workerRender 비활성화 — main 렌더로 fallback:",d),onRenderException:d=>eo.warn("[EvChart] workerRender 렌더 예외 — main 렌더로 fallback:",d),onFallback:d=>{d==="unsupported"&&eo.warn("[EvChart] workerRender 미지원 환경 — main 렌더 사용")}}}),this.renderEpoch=0,this.renderWorkerGate.setFrameHandler(d=>this.commitWorkerFrame(d)),this.renderWorkerGate.setErrorHandler(d=>this.drawSeriesLayerFallback(d)),this.renderWorkerGate.start()}init(){var u,f,p,g,m;const{series:t,data:n,labels:i,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,i),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||(g=(p=r==null?void 0:r[0])==null?void 0:p.scrollbar)!=null&&g.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:i}){this.drawSyncedIndicator({horizontal:t,label:n,mousePosition:i})}adjustXAndYAxisWidth(){var i,s,l,a;const t=(r,c,d)=>{const{interval:h,graphMin:u,graphMax:f,steps:p=0,minIndex:g,maxIndex:m,indexInterval:b}=r??{};let C=[];if((d==null?void 0:d.type)==="step"&&g!==void 0&&m!==void 0&&b!==void 0){const{labels:y}=this.data,w=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[];C=[];for(let T=g;T<=m;T+=b)w[T]!==void 0&&C.push(w[T])}else if(h)C=Array.from({length:p},(y,w)=>u+w*h),C.push(f);else{const{labels:y}=this.data;C=c==="x"?(y==null?void 0:y.x)??y??[]:(y==null?void 0:y.y)??y??[]}return C},n={x:(s=(i=this.axesRange)==null?void 0:i.x)==null?void 0:s.map((r,c)=>{var b,C,y,w;const d=this.axesX[c],h=(b=this.axesSteps)==null?void 0:b.x[c],u=t(h,"x",d),f=ve((C=d==null?void 0:d.labelStyle)==null?void 0:C.fixWidth)?d.labelStyle.fixWidth:0;let p=[];const g=(y=this.axesSteps)==null?void 0:y.x[c];if((d==null?void 0:d.type)==="linear"&&g!=null){const{graphMin:T,graphMax:k}=g;if(typeof T=="number"&&typeof k=="number"){const M=Math.abs(T)>=Math.abs(k)?T:k;p=[PS(M)]}}const m=((w=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:w.call(d,u,this.chartRect,p))??0;return{...r,size:{width:f||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 g,m,b;const d=this.axesY[c],h=(g=this.axesSteps)==null?void 0:g.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,p=((b=d==null?void 0:d.getLabelWidthHasMaxLength)==null?void 0:b.call(d,u,this.chartRect))??0;return{...r,size:{width:f||Math.max(p,r.size.width),height:r.size.height}}})};this.axesRange=n,this.labelOffset=this.getLabelOffset(n),this.labelRange=this.getAxesLabelRange(),this.axesSteps=this.calculateSteps()}computeAxesScaleChange(){var r;if(typeof((r=this.listeners)==null?void 0:r["axes-scale-change"])!="function")return null;const t=this._lastEmittedAxesRange,n=this.labelRange,i=(c,d)=>(c==null?void 0:c.min)===(d==null?void 0:d.min)&&(c==null?void 0:c.max)===(d==null?void 0:d.max),s=({min:c,max:d})=>({minSteps:c,maxSteps:d}),l=n.x.every((c,d)=>{var u;return!!!((u=this.options.axesX[d])!=null&&u.scaleChange)||!!t&&i(c,t.x[d])}),a=n.y.every((c,d)=>{var u;return!!!((u=this.options.axesY[d])!=null&&u.scaleChange)||!!t&&i(c,t.y[d])});return l&&a?null:(this._lastEmittedAxesRange=n,{x:n.x.map(s),y:n.y.map(s)})}emitDataMaxChange(){var i;const t=(i=this.listeners)==null?void 0:i["axes-data-max-change"];if(typeof t!="function")return;let n=-1/0;Object.values(this.seriesList).forEach(s=>{if(!(s!=null&&s.show)||!s.minMax)return;const l=s.minMax.maxY;Number.isFinite(l)&&l>n&&(n=l)}),t(Number.isFinite(n)?n:null)}prepareScale(){this.axesRange=this.getAxesRange(),this.labelOffset=this.getLabelOffset(),this.labelRange=this.getAxesLabelRange();const t=this.labelOffset;return this.axesSteps=this.calculateSteps(),this.adjustXAndYAxisWidth(),{scaleChange:this.computeAxesScaleChange(),scrollbarLabelOffset:t}}drawChart(t,n){var l,a,r,c,d,h;this.renderEpoch+=1,this.initScale();const{scaleChange:i,scrollbarLabelOffset:s}=this.prepareScale();this.computeScaleVersion(),((a=(l=this.scrollbar)==null?void 0:l.x)!=null&&a.use||(c=(r=this.scrollbar)==null?void 0:r.y)!=null&&c.use)&&this.updateScrollbarPosition(s),i&&typeof((d=this.listeners)==null?void 0:d["axes-scale-change"])=="function"&&this.listeners["axes-scale-change"](i),this.emitDataMaxChange(),!(!n&&this.tryDrawSeriesOnWorker(t))&&((h=this.options.realTimeScatter)!=null&&h.use?this.drawAxisAndSeries(t):(this.drawStaticLayer(this.bufferCtx,t),this.drawSeriesLayer(this.bufferCtx,t)),this.drawSeriesOverlay(),this.drawTip(),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}tryDrawSeriesOnWorker(t){var r;if(!((r=this.renderWorkerGate)!=null&&r.canAcceptRender())||!this.canRenderSeriesOnWorker(t).ok)return!1;const n=this.renderEpoch,i=GC(this,n),{columns:s,transferList:l}=WC(i);return this.drawStaticLayer(this.bufferCtx,t),this.computeSeriesGeometry(),this.renderWorkerGate.render(i,s,l)?this.drawSeriesOverlay():(this.drawSeriesLayer(this.bufferCtx,t),this.drawSeriesOverlay(),this.drawTip(),this.commitToDisplay(this.displayCtx,this.bufferCanvas)),!0}canRenderSeriesOnWorker(t){var a;if(t||this.lastHitInfo)return{ok:!1,reason:"hit-info"};const n=((a=this.seriesInfo)==null?void 0:a.charts)??{},i={line:!0,bar:!0,heatMap:!0},s=Object.keys(n).find(r=>!i[r]&&(n[r]??[]).some(c=>{var d;return((d=this.seriesList[c])==null?void 0:d.show)!==!1}));return s?{ok:!1,reason:`unsupported-type:${s}`}:(n.bar??[]).some(r=>{const c=this.seriesList[r];return(c==null?void 0:c.show)!==!1&&(c==null?void 0:c.timeMode)})?{ok:!1,reason:"time-bar"}:{ok:!0}}commitWorkerFrame(t){const n=t==null?void 0:t.bitmap;if(!n)return;if(t.epoch!==this.renderEpoch){n.close();return}const i=this.displayCtx;this.commitToDisplay(i,this.bufferCanvas),i.drawImage(n,0,0),n.close(),i.save(),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0),this.drawTip(i),i.restore()}drawSeriesLayerFallback(t){t&&t.epoch!==this.renderEpoch||(this.drawSeriesLayer(this.bufferCtx,void 0),this.commitToDisplay(this.displayCtx,this.bufferCanvas))}commitToDisplay(t,n){if(this.displayCanvas){const i=this.pixelRatio<1?this.pixelRatio:1;t.clearRect(0,0,this.displayCanvas.width/i,this.displayCanvas.height/i)}n&&(n==null?void 0:n.width)>1&&(n==null?void 0:n.height)>1&&t.drawImage(n,0,0),this._blitPrev=this.snapshotBlitState()}drawAxisAndSeries(t){const n=this.evaluateBlitGate(t),i=typeof window<"u"&&window.__EVUI_BLIT_FORCE_OFF__===!0,s=typeof window<"u"?window.__EVUI_BLIT_REFRESH_INTERVAL__:void 0,l=Number.isFinite(s)?s:this._blitRefreshInterval||FC,a=n.ok&&!i&&this.pointsLayerValid&&this.pointsLayersSized()&&this._framesSinceFullRedraw<l,r={blockedByForceOff:i,blockedByLayerInvalid:!this.pointsLayerValid,blockedByLayerUnsized:!this.pointsLayersSized(),blockedByRefreshDue:this._framesSinceFullRedraw>=l};let c=!1;if(a&&(c=this.drawChartBlitFastPath(t,n)),this.recordBlitDiag(n,c,r),c)this._framesSinceFullRedraw++,this._pointsLayerStamp=this.computePointsLayerStamp(),this._pointsLayerOptionsRef=this.options,this._hitCoordsDirty=!0;else{this.drawStaticLayer(this.bufferCtx,t);let d=!1,h=!1;!i&&this.canRouteFallbackViaLayer(t)?(d=this.maybeRebuildPointsLayer(r.blockedByRefreshDue),this.pointsLayerValid?this.compositePointsLayer(this.getPointsLayers().src,this.getMaxVisibleScatterPointSize()):(this.drawSeriesLayer(this.bufferCtx,t),h=!0)):(this.drawSeriesLayer(this.bufferCtx,t),d=this.maybeRebuildPointsLayer(!1),h=!(t!=null&&t.legend)),(d||h)&&(this._hitCoordsDirty=!1),d&&(this._framesSinceFullRedraw=0,this._blitCarry=0)}}collectDuplicatePoints(t,n){var s,l,a;const i=!!this.options.seriesReverse;for(let r=i?n.length-1:0;i?r>=0:r<n.length;i?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 p=0;p<f.length;p++){const g=f[p];t.set(g.k??z.coordinateKey(g.x,g.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(z.coordinateKey(f.x,f.y),c.sId)}}}}canSkipRealtimeScatterDedupe(t){var i,s;if(!((i=this.options.realTimeScatter)!=null&&i.use))return!1;let n=0;for(let l=0;l<t.length;l++)if((s=this.seriesList[t[l]])!=null&&s.show&&(n++,n>1))return!1;return n===1}computeScaleVersion(){var r,c;const t=this.chartRect??{},n=this.labelOffset??{},i=this.options??{},s=((r=this.axesSteps)==null?void 0:r.x)??[],l=((c=this.axesSteps)==null?void 0:c.y)??[];let a=`${t.x1},${t.x2},${t.y1},${t.y2},${t.chartWidth},${t.chartHeight}|${n.left},${n.right},${n.top},${n.bottom}|${this.pixelRatio}|${i.horizontal?1:0}|${i.thickness},${i.cPadRatio},${i.borderRadius}|`;for(let d=0;d<s.length;d++){const h=s[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a+="|";for(let d=0;d<l.length;d++){const h=l[d];a+=`${h==null?void 0:h.graphMin}:${h==null?void 0:h.graphMax}:${h==null?void 0:h.minIndex}:${h==null?void 0:h.maxIndex}:${h==null?void 0:h.oriSteps};`}a!==this._scaleKey&&(this._scaleKey=a,this._scaleVersion=(this._scaleVersion??0)+1)}computeSeriesGeometry(){const t={chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let n=0;this.seriesInfo.charts.bar.forEach(r=>{var c;(c=this.seriesList[r])!=null&&c.show&&n++}),["line","heatMap"].forEach(r=>{this.seriesInfo.charts[r].forEach(c=>{var d,h;(h=(d=this.seriesList[c])==null?void 0:d.computeGeometry)==null||h.call(d,t)})});const{thickness:i,cPadRatio:s,borderRadius:l}=this.options;let a=0;this.seriesInfo.charts.bar.forEach(r=>{var d;const c=this.seriesList[r];c&&((d=c.computeGeometry)==null||d.call(c,{...t,thickness:i,cPadRatio:s,borderRadius:l,showSeriesCount:n,showIndex:a}),c.show&&a++)})}drawSeriesLayer(t,n){var m;const{maxTip:i,selectLabel:s,selectItem:l,selectSeries:a,brush:r,displayOverflow:c,unSelectedOpacity:d}=this.options,h={ctx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps,maxTipOpt:{background:i.background,color:i.color},selectLabel:{option:s,selected:this.defaultSelectInfo},selectSeries:{option:a,selected:this.defaultSelectInfo},selectItem:{option:l,selected:this.defaultSelectItemInfo},isBrush:!!r,displayOverflow:c,unSelectedOpacity:d,isHorizontal:this.options.horizontal,dataEpoch:this._dataEpoch,scaleVersion:this._scaleVersion};let u=0,f=0;this.seriesInfo.charts.bar.forEach(b=>{this.seriesList[b].show&&f++});const p=new Map,g=Object.keys(this.seriesInfo.charts);for(let b=0;b<g.length;b++){const C=g[b],y=this.seriesInfo.charts[C];let w=!1;C==="scatter"&&(w=this.options.coordinateDedupe!==!1&&!this.canSkipRealtimeScatterDedupe(y),w&&this.collectDuplicatePoints(p,y));for(let T=0;T<y.length;T++){let k=this.seriesList[y[T]];switch(C){case"line":{const M=n==null?void 0:n.legend;k.draw({legendHitInfo:M,...h});break}case"heatMap":{const M=n==null?void 0:n.legend;k.draw({legendHitInfo:M,...h});break}case"bar":{const M=n==null?void 0:n.legend,{thickness:Z,cPadRatio:S,borderRadius:x}=this.options;k.draw({thickness:Z,cPadRatio:S,borderRadius:x,showSeriesCount:f,showIndex:u,legendHitInfo:M,...h}),k.show&&u++;break}case"pie":{const M=this.lastHitInfo??{sId:(m=this.defaultSelectItemInfo)==null?void 0:m.seriesID},Z=n==null?void 0:n.legend;this.options.sunburst?this.drawSunburst({selectInfo:M,legendHitInfo:Z,unSelectedOpacity:h.unSelectedOpacity},t):this.drawPie({selectInfo:M,legendHitInfo:Z,unSelectedOpacity:h.unSelectedOpacity},t),this.options.doughnutHoleSize>0&&this.drawDoughnutHole(t);break}case"scatter":{const M=n==null?void 0:n.legend;let Z;if(l.use&&l.useSeriesOpacity){const S=this.lastHitInfo,x=this.defaultSelectItemInfo;S!=null&&S.dataIndex||(S==null?void 0:S.dataIndex)===0?Z={seriesID:S.sId,dataIndex:S.dataIndex}:x!=null&&x.dataIndex||(x==null?void 0:x.dataIndex)===0?Z={...x}:Z=null}this.options.seriesReverse&&(k=this.seriesList[y.at(-1-T)]),k.draw({legendHitInfo:M,selectInfo:Z,duple:p,coordinateDedupe:w,...h});break}}}}}drawSeriesOverlay(){var s,l;const t=this.overlayCtx;if(!t)return;const n={overlayCtx:t,chartRect:this.chartRect,labelOffset:this.labelOffset,axesSteps:this.axesSteps},i=this.seriesInfo.charts.heatMap;for(let a=0;a<i.length;a++)(l=(s=this.seriesList[i[a]])==null?void 0:s.drawOverlay)==null||l.call(s,n)}drawTip(t){var i;let n;this.lastHitInfo?n=this.lastHitInfo:this.defaultSelectItemInfo?n=this.getItem(this.defaultSelectItemInfo,!1):this.defaultSelectInfo&&this.options.selectLabel.use?n=this.getItem(this.defaultSelectInfo,!1):n=null,(i=this.drawTips)==null||i.call(this,n,t)}createAxes(t,n=[]){const i=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 oC(t,r,i,a);case"time":return r.categoryMode?new rC(t,r,i,l,a):new sC(t,r,i,a);case"log":return new lC(t,r,i);case"step":return new aC(t,r,i,l,a);default:return!1}})}getAxesRange(){const t=this.axesX.map((i,s)=>i.calculateScaleRange(this.minMax.x[s],this.scrollbar.x,this.chartRect)),n=this.axesY.map((i,s)=>i.calculateScaleRange(this.minMax.y[s],this.scrollbar.y,this.chartRect));return{x:t,y:n}}drawStaticLayer(t,n){this.axesX.forEach((i,s)=>{i.ctx=t,i.draw(this.chartRect,this.labelOffset,this.axesSteps.x[s],n,this.defaultSelectInfo,this.data.labels)}),this.axesY.forEach((i,s)=>{i.ctx=t,i.draw(this.chartRect,this.labelOffset,this.axesSteps.y[s],n,this.defaultSelectInfo)})}calculateSteps(){const t=this.axesX.map((i,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 i.calculateSteps(l)}),n=this.axesY.map((i,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 i.calculateSteps(l)});return{x:t,y:n}}getAxesLabelRange(){const t=this.axesX.map((i,s)=>{const l=this.axesRange.x[s].size;return i.calculateLabelRange("x",this.chartRect,this.labelOffset,l.width)}),n=this.axesY.map((i,s)=>{const l=this.axesRange.y[s].size;return i.calculateLabelRange("y",this.chartRect,this.labelOffset,l.height)});return{x:t,y:n}}computePixelRatio(){const t=window.devicePixelRatio||1,n=this.displayCtx.webkitBackingStorePixelRatio||this.displayCtx.mozBackingStorePixelRatio||this.displayCtx.msBackingStorePixelRatio||this.displayCtx.oBackingStorePixelRatio||this.displayCtx.backingStorePixelRatio||1;return t/n}prepareLayout(t){this.pixelRatio=t,this.oldPixelRatio!==this.pixelRatio&&(this.oldPixelRatio=this.pixelRatio),this.bufferCtx.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}initScale(){const t=this.computePixelRatio();this.prepareLayout(t),this.overlayCtx&&this.overlayCtx.setTransform(t,0,0,t,0,0)}getChartDOMRect(){var s;const t=(s=this.chartDOM)==null?void 0:s.getBoundingClientRect(),n=(t==null?void 0:t.width)||10,i=(t==null?void 0:t.height)||10;return this.setWidth(n),this.setHeight(i),{width:n,height:i}}getOverlayClientRect(){return!this.cachedOverlayRect&&this.overlayCanvas&&(this.cachedOverlayRect=this.overlayCanvas.getBoundingClientRect()),this.cachedOverlayRect}getChartDOMClientRect(){return!this.cachedChartDOMRect&&this.chartDOM&&(this.cachedChartDOMRect=this.chartDOM.getBoundingClientRect()),this.cachedChartDOMRect}invalidateClientRectCache(){this.cachedOverlayRect=null,this.cachedChartDOMRect=null}getChartRect(){var k,M,Z,S;const{width:t,height:n}=this.getChartDOMRect(),i=this.options.padding,s=(M=(k=this.options.axesX)==null?void 0:k[0])==null?void 0:M.title,l=(S=(Z=this.options.axesY)==null?void 0:Z[0])==null?void 0:S.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 p=i.left+i.right+f,g=i.top+i.bottom+r+c+u,m=t>p?t-p:t,b=n>g?n-g:n,C=i.left,y=Math.max(t-i.right-f,C+2),w=i.top+c,T=Math.max(n-i.bottom-r-u,w+2);return{x1:C,x2:y,y1:w,y2:T,chartWidth:m,chartHeight:b,width:t,height:n}}setWidth(t){if(!this.displayCanvas)return;const n=t*this.pixelRatio;if(this._deviceWidth!==n&&(this._deviceWidth=n,this.displayCanvas.width=n,this.displayCanvas.style.width=`${t}px`,this.bufferCanvas.width=n,this.bufferCanvas.style.width=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.width=n,this.overlayCanvas.style.width=`${t}px`),this.pointsLayerA)){const i=Math.floor(t*this.pixelRatio);this.pointsLayerA.width!==i&&(this.pointsLayerA.width=i,this.pointsLayerB.width=i,this.pointsLayerValid=!1)}}setHeight(t){if(!this.displayCanvas)return;const n=t*this.pixelRatio;if(this._deviceHeight!==n&&(this._deviceHeight=n,this.displayCanvas.height=n,this.displayCanvas.style.height=`${t}px`,this.bufferCanvas.height=n,this.bufferCanvas.style.height=`${t}px`,this.overlayCanvas&&(this.overlayCanvas.height=n,this.overlayCanvas.style.height=`${t}px`),this.pointsLayerA)){const i=Math.floor(t*this.pixelRatio);this.pointsLayerA.height!==i&&(this.pointsLayerA.height=i,this.pointsLayerB.height=i,this.pointsLayerValid=!1)}}getLabelOffset(t=null){const n=this.axesX,i=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)}),i.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,p,g,m,b,C;const i=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=((p=(f=(u=this.options.axesY)==null?void 0:u[0])==null?void 0:f.scrollbar)==null?void 0:p.use)??!1,a=((m=(g=this.scrollbar)==null?void 0:g.x)==null?void 0:m.use)??!1,r=((C=(b=this.scrollbar)==null?void 0:b.y)==null?void 0:C.use)??!1;(s!==a||s||i&&s)&&this.updateScrollbarInfo("x",t),(l!==r||l||i&&l)&&this.updateScrollbarInfo("y",t)}update(t){var b,C,y,w,T,k,M;const n=this.options,i=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:p}=t;if(!this.isInit)return;if((h||r)&&(this._lastHoverSig=""),this.updateScrollbar(h,p),this.resetProps(),this.updateSeries=r,r&&(this.pointsLayerValid=!1),(b=this.options.realTimeScatter)!=null&&b.use&&!this.pointsLayerA&&this.createPointsLayers(),r){const Z=this.seriesList;this.seriesInfo={charts:{pie:[],bar:[],line:[],scatter:[],heatMap:[]},count:0},this.lastTip={pos:null,value:null},this.reconcileSeriesSet(a,n.type,n.horizontal,l,Z),this.legendDOM&&!n.legend.external&&this.updateLegend()}if(c.update&&(this.lastTip.value=null,c.keepDomain||(this.lastTip.pos=null,this.lastHitInfo=null)),!f)if(l.length&&this.addGroupInfo(l),(C=this.options.realTimeScatter)!=null&&C.use?(this.dataSet||(this.dataSet={}),this.createRealTimeScatterDataSet(i)):this.createDataSet(i,s),n.title.show?(this.isInitTitle?this.updateTitle():this.initTitle(),this.showTitle()):this.isInitTitle&&this.hideTitle(),n.legend.show&&!n.legend.external){const Z=!!((w=(y=n.legend)==null?void 0:y.table)!=null&&w.use)&&n.type!=="heatMap"&&n.type!=="scatter";this.isInitLegend?r?this.updateLegend():d?this.forceUpdateLegend():Z&&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="",(k=(T=n.tooltip)==null?void 0:T.formatter)!=null&&k.html||this.setDefaultTooltipLayout()),this.minMax=this.getStoreMinMax(),this.axesX=this.createAxes("x",n.axesX),this.axesY=this.createAxes("y",n.axesY),this.initDefaultSelectInfo();let g=t==null?void 0:t.hitInfo;!(g!=null&&g.legend)&&((M=this.legendHover)!=null&&M.sId)&&(g={...g||{},legend:this.legendHover}),this.render(g),this.dragInfo&&this.drawSelectionArea?this.drawSelectionArea(this.dragInfo):this.dragInfoBackup&&(f?this.drawSelectionArea(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.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,i,s,l,a,r,c;this.invalidateClientRectCache(),this.clear(),this.bufferCtx.restore(),this.bufferCtx.save(),this.pointsLayerValid=!1,((s=(i=(n=this.options.axesX)==null?void 0:n[0])==null?void 0:i.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.initRect(),this.initScale(),this.chartRect=this.getChartRect(),this.drawChart(void 0,!0),this.dragInfoBackup&&((c=this.drawSelectionArea)==null||c.call(this,this.dragInfoBackup)),t&&t(!0)}render(t){this.isInit&&(this.invalidateClientRectCache(),this._vsDetectFailed=!1,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(i=>{var s;return(s=this.seriesList[i])==null?void 0:s.showLegend}).map(i=>[i,this.seriesList[i]]):Object.entries(this.seriesList).filter(([,i])=>i.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 i=this.options.legend,s=this._getLegendSeries();if(i.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.invalidateRectOnScroll&&window.removeEventListener("scroll",this.invalidateRectOnScroll,{capture:!0})),this.isInitTooltip&&this.tooltipDestroy(),this.renderWorkerGate&&this.renderWorkerGate.destroy(),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:i}=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:[]}}i.use&&!this.defaultSelectInfo&&(this.defaultSelectInfo={seriesId:[]})}};Object.assign(Uo.prototype,MC);const AC={name:"EvChartToolbar",props:{toolbar:{type:Object,default:()=>({})}},emits:["onClickToolbar"]},KC={class:"ev-chart-toolbar"},_C={class:"ev-chart-toolbar__icon"};function UC(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon");return o.openBlock(),o.createElementBlock("div",KC,[o.createElementVNode("div",_C,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.$props.toolbar.items,(r,c)=>(o.openBlock(),o.createBlock(a,{key:`${c}-${r.icon}`,class:o.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 $r=de(AC,[["render",UC],["__scopeId","data-v-dfbffbab"]]);class JC{constructor(t,n,i,s,l,a,r){this.isExecuteZoom=l,this.evChartProps=t.props,this.evChartCloneData=n.data,this.brushIdx=a;const c=i.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 i=document.createElement("canvas");i.setAttribute("style","display: block;"),i.setAttribute("class","animation-canvas"),i.style.position="absolute",n.appendChild(i)}),t}setEventListener(t){const n=t?"addEventListener":"removeEventListener";this.isUseZoomMode=t,this.evChartDomContainers.forEach(i=>{i[n]("wheel",this.wrapWheelMoveZoomArea)})}wheelMoveZoomArea(t){t.preventDefault();const[n,i]=this.zoomAreaMemory.current[0];if(n===i)return;let s,l;if(t.deltaY>0){if(!n)return;s=n-1,l=i-1}else{if(i===this.cloneLabelsLastIdx)return;s=n+1,l=i+1}this.isUseToolbar=!0,this.executeZoom(s,l),this.zoomAreaMemory.current[0]=[s,l]}clickMoveZoomArea(t){if(!this.zoomAreaMemory[t].length)return;const[n,i]=this.zoomAreaMemory[t].pop();this.isUseToolbar=!0,this.executeZoom(n,i),this.setZoomAreaMemory(n,i,t==="previous"?"latest":"previous")}dragZoom({data:t,range:{dragSelectionInfo:n}}){const{dragXsp:i,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,p=c[d].labels,g=this.evChartCloneData[d].labels,[m,b]=this.zoomAreaMemory.current[0];let C=g.findIndex(M=>+M.$d==+u.$d),y=g.findLastIndex(M=>+M.$d==+f.$d);const w=M=>l/(p.length-1)*(M-m);let T=w(C);if(C===y&&(T-i>=s-T?C-=1:y+=1),C===m&&y===b)return;C-y===-1&&(T=w(C));const k=w(y);this.evChartZoomOptions.useAnimation?this.dragZoomAnimation(n,C,y,T,k):(this.executeZoom(C,y),this.setZoomAreaMemory(C,y))}}dragZoomAnimation(t,n,i,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,p]=h[u],g=p.getContext("2d");p.style.top=`${a.y1}px`,p.style.left=`${a.x1}px`,p.width=r*d,p.style.width=`${r}px`,p.height=c*d,p.style.height=`${c}px`,p.style.display==="none"&&(p.style.display="block"),this.isAnimationFinish=!1,this.isUseToolbar=!0,this.executeDragZoomAnimation(f,g,t,s,l).then(m=>{p.style.display="none",m&&u===h.length-1&&(this.isAnimationFinish=m,this.executeZoom(n,i),this.setZoomAreaMemory(n,i))})}}executeZoom(t,n){this.isExecuteZoom&&(this.isExecuteZoom.value=!0);for(let i=0;i<this.evChartCloneData.length;i++){const{data:s,labels:l,series:a}=this.evChartCloneData[i],r=this.evChartProps.data[i],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 i=0;i<n.value.length;i++){const s=t.data[n.value[i]];s.labels.length&&(this.brushIdx.start=0,this.brushIdx.end=s.labels.length-1)}}updateEvChartCloneData(t,n,i,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(i),this.setBrushIdx(t,n)}setZoomAreaMemory(t,n,i){if(t<0||n<=0)return;const{previous:s,current:l,latest:a}=this.zoomAreaMemory,r=l.pop(),{bufferMemoryCnt:c}=this.evChartZoomOptions;i?(s.length>=c&&s.splice(0,s.length-c+1),this.zoomAreaMemory[i].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,i,s,l){const{chartRange:a,exceptAxesYChartWidth:r,exceptAxesXChartHeight:c}=i;let d=0,h=s,u=l-s,f=l,p=1;const g=.0015;let m=.5;const b=.1,C=.05,y=50,w=Math.ceil(y*(s/r)),T=Math.ceil(y*((r-l)/r)),k=M=>(n.clearRect(0,0,r,c),h<=0&&u>=r?(t.style.opacity="initial",M(!0)):(m>=b&&(t.style.opacity=m,m-=C),n.globalAlpha=p,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),p-=g,d-=w,h-=w,u+=w+T,f+=T,requestAnimationFrame(()=>k(M))));return new Promise(M=>k(M))}setIconStyle(t){const n=(i,s)=>{s?this.iconStyle(i,"enable"):this.iconStyle(i,"disable")};if(t&&this.dragZoomIcon.classList.contains("active")){const{previous:i,latest:s}=this.zoomAreaMemory;n(this.previousIcon,i.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[i,s]=n==="enable"?[1,"initial"]:[.5,"none"];t.style.opacity=i,t.style.pointerEvents=s}initZoom(){if(!this.isAnimationFinish)return;const[t,n]=this.zoomAreaMemory.current[0],i=this.cloneLabelsLastIdx;(t!==0||n!==i)&&(this.isUseToolbar=!0,this.executeZoom(0,i),this.setZoomAreaMemory(0,i))}}const jC={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,displayOverflow:!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:!0,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,virtualScroll:{use:"auto",threshold:50,estimatedRowHeight:28,overscan:5}},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"},workerRender:!1,shallowDataWatch:!1},QC={series:{},groups:[],labels:[],data:{}},$C=e=>_g({...e},QC),qC=e=>e instanceof Date||e!==null&&typeof e=="object"&&typeof e.toDate=="function"&&typeof e.format=="function",Jo=e=>or(e,function t(n){if(qC(n))return n;if(o.isReactive(n))return or(o.toRaw(n),t)}),e1=()=>{let e=null;const t=200;return{clickEventCallback:s=>{e&&(clearTimeout(e),e=null),e=setTimeout(()=>{s(),e=null},t)},dblClickEventCallback:s=>{e&&(clearTimeout(e),e=null),s()}}},qr=(e,t)=>{var p;const n=o.getCurrentInstance(),{props:i,emit:s}=n,l=g=>{const m=He({},g,jC);return(g.type==="scatter"||g.type==="heatMap")&&!(g!=null&&g.tooltip)&&(m.tooltip.use=!1),g.type==="pie"&&!(g!=null&&g.padding)&&(m.padding={top:2,right:2,left:2,bottom:4}),m},a=$C,r=Ze(i.selectedItem),c=Ze(i.selectedLabel??(e==null?void 0:e.value)),d=Ze(i.selectedSeries),{clickEventCallback:h,dblClickEventCallback:u}=e1(),f={click:async g=>{await o.nextTick(),h(()=>{const{seriesId:m,dataIndex:b,eventTarget:C,targetAxis:y}=(g==null?void 0:g.selected)??{},{eventTarget:w}=(g==null?void 0:g.deselected)??{};switch(C){case"item":{m!==null?(s("update:selectedItem",{seriesID:m,dataIndex:b}),w==="label"&&s("update:selectedLabel",{dataIndex:[]})):s("update:selectedItem",null);break}case"label":{e!=null&&e.value?e.value.dataIndex=b:(s("update:selectedLabel",{dataIndex:b,targetAxis:y}),w==="item"&&s("update:selectedItem",null));break}case"series":{s("update:selectedSeries",{seriesId:m});break}}s("click",g)})},"dbl-click":async g=>{await o.nextTick(),u(()=>{const{eventTarget:m}=g;switch(m){case"series":{s("update:selectedSeries",{seriesId:g.seriesId?[g.seriesId]:[]});break}}s("dbl-click",g)})},"drag-select":async g=>{await o.nextTick(),s("drag-select",g)},"mouse-move":async g=>{t!=null&&t.value&&(t.value=g.hoveredLabel),await o.nextTick(),s("mouse-move",g)},"mouse-leave":()=>{t!=null&&t.value&&(t.value.label=null)},"click-legend":async g=>{await o.nextTick(),s("click-legend",g)},"update:legendData":async g=>{await o.nextTick(),s("update:legendData",g)},"axes-scale-change":g=>{s("axes-scale-change",g)}};return(p=n.vnode.props)!=null&&p.onAxesDataMaxChange&&(f["axes-data-max-change"]=g=>{s("axes-data-max-change",g)}),{eventListeners:f,selectItemInfo:r,selectLabelInfo:c,selectSeriesInfo:d,getNormalizedData:a,getNormalizedOptions:l}},ec=e=>{const t=o.ref(),n=o.computed(()=>{const i=s=>{let l;return s?l=s.unit?s.value+s.unit:`${s.value}px`:l=void 0,l};return{width:i(ra(e.width)),height:i(ra(e.height))}});return{wrapper:t,wrapperStyle:n}},tc=(e,{wrapper:t,evChartGroupRef:n},i,s)=>{const{props:l,emit:a}=o.getCurrentInstance(),r=o.ref(!1),c=o.ref(!1),d=o.ref(!0),h=o.ref(),u=o.reactive({zoom:e.zoom}),f=o.reactive({start:0,end:-1,isUseButton:!1,isUseScroll:!1});let p=null;const g=o.reactive({dom:[],props:{data:[],options:[]}}),m=o.reactive({data:null,options:null}),b=o.ref([]),C=x=>{x.data.length&&x.range&&c.value&&p.dragZoom(x)},y=()=>{g.props.options.forEach((x,L)=>{if(x.zoom={...x.zoom,use:c.value,getRangeInfo:C},c.value)x.dragSelection={...x.dragSelection,use:!0,keepDisplay:!1};else{const{use:I,keepDisplay:V}=m.options[L].dragSelection??{};x.dragSelection={use:!!I,keepDisplay:!!V}}})},w=()=>{if(n!=null&&n.value?(g.dom=n.value.querySelectorAll(".ev-chart-container"),g.dom.length&&s.value.forEach(({data:x,options:L},I)=>{x.chartIdx=I,g.props.data.push(x),g.props.options.push(L),b.value.push(I)})):(g.dom=[t.value.querySelector(".ev-chart-container")],g.props.data.push(l.data),g.props.options.push(l.options)),g.props.data.length){m.data=Ze(g.props.data),m.options=Ze(g.props.options);const x={updateZoomStartIdx:L=>a("update:zoomStartIdx",L),updateZoomEndIdx:L=>a("update:zoomEndIdx",L)};p=new JC(g,m,u,h.value,r,f,x)}},T=x=>{m.data[0].labels.length<=1||(c.value=!c.value,x?x.classList.toggle("active"):h.value.querySelector(".dragZoom").classList.toggle("active"),y(),p.setIconStyle(c.value),p.setEventListener(c.value))},k=(x,L)=>{if(p.isAnimationFinish)switch(L){case"dragZoom":T(x.target);break;case"reset":p.initZoom();break;case"previous":case"latest":p.clickMoveZoomArea(L);break}};o.onUpdated(()=>{p&&h.value&&p.setIcon(h.value)});const M=x=>{!_e(x.zoom,u.zoom)&&(u.zoom=x.zoom,p?(!u.zoom.toolbar.show&&c.value&&T(),p.setEvChartZoomOptions(u.zoom)):u.zoom.toolbar.show&&!n&&w())},Z=x=>{d.value?(r.value||(m.data=n?Jo(x):[Jo(x)],u.zoom.keepZoomStatus?d.value=!1:(c.value=!1,y()),p&&p.updateEvChartCloneData(m,b,c.value,u.zoom.keepZoomStatus)),r.value=!1):d.value=!0},S=(x,L)=>{if(p.isUseToolbar){p.isUseToolbar=!1;return}c.value&&(p.executeZoom(x,L),p.setZoomAreaMemory(x,L))};return o.watch(()=>[f.start,f.end],([x,L],[I])=>{if(i!=null&&i.value)if(typeof i.value.dataIndex=="number")x>=(I??0)?i.value.dataIndex-=x-(I??0):i.value.dataIndex+=I-x;else for(let V=0;V<i.value.dataIndex.length;V++)x>=(I??0)?i.value.dataIndex[V]-=x-(I??0):i.value.dataIndex[V]+=I-x;(f.isUseButton||f.isUseScroll)&&p.executeZoom(x,L)}),o.watch(()=>[f.isUseButton,f.isUseScroll],([x,L],[I,V])=>{I&&!x?p.setZoomAreaMemory(f.start,f.end):V&&!L&&(p.zoomAreaMemory.current[0]=[f.start,f.end])}),{evChartZoomOptions:u,evChartInfo:g,evChartToolbarRef:h,evChartClone:m,brushIdx:f,createEvChartZoom:w,setOptionsForUseZoom:M,setDataForUseZoom:Z,controlZoomIdx:S,onClickToolbar:k}},t1={name:"EvChart",components:{EvChartToolbar:$r},directives:{resize:En},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","axes-data-max-change"],setup(e,{emit:t}){let n=null;const i=o.ref(!1),s=o.inject("isChartGroup",!1),l=o.inject("brushSeries",{list:[],chartIdx:null}),a=o.inject("groupSelectedLabel",null),r=o.inject("groupHoveredLabel",null),c=o.inject("brushIdx",{start:0,end:-1}),d=o.inject("evChartPropsInGroup",[]),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:p,getNormalizedData:g,getNormalizedOptions:m}=qr(a,r),b=g(e.data),C=m(e.options),y=o.computed(()=>e.selectedLabel),w=o.computed(()=>e.selectedItem),{wrapper:T,wrapperStyle:k}=ec(C),{evChartZoomOptions:M,evChartToolbarRef:Z,createEvChartZoom:S,setOptionsForUseZoom:x,setDataForUseZoom:L,controlZoomIdx:I,onClickToolbar:V}=s?{}:tc(C,{wrapper:T,evChartGroupRef:null},e.selectedLabel?y:w,d);let v=null,E=null;const G=B=>{var Y;v?(B.updateSeries&&(v.updateSeries=!0),B.updateData&&(v.updateData=!0),B.updateLegend&&(v.updateLegend=!0),B.updateTooltip&&(v.updateTooltip=!0),(Y=B.updateSelTip)!=null&&Y.update&&(v.updateSelTip??(v.updateSelTip={}),v.updateSelTip.update=!0)):v={...B},clearTimeout(E),E=setTimeout(()=>{v&&n&&n.update(v),v=null,E=null},0)},R=()=>{var O;let B;C.selectLabel.use?B=f:C.selectSeries.use&&(B=p);const Y=(O=e.options.realTimeScatter)!=null&&O.use?{...e.data,groups:[],labels:[]}:b;n=new Uo(T.value,Y,C,h,u,B,l)},X=()=>{n&&(n.init(),!s&&C.zoom.toolbar.show&&S(),C.legend.show&&C.legend.external&&n.emitLegendData())};o.watch(()=>e.options,B=>{var Q,U;const Y=m(B),O=((U=(Q=n.options)==null?void 0:Q.legend)==null?void 0:U.show)??!1,_=!_e(Y.legend.table,n.options.legend.table),A=Y.tooltip.use&&!_e(Y.tooltip,n.options.tooltip);n.options=Y,G({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1},updateLegend:_,updateTooltip:A}),Y.legend.show&&Y.legend.external&&!O&&n.emitLegendData(),s||x(Y)},{deep:!0,flush:"post"}),o.watch(()=>e.data,B=>{var U,ee;const Y=(U=e.options.realTimeScatter)!=null&&U.use?{...B,groups:[],labels:[]}:g(B),O=!_e(Y.series,n.data.series),_=!_e(Y.groups,n.data.groups),A=O||_||e.options.type==="heatMap",Q=O||_||!_e(Y.labels,n.data.labels)||!_e(Y.data,n.data.data);n.data=(ee=e.options.realTimeScatter)!=null&&ee.use?Y:Jo(Y),G({updateSeries:A,updateSelTip:{update:!0,keepDomain:!1},updateData:Q}),!s&&Q&&L(Y)},{deep:!C.shallowDataWatch,flush:"post"}),s&&!(a!=null&&a.value)&&o.watch(()=>c.start,(B,Y)=>{if(y!=null&&y.value)for(let O=0;O<y.value.dataIndex.length;O++)B>=(Y??0)?y.value.dataIndex[O]-=B-(Y??0):y.value.dataIndex[O]+=Y-B;else w!=null&&w.value&&(B>=(Y??0)?w.value.dataIndex-=B-(Y??0):w.value.dataIndex+=Y-B)}),o.watch(()=>w.value,B=>{const Y=e.options.type;n.selectItemByData(B,Y)},{deep:!0,flush:"post"}),o.watch(()=>(a==null?void 0:a.value)??y.value,B=>{B!=null&&B.dataIndex&&n.selectLabelByData(B.dataIndex,B==null?void 0:B.targetAxis)},{deep:!0,flush:"post"}),o.watch(()=>e.selectedSeries,B=>{var Y;(Y=C.selectSeries)!=null&&Y.use?B.seriesId&&n.selectSeriesByData(B.seriesId):console.warn("[EVUI][Chart] selectSeries.use is false, so selectedSeries is not working")},{deep:!0,flush:"post"}),s||o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([B,Y])=>{I(B,Y)}),o.watch(()=>e.realTimeScatterReset,B=>{B&&(Object.keys(n.dataSet??{}).forEach(Y=>{n.dataSet[Y]&&(n.dataSet[Y].dataGroup=[])}),t("update:realTimeScatterReset",!1))}),o.watch(()=>{var B;return(B=e.options.realTimeScatter)==null?void 0:B.use},B=>{n.options.realTimeScatter.use=B??!1,n.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}),o.watch(()=>r==null?void 0:r.value,B=>{B&&e.options.syncHover!==!1&&(B.label==null?n.overlayClear():n.drawSyncedIndicator(B))},{deep:!0,flush:"post"}),o.onMounted(async()=>{d!=null&&d.value&&d.value.push(e),await R(),await X(),i.value=!0}),o.onBeforeUnmount(()=>{var B;clearTimeout(E),v=null,E=null,n&&"destroy"in n&&n.destroy(),(B=d==null?void 0:d.value)!=null&&B.length&&(d.value.length=0),i.value=!1}),o.onDeactivated(()=>{n&&"hideTooltip"in n&&n.hideTooltip()});const W=B=>{n==null||n.toggleSeries(B)},N=B=>{n==null||n.highlightSeries(B)},P=()=>{n==null||n.unhighlightSeries()},D=()=>{n&&"update"in n&&n.update({updateSeries:!0,updateSelTip:{update:!0,keepDomain:!1}})},H=es(()=>{n&&"resize"in n&&n.resize()},e.resizeTimeout);return o.onActivated(()=>{i.value&&H()}),{wrapper:T,wrapperStyle:k,onResize:H,redraw:D,toggleSeries:W,highlightSeries:N,unhighlightSeries:P,evChartToolbarRef:Z,injectIsChartGroup:s,onClickToolbar:V,normalizedOptions:C,zoomOptions:o.toRef(M??{zoom:{}},"zoom")}}},n1={key:0,ref:"evChartToolbarRef"};function i1(e,t,n,i,s,l){var c;const a=o.resolveComponent("ev-chart-toolbar"),r=o.resolveDirective("resize");return o.openBlock(),o.createElementBlock(o.Fragment,null,[(c=i.zoomOptions.toolbar)!=null&&c.show&&!i.injectIsChartGroup?(o.openBlock(),o.createElementBlock("div",n1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",{ref:"wrapper",style:o.normalizeStyle(i.wrapperStyle),class:"ev-chart"},null,4),[[r,i.onResize]])],64)}const bi=de(t1,[["render",i1]]);bi.install=e=>{e.component(bi.name,bi)};const s1={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"}}}}},o1=()=>{const e=o.ref(!1),t=o.ref(),n=o.ref([]),i=o.reactive({list:[],chartIdx:null});return{getNormalizedOptions:l=>He({},l,s1),isExecuteZoom:e,brushSeries:i,evChartGroupRef:t,evChartPropsInGroup:n}},l1={name:"EvChartGroup",components:{evChartToolbar:$r},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:i,brushSeries:s,evChartGroupRef:l,evChartPropsInGroup:a}=o1(),r=n(e.options);o.provide("isExecuteZoom",i),o.provide("isChartGroup",!0),o.provide("brushSeries",s),o.provide("evChartPropsInGroup",a);const c=o.computed({get:()=>e.groupSelectedLabel,set:T=>t("update:groupSelectedLabel",T)});o.provide("groupSelectedLabel",c);const d=o.ref(null);o.provide("groupHoveredLabel",d),o.watch(()=>e.options.syncHover,T=>{T?d.value={label:"",horizontal:!1}:d.value=null},{immediate:!0});const{evChartZoomOptions:h,evChartInfo:u,evChartToolbarRef:f,evChartClone:p,brushIdx:g,createEvChartZoom:m,setOptionsForUseZoom:b,setDataForUseZoom:C,controlZoomIdx:y,onClickToolbar:w}=tc(r,{wrapper:null,evChartGroupRef:l},c,a);return o.provide("evChartClone",p),o.provide("evChartInfo",u),o.provide("brushIdx",g),o.onMounted(()=>{m()}),o.watch(()=>u.props.data,T=>{C(T)},{deep:!0}),o.watch(()=>e.options,T=>{const k=n(T);b(k)},{deep:!0}),o.watch(()=>[e.zoomStartIdx,e.zoomEndIdx],([T,k])=>{g.isUseButton||g.isUseScroll||y(T,k)}),{evChartGroupRef:l,evChartToolbarRef:f,zoomOptions:o.toRef(h,"zoom"),onClickToolbar:w}}},a1={key:0,ref:"evChartToolbarRef"},r1={ref:"evChartGroupRef",class:"ev-chart-group__wrapper"};function c1(e,t,n,i,s,l){const a=o.resolveComponent("ev-chart-toolbar");return o.openBlock(),o.createElementBlock(o.Fragment,null,[i.zoomOptions.toolbar.show?(o.openBlock(),o.createElementBlock("div",a1,[o.createVNode(a,{toolbar:i.zoomOptions.toolbar,onOnClickToolbar:i.onClickToolbar},null,8,["toolbar","onOnClickToolbar"])],512)):o.createCommentVNode("",!0),o.createElementVNode("div",r1,[o.renderSlot(e.$slots,"default",{},void 0,!0)],512)],64)}const yi=de(l1,[["render",c1],["__scopeId","data-v-b1c0c322"]]);yi.install=e=>{e.component(yi.name,yi)};const Me={WHEEL:{UP:"MOVEUP_WHEEL",DOWN:"MOVEDOWN_WHEEL"},GRAB:{UP:"MOVEUP_GRAB",DOWN:"MOVEDOWN_GRAB"},BUTTON:{INCREASE:"INCREASE",DECREASE:"DECREASE"}},Be={LEFT:"leftX",RIGHT:"rightX"};let d1=class{constructor(t,n,i,s,l){this.evChart=t,this.evChartBrushOptions=i,this.evChartBrushRef=l,this.evChartData=n,this.brushIdx=s,i.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 i=this.evChartBrushRef.value.querySelector(".brush-canvas");if(i)this.drawBrushRect({brushCanvas:i,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:i,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,i,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,i,s){const{brushButtonWidth:l,brushCanvasWidth:a,axesXInterval:r,pixelRatio:c}=t;!i&&this.debounceBrushIdx&&(this.debounceBrushIdx.start=this.brushIdx.start,this.debounceBrushIdx.end=this.brushIdx.end);const d=this.debounceBrushIdx??this.brushIdx;switch(s){case Me.BUTTON.INCREASE:case Me.BUTTON.DECREASE:this.brushRectWidth=a*c,this.curBrushButtonType===Be.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===Be.RIGHT&&(this.brushRectWidth=n-this.beforeBrushRectX,this.brushRectWidth<=l?this.brushRectWidth=l:(this.brushRectX=this.beforeBrushRectX,this.beforeBrushRectWidth=this.brushRectWidth+this.brushRectX));break;case Me.GRAB.UP:case Me.GRAB.DOWN:this.brushRectX<=0&&s===Me.GRAB.DOWN||this.brushRectX+this.brushRectWidth>=a&&s===Me.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}const h=a*c;return s===Me.BUTTON.INCREASE||s===Me.BUTTON.DECREASE?(this.brushRectX<0&&(this.brushRectWidth+=this.brushRectX,this.brushRectX=0),this.brushRectX+this.brushRectWidth>h&&(this.brushRectWidth=h-this.brushRectX)):this.brushRectX<0?this.brushRectX=0:this.brushRectX+this.brushRectWidth>h&&(this.brushRectX=h-this.brushRectWidth),this.brushRectWidth>h&&(this.brushRectWidth=h),{brushRectX:this.brushRectX,brushRectWidth:this.brushRectWidth}}drawBrush(t,n,i,s){const{brushButtonWidth:l,brushCanvasHeight:a,brushCanvasWidth:r,axesXInterval:c,pixelRatio:d}=t,{brushRectX:h,brushRectWidth:u}=n,{height:f,selection:{fillColor:p,opacity:g}}=this.evChartBrushOptions.value,m=f-i.y1,b=h,C=h+u;s.style.position||(s.style.position="absolute",s.style.top=`${i.y1}px`,s.style.left=`${i.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=p,y.globalAlpha=g,y.fillRect(h,0,u,m),y.fillRect(b,0,l,m),y.fillRect(C-l,0,l,m),this.brushPosInfo={leftX:b/d,rightX:C/d,buttonWidth:l,axesXInterval:c,...t,...n}}getCanvasOffsetX(t){const n=this.brushCanvas.getBoundingClientRect();return t.clientX-n.left}addEvent(){let t;const n=l=>{if(this.isDragMode){const a=this.getCanvasOffsetX(l);this.mouseDownAndMove({offsetX:a})}};this.onDocumentMouseMove=ns(n,5),this.onDocumentMouseUp=()=>{document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),this.initEventState()},this.onMouseDown=l=>{l.preventDefault(),t.isInsideButton?this.isDragMode="button":t.isInsideBrush?(this.clickBrushInsideX=l.offsetX,this.isDragMode="grab"):t.isOutsideBrush&&this.teleportBrush(l),this.isDragMode&&(document.addEventListener("mousemove",this.onDocumentMouseMove),document.addEventListener("mouseup",this.onDocumentMouseUp))};const i=l=>{this.isDragMode||(t=this.getMousePosition(l),this.changeCursor(t))};this.onMouseMove=ns(i,5),this.onWheel=l=>{l.preventDefault();const a=l.deltaY>0?Me.WHEEL.DOWN:Me.WHEEL.UP;this.updateBrushIdx(a),this.debounceBrushIdx&&this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:a}),this.brushIdx.isUseScroll=!0},this.onMouseUp=()=>{this.initEventState()};const s=()=>{this.initEventState()};this.onWheelDebounce=es(s,100),this.setEventListener("addEventListener")}getMousePosition(t){const n=d=>Math.abs(this.brushPosInfo[d]-t.offsetX),i=n(Be.RIGHT)>n(Be.LEFT)?Be.LEFT:Be.RIGHT,s=d=>t.offsetX>this.brushPosInfo[d],l=d=>t.offsetX<this.brushPosInfo[d],a=l(Be.LEFT)||s(Be.RIGHT),r=s(Be.LEFT)&&l(Be.RIGHT),c=t.offsetX+this.brushPosInfo.buttonWidth>=this.brushPosInfo[i]&&t.offsetX-this.brushPosInfo.buttonWidth<=this.brushPosInfo[i];return this.curBrushButtonType=c&&i,{isInsideButton:c,isInsideBrush:r,isOutsideBrush:a}}destroy(){if(this.brushCanvas&&(this.setEventListener("removeEventListener"),document.removeEventListener("mousemove",this.onDocumentMouseMove),document.removeEventListener("mouseup",this.onDocumentMouseUp),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.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,i=(n.end-n.start)/2;let s,l,a;i>.5?(n.end-n.start)%2===0?(a=Math.round(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.ceil(t.offsetX/this.brushPosInfo.axesXInterval),s=Math.ceil(i),l=Math.floor(i)):(a=Math.floor(t.offsetX/this.brushPosInfo.axesXInterval),t.offsetX-a*this.brushPosInfo.axesXInterval>this.brushPosInfo.axesXInterval/2?(s=Math.floor(i),l=Math.ceil(i)):(s=Math.ceil(i),l=Math.floor(i),i<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 i;t.offsetX>this.beforeMouseXPos?this.isDragMode==="grab"?this.clickBrushInsideX<t.offsetX-n&&(i=Me.GRAB.UP,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX+n):t.offsetX-this.brushPosInfo[this.curBrushButtonType]>n&&(i=this.curBrushButtonType===Be.LEFT?Me.BUTTON.DECREASE:Me.BUTTON.INCREASE,this.brushIdx.isUseButton=!0):t.offsetX<this.beforeMouseXPos&&(this.isDragMode==="grab"?this.clickBrushInsideX>t.offsetX+n&&(i=Me.GRAB.DOWN,this.isUseBrushGrab=!0,this.brushIdx.isUseScroll=!0,this.clickBrushInsideX=t.offsetX-n):this.brushPosInfo[this.curBrushButtonType]-t.offsetX>n&&(i=this.curBrushButtonType===Be.LEFT?Me.BUTTON.INCREASE:Me.BUTTON.DECREASE,this.brushIdx.isUseButton=!0)),this.debounceBrushIdx?this.drawBrushRect({brushCanvas:this.brushCanvas,isDebounce:!0,mode:i,offsetX:t.offsetX}):this.updateBrushIdx(i),this.beforeMouseXPos=t.offsetX}updateBrushIdx(t){const n=this.debounceBrushIdx??this.brushIdx;switch(t){case Me.WHEEL.UP:case Me.GRAB.UP:if(n.end>=this.labelEndIdx)return;n.start+=1,n.end+=1;break;case Me.WHEEL.DOWN:case Me.GRAB.DOWN:if(n.start<=0)return;n.start-=1,n.end-=1;break;case Me.BUTTON.INCREASE:if(this.curBrushButtonType===Be.LEFT){if(!n.start)return;n.start-=1}else{if(n.end===this.labelEndIdx)return;n.end+=1}break;case Me.BUTTON.DECREASE:if(n.start===n.end-1)return;this.curBrushButtonType===Be.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===Be.LEFT?(s=Math.round(s),l=this.brushIdx.end,s===l&&(s-=1)):this.curBrushButtonType===Be.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:i}=t();this.brushIdx.start===n&&this.brushIdx.end===i&&this.drawBrushRect({brushCanvas:this.brushCanvas}),this.brushIdx.start=n??this.debounceBrushIdx.start,this.brushIdx.end=i??this.debounceBrushIdx.end}initEventState(){if(this.isCleaningUp)return;this.isCleaningUp=!0,new Promise(n=>{this.updateBrushIdxUseXPos(),n(!0)}).then(n=>{n&&(this.clickBrushInsideX=null,this.isDragMode=null,this.beforeMouseXPos=null,this.curBrushButtonType=null,this.isUseBrushGrab=!1,this.offsetXAndRectXInterval=null,this.brushIdx.isUseButton=!1,this.brushIdx.isUseScroll=!1),this.isCleaningUp=!1})}};const h1={show:!0,useDebounce:!0,chartIdx:0,height:100,showLabel:!1,selection:{fillColor:"#38ACEC",opacity:.65},useWheelMove:!0},u1=()=>({getNormalizedBrushOptions:t=>He({},t,h1)}),f1={name:"EvChartBrush",directives:{resize:En},props:{options:{type:Object,default:()=>({})}},setup(e){let t=null,n=null;const i=o.ref(!1),s=o.inject("evChartClone",{data:[]}),l=o.inject("evChartInfo",{props:{options:[]}}),a=o.inject("brushIdx",{start:0,end:-1,isUseButton:!1,isUseScroll:!1}),r=o.inject("brushSeries",{list:[],chartIdx:null}),{getNormalizedBrushOptions:c}=u1(),d=o.computed(()=>c(e.options)),{eventListeners:h,selectItemInfo:u,selectLabelInfo:f,selectSeriesInfo:p,getNormalizedData:g,getNormalizedOptions:m}=qr(),b=o.computed(()=>g((s.data??[])[d.value.chartIdx])),C=o.computed(()=>{var I,V;const x=l.props.options[d.value.chartIdx],L={...x,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:[{...(I=x==null?void 0:x.axesX)==null?void 0:I[0],title:{use:!1}}],axesY:[{...(V=x==null?void 0:x.axesY)==null?void 0:V[0],title:{use:!1}}]};return m(L)}),{wrapper:y,wrapperStyle:w}=ec(C.value);o.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}}))}),o.watch(C,(x,L)=>{var I;x.brush.chartIdx<=((I=s.data)==null?void 0:I.length)-1?n&&!_e(L.brush,x.brush)?n.removeBrushWrapper():t&&!_e(x,L)&&(t.options=Ze(x),t.update({updateSeries:!1,updateSelTip:{update:!1,keepDomain:!1}})):(t.data=Ze(b.value),t.update({updateSeries:!0,updateSelTip:{update:!1,keepDomain:!1},updateData:!1}),n.removeBrushCanvas())}),o.watch(()=>s.data,x=>{if(t){const L=x[d.value.chartIdx];if(L){const I=!_e(L.series,t.data.series),V=r.list[d.value.chartIdx];typeof V=="object"&&Object.keys(V).length&&Object.keys(L.series).forEach(v=>{var E;"show"in L.series[v]||(L.series[v].show=((E=V[v])==null?void 0:E.show)??!0)}),t.data=Ze(g(L)),t.update({updateSeries:I,updateSelTip:{update:!1,keepDomain:!1},updateData:!1})}}});const T=()=>{let x;C.value.selectLabel.use?x=f:C.value.selectSeries.use&&(x=p),t=new Uo(y.value,b.value,C.value,h,u,x)},k=()=>{n=new d1(t,b,d,a,y)},M=()=>{t&&t.init()},Z=x=>{n&&n.init(x)};o.watch(()=>[a.start,a.end],()=>{var x;y.value&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1&&Z()}),o.onMounted(async()=>{d.value.show&&(await T(),await M(),k(),Z()),i.value=!0}),o.onUpdated(async()=>{var x;if(d.value.show&&d.value.chartIdx<=((x=s.data)==null?void 0:x.length)-1){const L=r.list[d.value.chartIdx];typeof L=="object"&&Object.keys(L).length&&Object.keys(b.value.series).forEach(I=>{var V;"show"in b.value.series[I]||(b.value.series[I].show=((V=L[I])==null?void 0:V.show)??!0)}),await T(),await M(),k(),Z()}}),o.onBeforeUnmount(()=>{t&&"destroy"in t&&t.destroy(),n&&n.destroy(),i.value=!1}),o.onDeactivated(()=>{t&&"hideTooltip"in t&&t.hideTooltip()});const S=es(()=>{t&&"resize"in t&&new Promise(L=>t.resize(L)).then(L=>{L&&Z(L)})},0);return o.onActivated(()=>{i.value&&S()}),{evChartBrushOptions:d,evChartBrushRef:y,evChartBrushStyle:w,onResize:S}}};function m1(e,t,n,i,s,l){const a=o.resolveDirective("resize");return i.evChartBrushOptions.show?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,ref:"evChartBrushRef",style:o.normalizeStyle(i.evChartBrushStyle),class:"ev-chart-brush"},null,4)),[[a,i.onResize]]):o.createCommentVNode("",!0)}const xi=de(f1,[["render",m1]]);xi.install=e=>{e.component(xi.name,xi)};const p1={name:"TreeGridNode",components:{GridOptionButton:Ho},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,w)=>{t("check-tree-data",y,w)},i=y=>{t("expand-tree-data",y)},s=(y,w)=>{t("click-tree-data",y,w)},l=(y,w)=>{t("dbl-click-tree-data",y,w)},a=y=>{t("context-menu",y)},r=y=>{const w=e.expandIcon?e.expandIcon:"",T=e.expandIcon?e.collapseIcon:"";return y.expand?T:w},c=o.computed(()=>e.nodeData||{}),d=o.computed(()=>e.parentIcon||"tree-parent-icon"),h=o.computed(()=>e.childIcon||"tree-child-icon"),u=o.computed(()=>d.value!=="none"||h.value!=="none"),f=o.computed(()=>{const y=e.orderedColumns||[],w=y.findIndex(k=>k.expandColumn&&!k.hide&&!k.hiddenDisplay);if(w!==-1)return w;const T=y.findIndex(k=>!k.hide&&!k.hiddenDisplay);return T!==-1?T:0}),p=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"}),g=o.computed(()=>({cell:!0,"row-checkbox":!0,"non-border":!!e.borderStyle}));return{parentIconMV:d,childIconMV:h,node:c,isDataIcon:u,checkboxClass:g,expandColumnIdx:f,onCheck:n,onExpand:i,onClick:s,onDblClick:l,onContextMenu:a,expandIconClasses:r,getRowClass:p,getColumnClass:(y,w)=>({cell:!0,"tree-td":w===0,[y.type]:y.type,[y.align]:y.align,[y.field]:y.field,"non-border":!!e.borderStyle}),getColumnStyle:(y,w)=>({width:`${y.width}px`,height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,"min-width":`${e.minWidth}px`,"border-right":e.orderedColumns.length-1===w?"none":"1px solid #CFCFCF"}),getDepthStyle:y=>({"margin-left":`${y*13}px`})}}},g1=["data-index"],b1=["data-name","data-index"],y1={class:"td-content__wrapper"},x1=["title"],S1={class:"td-content"};function C1(e,t,n,i,s,l){var d;const a=o.resolveComponent("ev-checkbox"),r=o.resolveComponent("ev-icon"),c=o.resolveComponent("grid-option-button");return o.openBlock(),o.createElementBlock("tr",{"data-index":i.node.index,class:o.normalizeClass(i.getRowClass(i.node)),onClick:t[7]||(t[7]=h=>i.onClick(h,i.node)),onDblclick:t[8]||(t[8]=h=>i.onDblClick(h,i.node))},[n.useCheckbox.use?(o.openBlock(),o.createElementBlock("td",{key:0,class:o.normalizeClass(i.checkboxClass),style:o.normalizeStyle({width:`${n.minWidth}px`,height:`${n.rowHeight}px`,"border-right":"1px solid #CFCFCF"})},[o.createVNode(a,{modelValue:i.node.checked,"onUpdate:modelValue":t[0]||(t[0]=h=>i.node.checked=h),disabled:i.node.uncheckable,indeterminate:i.node.indeterminate,class:"row-checkbox-input",onChange:t[1]||(t[1]=h=>i.onCheck(h,i.node))},null,8,["modelValue","disabled","indeterminate"])],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.orderedColumns,(h,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:u},[!h.hide&&!h.hiddenDisplay?(o.openBlock(),o.createElementBlock("td",{key:0,"data-name":h.field,"data-index":i.node.index,class:o.normalizeClass(i.getColumnClass(h,u)),style:o.normalizeStyle(i.getColumnStyle(h,u))},[o.createElementVNode("div",y1,[u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:0,style:o.normalizeStyle(i.getDepthStyle(i.node.level))},null,4)):o.createCommentVNode("",!0),u===i.expandColumnIdx?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[i.node.hasChild?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[i.expandIconClasses(i.node)?(o.openBlock(),o.createBlock(r,{key:0,icon:i.expandIconClasses(i.node),style:{display:"block"},onClick:t[2]||(t[2]=f=>i.onExpand(i.node))},null,8,["icon"])):(o.openBlock(),o.createElementBlock("button",{key:1,class:"tree-expand-icon",onClick:t[3]||(t[3]=o.withModifiers(f=>i.onExpand(i.node),["stop"]))},[...t[9]||(t[9]=[o.createElementVNode("i",null,null,-1)])]))],64)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),u===i.expandColumnIdx&&i.isDataIcon?(o.openBlock(),o.createElementBlock("span",{key:2,title:i.node[h.field],class:o.normalizeClass({expand:i.node.expand,"ev-tree-toggle":!0})},[o.createElementVNode("span",{class:o.normalizeClass(i.node.hasChild?i.parentIconMV:i.childIconMV)},[...t[10]||(t[10]=[o.createElementVNode("i",null,null,-1)])],2)],10,x1)):o.createCommentVNode("",!0),o.createElementVNode("div",S1,[e.$slots[h.field+"Node"]?o.renderSlot(e.$slots,h.field+"Node",{key:0,item:{data:i.node.data}},void 0,!0):o.createCommentVNode("",!0)])])],14,b1)):o.createCommentVNode("",!0)],64))),128)),(d=n.customContextMenu)!=null&&d.length?(o.openBlock(),o.createElementBlock("td",{key:1,class:o.normalizeClass({"row-contextmenu":!0,"non-border":!!n.borderStyle}),style:o.normalizeStyle({position:"sticky",right:0,width:"30px",height:`${n.rowHeight}px`,"min-width":"30px","line-height":`${n.rowHeight}px`})},[e.$slots.contextmenuIconNode?(o.openBlock(),o.createElementBlock("span",{key:0,class:"row-contextmenu__btn",onClick:[t[4]||(t[4]=h=>i.onContextMenu(h)),t[5]||(t[5]=o.withModifiers((...h)=>n.menuRef.show&&n.menuRef.show(...h),["prevent"]))]},[o.renderSlot(e.$slots,"contextmenuIconNode",{},void 0,!0)])):(o.openBlock(),o.createBlock(c,{key:1,icon:"ev-icon-warning2",class:"row-contextmenu__btn",onClick:[t[6]||(t[6]=h=>i.onContextMenu(h)),o.withModifiers(n.menuRef.show,["prevent"])]},null,8,["onClick"]))],6)):o.createCommentVNode("",!0)],42,g1)}const k1=de(p1,[["render",C1],["__scopeId","data-v-faab3696"]]),w1={name:"EvTreeGridToolbar"},I1={class:"tree-grid-toolbar"};function L1(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("div",I1,[o.renderSlot(e.$slots,"toolbarWrapper")])}const T1=de(w1,[["render",L1]]),M1=e=>{const{props:t}=o.getCurrentInstance(),{checkInfo:n}=e;return{isRenderer:(d={})=>{var h;return!!((h=d==null?void 0:d.render)!=null&&h.use)},getComponentName:(d="")=>{const h=p=>p.charAt(0).toUpperCase()+p.slice(1),u="Renderer";let f="";if(d.indexOf("_")!==-1){const p=d.split("_");for(let g=0;g<p.length;g++)f+=h(p[g])}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=Qt(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(p=>p.checked),f=d.every(p=>h.includes(p));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}}},ms=e=>{const{originColumns:t,filteredColumns:n}=e;return t.map(i=>{const s=n.find(l=>l.index===i.index)??{};return{...i,...s}})},v1=e=>{const{scrollInfo:t,stores:n,elementInfo:i,resizeInfo:s,pageInfo:l,summaryScroll:a,getPagingData:r,updatePagingInfo:c}=e,d=f=>{let p=n.showTreeStore;l.isClientPaging&&(p=r());const g=i.body;if(g){const m=s.rowHeight,b=g.clientHeight>m?Math.ceil(g.clientHeight/m):p.length,C=p.length*m;let y=Math.floor(g.scrollTop/m);y>p.length-1&&(y=0);const w=y+b+1,T=Math.max(y,0),k=w,M=i.table;n.viewStore=p.slice(T,k),t.hasVerticalScrollBar=b<p.length||g.clientHeight<M.clientHeight,t.vScrollTopHeight=T*m,t.vScrollBottomHeight=C-n.viewStore.length*m-t.vScrollTopHeight,f&&l.isInfinite&&t.vScrollBottomHeight===0&&(l.prevPage=l.currentPage,l.currentPage=Math.ceil(k/l.perPage)+1,l.startIndex=k,c({onScrollEnd:!0}))}},h=()=>{const f=i.header,p=i.body,g=i.table;f.scrollLeft=p.scrollLeft,a.value=p.scrollLeft,t.hasHorizontalScrollBar=p.clientWidth<g.clientWidth};return{updateVScroll:d,updateHScroll:h,onScroll:()=>{const f=i.body,p=f.scrollTop,g=f.scrollLeft,m=t.lastScroll.top,b=t.lastScroll.left,C=g!==b;p!==m&&f.clientHeight&&d(!0),C&&h(),t.lastScroll.top=p,t.lastScroll.left=g}}},R1=e=>{const{props:t,emit:n}=o.getCurrentInstance(),{resizeInfo:i,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 b=i.columnWidth;i.columnWidth>0&&(b=i.columnWidth),b=i.columnWidth;let C=0;if(i.adjust&&s.body){const y=s.body;let w=y.offsetWidth;const T=y.offsetHeight,k=a.orderedColumns.reduce((M,Z)=>(Z.hide||Z.hiddenDisplay||(Z.width?M.totalWidth+=Z.width:M.emptyCount++),M),{totalWidth:h.customContextMenu.length?30:0,emptyCount:0});if(i.rowHeight*m.length>T-i.scrollWidth&&(w-=i.scrollWidth),l.useCheckbox.use&&(w-=i.minWidth),b=w-k.totalWidth,b>0){const M=k.emptyCount===0?0:Math.floor(b/k.emptyCount);C=b-M*k.emptyCount,b=k.emptyCount!==0?M:b}else b=i.columnWidth;b=b<i.minWidth?i.minWidth:b,i.columnWidth=b}if(a.orderedColumns.forEach(y=>{const w=r(y)?i.rendererMinWidth:i.minWidth;y.width&&y.width<w&&(y.width=w),!y.width&&!y.hide&&(y.width=b)}),C&&a.orderedColumns.length){let y=a.orderedColumns.length-1,w=a.orderedColumns[y];for(;y>0&&w&&(w.hide||w.hiddenDisplay);)y-=1,w=a.orderedColumns[y];w&&(w.width+=C)}i.isResize=!i.isResize},f=()=>{o.nextTick(()=>{var m,b;i.adjust&&a.orderedColumns.forEach(C=>{var w;const y=C;return!((w=t.columns[C.index])!=null&&w.width)&&!y.resized&&(y.width=0),y},void 0),u(),(m=s.body)!=null&&m.clientHeight&&c(),(b=s.body)!=null&&b.clientWidth&&d()})};return{calculatedColumn:u,onResize:f,onShow:m=>{m&&f()},onColumnResize:(m,b)=>{const C=s.header,y=s.body,w=C.getBoundingClientRect().left,T=C.querySelector(`li[data-index="${m}"]`),k=r(a.orderedColumns[m])?i.rendererMinWidth:i.minWidth,M=T.getBoundingClientRect(),Z=y.getBoundingClientRect().right-w,S=s.resizeLine,x=M.left-w+k,L=M.right-w,I=b.clientX,V=M.left-w;y.style.overflow="auto",S.style.left=`${L}px`,i.showResizeLine=!0;const v=G=>{const R=G.clientX-I,X=L+R;let W=Math.max(x,X);W=Math.min(Z,W),S.style.left=`${W}px`},E=()=>{const R=parseInt(S.style.left,10)-V;a.orderedColumns[m]&&(a.orderedColumns[m].width=R,a.orderedColumns[m].resized=!0),i.showResizeLine=!1,document.removeEventListener("mousemove",v),f();const X=ms(a);n("resize-column",{column:a.orderedColumns[m],columns:X}),n("change-column-info",{type:"resize",columns:X})};document.addEventListener("mousemove",v),document.addEventListener("mouseup",E,{once:!0})}}},V1=e=>{const{emit:t}=o.getCurrentInstance(),n=e,i=(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",i(r,c)))},100),!0)},onRowDblClick:(r,c)=>{clearTimeout(s),t("dblclick-row",i(r,c))}}},E1=e=>{const{checkInfo:t,stores:n,checkHeader:i,pageInfo:s,getPagingData:l}=e,{emit:a}=o.getCurrentInstance(),r=()=>t.useCheckbox.mode==="each",c=p=>{const g=n.treeStore.findIndex(m=>m.index===p.index);g!==-1&&(n.treeStore[g].checked=p.checked)},d=p=>{r()||p.hasChild&&p.children.forEach(g=>{const m=g;p.checked&&!m.checked&&!m.uncheckable&&t.checkedRows.push(m),p.checked||(t.checkedRows=t.checkedRows.filter(b=>b.index!==m.index)),m.checked=p.checked&&!m.uncheckable,m.hasChild&&d(m)})},h=p=>{if(r())return;const g=p.parent;if(g){const m=g.children.every(C=>C.checked);g.checked=m&&!g.uncheckable;const b=g.children.filter(C=>C.uncheckable);if(b.length){const C=g.children.filter(y=>y.checked);b.length+C.length===g.children.length&&(g.checked=!0)}g.indeterminate=!m&&g.children.some(C=>C.checked||C.indeterminate),g.checked?t.checkedRows.push(g):t.checkedRows=t.checkedRows.filter(C=>C.index!==g.index),g.parent&&h(g)}};return{onCheck:(p,g)=>{let m=n.store;s.isClientPaging&&(m=l());const b=()=>t.useCheckbox.mode==="single",C=()=>{t.isHeaderChecked&&(t.isHeaderChecked=!1)},y=()=>{b()&&t.checkedRows.length>0&&(t.prevCheckedRow.checked=!1,c(t.prevCheckedRow))},w=k=>{if(b()){t.checkedRows=[k];return}d(k),h(k),t.checkedRows.push(k),k.indeterminate=!1},T=k=>{if(b()){t.checkedRows=[];return}t.checkedRows=t.checkedRows.filter(M=>M.index!==k.index)};y(),g.checked?(w(g),i(m)):(C(),T(g),d(g),h(g)),t.prevCheckedRow=g,a("update:checked",t.checkedRows),a("check-row",p,g.index,g)},onCheckAll:p=>{var b;const g=t.isHeaderChecked;let m=(b=n.store)==null?void 0:b.filter(C=>C.isFilter);s.isClientPaging&&(m=l()),m.forEach(C=>{C.checked=g&&!C.uncheckable,C.checked?t.checkedRows.find(y=>y.index===C.index)||t.checkedRows.push(C):t.checkedRows=t.checkedRows.filter(y=>y.index!==C.index),C.indeterminate=!1}),t.isHeaderIndeterminate=!1,a("update:checked",t.checkedRows),a("check-all",p,t.checkedRows)}}},G1=e=>{const{emit:t}=o.getCurrentInstance(),{contextInfo:n,stores:i,selectInfo:s,useGridSetting:l,columnSettingInfo:a,setColumnHidden:r,onSort:c}=e,d=(p=!0)=>{const g=[];if(p&&n.customContextMenu.length){const m=s.selectedRow,b=n.customContextMenu.map(C=>{const y=C;return y.validate&&(y.disabled=!y.validate(y.itemId,m)),y.selectedRow=m??[],y});g.push(...b)}n.contextMenuItems=g};return{setContextMenu:d,onContextMenu:p=>{var b,C;const m=(C=(b=p.target.closest(".row"))==null?void 0:b.dataset)==null?void 0:C.index;if(m){const y=i.viewStore.findIndex(T=>T.index===Number(m)),w=i.viewStore[y];s.selectedRow=[w],d(),t("update:selected",s.selectedRow)}else s.selectedRow=[],d(!1),t("update:selected",[])},onColumnContextMenu:(p,g)=>{var m,b,C,y,w,T;if(p.target.className.includes("column-name")){const k=!!g.sortable;n.columnMenuItems=[{text:((m=n.columnMenuTextInfo)==null?void 0:m.hide)??"Hide",iconClass:"ev-icon-visibility-off",disabled:!l.value||i.orderedColumns.length===1||!!g.fixed,hidden:((b=n.hiddenColumnMenuItem)==null?void 0:b.hide)||!l.value,click:()=>{r(g.field),t("change-column-status",{columns:i.updatedColumns}),t("change-column-info",{type:"display",columns:i.updatedColumns})}},{text:((C=n.columnMenuTextInfo)==null?void 0:C.ascending)??"Ascending",iconClass:"ev-icon-allow2-up",disabled:!k,hidden:(y=n.hiddenColumnMenuItem)==null?void 0:y.ascending,click:()=>c(g,"asc")},{text:((w=n.columnMenuTextInfo)==null?void 0:w.descending)??"Descending",iconClass:"ev-icon-allow2-down",disabled:!k,hidden:(T=n.hiddenColumnMenuItem)==null?void 0:T.descending,click:()=>c(g,"desc")}]}else n.columnMenuItems.length=0},onGridSettingContextMenu:p=>{const{useDefaultColumnSetting:g,columnSettingTextInfo:m}=a,b={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]),g&&n.gridSettingContextMenuItems.push(b),n.gridSettingMenu.show(p)}}},W1=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,onResize:i}=e,s=()=>{let r=0;const c=[];function d(u){const f={};return Object.keys(u).forEach(p=>{p!=="children"&&(f[p]=u[p])}),f}function h(u){const{node:f,level:p,isShow:g,parent:m,uncheckable:b}=u;f!==null&&typeof f=="object"&&(f.index=r++,f.level=p,Object.hasOwnProperty.call(f,"checked")||(f.checked=!1),Object.hasOwnProperty.call(f,"selected")||(f.selected=!1),Object.hasOwnProperty.call(f,"show")||(f.show=g),Object.hasOwnProperty.call(f,"expand")||(f.expand=!0),Object.hasOwnProperty.call(f,"isFilter")||(f.isFilter=!1),Object.hasOwnProperty.call(f,"uncheckable")||(f.uncheckable=b),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(C=>h({node:C,level:p+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}),i()}}},Z1=e=>{const{stores:t,filterInfo:n,pageInfo:i,getConvertValue:s,onResize:l,checkHeader:a,getPagingData:r,updatePagingInfo:c}=e,d=p=>{if(!(p!=null&&p.parent))return;const{parent:g}=p;g.show=!0,g.isFilter=!0,d(g)},h=p=>{if(!(p!=null&&p.children))return;const{children:g}=p;g.forEach(m=>{const b=m;b.parent.show&&b.parent.expand?b.show=!0:b.show=!1,b.isFilter=!0,b.hasChild&&h(b)})};let u=null;return{onSearch:p=>{u&&clearTimeout(u),u=setTimeout(()=>{n.isSearch=!1,n.searchWord=p;const g=t.treeStore;g.forEach(m=>{m.show=!1,m.isFilter=!1}),p?(g.filter(b=>{let C=!1;for(let y=0;y<t.orderedColumns.length;y++){const w=t.orderedColumns[y]||{};let T=b[w.field]??null;if(w.type=w.type||"string",T!==null&&!w.hide&&((w==null?void 0:w.searchable)===void 0||w!=null&&w.searchable)&&(T=s(w,T).toString(),C=T.toLowerCase().includes(p.toString().toLowerCase()),C))break}return C}).forEach(b=>{b.show=!0,b.parent&&!b.parent.expand&&(b.show=!1),b.isFilter=!0,d(b),h(b)}),n.isSearch=!0):(g.forEach(m=>{m.show=!0,m.isFilter=!1}),g.forEach(m=>{d(m),h(m)})),!p&&i.isClientPaging&&i.prevPage&&(i.currentPage=1,t.pagingStore=r()),c({onSearch:!0}),a(t.store),l()},500)}}},X1=e=>{const{emit:t}=o.getCurrentInstance(),{stores:n,pageInfo:i,sortInfo:s,filterInfo:l,elementInfo:a,clearCheckInfo:r}=e,c=()=>{const u=(i.currentPage-1)*i.perPage,f=parseInt(u,10)+parseInt(i.perPage,10);return n.showTreeStore.slice(u,f)},d=u=>{t("page-change",{eventName:u,pageInfo:{currentPage:i.currentPage,prevPage:i.prevPage,startIndex:i.startIndex,total:i.pageTotal,perPage:i.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)}}),i.isInfinite&&(u!=null&&u.onSearch||u!=null&&u.onSort)&&(i.currentPage=1,a.body.scrollTop=0,r())};return{getPagingData:c,updatePagingInfo:d,changePage:u=>{if(i.isClientPaging)if(i.prevPage=u,n.showTreeStore.length<=i.perPage)n.pagingStore=n.showTreeStore;else{const f=(i.currentPage-1)*i.perPage,p=parseInt(f,10)+parseInt(i.perPage,10);n.pagingStore=n.showTreeStore.slice(f,p),a.body.scrollTop=0,i.startIndex=f}d({onChangePage:!0})}}},N1=({sortInfo:e,stores:t})=>{const{emit:n}=o.getCurrentInstance(),i=(u=!0)=>u?["asc","desc","init"]:["asc","desc"];function s(){this.orders=i(),this.dequeue=()=>this.orders.shift(),this.enqueue=u=>this.orders.push(u)}const l=(u,f="init")=>{t.orderedColumns.forEach(p=>{p.index===(u==null?void 0:u.index)&&f?p.sortOption={sortType:f}:p.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=i(),e.sortField=u==null?void 0:u.field),f&&(r.orders=i(),f==="desc"&&(e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder))),e.sortOrder=r.dequeue(),r.enqueue(e.sortOrder),a(),l(u,e.sortOrder);const g=ms(t);n("sort-column",{field:e.sortField,order:e.sortOrder,column:e.sortColumn,columns:g}),n("change-column-info",{type:"sort",columns:g})}},setSortInfo:(u,f=!0)=>{const p=u==null?void 0:u.findIndex(b=>{var C;return(b==null?void 0:b.sortable)&&((C=b==null?void 0:b.sortOption)==null?void 0:C.sortType)&&b.sortOption.sortType!=="init"}),g=u[p];p>-1&&(g.index=p);const{sortType:m}=(g==null?void 0:g.sortOption)||{};e.sortColumn=g,e.sortField=g==null?void 0:g.field,e.isSorting=!!m,e.sortOrder=m,l(g,m),f&&n("change-column-info",{type:"sort",columns:ms(t)})},initSortInfo:u=>{e.isSorting=!1,e.sortOrder="init",u.forEach(f=>{var p;(p=f==null?void 0:f.sortOption)!=null&&p.sortType&&f.sortOption.sortType!=="init"&&(f.sortOption.sortType="init")})}}},P1={name:"EvTreeGrid",components:{TreeGridNode:k1,Toolbar:T1,GridPagination:vr,GridSummary:Wr,ColumnSetting:Zr,GridSortButton:Xr,GridOptionButton:Ho},directives:{observeVisibility:js,resize:En},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 ps,gs,bs,ys,xs,Ss,Cs,sn,In;const t=o.ref(null),n=o.computed(()=>{var K,oe;return((oe=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:oe.use)||!1}),i=o.computed(()=>{var K;return((K=e.option)==null?void 0:K.useSummary)||!1}),s=o.computed(()=>e.option.emptyText??"No records"),l=o.reactive({body:null,header:null,table:null,resizeLine:null,"grid-wrapper":null}),a=o.reactive({isSearch:!1,searchWord:""}),r=o.reactive({isShowColumnSetting:!1,isFilteringColumn:!1,visibleColumnIdx:[],hiddenColumn:"",columnSettingPosition:{top:0,left:0,columnListMenuWidth:0},useDefaultColumnSetting:o.computed(()=>{var K,oe;return((oe=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:oe.useDefaultColumnSetting)??!0}),columnSettingTextInfo:{title:((gs=(ps=e.option)==null?void 0:ps.useGridSetting)==null?void 0:gs.columnMenuText)??"Column List",search:((ys=(bs=e.option)==null?void 0:bs.useGridSetting)==null?void 0:ys.searchText)??"Search",empty:((Ss=(xs=e.option)==null?void 0:xs.useGridSetting)==null?void 0:Ss.emptyText)??"No records",ok:((sn=(Cs=e.option)==null?void 0:Cs.useGridSetting)==null?void 0:sn.okBtnText)??"OK"}}),c=o.reactive({treeStore:[],viewStore:[],filterStore:[],pagingStore:[],originStore:[],showTreeStore:o.computed(()=>c.treeStore.filter(K=>K.show)),searchStore:o.computed(()=>c.treeStore.filter(K=>K.isFilter)),store:o.computed(()=>a.isSearch?c.searchStore:c.treeStore),treeRows:e.rows,filteredColumns:[],originColumns:o.computed(()=>e.columns.map((K,oe)=>{var pe;return{index:oe,hiddenDisplay:!1,...K,width:isFinite(K.width)?K.width:void 0,sortOption:{sortType:((pe=K==null?void 0:K.sortOption)==null?void 0:pe.sortType)||"init"}}})),orderedColumns:o.computed(()=>c.filteredColumns.length?c.filteredColumns:c.originColumns),updatedColumns:o.computed(()=>ms(c))}),d=o.reactive({usePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.use)||!1}),useClient:((In=e.option.page)==null?void 0:In.useClient)||!1,isInfinite:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.isInfinite)||!1}),startIndex:0,prevPage:0,currentPage:0,pageTotal:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.total)||0}),perPage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.perPage)||20}),visiblePage:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.visiblePage)||8}),order:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.order)||"center"}),showPageInfo:o.computed(()=>{var K;return((K=e.option.page)==null?void 0:K.showPageInfo)||!1}),isClientPaging:o.computed(()=>d.useClient&&d.usePage&&!d.isInfinite),isHighlight:!1,highlightPage:0}),h=o.reactive({prevCheckedRow:[],isHeaderChecked:!1,isHeaderUncheckable:!1,isHeaderIndeterminate:!1,checkedRows:e.checked,useCheckbox:o.computed(()=>e.option.useCheckbox||{})}),{isRenderer:u,getComponentName:f,getConvertValue:p,getColumnIndex:g,setPixelUnit:m,checkHeader:b}=M1({checkInfo:h}),C=o.reactive({lastScroll:{top:0,left:0},vScrollTopHeight:0,vScrollBottomHeight:0,hasVerticalScrollBar:!1,hasHorizontalScrollBar:!1}),y=o.reactive({selectedRow:e.selected,useSelect:o.computed(()=>{var K,oe;return((oe=(K=e.option)==null?void 0:K.useSelection)==null?void 0:oe.use)??!0}),limitCount:o.computed(()=>{var oe,pe;let K=(pe=(oe=e.option)==null?void 0:oe.useSelection)==null?void 0:pe.limitCount;return K=K&&K>=2?K:0,K}),multiple:o.computed(()=>{var K,oe;return((oe=(K=e.option)==null?void 0:K.useSelection)==null?void 0:oe.multiple)??!1})}),w=o.reactive({isSorting:!1,sortField:"",sortOrder:"",sortColumn:{},sortFunction:e.option.customAscFunction??{}}),T=o.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:o.computed(()=>{var K,oe;return((oe=(K=e.option)==null?void 0:K.useGridSetting)==null?void 0:oe.customContextMenu)||[]}),isShowMenuOnClick:!1}),k=o.reactive({minWidth:40,rendererMinWidth:80,showResizeLine:!1,adjust:e.option.adjust||!1,columnWidth:e.option.columnWidth||80,scrollWidth:e.option.scrollWidth||17,rowHeight:o.computed(()=>e.option.rowHeight||35),gridWidth:o.computed(()=>e.width?m(e.width):"100%"),gridHeight:o.computed(()=>e.height?m(e.height):"100%"),isResize:!1}),M=o.reactive({showHeader:o.computed(()=>e.option.showHeader===void 0?!0:e.option.showHeader),stripeStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.stripe)||!1}),borderStyle:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.border)||""}),highlightIdx:o.computed(()=>{var K;return((K=e.option.style)==null?void 0:K.highlight)??-1})}),Z=()=>{y.selectedRow.length=0,c.store.forEach(K=>{K.selected=!1})},S=()=>{h.isHeaderChecked=!1,h.isHeaderIndeterminate=!1,h.checkedRows.length=0,c.store.forEach(K=>{K.checked=!1,K.indeterminate=!1})},{getPagingData:x,updatePagingInfo:L,changePage:I}=X1({stores:c,pageInfo:d,sortInfo:w,filterInfo:a,elementInfo:l,clearCheckInfo:S}),V=o.ref(0),{updateVScroll:v,updateHScroll:E,onScroll:G}=v1({scrollInfo:C,stores:c,elementInfo:l,resizeInfo:k,pageInfo:d,summaryScroll:V,getPagingData:x,updatePagingInfo:L}),{onRowClick:R,onRowDblClick:X}=V1(y),{onCheck:W,onCheckAll:N}=E1({checkInfo:h,stores:c,checkHeader:b,pageInfo:d,getPagingData:x}),{calculatedColumn:P,onResize:D,onShow:H,onColumnResize:B}=R1({resizeInfo:k,elementInfo:l,checkInfo:h,stores:c,isRenderer:u,updateVScroll:v,updateHScroll:E,contextInfo:T}),{setTreeNodeStore:Y,handleExpand:O}=W1({stores:c,onResize:D}),{onSort:_,initSortInfo:A,setSortInfo:Q}=N1({sortInfo:w,stores:c}),{onSearch:U}=Z1({stores:c,filterInfo:a,pageInfo:d,getConvertValue:p,onResize:D,checkHeader:b,getPagingData:x,updatePagingInfo:L}),{setPositionColumnSetting:ee,initColumnSettingInfo:$,onApplyColumn:te,setColumnHidden:J}=Nr({stores:c,columnSettingInfo:r,contextInfo:T,onSearch:U,onResize:D}),{setContextMenu:q,onContextMenu:j,onColumnContextMenu:ae,onGridSettingContextMenu:he}=G1({contextInfo:T,stores:c,selectInfo:y,useGridSetting:n,columnSettingInfo:r,setColumnHidden:J,onSort:_}),se=K=>{T.gridSettingContextMenuItems.length=0,T.customGridSettingContextMenu.length?he(K):r.isShowColumnSetting=!0},fe=K=>{var oe,pe,ke,Re,ze,Qe;K.type==="wheel"&&((oe=T.menu)==null||oe.hide(K)),K.type==="scroll"&&!((pe=K.target.classList)!=null&&pe.contains("table-body"))&&!((Re=(ke=K.target.offsetParent)==null?void 0:ke.classList)!=null&&Re.contains("ev-grid-column-setting"))&&(r.isShowColumnSetting=!1,T.isShowMenuOnClick=!1,(ze=T.columnMenu)==null||ze.hide(K),(Qe=T.gridSettingMenu)==null||Qe.hide())};o.onMounted(()=>{var K;if(c.treeStore=Y(),c.originStore=Ze(c.treeStore),(K=e.option)!=null&&K.useSort)Q(e.columns,!1);else{const oe=T.hiddenColumnMenuItem;oe.ascending=!0,oe.descending=!0}document.addEventListener("wheel",fe,{capture:!1}),document.addEventListener("scroll",fe,{capture:!0})}),o.onUnmounted(()=>{document.removeEventListener("wheel",fe,{capture:!1}),document.removeEventListener("scroll",fe,{capture:!0})}),o.onActivated(()=>{D()}),o.watch(()=>{var K;return(K=e.option)==null?void 0:K.useSort},K=>{const oe=e.option.hiddenColumnMenuItem,pe=T.hiddenColumnMenuItem;K?(pe.ascending=(oe==null?void 0:oe.ascending)??!1,pe.descending=(oe==null?void 0:oe.descending)??!1,Q(e.columns,!1)):(pe.ascending=!0,pe.descending=!0,A(e.columns))}),o.watch(()=>r.isShowColumnSetting,K=>{var oe;if(!K){(oe=T.gridSettingMenu)==null||oe.hide();return}ee(t.value)}),o.watch(()=>e.columns,()=>{$()},{deep:!0,immediate:!0}),o.watch(()=>e.checked,K=>{h.checkedRows=K}),o.watch(()=>h.checkedRows,K=>{h.isHeaderChecked=!1;let oe=c.store;d.isClientPaging&&(oe=x()),oe.length&&(oe.forEach(pe=>{pe.checked=!!K.find(ke=>ke.index===pe.index)}),b(oe)),v()}),o.watch(()=>e.selected,K=>{y.useSelect&&(y.selectedRow=K)}),o.watch(()=>y.selectedRow,K=>{y.useSelect&&(c.store.forEach(oe=>{oe.selected=!!K.find(pe=>pe.index===oe.index)}),v())},{deep:!0}),o.watch(()=>M.highlightIdx,async K=>{await o.nextTick();const oe=ke=>{if(!(ke!=null&&ke.children))return;const{children:Re}=ke;Re.forEach(ze=>{const Qe=ze;Qe.parent.show&&Qe.parent.expand?Qe.show=!0:Qe.show=!1,Qe.isFilter=!0,Qe.hasChild&&oe(Qe)})},pe=ke=>{if(!(ke!=null&&ke.parent)){oe(ke);return}const{parent:Re}=ke;Re.show=!0,Re.isFilter=!0,Re.expand=!0,oe(Re),pe(Re)};if(K>=0){const ke=c.store.find(ze=>ze.index===K);if(!ke)return;ke.show=!0,ke.isFilter=!0,pe(ke);const Re=c.showTreeStore.map(ze=>ze.index).indexOf(ke.index);if(d.usePage&&!d.isInfinite){const ze=Math.ceil(Re/d.perPage);if(d.highlightPage=Re===d.perPage?ze+1:ze||1,d.highlightPage!==d.currentPage){d.currentPage=d.highlightPage,d.isHighlight=!0;return}}l.body.scrollTop=k.rowHeight*Re}}),o.watch(()=>h.useCheckbox.mode,()=>{h.checkedRows=[],h.isHeaderChecked=!1}),o.watch(()=>y.useSelect,()=>{Z()}),o.watch(()=>y.multiple,()=>{Z()}),o.watch(()=>e.rows,K=>{c.treeRows=K,c.treeStore=Y(),D()},{deep:!0}),o.watch(()=>c.treeStore.length,()=>{b(c.store)}),o.watch(()=>[e.width,e.height,e.option.columnWidth],()=>{e.option.columnWidth!=null&&(k.columnWidth=e.option.columnWidth),c.orderedColumns.map(K=>{var pe;const oe=K;return!((pe=e.columns[K.index])!=null&&pe.width)&&!oe.resized&&(oe.width=0),oe}),D()}),o.watch(()=>e.option.searchValue,K=>{o.nextTick(()=>{K!==void 0&&(U((K==null?void 0:K.value)??K),d.isClientPaging&&(S(),Z()))})},{immediate:!0}),o.watch(()=>{var K;return(K=e.option.page)==null?void 0:K.currentPage},K=>{var pe;const oe=K||1;d.currentPage=(pe=e.option.page)!=null&&pe.isInfinite?1:oe},{immediate:!0}),o.watch(()=>d.currentPage,(K,oe)=>{o.nextTick(()=>{if(I(oe),d.isClientPaging&&K!==oe&&(S(),Z()),v(),K===d.highlightPage&&d.isHighlight){const pe=c.pagingStore.map(ke=>ke.index).indexOf(M.highlightIdx);l.body.scrollTop=k.rowHeight*pe,d.isHighlight=!d.isHighlight}})});const ge=()=>({"column-sort__icon":!0,"column-sort__icon--asc":w.sortOrder==="asc","column-sort__icon--desc":w.sortOrder==="desc"}),le=o.computed(()=>({width:k.gridWidth,height:k.gridHeight})),ce=o.computed(()=>({"table-body":!0,stripe:M.stripeStyle,"bottom-border":!!c.viewStore.length,"non-border":!!M.borderStyle})),be=o.computed(()=>({table:!0,"ev-grid":!0,"ev-tree-grid":!0,adjust:k.adjust,"non-header":!M.showHeader,"ev-tree-grid--empty":!c.viewStore.length})),Ie=o.computed(()=>({"table-header":!0,"non-border":!!M.borderStyle})),Ve=o.computed(()=>({column:!0,"checkbox-all":!0,"non-border":!!M.borderStyle})),kt=o.computed(()=>h.useCheckbox.use&&h.useCheckbox.headerCheck&&h.useCheckbox.mode!=="single"),Vt=K=>({column:!0,render:u(K),"non-border":!!M.borderStyle,[K.field]:K.field}),jo=(K,oe)=>{const pe=u(K);return{width:`${K.width}px`,"min-width":pe?`${k.rendererMinWidth}px;`:`${k.minWidth}px`,"margin-right":c.orderedColumns.length-1===oe&&C.hasVerticalScrollBar&&C.hasHorizontalScrollBar?`${k.scrollWidth}px`:"0px","border-right":c.orderedColumns.length-1===oe?"none":"1px solid #CFCFCF"}},Qo=K=>`${K}Node`;return{summaryScroll:V,gridStyle:le,gridClass:be,headerClass:Ie,headerCheckboxClass:Ve,isHeaderCheckbox:kt,bodyStyle:ce,useSummary:i,useGridSetting:n,toolbarRef:t,stores:c,emptyText:s,...o.toRefs(M),...o.toRefs(l),...o.toRefs(c),...o.toRefs(a),...o.toRefs(C),...o.toRefs(k),...o.toRefs(y),...o.toRefs(h),...o.toRefs(w),...o.toRefs(T),...o.toRefs(d),...o.toRefs(r),isRenderer:u,getComponentName:f,getConvertValue:p,getColumnIndex:g,setPixelUnit:m,updateVScroll:v,updateHScroll:E,onScroll:G,calculatedColumn:P,onResize:D,onShow:H,onColumnResize:B,onRowClick:R,onRowDblClick:X,onCheck:W,onCheckAll:N,setContextMenu:q,onContextMenu:j,onSearch:U,handleExpand:O,getColumnClass:Vt,getColumnStyle:jo,getSlotName:Qo,setGridSetting:se,onApplyColumn:te,onColumnContextMenu:ae,onSort:_,sortIconClass:ge}}},B1={class:"column-list"},D1=["data-index"],Y1=["title","onClick"],O1=["onClick"],H1=["onMousedown"],z1={ref:"table"},F1=["title"],A1={key:0},K1={class:"is-empty"},_1={ref:"resizeLine",class:"table-resize-line"};function U1(e,t,n,i,s,l){var C;const a=o.resolveComponent("grid-option-button"),r=o.resolveComponent("toolbar"),c=o.resolveComponent("ev-checkbox"),d=o.resolveComponent("grid-sort-button"),h=o.resolveComponent("tree-grid-node"),u=o.resolveComponent("ev-context-menu"),f=o.resolveComponent("grid-summary"),p=o.resolveComponent("grid-pagination"),g=o.resolveComponent("column-setting"),m=o.resolveDirective("resize"),b=o.resolveDirective("observe-visibility");return o.openBlock(),o.createElementBlock(o.Fragment,null,[e.$slots.toolbar||i.useGridSetting?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"toolbarRef",class:"toolbar-wrapper",style:o.normalizeStyle(`width: ${e.gridWidth};`)},[o.createVNode(r,null,{toolbarWrapper:o.withCtx(()=>[i.useGridSetting?(o.openBlock(),o.createBlock(a,{key:0,class:"grid-setting__icon",onClick:i.setGridSetting},null,8,["onClick"])):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"toolbar",{item:{onSearch:i.onSearch}},void 0,!0)]),_:3})],4)):o.createCommentVNode("",!0),o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref:"grid-wrapper",style:o.normalizeStyle(i.gridStyle)},[o.createElementVNode("div",{ref:"grid",class:o.normalizeClass(i.gridClass)},[o.withDirectives(o.createElementVNode("div",{ref:"header",class:o.normalizeClass(i.headerClass)},[o.createElementVNode("ul",B1,[e.useCheckbox.use?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(i.headerCheckboxClass),style:o.normalizeStyle({width:`${e.minWidth}px`,"border-right":"1px solid #CFCFCF"})},[i.isHeaderCheckbox?(o.openBlock(),o.createBlock(c,{key:0,modelValue:e.isHeaderChecked,"onUpdate:modelValue":t[0]||(t[0]=y=>e.isHeaderChecked=y),disabled:e.isHeaderUncheckable,indeterminate:e.isHeaderIndeterminate,onChange:i.onCheckAll},null,8,["modelValue","disabled","indeterminate","onChange"])):o.createCommentVNode("",!0)],6)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.orderedColumns,(y,w)=>{var T,k;return o.openBlock(),o.createElementBlock(o.Fragment,{key:w},[!y.hide&&!y.hiddenDisplay?(o.openBlock(),o.createElementBlock("li",{key:0,"data-index":w,class:o.normalizeClass(i.getColumnClass(y)),style:o.normalizeStyle(i.getColumnStyle(y,w))},[y.customHeader&&e.$slots.customHeader?o.renderSlot(e.$slots,"customHeader",{key:0},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:y.caption,class:o.normalizeClass(["column-name",{"column-name--click":i.useGridSetting}]),onClick:[M=>i.onColumnContextMenu(M,y),t[1]||(t[1]=o.withModifiers((...M)=>e.columnMenu.show&&e.columnMenu.show(...M),["prevent"]))]},[o.createTextVNode(o.toDisplayString(y.caption)+" ",1),o.createElementVNode("span",{onClick:o.withModifiers(M=>i.onSort(y),["stop"])},[e.$slots.sortIcon?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(T=e.$props.option)!=null&&T.useSort&&(y!=null&&y.sortable)?(o.openBlock(),o.createElementBlock("span",{key:0,class:"column-sort__icon column-sort__icon--basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,"sortIcon",{},void 0,!0)],4)):o.createCommentVNode("",!0),e.sortField===y.field?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(i.sortIconClass(y)),style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},[o.renderSlot(e.$slots,`sortIcon_${e.sortOrder}`,{},void 0,!0)],6)):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[(k=e.$props.option)!=null&&k.useSort&&(y!=null&&y.sortable)?(o.openBlock(),o.createBlock(d,{key:0,class:"column-sort__icon column-sort__icon--basic",icon:"basic",style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`})},null,8,["style"])):o.createCommentVNode("",!0),e.sortField===y.field?(o.openBlock(),o.createBlock(d,{key:1,class:o.normalizeClass(i.sortIconClass(y)),icon:e.sortOrder,style:o.normalizeStyle({height:`${e.rowHeight}px`,"line-height":`${e.rowHeight}px`,visibility:e.sortOrder?y.hidden:!0})},null,8,["class","icon","style"])):o.createCommentVNode("",!0)],64))],8,O1)],10,Y1)),o.createElementVNode("span",{class:"column-resize",onMousedown:o.withModifiers(M=>i.onColumnResize(w,M),["stop","left"])},null,40,H1)],14,D1)):o.createCommentVNode("",!0)],64)}),128)),(C=e.$props.option.customContextMenu)!=null&&C.length?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({column:!0,"non-border":!!e.borderStyle}),style:o.normalizeStyle({width:"30px","min-width":"30px","margin-right":e.hasVerticalScrollBar||e.hasHorizontalScrollBar?`${e.scrollWidth}px`:"0px"})},null,6)):o.createCommentVNode("",!0)])],2),[[o.vShow,e.showHeader]]),o.createElementVNode("div",{ref:"body",class:o.normalizeClass(i.bodyStyle),onScroll:t[2]||(t[2]=(...y)=>i.onScroll&&i.onScroll(...y)),onContextmenu:[t[3]||(t[3]=y=>i.onContextMenu(y)),t[4]||(t[4]=o.withModifiers((...y)=>e.menu.show&&e.menu.show(...y),["prevent"]))]},[o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollTopHeight}px;`),class:"vscroll-spacer"},null,4),o.createElementVNode("table",z1,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.viewStore,(y,w)=>(o.openBlock(),o.createBlock(h,{key:w,"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:i.onCheck,onExpandTreeData:i.handleExpand,onClickTreeData:i.onRowClick,onDblClickTreeData:i.onRowDblClick,onContextMenu:i.onContextMenu},o.createSlots({_:2},[o.renderList(e.orderedColumns,(T,k)=>({name:i.getSlotName(T.field),fn:o.withCtx(({item:M})=>[e.$slots[T.field]?o.renderSlot(e.$slots,T.field,{key:0,item:{data:M.data,fieldName:T.field}},void 0,!0):(o.openBlock(),o.createElementBlock("span",{key:1,title:i.getConvertValue(T,y[T.field])},o.toDisplayString(i.getConvertValue(T,y[T.field])),9,F1))])})),e.$slots.contextmenuIcon?{name:"contextmenuIconNode",fn:o.withCtx(()=>[o.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?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("tr",A1,[o.createElementVNode("td",K1,o.toDisplayString(i.emptyText),1)]))])],512),o.createElementVNode("div",{style:o.normalizeStyle(`height: ${e.vScrollBottomHeight}px;`),class:"vscroll-spacer"},null,4),o.createVNode(u,{ref:"menu","custom-class":e.contextMenuClass,items:e.contextMenuItems},null,8,["custom-class","items"]),o.createVNode(u,{ref:"columnMenu",items:e.columnMenuItems},null,8,["items"]),o.createVNode(u,{ref:"gridSettingMenu",items:e.gridSettingContextMenuItems,"is-show-menu-on-click":e.isShowMenuOnClick},null,8,["items","is-show-menu-on-click"])],34),o.withDirectives(o.createElementVNode("div",_1,null,512),[[o.vShow,e.showResizeLine]])],2)],4)),[[m,i.onResize],[b,{callback:i.onShow,once:!0}]]),i.useSummary?(o.openBlock(),o.createBlock(f,{key:1,"is-tree":!0,"ordered-columns":e.orderedColumns,stores:i.stores,"use-checkbox":e.useCheckbox.use,"style-option":{borderStyle:e.borderStyle,minWidth:e.minWidth,rowHeight:e.rowHeight},"scroll-left":i.summaryScroll},null,8,["ordered-columns","stores","use-checkbox","style-option","scroll-left"])):o.createCommentVNode("",!0),e.usePage&&!e.isInfinite?(o.openBlock(),o.createBlock(p,{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"])):o.createCommentVNode("",!0),o.createVNode(g,{"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:i.onApplyColumn},null,8,["is-show","is-show-menu-on-click","columns","hidden-column","position","text-info","onApplyColumn"])],64)}const Si=de(P1,[["render",U1],["__scopeId","data-v-9ed705b7"]]);Si.install=e=>{e.component(Si.name,Si)};const J1={name:"PageButton",props:{page:{type:Object,required:!0},disabled:{type:Boolean,default:!1}}},j1=["aria-current"];function Q1(e,t,n,i,s,l){return o.openBlock(),o.createElementBlock("span",o.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]=o.withModifiers((...a)=>n.page.click&&n.page.click(...a),["stop"]))}),[o.renderSlot(e.$slots,"default",{},()=>[o.createTextVNode(o.toDisplayString(n.page.number),1)])],16,j1)}const $1={name:"EvPagination",components:{EvIcon:Sn,pageButton:de(J1,[["render",Q1]])},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=o.computed(()=>e.visiblePage>7?e.visiblePage:7),i=o.computed(()=>e.modelValue),s=o.computed(()=>e.total===0?1:Math.ceil(e.total/e.perPage)),l=o.computed(()=>i.value>1),a=o.computed(()=>i.value<s.value),r=o.computed(()=>Math.max(i.value-e.pagePerJump,1)),c=o.computed(()=>Math.min(i.value+e.pagePerJump,s.value)),d=o.computed(()=>{const m=i.value*e.perPage-e.perPage+1;return m>=0?m:0}),h=(m,b)=>{i.value===m||m<1||m>s.value||(t("update:modelValue",m),t("change",m),b&&b.target&&o.nextTick(()=>b.target.focus()))},u=(m,b={})=>({number:m,isCurrent:b.isCurrent??i.value===m,click:C=>h(m,C),input:(C,y)=>h(+y,C),disabled:b.disabled||!1,class:b.class||""}),f=(m,b)=>{const C=[],y=m>0?m:1;for(let w=y;w<=b;w++)C.push(u(w));return C},p=o.computed(()=>{const m=parseInt(n.value,10);if(m===0)return[];const b=Math.min(Math.max(0,m)||s.value,s.value);if(s.value<=b)return f(1,s.value);const C=b%2===0?1:0,y=Math.floor(b/2),w=s.value-y+1+C;if(i.value>y&&i.value<w){const k=s.value,M=i.value-y+2,Z=i.value+y-2-C,S=M-1===2?2:-1,x=Z+1===k-1?Z+1:-1;return[u(1),u(S),...f(M,Z),u(x),u(s.value)]}else if(i.value===y){const T=i.value+y-1-C;return[...f(1,T),u(-1),u(s.value)]}else if(i.value===w){const T=i.value-y+1;return[u(1),u(-1),...f(T,s.value)]}return[...f(1,y),u(-1),...f(w,s.value)]}),g=o.computed(()=>({"justify-content":e.order,flex:"3 1 0%"}));return o.watch(()=>s.value,m=>{i.value>m&&h(m)}),o.watch(()=>i.value,(m,b)=>{s.value<m&&h(b)}),{pageCount:s,pagesInRange:p,hasPrev:l,hasNext:a,listClasses:g,firstData:d,current:i,changePage:h,getPage:u,prevJumpPage:r,nextJumpPage:c}}},q1={class:"pagination"},ek={key:0,class:"pagination-info"},tk={key:0,class:"pagination-ellipsis"},nk=["onClick"];function ik(e,t,n,i,s,l){const a=o.resolveComponent("ev-icon"),r=o.resolveComponent("page-button");return o.openBlock(),o.createElementBlock("nav",q1,[n.showPageInfo?(o.openBlock(),o.createElementBlock("small",ek,[n.perPage===1?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(o.toDisplayString(i.firstData)+" / "+o.toDisplayString(n.total),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(i.firstData)+" - "+o.toDisplayString(Math.min(i.current*n.perPage,n.total))+" / "+o.toDisplayString(n.total),1)],64))])):o.createCommentVNode("",!0),o.createElementVNode("ul",{class:"pagination-list",style:o.normalizeStyle(i.listClasses)},[e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:0,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.prevJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-left"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasPrev}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasPrev,page:i.getPage(i.current-1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-left"})]),_:1},8,["disabled","page"])],2),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.pagesInRange,(c,d)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:d},[c.number===-1?(o.openBlock(),o.createElementBlock("li",tk,[...t[0]||(t[0]=[o.createElementVNode("span",null,"…",-1)])])):(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass({"is-current":c.isCurrent,"is-page":!0}),onClick:c.click},[o.createVNode(r,{page:c},null,8,["page"])],10,nk))],64))),128)),o.createElementVNode("li",{class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-next",disabled:!i.hasNext,page:i.getPage(i.current+1)},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-arrow-right"})]),_:1},8,["disabled","page"])],2),e.$props.pagePerJump?(o.openBlock(),o.createElementBlock("li",{key:1,class:o.normalizeClass(["step-button",{"is-disabled":!i.hasNext}])},[o.createVNode(r,{class:"pagination-previous",disabled:!i.hasNext,page:i.getPage(i.nextJumpPage,{isCurrent:!1})},{default:o.withCtx(()=>[o.createVNode(a,{icon:"ev-icon-s-double-right"})]),_:1},8,["disabled","page"])],2)):o.createCommentVNode("",!0)],4)])}const Ci=de($1,[["render",ik]]);Ci.install=e=>{e.component(Ci.name,Ci)};const sk="3.10.0",ok=[Gn,Wn,un,Zn,fn,mn,Xn,Nn,Bn,Dn,Yn,zn,Qn,Sn,ei,ti,ni,ii,si,oi,li,ai,ri,ci,hi,bi,yi,xi,ls,rs,cs,Si,Ci],lk={version:sk,install:e=>{e&&ok.forEach(t=>{e.use(t)})}};re.EvButton=un,re.EvButtonGroup=Zn,re.EvCalendar=ei,re.EvChart=bi,re.EvChartBrush=xi,re.EvChartGroup=yi,re.EvCheckbox=fn,re.EvCheckboxGroup=mn,re.EvContextMenu=ii,re.EvDatePicker=ti,re.EvGrid=hi,re.EvIcon=Sn,re.EvInputNumber=zn,re.EvLoading=oi,re.EvMenu=ai,re.EvMessage=ls,re.EvMessageBox=cs,re.EvNotification=rs,re.EvPagination=Ci,re.EvProgress=li,re.EvRadio=Xn,re.EvRadioGroup=Nn,re.EvScheduler=ni,re.EvSelect=Bn,re.EvSlider=Qn,re.EvTabPanel=Wn,re.EvTabs=Gn,re.EvTextField=Yn,re.EvTimePicker=ci,re.EvToggle=Dn,re.EvTree=ri,re.EvTreeGrid=Si,re.EvWindow=si,re.default=lk,Object.defineProperties(re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});