Files
MoneyFlix/public/assets/js/app.8e9399a666b59b9816a2.js
T
1sonhador 97eca96f83 MoneyFlix: Add Auth module, fix error monitoring, improve lock screen functionality
- Add complete Auth module with login, logout, lock screen functionality
- Fix 401 error on error monitoring page by adding /error-monitoring/ to public patterns
- Improve lock screen with proper form handling and unlock functionality
- Add RoleModel and role management views
- Add BaseModel for common model functionality
- Update authentication system and middleware
- Add troubleshooting documentation
- Update assets and build tools
2025-10-22 18:09:43 +01:00

3 lines
1.6 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see app.8e9399a666b59b9816a2.js.LICENSE.txt */
(()=>{var t={19:function(t,e,n){var i,r,o,a,s,l,c,u,h;t.exports=(h=n(9021),n(3009),n(1025),o=(r=(i=h).lib).Base,a=r.WordArray,l=(s=i.algo).SHA256,c=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,i=c.create(n.hasher,t),r=a.create(),o=a.create([1]),s=r.words,l=o.words,u=n.keySize,h=n.iterations;s.length<u;){var d=i.update(e).finalize(o);i.reset();for(var p=d.words,f=p.length,g=d,m=1;m<h;m++){g=i.finalize(g),i.reset();for(var y=g.words,v=0;v<f;v++)p[v]^=y[v]}r.concat(d),l[0]++}return r.sigBytes=4*u,r}}),i.PBKDF2=function(t,e,n){return u.create(n).compute(t,e)},h.PBKDF2)},25:function(t,e,n){var i,r,o,a;t.exports=(a=n(9021),n(7165),r=(i=a).lib.CipherParams,o=i.enc.Hex,i.format.Hex={stringify:function(t){return t.ciphertext.toString(o)},parse:function(t){var e=o.parse(t);return r.create({ciphertext:e})}},a.format.Hex)},34:(t,e,n)=>{"use strict";var i=n(4901);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},81:(t,e,n)=>{"use strict";var i=n(9565),r=n(9306),o=n(8551),a=n(6823),s=n(851),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(r(n))return o(i(n,t));throw new l(a(t)+" is not iterable")}},283:(t,e,n)=>{"use strict";var i=n(9504),r=n(9039),o=n(4901),a=n(9297),s=n(3724),l=n(350).CONFIGURABLE,c=n(3706),u=n(1181),h=u.enforce,d=u.get,p=String,f=Object.defineProperty,g=i("".slice),m=i("".replace),y=i([].join),v=s&&!r(function(){return 8!==f(function(){},"length",{value:8}).length}),_=String(String).split("String"),x=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(s?f(t,"name",{value:e,configurable:!0}):t.name=e),v&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=h(t);return a(i,"source")||(i.source=y(_,"string"==typeof e?e:"")),t};Function.prototype.toString=x(function(){return o(this)&&d(this).source||c(this)},"toString")},350:(t,e,n)=>{"use strict";var i=n(3724),r=n(9297),o=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,s=r(o,"name"),l=s&&"something"===function(){}.name,c=s&&(!i||i&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},397:(t,e,n)=>{"use strict";var i=n(7751);t.exports=i("document","documentElement")},421:t=>{"use strict";t.exports={}},477:()=>{},482:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.Iso97971={pad:function(t,e){t.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(t,e)},unpad:function(t){i.pad.ZeroPadding.unpad(t),t.sigBytes--}},i.pad.Iso97971)},616:(t,e,n)=>{"use strict";var i=n(9039);t.exports=!i(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},655:(t,e,n)=>{"use strict";var i=n(6955),r=String;t.exports=function(t){if("Symbol"===i(t))throw new TypeError("Cannot convert a Symbol value to a string");return r(t)}},679:(t,e,n)=>{"use strict";var i=n(1625),r=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw new r("Incorrect invocation")}},687:(t,e,n)=>{"use strict";var i=n(4913).f,r=n(9297),o=n(8227)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!r(t,o)&&i(t,o,{configurable:!0,value:e})}},706:(t,e,n)=>{"use strict";var i=n(350).PROPER,r=n(9039),o=n(7452);t.exports=function(t){return r(function(){return!!o[t]()||"​…᠎"!=="​…᠎"[t]()||i&&o[t].name!==t})}},741:t=>{"use strict";var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?n:e)(i)}},754:function(t,e,n){var i,r,o;t.exports=(i=n(9021),o=(r=i).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,i=this._map;t.clamp();for(var r=[],o=0;o<n;o+=3)for(var a=(e[o>>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)r.push(i.charAt(a>>>6*(3-s)&63));var l=i.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(t){var e=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r<n.length;r++)i[n.charCodeAt(r)]=r}var a=n.charAt(64);if(a){var s=t.indexOf(a);-1!==s&&(e=s)}return function(t,e,n){for(var i=[],r=0,a=0;a<e;a++)if(a%4){var s=n[t.charCodeAt(a-1)]<<a%4*2|n[t.charCodeAt(a)]>>>6-a%4*2;i[r>>>2]|=s<<24-r%4*8,r++}return o.create(i,r)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)},757:(t,e,n)=>{"use strict";var i=n(7751),r=n(4901),o=n(1625),a=n(7040),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&o(e.prototype,s(t))}},788:(t,e,n)=>{"use strict";var i=n(34),r=n(2195),o=n(8227)("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[o])?!!e:"RegExp"===r(t))}},851:(t,e,n)=>{"use strict";var i=n(6955),r=n(5966),o=n(4117),a=n(6269),s=n(8227)("iterator");t.exports=function(t){if(!o(t))return r(t,s)||r(t,"@@iterator")||a[i(t)]}},955:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib.BlockCipher,n=t.algo,r=[],o=[],a=[],s=[],l=[],c=[],u=[],h=[],d=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var n=0,i=0;for(e=0;e<256;e++){var f=i^i<<1^i<<2^i<<3^i<<4;f=f>>>8^255&f^99,r[n]=f,o[f]=n;var g=t[n],m=t[g],y=t[m],v=257*t[f]^16843008*f;a[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,l[n]=v<<8|v>>>24,c[n]=v,v=16843009*y^65537*m^257*g^16843008*n,u[f]=v<<24|v>>>8,h[f]=v<<16|v>>>16,d[f]=v<<8|v>>>24,p[f]=v,n?(n=g^t[t[t[y^g]]],i^=t[t[i]]):n=i=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],g=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,i=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<i;a++)a<n?o[a]=e[a]:(c=o[a-1],a%n?n>6&&a%n==4&&(c=r[c>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c]):(c=r[(c=c<<8|c>>>24)>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c],c^=f[a/n|0]<<24),o[a]=o[a-n]^c);for(var s=this._invKeySchedule=[],l=0;l<i;l++){if(a=i-l,l%4)var c=o[a];else c=o[a-4];s[l]=l<4||a<=4?c:u[r[c>>>24]]^h[r[c>>>16&255]]^d[r[c>>>8&255]]^p[r[255&c]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,l,c,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,u,h,d,p,o),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,i,r,o,a,s){for(var l=this._nRounds,c=t[e]^n[0],u=t[e+1]^n[1],h=t[e+2]^n[2],d=t[e+3]^n[3],p=4,f=1;f<l;f++){var g=i[c>>>24]^r[u>>>16&255]^o[h>>>8&255]^a[255&d]^n[p++],m=i[u>>>24]^r[h>>>16&255]^o[d>>>8&255]^a[255&c]^n[p++],y=i[h>>>24]^r[d>>>16&255]^o[c>>>8&255]^a[255&u]^n[p++],v=i[d>>>24]^r[c>>>16&255]^o[u>>>8&255]^a[255&h]^n[p++];c=g,u=m,h=y,d=v}g=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[p++],m=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&c])^n[p++],y=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^n[p++],v=(s[d>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^n[p++],t[e]=g,t[e+1]=m,t[e+2]=y,t[e+3]=v},keySize:8});t.AES=e._createHelper(g)}(),i.AES)},1025:function(t,e,n){var i,r,o;t.exports=(r=(i=n(9021)).lib.Base,o=i.enc.Utf8,void(i.algo.HMAC=r.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=o.parse(e));var n=t.blockSize,i=4*n;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var r=this._oKey=e.clone(),a=this._iKey=e.clone(),s=r.words,l=a.words,c=0;c<n;c++)s[c]^=1549556828,l[c]^=909522486;r.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}})))},1034:(t,e,n)=>{"use strict";var i=n(9565),r=n(9297),o=n(1625),a=n(5213),s=n(7979),l=RegExp.prototype;t.exports=a.correct?function(t){return t.flags}:function(t){return a.correct||!o(l,t)||r(t,"flags")?t.flags:i(s,t)}},1056:(t,e,n)=>{"use strict";var i=n(4913).f;t.exports=function(t,e,n){n in t||i(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},1072:(t,e,n)=>{"use strict";var i=n(1828),r=n(8727);t.exports=Object.keys||function(t){return i(t,r)}},1088:(t,e,n)=>{"use strict";var i=n(6518),r=n(9565),o=n(6395),a=n(350),s=n(4901),l=n(3994),c=n(2787),u=n(2967),h=n(687),d=n(6699),p=n(6840),f=n(8227),g=n(6269),m=n(7657),y=a.PROPER,v=a.CONFIGURABLE,_=m.IteratorPrototype,x=m.BUGGY_SAFARI_ITERATORS,b=f("iterator"),w="keys",S="values",M="entries",C=function(){return this};t.exports=function(t,e,n,a,f,m,T){l(n,e,a);var I,D,k,A=function(t){if(t===f&&R)return R;if(!x&&t&&t in P)return P[t];switch(t){case w:case S:case M:return function(){return new n(this,t)}}return function(){return new n(this)}},E=e+" Iterator",L=!1,P=t.prototype,O=P[b]||P["@@iterator"]||f&&P[f],R=!x&&O||A(f),B="Array"===e&&P.entries||O;if(B&&(I=c(B.call(new t)))!==Object.prototype&&I.next&&(o||c(I)===_||(u?u(I,_):s(I[b])||p(I,b,C)),h(I,E,!0,!0),o&&(g[E]=C)),y&&f===S&&O&&O.name!==S&&(!o&&v?d(P,"name",S):(L=!0,R=function(){return r(O,this)})),f)if(D={values:A(S),keys:m?R:A(w),entries:A(M)},T)for(k in D)(x||L||!(k in P))&&p(P,k,D[k]);else i({target:e,proto:!0,forced:x||L},D);return o&&!T||P[b]===R||p(P,b,R,{name:f}),g[e]=R,D}},1181:(t,e,n)=>{"use strict";var i,r,o,a=n(8622),s=n(4576),l=n(34),c=n(6699),u=n(9297),h=n(7629),d=n(6119),p=n(421),f="Object already initialized",g=s.TypeError,m=s.WeakMap;if(a||h.state){var y=h.state||(h.state=new m);y.get=y.get,y.has=y.has,y.set=y.set,i=function(t,e){if(y.has(t))throw new g(f);return e.facade=t,y.set(t,e),e},r=function(t){return y.get(t)||{}},o=function(t){return y.has(t)}}else{var v=d("state");p[v]=!0,i=function(t,e){if(u(t,v))throw new g(f);return e.facade=t,c(t,v,e),e},r=function(t){return u(t,v)?t[v]:{}},o=function(t){return u(t,v)}}t.exports={set:i,get:r,has:o,enforce:function(t){return o(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=r(e)).type!==t)throw new g("Incompatible receiver, "+t+" required");return n}}}},1291:(t,e,n)=>{"use strict";var i=n(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},1380:function(t,e,n){var i;t.exports=(i=n(9021),n(3240),function(){var t=i,e=t.lib.Hasher,n=t.x64,r=n.Word,o=n.WordArray,a=t.algo;function s(){return r.create.apply(r,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=s()}();var u=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=n[5],h=n[6],d=n[7],p=i.high,f=i.low,g=r.high,m=r.low,y=o.high,v=o.low,_=a.high,x=a.low,b=s.high,w=s.low,S=u.high,M=u.low,C=h.high,T=h.low,I=d.high,D=d.low,k=p,A=f,E=g,L=m,P=y,O=v,R=_,B=x,N=b,z=w,F=S,V=M,H=C,j=T,W=I,G=D,U=0;U<80;U++){var q,Y,X=c[U];if(U<16)Y=X.high=0|t[e+2*U],q=X.low=0|t[e+2*U+1];else{var $=c[U-15],Z=$.high,K=$.low,J=(Z>>>1|K<<31)^(Z>>>8|K<<24)^Z>>>7,Q=(K>>>1|Z<<31)^(K>>>8|Z<<24)^(K>>>7|Z<<25),tt=c[U-2],et=tt.high,nt=tt.low,it=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,rt=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=c[U-7],at=ot.high,st=ot.low,lt=c[U-16],ct=lt.high,ut=lt.low;Y=(Y=(Y=J+at+((q=Q+st)>>>0<Q>>>0?1:0))+it+((q+=rt)>>>0<rt>>>0?1:0))+ct+((q+=ut)>>>0<ut>>>0?1:0),X.high=Y,X.low=q}var ht,dt=N&F^~N&H,pt=z&V^~z&j,ft=k&E^k&P^E&P,gt=A&L^A&O^L&O,mt=(k>>>28|A<<4)^(k<<30|A>>>2)^(k<<25|A>>>7),yt=(A>>>28|k<<4)^(A<<30|k>>>2)^(A<<25|k>>>7),vt=(N>>>14|z<<18)^(N>>>18|z<<14)^(N<<23|z>>>9),_t=(z>>>14|N<<18)^(z>>>18|N<<14)^(z<<23|N>>>9),xt=l[U],bt=xt.high,wt=xt.low,St=W+vt+((ht=G+_t)>>>0<G>>>0?1:0),Mt=yt+gt;W=H,G=j,H=F,j=V,F=N,V=z,N=R+(St=(St=(St=St+dt+((ht+=pt)>>>0<pt>>>0?1:0))+bt+((ht+=wt)>>>0<wt>>>0?1:0))+Y+((ht+=q)>>>0<q>>>0?1:0))+((z=B+ht|0)>>>0<B>>>0?1:0)|0,R=P,B=O,P=E,O=L,E=k,L=A,k=St+(mt+ft+(Mt>>>0<yt>>>0?1:0))+((A=ht+Mt|0)>>>0<ht>>>0?1:0)|0}f=i.low=f+A,i.high=p+k+(f>>>0<A>>>0?1:0),m=r.low=m+L,r.high=g+E+(m>>>0<L>>>0?1:0),v=o.low=v+O,o.high=y+P+(v>>>0<O>>>0?1:0),x=a.low=x+B,a.high=_+R+(x>>>0<B>>>0?1:0),w=s.low=w+z,s.high=b+N+(w>>>0<z>>>0?1:0),M=u.low=M+V,u.high=S+F+(M>>>0<V>>>0?1:0),T=h.low=T+j,h.high=C+H+(T>>>0<j>>>0?1:0),D=d.low=D+G,d.high=I+W+(D>>>0<G>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(i+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(u),t.HmacSHA512=e._createHmacHelper(u)}(),i.SHA512)},1396:function(t,e,n){var i;t.exports=(i=n(9021),n(3240),n(6440),n(5503),n(754),n(4725),n(4636),n(5471),n(3009),n(6308),n(1380),n(9557),n(5953),n(8056),n(1025),n(19),n(9506),n(7165),n(2169),n(6939),n(6372),n(3797),n(8454),n(2073),n(4905),n(482),n(2155),n(8124),n(25),n(955),n(7628),n(7193),n(6298),n(2696),n(3128),i)},1625:(t,e,n)=>{"use strict";var i=n(9504);t.exports=i({}.isPrototypeOf)},1828:(t,e,n)=>{"use strict";var i=n(9504),r=n(9297),o=n(5397),a=n(9617).indexOf,s=n(421),l=i([].push);t.exports=function(t,e){var n,i=o(t),c=0,u=[];for(n in i)!r(s,n)&&r(i,n)&&l(u,n);for(;e.length>c;)r(i,n=e[c++])&&(~a(u,n)||l(u,n));return u}},1989:(t,e,n)=>{"use strict";function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function r(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(2953),t=n.hmd(t);class o{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({apiEndpoint:"/api/error-monitoring/js-error",project:"CRM",environment:"production",maxErrors:50,debounceTime:1e3,enableConsoleCapture:!0,enablePromiseRejection:!0,enableResourceErrors:!0},t),this.errorCount=0,this.recentErrors=new Set,this.debounceTimer=null,this.init()}init(){window.addEventListener("error",t=>{this.captureError({message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error:t.error,type:"javascript_error"})}),this.config.enablePromiseRejection&&window.addEventListener("unhandledrejection",t=>{var e;this.captureError({message:"Unhandled Promise Rejection: ".concat(t.reason),filename:window.location.href,lineno:0,colno:0,error:t.reason,type:"promise_rejection",stack:null===(e=t.reason)||void 0===e?void 0:e.stack})}),this.config.enableResourceErrors&&window.addEventListener("error",t=>{t.target!==window&&this.captureError({message:"Resource failed to load: ".concat(t.target.src||t.target.href),filename:t.target.src||t.target.href||window.location.href,lineno:0,colno:0,type:"resource_error",resourceType:t.target.tagName})},!0),this.config.enableConsoleCapture&&this.wrapConsoleError(),console.log("🐛 Error Tracker initialized for project:",this.config.project)}captureError(t){if(this.errorCount>=this.config.maxErrors)return;const e=this.createErrorId(t);this.recentErrors.has(e)||(this.recentErrors.add(e),this.errorCount++,setTimeout(()=>{this.recentErrors.delete(e)},5*this.config.debounceTime),clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.sendError(t)},this.config.debounceTime))}createErrorId(t){return"".concat(t.message,"_").concat(t.filename,"_").concat(t.lineno)}sendError(t){const e={message:t.message||"Unknown JavaScript Error",filename:t.filename||window.location.href,lineno:t.lineno||0,colno:t.colno||0,stack:this.getStackTrace(t.error),url:window.location.href,referrer:document.referrer,title:document.title,timestamp:(new Date).toISOString(),project:this.config.project,environment:this.config.environment,screen:{width:screen.width,height:screen.height,colorDepth:screen.colorDepth},viewport:{width:window.innerWidth,height:window.innerHeight},extra:{type:t.type||"javascript_error",resourceType:t.resourceType,userAgent:navigator.userAgent,cookieEnabled:navigator.cookieEnabled,language:navigator.language,platform:navigator.platform,onLine:navigator.onLine}};fetch(this.config.apiEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{t.success?console.log("🐛 Error reported:",t.data.unique_id):console.warn("Failed to report error:",t.message)}).catch(t=>{console.warn("Error tracker failed to send error:",t)})}getStackTrace(t){if(t&&t.stack)return t.stack;try{throw new Error}catch(t){return t.stack}}wrapConsoleError(){var t=this;const e=console.error;console.error=function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];e.apply(console,i);const o=i.map(t=>"object"==typeof t?JSON.stringify(t):String(t)).join(" ");t.captureError({message:"Console Error: ".concat(o),filename:window.location.href,lineno:0,colno:0,type:"console_error"})}}reportError(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.captureError({message:t,filename:window.location.href,lineno:0,colno:0,type:"manual_error",extra:e})}setUser(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.config.userId=t,this.config.userData=e}setContext(t,e){this.config.customContext||(this.config.customContext={}),this.config.customContext[t]=e}setEnabled(t){this.config.enabled=t}}if("undefined"!=typeof window){const t="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("local")?"development":"production";window.errorTracker=new o({environment:t,project:"CRM",enableConsoleCapture:"development"===t,maxErrors:"development"===t?100:50}),window.reportError=(t,e)=>{window.errorTracker.reportError(t,e)},console.log("🐛 Global error tracking enabled")}t.exports&&(t.exports=o)},2073:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.AnsiX923={pad:function(t,e){var n=t.sigBytes,i=4*e,r=i-n%i,o=n+r-1;t.clamp(),t.words[o>>>2]|=r<<24-o%4*8,t.sigBytes+=r},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Ansix923)},2106:(t,e,n)=>{"use strict";var i=n(283),r=n(4913);t.exports=function(t,e,n){return n.get&&i(n.get,e,{getter:!0}),n.set&&i(n.set,e,{setter:!0}),r.f(t,e,n)}},2140:(t,e,n)=>{"use strict";var i={};i[n(8227)("toStringTag")]="z",t.exports="[object z]"===String(i)},2155:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},i.pad.ZeroPadding)},2169:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.mode.CFB=function(){var t=i.lib.BlockCipherMode.extend();function e(t,e,n,i){var r,o=this._iv;o?(r=o.slice(0),this._iv=void 0):r=this._prevBlock,i.encryptBlock(r,0);for(var a=0;a<n;a++)t[e+a]^=r[a]}return t.Encryptor=t.extend({processBlock:function(t,n){var i=this._cipher,r=i.blockSize;e.call(this,t,n,r,i),this._prevBlock=t.slice(n,n+r)}}),t.Decryptor=t.extend({processBlock:function(t,n){var i=this._cipher,r=i.blockSize,o=t.slice(n,n+r);e.call(this,t,n,r,i),this._prevBlock=o}}),t}(),i.mode.CFB)},2195:(t,e,n)=>{"use strict";var i=n(9504),r=i({}.toString),o=i("".slice);t.exports=function(t){return o(r(t),8,-1)}},2211:(t,e,n)=>{"use strict";var i=n(9039);t.exports=!i(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},2360:(t,e,n)=>{"use strict";var i,r=n(8551),o=n(6801),a=n(8727),s=n(421),l=n(397),c=n(4055),u=n(6119),h="prototype",d="script",p=u("IE_PROTO"),f=function(){},g=function(t){return"<"+d+">"+t+"</"+d+">"},m=function(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;y="undefined"!=typeof document?document.domain&&i?m(i):(e=c("iframe"),n="java"+d+":",e.style.display="none",l.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(g("document.F=Object")),t.close(),t.F):m(i);for(var r=a.length;r--;)delete y[h][a[r]];return y()};s[p]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f[h]=r(t),n=new f,f[h]=null,n[p]=t):n=y(),void 0===e?n:o.f(n,e)}},2478:(t,e,n)=>{"use strict";var i=n(9504),r=n(8981),o=Math.floor,a=i("".charAt),s=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,i,h,d){var p=n+t.length,f=i.length,g=u;return void 0!==h&&(h=r(h),g=c),s(d,g,function(r,s){var c;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return l(e,0,n);case"'":return l(e,p);case"<":c=h[l(s,1,-1)];break;default:var u=+s;if(0===u)return r;if(u>f){var d=o(u/10);return 0===d?r:d<=f?void 0===i[d-1]?a(s,1):i[d-1]+a(s,1):r}c=i[u-1]}return void 0===c?"":c})}},2529:t=>{"use strict";t.exports=function(t,e){return{value:t,done:e}}},2652:(t,e,n)=>{"use strict";var i=n(6080),r=n(9565),o=n(8551),a=n(6823),s=n(4209),l=n(6198),c=n(1625),u=n(81),h=n(851),d=n(9539),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},g=f.prototype;t.exports=function(t,e,n){var m,y,v,_,x,b,w,S=n&&n.that,M=!(!n||!n.AS_ENTRIES),C=!(!n||!n.IS_RECORD),T=!(!n||!n.IS_ITERATOR),I=!(!n||!n.INTERRUPTED),D=i(e,S),k=function(t){return m&&d(m,"normal"),new f(!0,t)},A=function(t){return M?(o(t),I?D(t[0],t[1],k):D(t[0],t[1])):I?D(t,k):D(t)};if(C)m=t.iterator;else if(T)m=t;else{if(!(y=h(t)))throw new p(a(t)+" is not iterable");if(s(y)){for(v=0,_=l(t);_>v;v++)if((x=A(t[v]))&&c(g,x))return x;return new f(!1)}m=u(t,y)}for(b=C?t.next:m.next;!(w=r(b,m)).done;){try{x=A(w.value)}catch(t){d(m,"throw",t)}if("object"==typeof x&&x&&c(g,x))return x}return new f(!1)}},2696:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib.StreamCipher,n=t.algo,r=[],o=[],a=[],s=n.RabbitLegacy=e.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,n=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var r=0;r<4;r++)l.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(e){var o=e.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&u,d=u<<16|65535&c;for(i[0]^=c,i[1]^=h,i[2]^=u,i[3]^=d,i[4]^=c,i[5]^=h,i[6]^=u,i[7]^=d,r=0;r<4;r++)l.call(this)}},_doProcessBlock:function(t,e){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function l(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,s=i>>>16,l=((r*r>>>17)+r*s>>>15)+s*s,c=((4294901760&i)*i|0)+((65535&i)*i|0);a[n]=l^c}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),i.RabbitLegacy)},2762:(t,e,n)=>{"use strict";var i=n(6518),r=n(3802).trim;i({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return r(this)}})},2777:(t,e,n)=>{"use strict";var i=n(9565),r=n(34),o=n(757),a=n(5966),s=n(4270),l=n(8227),c=TypeError,u=l("toPrimitive");t.exports=function(t,e){if(!r(t)||o(t))return t;var n,l=a(t,u);if(l){if(void 0===e&&(e="default"),n=i(l,t,e),!r(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},2787:(t,e,n)=>{"use strict";var i=n(9297),r=n(4901),o=n(8981),a=n(6119),s=n(2211),l=a("IE_PROTO"),c=Object,u=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=o(t);if(i(e,l))return e[l];var n=e.constructor;return r(n)&&e instanceof n?n.prototype:e instanceof c?u:null}},2796:(t,e,n)=>{"use strict";var i=n(9039),r=n(4901),o=/#|\.prototype\./,a=function(t,e){var n=l[s(t)];return n===u||n!==c&&(r(e)?i(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},2803:()=>{window.formatValue=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t&&0!==t)return"0"+e;const n=parseFloat(t);return isNaN(n)?"0"+e:n>=1e6?(n/1e6).toFixed(1)+"M"+e:n>=1e3?(n/1e3).toFixed(1)+"k"+e:n.toString()+e},window.formatCurrency=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$";if(!t&&0!==t)return e+"0";const n=parseFloat(t);return isNaN(n)?e+"0":e+n.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2})},window.formatPercentage=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!t&&0!==t)return"0%";const n=parseFloat(t);return isNaN(n)?"0%":n.toFixed(e)+"%"},window.formatDate=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"short";if(!t)return"";const n=new Date(t);if(isNaN(n.getTime()))return"";switch(e){case"short":default:return n.toLocaleDateString();case"long":return n.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"});case"time":return n.toLocaleTimeString();case"datetime":return n.toLocaleString()}},window.formatFileSize=function(t){if(!t&&0!==t)return"0 B";const e=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(1024));return 0===n?t+" "+e[n]:(t/Math.pow(1024,n)).toFixed(1)+" "+e[n]},window.formatRelativeTime=function(t){if(!t)return"";const e=new Date(t);if(isNaN(e.getTime()))return"";const n=new Date,i=Math.floor((n-e)/1e3);if(i<60)return"just now";const r=Math.floor(i/60);if(r<60)return r+" minute"+(r>1?"s":"")+" ago";const o=Math.floor(r/60);if(o<24)return o+" hour"+(o>1?"s":"")+" ago";const a=Math.floor(o/24);if(a<7)return a+" day"+(a>1?"s":"")+" ago";const s=Math.floor(a/7);if(s<4)return s+" week"+(s>1?"s":"")+" ago";const l=Math.floor(a/30);if(l<12)return l+" month"+(l>1?"s":"")+" ago";const c=Math.floor(a/365);return c+" year"+(c>1?"s":"")+" ago"}},2812:t=>{"use strict";var e=TypeError;t.exports=function(t,n){if(t<n)throw new e("Not enough arguments");return t}},2839:(t,e,n)=>{"use strict";var i=n(4576).navigator,r=i&&i.userAgent;t.exports=r?String(r):""},2953:(t,e,n)=>{"use strict";var i=n(4576),r=n(7400),o=n(9296),a=n(3792),s=n(6699),l=n(687),c=n(8227)("iterator"),u=a.values,h=function(t,e){if(t){if(t[c]!==u)try{s(t,c,u)}catch(e){t[c]=u}if(l(t,e,!0),r[e])for(var n in a)if(t[n]!==a[n])try{s(t,n,a[n])}catch(e){t[n]=a[n]}}};for(var d in r)h(i[d]&&i[d].prototype,d);h(o,"DOMTokenList")},2967:(t,e,n)=>{"use strict";var i=n(6706),r=n(34),o=n(7750),a=n(3506);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=i(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return o(n),a(i),r(n)?(e?t(n,i):n.__proto__=i,n):n}}():void 0)},3009:function(t,e,n){var i;t.exports=(i=n(9021),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,a=e.algo,s=[],l=[];!function(){function e(e){for(var n=t.sqrt(e),i=2;i<=n;i++)if(!(e%i))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var i=2,r=0;r<64;)e(i)&&(r<8&&(s[r]=n(t.pow(i,.5))),l[r]=n(t.pow(i,1/3)),r++),i++}();var c=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],u=n[5],h=n[6],d=n[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var f=c[p-15],g=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,m=c[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[p]=g+c[p-7]+y+c[p-16]}var v=i&r^i&o^r&o,_=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),x=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&h)+l[p]+c[p];d=h,h=u,u=s,s=a+x|0,a=o,o=r,r=i,i=x+(_+v)|0}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+h|0,n[7]=n[7]+d|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=t.floor(i/4294967296),n[15+(r+64>>>9<<4)]=i,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(u),e.HmacSHA256=o._createHmacHelper(u)}(Math),i.SHA256)},3128:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib.BlockCipher,n=t.algo;const r=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var s={pbox:[],sbox:[]};function l(t,e){let n=e>>24&255,i=e>>16&255,r=e>>8&255,o=255&e,a=t.sbox[0][n]+t.sbox[1][i];return a^=t.sbox[2][r],a+=t.sbox[3][o],a}function c(t,e,n){let i,o=e,a=n;for(let e=0;e<r;++e)o^=t.pbox[e],a=l(t,o)^a,i=o,o=a,a=i;return i=o,o=a,a=i,a^=t.pbox[r],o^=t.pbox[17],{left:o,right:a}}var u=n.Blowfish=e.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4;!function(t,e,n){for(let e=0;e<4;e++){t.sbox[e]=[];for(let n=0;n<256;n++)t.sbox[e][n]=a[e][n]}let i=0;for(let r=0;r<18;r++)t.pbox[r]=o[r]^e[i],i++,i>=n&&(i=0);let r=0,s=0,l=0;for(let e=0;e<18;e+=2)l=c(t,r,s),r=l.left,s=l.right,t.pbox[e]=r,t.pbox[e+1]=s;for(let e=0;e<4;e++)for(let n=0;n<256;n+=2)l=c(t,r,s),r=l.left,s=l.right,t.sbox[e][n]=r,t.sbox[e][n+1]=s}(s,e,n)}},encryptBlock:function(t,e){var n=c(s,t[e],t[e+1]);t[e]=n.left,t[e+1]=n.right},decryptBlock:function(t,e){var n=function(t,e,n){let i,r=e,o=n;for(let e=17;e>1;--e)r^=t.pbox[e],o=l(t,r)^o,i=r,r=o,o=i;return i=r,r=o,o=i,o^=t.pbox[1],r^=t.pbox[0],{left:r,right:o}}(s,t[e],t[e+1]);t[e]=n.left,t[e+1]=n.right},blockSize:2,keySize:4,ivSize:2});t.Blowfish=e._createHelper(u)}(),i.Blowfish)},3167:(t,e,n)=>{"use strict";var i=n(4901),r=n(34),o=n(2967);t.exports=function(t,e,n){var a,s;return o&&i(a=e.constructor)&&a!==n&&r(s=a.prototype)&&s!==n.prototype&&o(t,s),t}},3240:function(t,e,n){var i,r,o,a,s,l;t.exports=(i=n(9021),o=(r=i).lib,a=o.Base,s=o.WordArray,(l=r.x64={}).Word=a.extend({init:function(t,e){this.high=t,this.low=e}}),l.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],i=0;i<e;i++){var r=t[i];n.push(r.high),n.push(r.low)}return s.create(n,this.sigBytes)},clone:function(){for(var t=a.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}}),i)},3296:(t,e,n)=>{"use strict";n(5806)},3389:(t,e,n)=>{"use strict";var i=n(4576),r=n(3724),o=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!r)return i[t];var e=o(i,t);return e&&e.value}},3392:(t,e,n)=>{"use strict";var i=n(9504),r=0,o=Math.random(),a=i(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+o,36)}},3506:(t,e,n)=>{"use strict";var i=n(3925),r=String,o=TypeError;t.exports=function(t){if(i(t))return t;throw new o("Can't set "+r(t)+" as a prototype")}},3517:(t,e,n)=>{"use strict";var i=n(9504),r=n(9039),o=n(4901),a=n(6955),s=n(7751),l=n(3706),c=function(){},u=s("Reflect","construct"),h=/^\s*(?:class|function)\b/,d=i(h.exec),p=!h.test(c),f=function(t){if(!o(t))return!1;try{return u(c,[],t),!0}catch(t){return!1}},g=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(h,l(t))}catch(t){return!0}};g.sham=!0,t.exports=!u||r(function(){var t;return f(f.call)||!f(Object)||!f(function(){t=!0})||t})?g:f},3607:(t,e,n)=>{"use strict";var i=n(2839).match(/AppleWebKit\/(\d+)\./);t.exports=!!i&&+i[1]},3635:(t,e,n)=>{"use strict";var i=n(9039),r=n(4576).RegExp;t.exports=i(function(){var t=r(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},3706:(t,e,n)=>{"use strict";var i=n(9504),r=n(4901),o=n(7629),a=i(Function.toString);r(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},3709:(t,e,n)=>{"use strict";var i=n(2839).match(/firefox\/(\d+)/i);t.exports=!!i&&+i[1]},3717:(t,e)=>{"use strict";e.f=Object.getOwnPropertySymbols},3724:(t,e,n)=>{"use strict";var i=n(9039);t.exports=!i(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3763:(t,e,n)=>{"use strict";var i=n(2839);t.exports=/MSIE|Trident/.test(i)},3792:(t,e,n)=>{"use strict";var i=n(5397),r=n(6469),o=n(6269),a=n(1181),s=n(4913).f,l=n(1088),c=n(2529),u=n(6395),h=n(3724),d="Array Iterator",p=a.set,f=a.getterFor(d);t.exports=l(Array,"Array",function(t,e){p(this,{type:d,target:i(t),index:0,kind:e})},function(){var t=f(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,c(void 0,!0);switch(t.kind){case"keys":return c(n,!1);case"values":return c(e[n],!1)}return c([n,e[n]],!1)},"values");var g=o.Arguments=o.Array;if(r("keys"),r("values"),r("entries"),!u&&h&&"values"!==g.name)try{s(g,"name",{value:"values"})}catch(t){}},3797:function(t,e,n){var i,r,o;t.exports=(o=n(9021),n(7165),o.mode.OFB=(r=(i=o.lib.BlockCipherMode.extend()).Encryptor=i.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._keystream;r&&(o=this._keystream=r.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var a=0;a<i;a++)t[e+a]^=o[a]}}),i.Decryptor=r,i),o.mode.OFB)},3802:(t,e,n)=>{"use strict";var i=n(9504),r=n(7750),o=n(655),a=n(7452),s=i("".replace),l=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),u=function(t){return function(e){var n=o(r(e));return 1&t&&(n=s(n,l,"")),2&t&&(n=s(n,c,"$1")),n}};t.exports={start:u(1),end:u(2),trim:u(3)}},3921:(t,e,n)=>{"use strict";var i=n(6518),r=n(2652),o=n(4659);i({target:"Object",stat:!0},{fromEntries:function(t){var e={};return r(t,function(t,n){o(e,t,n)},{AS_ENTRIES:!0}),e}})},3925:(t,e,n)=>{"use strict";var i=n(34);t.exports=function(t){return i(t)||null===t}},3994:(t,e,n)=>{"use strict";var i=n(7657).IteratorPrototype,r=n(2360),o=n(6980),a=n(687),s=n(6269),l=function(){return this};t.exports=function(t,e,n,c){var u=e+" Iterator";return t.prototype=r(i,{next:o(+!c,n)}),a(t,u,!1,!0),s[u]=l,t}},4055:(t,e,n)=>{"use strict";var i=n(4576),r=n(34),o=i.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},4117:t=>{"use strict";t.exports=function(t){return null==t}},4209:(t,e,n)=>{"use strict";var i=n(8227),r=n(6269),o=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[o]===t)}},4213:(t,e,n)=>{"use strict";var i=n(3724),r=n(9504),o=n(9565),a=n(9039),s=n(1072),l=n(3717),c=n(8773),u=n(8981),h=n(7055),d=Object.assign,p=Object.defineProperty,f=r([].concat);t.exports=!d||a(function(){if(i&&1!==d({b:1},d(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!==d({},t)[n]||s(d({},e)).join("")!==r})?function(t,e){for(var n=u(t),r=arguments.length,a=1,d=l.f,p=c.f;r>a;)for(var g,m=h(arguments[a++]),y=d?f(s(m),d(m)):s(m),v=y.length,_=0;v>_;)g=y[_++],i&&!o(p,m,g)||(n[g]=m[g]);return n}:d},4270:(t,e,n)=>{"use strict";var i=n(9565),r=n(4901),o=n(34),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&r(n=t.toString)&&!o(s=i(n,t)))return s;if(r(n=t.valueOf)&&!o(s=i(n,t)))return s;if("string"!==e&&r(n=t.toString)&&!o(s=i(n,t)))return s;throw new a("Can't convert object to primitive value")}},4450:()=>{function t(){return{campaign:{},stats:{},spend:{},formatted:{},loading:!0,error:!1,errorMessage:"",campaignId:null,init(){this.campaignId=this.$el.dataset.campaignId||window.location.pathname.split("/").pop(),this.campaignId&&this.loadCampaignDetails()},async loadCampaignDetails(){try{this.loading=!0,this.error=!1;const t=await fetch("/advertising/api/campaigns/".concat(this.campaignId)),e=await t.json();e.success?(this.campaign=e.data.campaign,this.stats=e.data.stats,this.spend=e.data.spend,this.formatted=e.data.formatted):(this.error=!0,this.errorMessage=e.error||"Erro ao carregar detalhes da campanha")}catch(t){console.error("Error loading campaign details:",t),this.error=!0,this.errorMessage="Erro de conexão"}finally{this.loading=!1}},async refresh(){await this.loadCampaignDetails()},async updateCampaignField(t,e){try{const n=await fetch("/advertising/api/campaigns/".concat(this.campaignId),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:e})}),i=await n.json();i.success?(this.campaign[t]=e,this.showNotification("Campanha atualizada com sucesso","success")):this.showNotification(i.error||"Erro ao atualizar campanha","error")}catch(t){console.error("Error updating campaign:",t),this.showNotification("Erro de conexão","error")}},async deleteCampaign(){if((await Swal.fire({title:this.$t("advertising.campaigns.delete.confirm_title"),text:this.$t("advertising.campaigns.delete.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("advertising.campaigns.delete.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const t=await fetch("/advertising/api/campaigns/".concat(this.campaignId),{method:"DELETE"}),e=await t.json();e.success?(this.showNotification("Campanha eliminada com sucesso","success"),setTimeout(()=>{window.location.href="/advertising/campaigns"},1500)):this.showNotification(e.error||"Erro ao eliminar campanha","error")}catch(t){console.error("Error deleting campaign:",t),this.showNotification("Erro de conexão","error")}},async duplicateCampaign(){if((await Swal.fire({title:this.$t("advertising.campaigns.duplicate.confirm_title"),text:this.$t("advertising.campaigns.duplicate.confirm_text"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#6c757d",confirmButtonText:this.$t("advertising.campaigns.duplicate.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-primary w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const t=await fetch("/advertising/api/campaigns/".concat(this.campaignId,"/duplicate"),{method:"POST"}),e=await t.json();e.success?(this.showNotification("Campanha duplicada com sucesso","success"),setTimeout(()=>{window.location.href="/advertising/campaigns/".concat(e.data.campaign_id)},1500)):this.showNotification(e.error||"Erro ao duplicar campanha","error")}catch(t){console.error("Error duplicating campaign:",t),this.showNotification("Erro de conexão","error")}},editCampaign(){window.location.href="/advertising/campaigns/".concat(this.campaignId,"/edit")},viewCreatives(){window.location.href="/advertising/creatives?campaign=".concat(this.campaignId)},viewTracking(){window.location.href="/advertising/tracking?campaign=".concat(this.campaignId)},viewReports(){window.location.href="/advertising/reports?campaign=".concat(this.campaignId)},formatNumber:t=>null==t?"0":new Intl.NumberFormat("pt-PT").format(t),formatCurrency:t=>null==t?"€0,00":new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),formatPercentage:t=>null==t?"0%":new Intl.NumberFormat("pt-PT",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(t/100),formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"N/A",showNotification(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";window.Swal?Swal.fire({title:"success"===e?"Sucesso!":"Aviso",text:t,icon:e,timer:"success"===e?2e3:void 0,showConfirmButton:"success"!==e}):alert(t)},get hasEndDate(){return this.campaign.end_date&&""!==this.campaign.end_date},get isActive(){return"active"===this.campaign.status},get isPaused(){return"paused"===this.campaign.status},get isDraft(){return"draft"===this.campaign.status},get isEnded(){return"ended"===this.campaign.status},get statusIcon(){return{active:"ri-play-circle-line",paused:"ri-pause-circle-line",draft:"ri-file-text-line",ended:"ri-stop-circle-line"}[this.campaign.status]||"ri-file-text-line"},get totalImpressions(){return this.stats.total_impressions||0},get totalClicks(){return this.stats.total_clicks||0},get ctr(){return this.stats.ctr||0},get totalSpend(){return this.spend.total_spend||0}}}"undefined"!=typeof window&&(window.Alpine?window.Alpine.data("advertisingCampaignDetails",t):document.addEventListener("alpine:init",()=>{window.Alpine.data("advertisingCampaignDetails",t)})),document.addEventListener("alpine-ready",()=>{window.Alpine&&!window.Alpine.data("advertisingCampaignDetails")&&window.Alpine.data("advertisingCampaignDetails",t)})},4488:(t,e,n)=>{"use strict";var i=n(7680),r=Math.floor,o=function(t,e){var n=t.length;if(n<8)for(var a,s,l=1;l<n;){for(s=l,a=t[l];s&&e(t[s-1],a)>0;)t[s]=t[--s];s!==l++&&(t[s]=a)}else for(var c=r(n/2),u=o(i(t,0,c),e),h=o(i(t,c),e),d=u.length,p=h.length,f=0,g=0;f<d||g<p;)t[f+g]=f<d&&g<p?e(u[f],h[g])<=0?u[f++]:h[g++]:f<d?u[f++]:h[g++];return t};t.exports=o},4495:(t,e,n)=>{"use strict";var i=n(9519),r=n(9039),o=n(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol("symbol detection");return!o(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41})},4576:function(t,e,n){"use strict";var i=function(t){return t&&t.Math===Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n.g&&n.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:(t,e,n)=>{"use strict";var i=n(9039);t.exports=function(t,e){var n=[][t];return!!n&&i(function(){n.call(null,e||function(){return 1},1)})}},4606:(t,e,n)=>{"use strict";var i=n(6823),r=TypeError;t.exports=function(t,e){if(!delete t[e])throw new r("Cannot delete property "+i(e)+" of "+i(t))}},4636:function(t,e,n){var i;t.exports=(i=n(9021),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=a.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var i=e+n,r=t[i];t[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,a=t[e+0],l=t[e+1],p=t[e+2],f=t[e+3],g=t[e+4],m=t[e+5],y=t[e+6],v=t[e+7],_=t[e+8],x=t[e+9],b=t[e+10],w=t[e+11],S=t[e+12],M=t[e+13],C=t[e+14],T=t[e+15],I=o[0],D=o[1],k=o[2],A=o[3];I=c(I,D,k,A,a,7,s[0]),A=c(A,I,D,k,l,12,s[1]),k=c(k,A,I,D,p,17,s[2]),D=c(D,k,A,I,f,22,s[3]),I=c(I,D,k,A,g,7,s[4]),A=c(A,I,D,k,m,12,s[5]),k=c(k,A,I,D,y,17,s[6]),D=c(D,k,A,I,v,22,s[7]),I=c(I,D,k,A,_,7,s[8]),A=c(A,I,D,k,x,12,s[9]),k=c(k,A,I,D,b,17,s[10]),D=c(D,k,A,I,w,22,s[11]),I=c(I,D,k,A,S,7,s[12]),A=c(A,I,D,k,M,12,s[13]),k=c(k,A,I,D,C,17,s[14]),I=u(I,D=c(D,k,A,I,T,22,s[15]),k,A,l,5,s[16]),A=u(A,I,D,k,y,9,s[17]),k=u(k,A,I,D,w,14,s[18]),D=u(D,k,A,I,a,20,s[19]),I=u(I,D,k,A,m,5,s[20]),A=u(A,I,D,k,b,9,s[21]),k=u(k,A,I,D,T,14,s[22]),D=u(D,k,A,I,g,20,s[23]),I=u(I,D,k,A,x,5,s[24]),A=u(A,I,D,k,C,9,s[25]),k=u(k,A,I,D,f,14,s[26]),D=u(D,k,A,I,_,20,s[27]),I=u(I,D,k,A,M,5,s[28]),A=u(A,I,D,k,p,9,s[29]),k=u(k,A,I,D,v,14,s[30]),I=h(I,D=u(D,k,A,I,S,20,s[31]),k,A,m,4,s[32]),A=h(A,I,D,k,_,11,s[33]),k=h(k,A,I,D,w,16,s[34]),D=h(D,k,A,I,C,23,s[35]),I=h(I,D,k,A,l,4,s[36]),A=h(A,I,D,k,g,11,s[37]),k=h(k,A,I,D,v,16,s[38]),D=h(D,k,A,I,b,23,s[39]),I=h(I,D,k,A,M,4,s[40]),A=h(A,I,D,k,a,11,s[41]),k=h(k,A,I,D,f,16,s[42]),D=h(D,k,A,I,y,23,s[43]),I=h(I,D,k,A,x,4,s[44]),A=h(A,I,D,k,S,11,s[45]),k=h(k,A,I,D,T,16,s[46]),I=d(I,D=h(D,k,A,I,p,23,s[47]),k,A,a,6,s[48]),A=d(A,I,D,k,v,10,s[49]),k=d(k,A,I,D,C,15,s[50]),D=d(D,k,A,I,m,21,s[51]),I=d(I,D,k,A,S,6,s[52]),A=d(A,I,D,k,f,10,s[53]),k=d(k,A,I,D,b,15,s[54]),D=d(D,k,A,I,l,21,s[55]),I=d(I,D,k,A,_,6,s[56]),A=d(A,I,D,k,T,10,s[57]),k=d(k,A,I,D,y,15,s[58]),D=d(D,k,A,I,M,21,s[59]),I=d(I,D,k,A,g,6,s[60]),A=d(A,I,D,k,w,10,s[61]),k=d(k,A,I,D,p,15,s[62]),D=d(D,k,A,I,x,21,s[63]),o[0]=o[0]+I|0,o[1]=o[1]+D|0,o[2]=o[2]+k|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,i=8*this._nDataBytes,r=8*e.sigBytes;n[r>>>5]|=128<<24-r%32;var o=t.floor(i/4294967296),a=i;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,n,i,r,o,a){var s=t+(e&n|~e&i)+r+a;return(s<<o|s>>>32-o)+e}function u(t,e,n,i,r,o,a){var s=t+(e&i|n&~i)+r+a;return(s<<o|s>>>32-o)+e}function h(t,e,n,i,r,o,a){var s=t+(e^n^i)+r+a;return(s<<o|s>>>32-o)+e}function d(t,e,n,i,r,o,a){var s=t+(n^(e|~i))+r+a;return(s<<o|s>>>32-o)+e}e.MD5=o._createHelper(l),e.HmacMD5=o._createHmacHelper(l)}(Math),i.MD5)},4659:(t,e,n)=>{"use strict";var i=n(3724),r=n(4913),o=n(6980);t.exports=function(t,e,n){i?r.f(t,e,o(0,n)):t[e]=n}},4725:function(t,e,n){var i,r,o;t.exports=(i=n(9021),o=(r=i).lib.WordArray,r.enc.Base64url={stringify:function(t,e){void 0===e&&(e=!0);var n=t.words,i=t.sigBytes,r=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a<i;a+=3)for(var s=(n[a>>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,l=0;l<4&&a+.75*l<i;l++)o.push(r.charAt(s>>>6*(3-l)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t,e){void 0===e&&(e=!0);var n=t.length,i=e?this._safe_map:this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var a=0;a<i.length;a++)r[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var l=t.indexOf(s);-1!==l&&(n=l)}return function(t,e,n){for(var i=[],r=0,a=0;a<e;a++)if(a%4){var s=n[t.charCodeAt(a-1)]<<a%4*2|n[t.charCodeAt(a)]>>>6-a%4*2;i[r>>>2]|=s<<24-r%4*8,r++}return o.create(i,r)}(t,n,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},i.enc.Base64url)},4864:(t,e,n)=>{"use strict";var i=n(3724),r=n(4576),o=n(9504),a=n(2796),s=n(3167),l=n(6699),c=n(2360),u=n(8480).f,h=n(1625),d=n(788),p=n(655),f=n(1034),g=n(8429),m=n(1056),y=n(6840),v=n(9039),_=n(9297),x=n(1181).enforce,b=n(7633),w=n(8227),S=n(3635),M=n(8814),C=w("match"),T=r.RegExp,I=T.prototype,D=r.SyntaxError,k=o(I.exec),A=o("".charAt),E=o("".replace),L=o("".indexOf),P=o("".slice),O=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,R=/a/g,B=/a/g,N=new T(R)!==R,z=g.MISSED_STICKY,F=g.UNSUPPORTED_Y;if(a("RegExp",i&&(!N||z||S||M||v(function(){return B[C]=!1,T(R)!==R||T(B)===B||"/a/i"!==String(T(R,"i"))})))){for(var V=function(t,e){var n,i,r,o,a,u,g=h(I,this),m=d(t),y=void 0===e,v=[],b=t;if(!g&&m&&y&&t.constructor===V)return t;if((m||h(I,t))&&(t=t.source,y&&(e=f(b))),t=void 0===t?"":p(t),e=void 0===e?"":p(e),b=t,S&&"dotAll"in R&&(i=!!e&&L(e,"s")>-1)&&(e=E(e,/s/g,"")),n=e,z&&"sticky"in R&&(r=!!e&&L(e,"y")>-1)&&F&&(e=E(e,/y/g,"")),M&&(o=function(t){for(var e,n=t.length,i=0,r="",o=[],a=c(null),s=!1,l=!1,u=0,h="";i<=n;i++){if("\\"===(e=A(t,i)))e+=A(t,++i);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:if(r+=e,"?:"===P(t,i+1,i+3))continue;k(O,P(t,i+1))&&(i+=2,l=!0),u++;continue;case">"===e&&l:if(""===h||_(a,h))throw new D("Invalid capture group name");a[h]=!0,o[o.length]=[h,u],l=!1,h="";continue}l?h+=e:r+=e}return[r,o]}(t),t=o[0],v=o[1]),a=s(T(t,e),g?this:I,V),(i||r||v.length)&&(u=x(a),i&&(u.dotAll=!0,u.raw=V(function(t){for(var e,n=t.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(e=A(t,i))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),r+=e):r+="[\\s\\S]":r+=e+A(t,++i);return r}(t),n)),r&&(u.sticky=!0),v.length&&(u.groups=v)),t!==b)try{l(a,"source",""===b?"(?:)":b)}catch(t){}return a},H=u(T),j=0;H.length>j;)m(V,T,H[j++]);I.constructor=V,V.prototype=I,y(r,"RegExp",V,{constructor:!0})}b("RegExp")},4901:t=>{"use strict";var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},4905:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.Iso10126={pad:function(t,e){var n=4*e,r=n-t.sigBytes%n;t.concat(i.lib.WordArray.random(r-1)).concat(i.lib.WordArray.create([r<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},i.pad.Iso10126)},4913:(t,e,n)=>{"use strict";var i=n(3724),r=n(5917),o=n(8686),a=n(8551),s=n(6969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,h="enumerable",d="configurable",p="writable";e.f=i?o?function(t,e,n){if(a(t),e=s(e),a(n),"function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var i=u(t,e);i&&i[p]&&(t[e]=n.value,n={configurable:d in n?n[d]:i[d],enumerable:h in n?n[h]:i[h],writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(a(t),e=s(e),a(n),r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},5031:(t,e,n)=>{"use strict";var i=n(7751),r=n(9504),o=n(8480),a=n(3717),s=n(8551),l=r([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=o.f(s(t)),n=a.f;return n?l(e,n(t)):e}},5213:(t,e,n)=>{"use strict";var i=n(4576),r=n(9039),o=i.RegExp,a=!r(function(){var t=!0;try{o(".","d")}catch(e){t=!1}var e={},n="",i=t?"dgimsy":"gimsy",r=function(t,i){Object.defineProperty(e,t,{get:function(){return n+=i,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in t&&(a.hasIndices="d"),a)r(s,a[s]);return Object.getOwnPropertyDescriptor(o.prototype,"flags").get.call(e)!==i||n!==i});t.exports={correct:a}},5397:(t,e,n)=>{"use strict";var i=n(7055),r=n(7750);t.exports=function(t){return i(r(t))}},5440:(t,e,n)=>{"use strict";var i=n(8745),r=n(9565),o=n(9504),a=n(9228),s=n(9039),l=n(8551),c=n(4901),u=n(34),h=n(1291),d=n(8014),p=n(655),f=n(7750),g=n(7829),m=n(5966),y=n(2478),v=n(1034),_=n(6682),x=n(8227)("replace"),b=Math.max,w=Math.min,S=o([].concat),M=o([].push),C=o("".indexOf),T=o("".slice),I=function(t){return void 0===t?t:String(t)},D="$0"==="a".replace(/./,"$0"),k=!!/./[x]&&""===/./[x]("a","$0");a("replace",function(t,e,n){var o=k?"$":"$0";return[function(t,n){var i=f(this),o=u(t)?m(t,x):void 0;return o?r(o,t,i,n):r(e,p(i),t,n)},function(t,r){var a=l(this),s=p(t);if("string"==typeof r&&-1===C(r,o)&&-1===C(r,"$<")){var u=n(e,a,s,r);if(u.done)return u.value}var f=c(r);f||(r=p(r));var m,x=p(v(a)),D=-1!==C(x,"g");D&&(m=-1!==C(x,"u"),a.lastIndex=0);for(var k,A=[];null!==(k=_(a,s))&&(M(A,k),D);)""===p(k[0])&&(a.lastIndex=g(s,d(a.lastIndex),m));for(var E="",L=0,P=0;P<A.length;P++){for(var O,R=p((k=A[P])[0]),B=b(w(h(k.index),s.length),0),N=[],z=1;z<k.length;z++)M(N,I(k[z]));var F=k.groups;if(f){var V=S([R],N,B,s);void 0!==F&&M(V,F),O=p(i(r,void 0,V))}else O=y(R,s,B,N,F,r);B>=L&&(E+=T(s,L,B)+O,L=B+R.length)}return E+T(s,L)}]},!!s(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})||!D||k)},5471:function(t,e,n){var i,r,o,a,s,l,c,u;t.exports=(r=(i=u=n(9021)).lib,o=r.WordArray,a=r.Hasher,s=i.algo,l=[],c=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],c=0;c<80;c++){if(c<16)l[c]=0|t[e+c];else{var u=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=u<<1|u>>>31}var h=(i<<5|i>>>27)+s+l[c];h+=c<20?1518500249+(r&o|~r&a):c<40?1859775393+(r^o^a):c<60?(r&o|r&a|o&a)-1894007588:(r^o^a)-899497514,s=a,a=o,o=r<<30|r>>>2,r=i,i=h}n[0]=n[0]+i|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(i+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),i.SHA1=a._createHelper(c),i.HmacSHA1=a._createHmacHelper(c),u.SHA1)},5503:function(t,e,n){var i;t.exports=(i=n(9021),function(){var t=i,e=t.lib.WordArray,n=t.enc;function r(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r<n;r+=2){var o=e[r>>>2]>>>16-r%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var n=t.length,i=[],r=0;r<n;r++)i[r>>>1]|=t.charCodeAt(r)<<16-r%2*16;return e.create(i,2*n)}},n.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],o=0;o<n;o+=2){var a=r(e[o>>>2]>>>16-o%4*8&65535);i.push(String.fromCharCode(a))}return i.join("")},parse:function(t){for(var n=t.length,i=[],o=0;o<n;o++)i[o>>>1]|=r(t.charCodeAt(o)<<16-o%2*16);return e.create(i,2*n)}}}(),i.enc.Utf16)},5610:(t,e,n)=>{"use strict";var i=n(1291),r=Math.max,o=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):o(n,e)}},5745:(t,e,n)=>{"use strict";var i=n(7629);t.exports=function(t,e){return i[t]||(i[t]=e||{})}},5806:(t,e,n)=>{"use strict";n(7764);var i,r=n(6518),o=n(3724),a=n(7416),s=n(4576),l=n(6080),c=n(9504),u=n(6840),h=n(2106),d=n(679),p=n(9297),f=n(4213),g=n(7916),m=n(7680),y=n(8183).codeAt,v=n(6098),_=n(655),x=n(687),b=n(2812),w=n(8406),S=n(1181),M=S.set,C=S.getterFor("URL"),T=w.URLSearchParams,I=w.getState,D=s.URL,k=s.TypeError,A=s.parseInt,E=Math.floor,L=Math.pow,P=c("".charAt),O=c(/./.exec),R=c([].join),B=c(1.1.toString),N=c([].pop),z=c([].push),F=c("".replace),V=c([].shift),H=c("".split),j=c("".slice),W=c("".toLowerCase),G=c([].unshift),U="Invalid scheme",q="Invalid host",Y="Invalid port",X=/[a-z]/i,$=/[\d+-.a-z]/i,Z=/\d/,K=/^0x/i,J=/^[0-7]+$/,Q=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+/,rt=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ot=/[\t\n\r]/g,at=function(t){var e,n,i,r;if("number"==typeof t){for(e=[],n=0;n<4;n++)G(e,t%256),t=E(t/256);return R(e,".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,n=1,i=null,r=0,o=0;o<8;o++)0!==t[o]?(r>n&&(e=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n?i:e}(t),n=0;n<8;n++)r&&0===t[n]||(r&&(r=!1),i===n?(e+=n?":":"::",r=!0):(e+=B(t[n],16),n<7&&(e+=":")));return"["+e+"]"}return t},st={},lt=f({},st,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=f({},lt,{"#":1,"?":1,"{":1,"}":1}),ut=f({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ht=function(t,e){var n=y(t,0);return n>32&&n<127&&!p(e,t)?t:encodeURIComponent(t)},dt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pt=function(t,e){var n;return 2===t.length&&O(X,P(t,0))&&(":"===(n=P(t,1))||!e&&"|"===n)},ft=function(t){var e;return t.length>1&&pt(j(t,0,2))&&(2===t.length||"/"===(e=P(t,2))||"\\"===e||"?"===e||"#"===e)},gt=function(t){return"."===t||"%2e"===W(t)},mt=function(t){return".."===(t=W(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},yt={},vt={},_t={},xt={},bt={},wt={},St={},Mt={},Ct={},Tt={},It={},Dt={},kt={},At={},Et={},Lt={},Pt={},Ot={},Rt={},Bt={},Nt={},zt=function(t,e,n){var i,r,o,a=_(t);if(e){if(r=this.parse(a))throw new k(r);this.searchParams=null}else{if(void 0!==n&&(i=new zt(n,!0)),r=this.parse(a,null,i))throw new k(r);(o=I(new T)).bindURL(this),this.searchParams=o}};zt.prototype={type:"URL",parse:function(t,e,n){var r,o,a,s,l=this,c=e||yt,u=0,h="",d=!1,f=!1,y=!1;for(t=_(t),e||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=F(t,it,""),t=F(t,rt,"$1")),t=F(t,ot,""),r=g(t);u<=r.length;){switch(o=r[u],c){case yt:if(!o||!O(X,o)){if(e)return U;c=_t;continue}h+=W(o),c=vt;break;case vt:if(o&&(O($,o)||"+"===o||"-"===o||"."===o))h+=W(o);else{if(":"!==o){if(e)return U;h="",c=_t,u=0;continue}if(e&&(l.isSpecial()!==p(dt,h)||"file"===h&&(l.includesCredentials()||null!==l.port)||"file"===l.scheme&&!l.host))return;if(l.scheme=h,e)return void(l.isSpecial()&&dt[l.scheme]===l.port&&(l.port=null));h="","file"===l.scheme?c=At:l.isSpecial()&&n&&n.scheme===l.scheme?c=xt:l.isSpecial()?c=Mt:"/"===r[u+1]?(c=bt,u++):(l.cannotBeABaseURL=!0,z(l.path,""),c=Rt)}break;case _t:if(!n||n.cannotBeABaseURL&&"#"!==o)return U;if(n.cannotBeABaseURL&&"#"===o){l.scheme=n.scheme,l.path=m(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,c=Nt;break}c="file"===n.scheme?At:wt;continue;case xt:if("/"!==o||"/"!==r[u+1]){c=wt;continue}c=Ct,u++;break;case bt:if("/"===o){c=Tt;break}c=Ot;continue;case wt:if(l.scheme=n.scheme,o===i)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query=n.query;else if("/"===o||"\\"===o&&l.isSpecial())c=St;else if("?"===o)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query="",c=Bt;else{if("#"!==o){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.path.length--,c=Ot;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query=n.query,l.fragment="",c=Nt}break;case St:if(!l.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,c=Ot;continue}c=Tt}else c=Ct;break;case Mt:if(c=Ct,"/"!==o||"/"!==P(h,u+1))continue;u++;break;case Ct:if("/"!==o&&"\\"!==o){c=Tt;continue}break;case Tt:if("@"===o){d&&(h="%40"+h),d=!0,a=g(h);for(var v=0;v<a.length;v++){var x=a[v];if(":"!==x||y){var b=ht(x,ut);y?l.password+=b:l.username+=b}else y=!0}h=""}else if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&l.isSpecial()){if(d&&""===h)return"Invalid authority";u-=g(h).length+1,h="",c=It}else h+=o;break;case It:case Dt:if(e&&"file"===l.scheme){c=Lt;continue}if(":"!==o||f){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&l.isSpecial()){if(l.isSpecial()&&""===h)return q;if(e&&""===h&&(l.includesCredentials()||null!==l.port))return;if(s=l.parseHost(h))return s;if(h="",c=Pt,e)return;continue}"["===o?f=!0:"]"===o&&(f=!1),h+=o}else{if(""===h)return q;if(s=l.parseHost(h))return s;if(h="",c=kt,e===Dt)return}break;case kt:if(!O(Z,o)){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&l.isSpecial()||e){if(""!==h){var w=A(h,10);if(w>65535)return Y;l.port=l.isSpecial()&&w===dt[l.scheme]?null:w,h=""}if(e)return;c=Pt;continue}return Y}h+=o;break;case At:if(l.scheme="file","/"===o||"\\"===o)c=Et;else{if(!n||"file"!==n.scheme){c=Ot;continue}switch(o){case i:l.host=n.host,l.path=m(n.path),l.query=n.query;break;case"?":l.host=n.host,l.path=m(n.path),l.query="",c=Bt;break;case"#":l.host=n.host,l.path=m(n.path),l.query=n.query,l.fragment="",c=Nt;break;default:ft(R(m(r,u),""))||(l.host=n.host,l.path=m(n.path),l.shortenPath()),c=Ot;continue}}break;case Et:if("/"===o||"\\"===o){c=Lt;break}n&&"file"===n.scheme&&!ft(R(m(r,u),""))&&(pt(n.path[0],!0)?z(l.path,n.path[0]):l.host=n.host),c=Ot;continue;case Lt:if(o===i||"/"===o||"\\"===o||"?"===o||"#"===o){if(!e&&pt(h))c=Ot;else if(""===h){if(l.host="",e)return;c=Pt}else{if(s=l.parseHost(h))return s;if("localhost"===l.host&&(l.host=""),e)return;h="",c=Pt}continue}h+=o;break;case Pt:if(l.isSpecial()){if(c=Ot,"/"!==o&&"\\"!==o)continue}else if(e||"?"!==o)if(e||"#"!==o){if(o!==i&&(c=Ot,"/"!==o))continue}else l.fragment="",c=Nt;else l.query="",c=Bt;break;case Ot:if(o===i||"/"===o||"\\"===o&&l.isSpecial()||!e&&("?"===o||"#"===o)){if(mt(h)?(l.shortenPath(),"/"===o||"\\"===o&&l.isSpecial()||z(l.path,"")):gt(h)?"/"===o||"\\"===o&&l.isSpecial()||z(l.path,""):("file"===l.scheme&&!l.path.length&&pt(h)&&(l.host&&(l.host=""),h=P(h,0)+":"),z(l.path,h)),h="","file"===l.scheme&&(o===i||"?"===o||"#"===o))for(;l.path.length>1&&""===l.path[0];)V(l.path);"?"===o?(l.query="",c=Bt):"#"===o&&(l.fragment="",c=Nt)}else h+=ht(o,ct);break;case Rt:"?"===o?(l.query="",c=Bt):"#"===o?(l.fragment="",c=Nt):o!==i&&(l.path[0]+=ht(o,st));break;case Bt:e||"#"!==o?o!==i&&("'"===o&&l.isSpecial()?l.query+="%27":l.query+="#"===o?"%23":ht(o,st)):(l.fragment="",c=Nt);break;case Nt:o!==i&&(l.fragment+=ht(o,lt))}u++}},parseHost:function(t){var e,n,i;if("["===P(t,0)){if("]"!==P(t,t.length-1))return q;if(e=function(t){var e,n,i,r,o,a,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,h=0,d=function(){return P(t,h)};if(":"===d()){if(":"!==P(t,1))return;h+=2,u=++c}for(;d();){if(8===c)return;if(":"!==d()){for(e=n=0;n<4&&O(tt,d());)e=16*e+A(d(),16),h++,n++;if("."===d()){if(0===n)return;if(h-=n,c>6)return;for(i=0;d();){if(r=null,i>0){if(!("."===d()&&i<4))return;h++}if(!O(Z,d()))return;for(;O(Z,d());){if(o=A(d(),10),null===r)r=o;else{if(0===r)return;r=10*r+o}if(r>255)return;h++}l[c]=256*l[c]+r,2!==++i&&4!==i||c++}if(4!==i)return;break}if(":"===d()){if(h++,!d())return}else if(d())return;l[c++]=e}else{if(null!==u)return;h++,u=++c}}if(null!==u)for(a=c-u,c=7;0!==c&&a>0;)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s;else if(8!==c)return;return l}(j(t,1,-1)),!e)return q;this.host=e}else if(this.isSpecial()){if(t=v(t),O(et,t))return q;if(e=function(t){var e,n,i,r,o,a,s,l=H(t,".");if(l.length&&""===l[l.length-1]&&l.length--,(e=l.length)>4)return t;for(n=[],i=0;i<e;i++){if(""===(r=l[i]))return t;if(o=10,r.length>1&&"0"===P(r,0)&&(o=O(K,r)?16:8,r=j(r,8===o?1:2)),""===r)a=0;else{if(!O(10===o?Q:8===o?J:tt,r))return t;a=A(r,o)}z(n,a)}for(i=0;i<e;i++)if(a=n[i],i===e-1){if(a>=L(256,5-e))return null}else if(a>255)return null;for(s=N(n),i=0;i<n.length;i++)s+=n[i]*L(256,3-i);return s}(t),null===e)return q;this.host=e}else{if(O(nt,t))return q;for(e="",n=g(t),i=0;i<n.length;i++)e+=ht(n[i],st);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(dt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&&pt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,n=t.username,i=t.password,r=t.host,o=t.port,a=t.path,s=t.query,l=t.fragment,c=e+":";return null!==r?(c+="//",t.includesCredentials()&&(c+=n+(i?":"+i:"")+"@"),c+=at(r),null!==o&&(c+=":"+o)):"file"===e&&(c+="//"),c+=t.cannotBeABaseURL?a[0]:a.length?"/"+R(a,"/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},setHref:function(t){var e=this.parse(t);if(e)throw new k(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Ft(t.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+at(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(_(t)+":",yt)},getUsername:function(){return this.username},setUsername:function(t){var e=g(_(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<e.length;n++)this.username+=ht(e[n],ut)}},getPassword:function(){return this.password},setPassword:function(t){var e=g(_(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<e.length;n++)this.password+=ht(e[n],ut)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?at(t):at(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,It)},getHostname:function(){var t=this.host;return null===t?"":at(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Dt)},getPort:function(){var t=this.port;return null===t?"":_(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=_(t))?this.port=null:this.parse(t,kt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+R(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Pt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=_(t))?this.query=null:("?"===P(t,0)&&(t=j(t,1)),this.query="",this.parse(t,Bt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=_(t))?("#"===P(t,0)&&(t=j(t,1)),this.fragment="",this.parse(t,Nt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ft=function(t){var e=d(this,Vt),n=b(arguments.length,1)>1?arguments[1]:void 0,i=M(e,new zt(t,!1,n));o||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},Vt=Ft.prototype,Ht=function(t,e){return{get:function(){return C(this)[t]()},set:e&&function(t){return C(this)[e](t)},configurable:!0,enumerable:!0}};if(o&&(h(Vt,"href",Ht("serialize","setHref")),h(Vt,"origin",Ht("getOrigin")),h(Vt,"protocol",Ht("getProtocol","setProtocol")),h(Vt,"username",Ht("getUsername","setUsername")),h(Vt,"password",Ht("getPassword","setPassword")),h(Vt,"host",Ht("getHost","setHost")),h(Vt,"hostname",Ht("getHostname","setHostname")),h(Vt,"port",Ht("getPort","setPort")),h(Vt,"pathname",Ht("getPathname","setPathname")),h(Vt,"search",Ht("getSearch","setSearch")),h(Vt,"searchParams",Ht("getSearchParams")),h(Vt,"hash",Ht("getHash","setHash"))),u(Vt,"toJSON",function(){return C(this).serialize()},{enumerable:!0}),u(Vt,"toString",function(){return C(this).serialize()},{enumerable:!0}),D){var jt=D.createObjectURL,Wt=D.revokeObjectURL;jt&&u(Ft,"createObjectURL",l(jt,D)),Wt&&u(Ft,"revokeObjectURL",l(Wt,D))}x(Ft,"URL"),r({global:!0,constructor:!0,forced:!a,sham:!o},{URL:Ft})},5917:(t,e,n)=>{"use strict";var i=n(3724),r=n(9039),o=n(4055);t.exports=!i&&!r(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},5953:function(t,e,n){var i;t.exports=(i=n(9021),n(3240),function(t){var e=i,n=e.lib,r=n.WordArray,o=n.Hasher,a=e.x64.Word,s=e.algo,l=[],c=[],u=[];!function(){for(var t=1,e=0,n=0;n<24;n++){l[t+5*e]=(n+1)*(n+2)/2%64;var i=(2*t+3*e)%5;t=e%5,e=i}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var r=1,o=0;o<24;o++){for(var s=0,h=0,d=0;d<7;d++){if(1&r){var p=(1<<d)-1;p<32?h^=1<<p:s^=1<<p-32}128&r?r=r<<1^113:r<<=1}u[o]=a.create(s,h)}}();var h=[];!function(){for(var t=0;t<25;t++)h[t]=a.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var n=this._state,i=this.blockSize/2,r=0;r<i;r++){var o=t[e+2*r],a=t[e+2*r+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(D=n[r]).high^=a,D.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var p=0,f=0,g=0;g<5;g++)p^=(D=n[d+5*g]).high,f^=D.low;var m=h[d];m.high=p,m.low=f}for(d=0;d<5;d++){var y=h[(d+4)%5],v=h[(d+1)%5],_=v.high,x=v.low;for(p=y.high^(_<<1|x>>>31),f=y.low^(x<<1|_>>>31),g=0;g<5;g++)(D=n[d+5*g]).high^=p,D.low^=f}for(var b=1;b<25;b++){var w=(D=n[b]).high,S=D.low,M=l[b];M<32?(p=w<<M|S>>>32-M,f=S<<M|w>>>32-M):(p=S<<M-32|w>>>64-M,f=w<<M-32|S>>>64-M);var C=h[c[b]];C.high=p,C.low=f}var T=h[0],I=n[0];for(T.high=I.high,T.low=I.low,d=0;d<5;d++)for(g=0;g<5;g++){var D=n[b=d+5*g],k=h[b],A=h[(d+1)%5+5*g],E=h[(d+2)%5+5*g];D.high=k.high^~A.high&E.high,D.low=k.low^~A.low&E.low}D=n[0];var L=u[s];D.high^=L.high,D.low^=L.low}},_doFinalize:function(){var e=this._data,n=e.words,i=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[i>>>5]|=1<<24-i%32,n[(t.ceil((i+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],u=0;u<l;u++){var h=a[u],d=h.high,p=h.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(d)}return new r.init(c,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});e.SHA3=o._createHelper(d),e.HmacSHA3=o._createHmacHelper(d)}(Math),i.SHA3)},5966:(t,e,n)=>{"use strict";var i=n(9306),r=n(4117);t.exports=function(t,e){var n=t[e];return r(n)?void 0:i(n)}},5987:()=>{function t(){return{data:{},charts:{},loading:!0,error:!1,errorMessage:"",init(){this.loadReportsData()},async loadReportsData(){try{this.loading=!0,this.error=!1;const t=await fetch("/apps/crm/reports/api"),e=await t.json();e.success?(this.data=e.data,this.initCharts()):(this.error=!0,this.errorMessage=e.error||"Erro ao carregar relatórios")}catch(t){console.error("Error loading CRM reports:",t),this.error=!0,this.errorMessage="Erro de conexão"}finally{this.loading=!1}},async refresh(){await this.loadReportsData()},initCharts(){setTimeout(()=>{this.initLeadsBySourceChart(),this.initDealsByStageChart(),this.initTasksByStatusChart(),this.initMonthlyRevenueChart()},100)},initLeadsBySourceChart(){var t;const e=document.getElementById("leadsBySourceChart");if(!e||null===(t=this.data.charts)||void 0===t||!t.leads_by_source)return;const n=this.data.charts.leads_by_source;this.charts.leadsBySource=new ApexCharts(e,{series:n.map(t=>t.count),chart:{type:"donut",height:300},labels:n.map(t=>t.source),colors:["#556ee6","#34c38f","#f1b44c","#f46a6a"],legend:{position:"bottom"},plotOptions:{pie:{donut:{size:"70%"}}}}),this.charts.leadsBySource.render()},initDealsByStageChart(){var t;const e=document.getElementById("dealsByStageChart");if(!e||null===(t=this.data.charts)||void 0===t||!t.deals_by_stage)return;const n=this.data.charts.deals_by_stage;this.charts.dealsByStage=new ApexCharts(e,{series:[{name:"Deals",data:n.map(t=>t.count)}],chart:{type:"bar",height:300},xaxis:{categories:n.map(t=>t.stage)},colors:["#556ee6"],plotOptions:{bar:{horizontal:!1,columnWidth:"55%"}}}),this.charts.dealsByStage.render()},initTasksByStatusChart(){var t;const e=document.getElementById("tasksByStatusChart");if(!e||null===(t=this.data.charts)||void 0===t||!t.tasks_by_status)return;const n=this.data.charts.tasks_by_status;this.charts.tasksByStatus=new ApexCharts(e,{series:n.map(t=>t.count),chart:{type:"pie",height:300},labels:n.map(t=>t.status),colors:["#556ee6","#34c38f","#f1b44c","#f46a6a"],legend:{position:"bottom"}}),this.charts.tasksByStatus.render()},initMonthlyRevenueChart(){var t;const e=document.getElementById("monthlyRevenueChart");if(!e||null===(t=this.data.charts)||void 0===t||!t.monthly_revenue)return;const n=this.data.charts.monthly_revenue;this.charts.monthlyRevenue=new ApexCharts(e,{series:[{name:"Revenue",data:n.map(t=>t.revenue)}],chart:{type:"line",height:300},xaxis:{categories:n.map(t=>t.month)},colors:["#34c38f"],stroke:{curve:"smooth"},yaxis:{labels:{formatter:function(t){return"€"+t.toLocaleString()}}}}),this.charts.monthlyRevenue.render()},formatNumber:t=>null==t?"0":new Intl.NumberFormat("pt-PT").format(t),formatCurrency:t=>null==t?"€0,00":new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),formatPercentage(t,e){if(0===e)return"0%";const n=t/e*100;return new Intl.NumberFormat("pt-PT",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(n/100)},get totalLeads(){var t;return(null===(t=this.data.leads)||void 0===t?void 0:t.total)||0},get qualifiedLeads(){var t;return(null===(t=this.data.leads)||void 0===t?void 0:t.qualified)||0},get convertedLeads(){var t;return(null===(t=this.data.leads)||void 0===t?void 0:t.converted)||0},get totalDeals(){var t;return(null===(t=this.data.deals)||void 0===t?void 0:t.total)||0},get wonDeals(){var t;return(null===(t=this.data.deals)||void 0===t?void 0:t.won)||0},get totalDealValue(){var t;return(null===(t=this.data.deals)||void 0===t?void 0:t.value)||0},get wonDealValue(){var t;return(null===(t=this.data.deals)||void 0===t?void 0:t.won_value)||0},get totalTasks(){var t;return(null===(t=this.data.tasks)||void 0===t?void 0:t.total)||0},get overdueTasks(){var t;return(null===(t=this.data.tasks)||void 0===t?void 0:t.overdue)||0},get leadConversionRate(){return 0===this.totalLeads?0:this.convertedLeads/this.totalLeads*100},get dealWinRate(){return 0===this.totalDeals?0:this.wonDeals/this.totalDeals*100}}}"undefined"!=typeof window&&(window.Alpine?window.Alpine.data("crmReportsDashboard",t):document.addEventListener("alpine:init",()=>{window.Alpine.data("crmReportsDashboard",t)})),document.addEventListener("alpine-ready",()=>{window.Alpine&&!window.Alpine.data("crmReportsDashboard")&&window.Alpine.data("crmReportsDashboard",t)})},6080:(t,e,n)=>{"use strict";var i=n(7476),r=n(9306),o=n(616),a=i(i.bind);t.exports=function(t,e){return r(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},6098:(t,e,n)=>{"use strict";var i=n(9504),r=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",l=RangeError,c=i(a.exec),u=Math.floor,h=String.fromCharCode,d=i("".charCodeAt),p=i([].join),f=i([].push),g=i("".replace),m=i("".split),y=i("".toLowerCase),v=function(t){return t+22+75*(t<26)},_=function(t,e,n){var i=0;for(t=n?u(t/700):t>>1,t+=u(t/e);t>455;)t=u(t/35),i+=36;return u(i+36*t/(t+38))},x=function(t){var e=[];t=function(t){for(var e=[],n=0,i=t.length;n<i;){var r=d(t,n++);if(r>=55296&&r<=56319&&n<i){var o=d(t,n++);56320==(64512&o)?f(e,((1023&r)<<10)+(1023&o)+65536):(f(e,r),n--)}else f(e,r)}return e}(t);var n,i,o=t.length,a=128,c=0,g=72;for(n=0;n<t.length;n++)(i=t[n])<128&&f(e,h(i));var m=e.length,y=m;for(m&&f(e,"-");y<o;){var x=r;for(n=0;n<t.length;n++)(i=t[n])>=a&&i<x&&(x=i);var b=y+1;if(x-a>u((r-c)/b))throw new l(s);for(c+=(x-a)*b,a=x,n=0;n<t.length;n++){if((i=t[n])<a&&++c>r)throw new l(s);if(i===a){for(var w=c,S=36;;){var M=S<=g?1:S>=g+26?26:S-g;if(w<M)break;var C=w-M,T=36-M;f(e,h(v(M+C%T))),w=u(C/T),S+=36}f(e,h(v(w))),g=_(c,b,y===m),c=0,y++}}c++,a++}return p(e,"")};t.exports=function(t){var e,n,i=[],r=m(g(y(t),a,"."),".");for(e=0;e<r.length;e++)n=r[e],f(i,c(o,n)?"xn--"+x(n):n);return p(i,".")}},6119:(t,e,n)=>{"use strict";var i=n(5745),r=n(3392),o=i("keys");t.exports=function(t){return o[t]||(o[t]=r(t))}},6198:(t,e,n)=>{"use strict";var i=n(8014);t.exports=function(t){return i(t.length)}},6269:t=>{"use strict";t.exports={}},6279:(t,e,n)=>{"use strict";var i=n(6840);t.exports=function(t,e,n){for(var r in e)i(t,r,e[r],n);return t}},6298:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib.StreamCipher,n=t.algo,r=[],o=[],a=[],s=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)r[n]^=i[n+4&7];if(e){var o=e.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&u,d=u<<16|65535&c;for(r[0]^=c,r[1]^=h,r[2]^=u,r[3]^=d,r[4]^=c,r[5]^=h,r[6]^=u,r[7]^=d,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(t,e){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var i=0;i<4;i++)r[i]=16711935&(r[i]<<8|r[i]>>>24)|4278255360&(r[i]<<24|r[i]>>>8),t[e+i]^=r[i]},blockSize:4,ivSize:2});function l(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0<o[0]>>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0<o[1]>>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0<o[2]>>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0<o[3]>>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0<o[4]>>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0<o[5]>>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0<o[6]>>>0?1:0)|0,this._b=e[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var i=t[n]+e[n],r=65535&i,s=i>>>16,l=((r*r>>>17)+r*s>>>15)+s*s,c=((4294901760&i)*i|0)+((65535&i)*i|0);a[n]=l^c}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),i.Rabbit)},6308:function(t,e,n){var i,r,o,a,s,l;t.exports=(l=n(9021),n(3009),r=(i=l).lib.WordArray,o=i.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),i.SHA224=a._createHelper(s),i.HmacSHA224=a._createHmacHelper(s),l.SHA224)},6319:(t,e,n)=>{"use strict";var i=n(8551),r=n(9539);t.exports=function(t,e,n,o){try{return o?e(i(n)[0],n[1]):e(n)}catch(e){r(t,"throw",e)}}},6372:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.mode.CTRGladman=function(){var t=i.lib.BlockCipherMode.extend();function e(t){if(255&~(t>>24))t+=1<<24;else{var e=t>>16&255,n=t>>8&255,i=255&t;255===e?(e=0,255===n?(n=0,255===i?i=0:++i):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=i}return t}var n=t.Encryptor=t.extend({processBlock:function(t,n){var i=this._cipher,r=i.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(a);var s=a.slice(0);i.encryptBlock(s,0);for(var l=0;l<r;l++)t[n+l]^=s[l]}});return t.Decryptor=n,t}(),i.mode.CTRGladman)},6395:t=>{"use strict";t.exports=!1},6440:function(t,e,n){var i;t.exports=(i=n(9021),function(){if("function"==typeof ArrayBuffer){var t=i.lib.WordArray,e=t.init,n=t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var n=t.byteLength,i=[],r=0;r<n;r++)i[r>>>2]|=t[r]<<24-r%4*8;e.call(this,i,n)}else e.apply(this,arguments)};n.prototype=t}}(),i.lib.WordArray)},6469:(t,e,n)=>{"use strict";var i=n(8227),r=n(2360),o=n(4913).f,a=i("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},6518:(t,e,n)=>{"use strict";var i=n(4576),r=n(7347).f,o=n(6699),a=n(6840),s=n(9433),l=n(7740),c=n(2796);t.exports=function(t,e){var n,u,h,d,p,f=t.target,g=t.global,m=t.stat;if(n=g?i:m?i[f]||s(f,{}):i[f]&&i[f].prototype)for(u in e){if(d=e[u],h=t.dontCallGetSet?(p=r(n,u))&&p.value:n[u],!c(g?u:f+(m?".":"#")+u,t.forced)&&void 0!==h){if(typeof d==typeof h)continue;l(d,h)}(t.sham||h&&h.sham)&&o(d,"sham",!0),a(n,u,d,t)}}},6682:(t,e,n)=>{"use strict";var i=n(9565),r=n(8551),o=n(4901),a=n(2195),s=n(7323),l=TypeError;t.exports=function(t,e){var n=t.exec;if(o(n)){var c=i(n,t,e);return null!==c&&r(c),c}if("RegExp"===a(t))return i(s,t,e);throw new l("RegExp#exec called on incompatible receiver")}},6699:(t,e,n)=>{"use strict";var i=n(3724),r=n(4913),o=n(6980);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},6704:()=>{function t(){return{widgetType:"",widgetData:null,loading:!0,error:!1,errorMessage:"",init(){this.widgetType=this.$el.getAttribute("data-widget-type"),this.widgetType&&this.loadWidgetData()},async loadWidgetData(){try{this.loading=!0,this.error=!1;const t=await fetch("/dashboard/api/widget/".concat(this.widgetType));if(!t.ok)throw new Error("HTTP ".concat(t.status,": ").concat(t.statusText));const e=await t.json();if(!e.success)throw new Error(e.error||"Failed to load widget data");this.widgetData=e.data}catch(t){console.error("Error loading widget ".concat(this.widgetType,":"),t),this.error=!0,this.errorMessage=t.message}finally{this.loading=!1}},refresh(){this.loadWidgetData()},formatNumber:t=>new Intl.NumberFormat("pt-PT").format(t),formatCurrency:t=>new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),formatPercentage:t=>"".concat(t,"%")}}"undefined"!=typeof window&&(window.Alpine?window.Alpine.data("dynamicWidget",t):document.addEventListener("alpine:init",()=>{window.Alpine.data("dynamicWidget",t)})),document.addEventListener("alpine-ready",()=>{window.Alpine&&!window.Alpine.data("dynamicWidget")&&window.Alpine.data("dynamicWidget",t)})},6706:(t,e,n)=>{"use strict";var i=n(9504),r=n(9306);t.exports=function(t,e,n){try{return i(r(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},6801:(t,e,n)=>{"use strict";var i=n(3724),r=n(8686),o=n(4913),a=n(8551),s=n(5397),l=n(1072);e.f=i&&!r?Object.defineProperties:function(t,e){a(t);for(var n,i=s(e),r=l(e),c=r.length,u=0;c>u;)o.f(t,n=r[u++],i[n]);return t}},6823:t=>{"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6840:(t,e,n)=>{"use strict";var i=n(4901),r=n(4913),o=n(283),a=n(9433);t.exports=function(t,e,n,s){s||(s={});var l=s.enumerable,c=void 0!==s.name?s.name:e;if(i(n)&&o(n,c,s),s.global)l?t[e]=n:a(e,n);else{try{s.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:r.f(t,e,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},6910:(t,e,n)=>{"use strict";var i=n(6518),r=n(9504),o=n(9306),a=n(8981),s=n(6198),l=n(4606),c=n(655),u=n(9039),h=n(4488),d=n(4598),p=n(3709),f=n(3763),g=n(9519),m=n(3607),y=[],v=r(y.sort),_=r(y.push),x=u(function(){y.sort(void 0)}),b=u(function(){y.sort(null)}),w=d("sort"),S=!u(function(){if(g)return g<70;if(!(p&&p>3)){if(f)return!0;if(m)return m<603;var t,e,n,i,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)y.push({k:e+i,v:n})}for(y.sort(function(t,e){return e.v-t.v}),i=0;i<y.length;i++)e=y[i].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return"DGBEFHACIJK"!==r}});i({target:"Array",proto:!0,forced:x||!b||!w||!S},{sort:function(t){void 0!==t&&o(t);var e=a(this);if(S)return void 0===t?v(e):v(e,t);var n,i,r=[],u=s(e);for(i=0;i<u;i++)i in e&&_(r,e[i]);for(h(r,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:c(e)>c(n)?1:-1}}(t)),n=s(r),i=0;i<n;)e[i]=r[i++];for(;i<u;)l(e,i++);return e}})},6939:function(t,e,n){var i,r,o;t.exports=(o=n(9021),n(7165),o.mode.CTR=(r=(i=o.lib.BlockCipherMode.extend()).Encryptor=i.extend({processBlock:function(t,e){var n=this._cipher,i=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0);var a=o.slice(0);n.encryptBlock(a,0),o[i-1]=o[i-1]+1|0;for(var s=0;s<i;s++)t[e+s]^=a[s]}}),i.Decryptor=r,i),o.mode.CTR)},6955:(t,e,n)=>{"use strict";var i=n(2140),r=n(4901),o=n(2195),a=n(8227)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());t.exports=i?o:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=s(t),a))?n:l?o(e):"Object"===(i=o(e))&&r(e.callee)?"Arguments":i}},6969:(t,e,n)=>{"use strict";var i=n(2777),r=n(757);t.exports=function(t){var e=i(t,"string");return r(e)?e:e+""}},6980:t=>{"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7040:(t,e,n)=>{"use strict";var i=n(4495);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(t,e,n)=>{"use strict";var i=n(9504),r=n(9039),o=n(2195),a=Object,s=i("".split);t.exports=r(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===o(t)?s(t,""):a(t)}:a},7165:function(t,e,n){var i,r,o,a,s,l,c,u,h,d,p,f,g,m,y,v,_,x,b;t.exports=(i=n(9021),n(9506),void(i.lib.Cipher||(r=i,o=r.lib,a=o.Base,s=o.WordArray,l=o.BufferedBlockAlgorithm,c=r.enc,c.Utf8,u=c.Base64,h=r.algo.EvpKDF,d=o.Cipher=l.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){l.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?b:_}return function(e){return{encrypt:function(n,i,r){return t(i).encrypt(e,n,i,r)},decrypt:function(n,i,r){return t(i).decrypt(e,n,i,r)}}}}()}),o.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),p=r.mode={},f=o.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),g=p.CBC=function(){var t=f.extend();function e(t,e,n){var i,r=this._iv;r?(i=r,this._iv=void 0):i=this._prevBlock;for(var o=0;o<n;o++)t[e+o]^=i[o]}return t.Encryptor=t.extend({processBlock:function(t,n){var i=this._cipher,r=i.blockSize;e.call(this,t,n,r),i.encryptBlock(t,n),this._prevBlock=t.slice(n,n+r)}}),t.Decryptor=t.extend({processBlock:function(t,n){var i=this._cipher,r=i.blockSize,o=t.slice(n,n+r);i.decryptBlock(t,n),e.call(this,t,n,r),this._prevBlock=o}}),t}(),m=(r.pad={}).Pkcs7={pad:function(t,e){for(var n=4*e,i=n-t.sigBytes%n,r=i<<24|i<<16|i<<8|i,o=[],a=0;a<i;a+=4)o.push(r);var l=s.create(o,i);t.concat(l)},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:m}),reset:function(){var t;d.reset.call(this);var e=this.cfg,n=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(i,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),y=o.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),v=(r.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(e):e).toString(u)},parse:function(t){var e,n=u.parse(t),i=n.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=s.create(i.slice(2,4)),i.splice(0,4),n.sigBytes-=16),y.create({ciphertext:n,salt:e})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:v}),encrypt:function(t,e,n,i){i=this.cfg.extend(i);var r=t.createEncryptor(n,i),o=r.finalize(e),a=r.cfg;return y.create({ciphertext:o,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,n,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(n,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=(r.kdf={}).OpenSSL={execute:function(t,e,n,i,r){if(i||(i=s.random(8)),r)o=h.create({keySize:e+n,hasher:r}).compute(t,i);else var o=h.create({keySize:e+n}).compute(t,i);var a=s.create(o.words.slice(e),4*n);return o.sigBytes=4*e,y.create({key:o,iv:a,salt:i})}},b=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:x}),encrypt:function(t,e,n,i){var r=(i=this.cfg.extend(i)).kdf.execute(n,t.keySize,t.ivSize,i.salt,i.hasher);i.iv=r.iv;var o=_.encrypt.call(this,t,e,r.key,i);return o.mixIn(r),o},decrypt:function(t,e,n,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var r=i.kdf.execute(n,t.keySize,t.ivSize,e.salt,i.hasher);return i.iv=r.iv,_.decrypt.call(this,t,e,r.key,i)}}))))},7193:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib.StreamCipher,n=t.algo,r=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,i=this._S=[],r=0;r<256;r++)i[r]=r;r=0;for(var o=0;r<256;r++){var a=r%n,s=e[a>>>2]>>>24-a%4*8&255;o=(o+i[r]+s)%256;var l=i[r];i[r]=i[o],i[o]=l}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,i=0,r=0;r<4;r++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,i|=t[(t[e]+t[n])%256]<<24-8*r}return this._i=e,this._j=n,i}t.RC4=e._createHelper(r);var a=n.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(a)}(),i.RC4)},7208:(t,e,n)=>{"use strict";var i=n(6518),r=n(9565);i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return r(URL.prototype.toString,this)}})},7323:(t,e,n)=>{"use strict";var i,r,o=n(9565),a=n(9504),s=n(655),l=n(7979),c=n(8429),u=n(5745),h=n(2360),d=n(1181).get,p=n(3635),f=n(8814),g=u("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,y=m,v=a("".charAt),_=a("".indexOf),x=a("".replace),b=a("".slice),w=(r=/b*/g,o(m,i=/a/,"a"),o(m,r,"a"),0!==i.lastIndex||0!==r.lastIndex),S=c.BROKEN_CARET,M=void 0!==/()??/.exec("")[1];(w||M||S||p||f)&&(y=function(t){var e,n,i,r,a,c,u,p=this,f=d(p),C=s(t),T=f.raw;if(T)return T.lastIndex=p.lastIndex,e=o(y,T,C),p.lastIndex=T.lastIndex,e;var I=f.groups,D=S&&p.sticky,k=o(l,p),A=p.source,E=0,L=C;if(D&&(k=x(k,"y",""),-1===_(k,"g")&&(k+="g"),L=b(C,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==v(C,p.lastIndex-1))&&(A="(?: "+A+")",L=" "+L,E++),n=new RegExp("^(?:"+A+")",k)),M&&(n=new RegExp("^"+A+"$(?!\\s)",k)),w&&(i=p.lastIndex),r=o(m,D?n:p,L),D?r?(r.input=b(r.input,E),r[0]=b(r[0],E),r.index=p.lastIndex,p.lastIndex+=r[0].length):p.lastIndex=0:w&&r&&(p.lastIndex=p.global?r.index+r[0].length:i),M&&r&&r.length>1&&o(g,r[0],n,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)}),r&&I)for(r.groups=c=h(null),a=0;a<I.length;a++)c[(u=I[a])[0]]=r[u[1]];return r}),t.exports=y},7337:(t,e,n)=>{"use strict";var i=n(6518),r=n(9504),o=n(5610),a=RangeError,s=String.fromCharCode,l=String.fromCodePoint,c=r([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(t){for(var e,n=[],i=arguments.length,r=0;i>r;){if(e=+arguments[r++],o(e,1114111)!==e)throw new a(e+" is not a valid code point");n[r]=e<65536?s(e):s(55296+((e-=65536)>>10),e%1024+56320)}return c(n,"")}})},7347:(t,e,n)=>{"use strict";var i=n(3724),r=n(9565),o=n(8773),a=n(6980),s=n(5397),l=n(6969),c=n(9297),u=n(5917),h=Object.getOwnPropertyDescriptor;e.f=i?h:function(t,e){if(t=s(t),e=l(e),u)try{return h(t,e)}catch(t){}if(c(t,e))return a(!r(o.f,t,e),t[e])}},7400:t=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7416:(t,e,n)=>{"use strict";var i=n(9039),r=n(8227),o=n(3724),a=n(6395),s=r("iterator");t.exports=!i(function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),i="";return t.pathname="c%20d",e.forEach(function(t,n){e.delete("b"),i+=n+t}),n.delete("a",2),n.delete("b",void 0),a&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!e.size&&(a||!o)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==i||"x"!==new URL("https://x",void 0).host})},7452:t=>{"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},7476:(t,e,n)=>{"use strict";var i=n(2195),r=n(9504);t.exports=function(t){if("Function"===i(t))return r(t)}},7495:(t,e,n)=>{"use strict";var i=n(6518),r=n(7323);i({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},7628:function(t,e,n){var i;t.exports=(i=n(9021),n(754),n(4636),n(9506),n(7165),function(){var t=i,e=t.lib,n=e.WordArray,r=e.BlockCipher,o=t.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=r.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;n<56;n++){var i=a[n]-1;e[n]=t[i>>>5]>>>31-i%32&1}for(var r=this._subKeys=[],o=0;o<16;o++){var c=r[o]=[],u=l[o];for(n=0;n<24;n++)c[n/6|0]|=e[(s[n]-1+u)%28]<<31-n%6,c[4+(n/6|0)]|=e[28+(s[n+24]-1+u)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=r[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,n){this._lBlock=t[e],this._rBlock=t[e+1],d.call(this,4,252645135),d.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),d.call(this,1,1431655765);for(var i=0;i<16;i++){for(var r=n[i],o=this._lBlock,a=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((a^r[l])&u[l])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,d.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function p(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}t.DES=r._createHelper(h);var f=o.TripleDES=r.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),r=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=h.createEncryptor(n.create(e)),this._des2=h.createEncryptor(n.create(i)),this._des3=h.createEncryptor(n.create(r))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=r._createHelper(f)}(),i.TripleDES)},7629:(t,e,n)=>{"use strict";var i=n(6395),r=n(4576),o=n(9433),a="__core-js_shared__",s=t.exports=r[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.45.1",mode:i?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"})},7633:(t,e,n)=>{"use strict";var i=n(7751),r=n(2106),o=n(8227),a=n(3724),s=o("species");t.exports=function(t){var e=i(t);a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},7657:(t,e,n)=>{"use strict";var i,r,o,a=n(9039),s=n(4901),l=n(34),c=n(2360),u=n(2787),h=n(6840),d=n(8227),p=n(6395),f=d("iterator"),g=!1;[].keys&&("next"in(o=[].keys())?(r=u(u(o)))!==Object.prototype&&(i=r):g=!0),!l(i)||a(function(){var t={};return i[f].call(t)!==t})?i={}:p&&(i=c(i)),s(i[f])||h(i,f,function(){return this}),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:g}},7680:(t,e,n)=>{"use strict";var i=n(9504);t.exports=i([].slice)},7740:(t,e,n)=>{"use strict";var i=n(9297),r=n(5031),o=n(7347),a=n(4913);t.exports=function(t,e,n){for(var s=r(e),l=a.f,c=o.f,u=0;u<s.length;u++){var h=s[u];i(t,h)||n&&i(n,h)||l(t,h,c(e,h))}}},7750:(t,e,n)=>{"use strict";var i=n(4117),r=TypeError;t.exports=function(t){if(i(t))throw new r("Can't call method on "+t);return t}},7751:(t,e,n)=>{"use strict";var i=n(4576),r=n(4901);t.exports=function(t,e){return arguments.length<2?(n=i[t],r(n)?n:void 0):i[t]&&i[t][e];var n}},7764:(t,e,n)=>{"use strict";var i=n(8183).charAt,r=n(655),o=n(1181),a=n(1088),s=n(2529),l="String Iterator",c=o.set,u=o.getterFor(l);a(String,"String",function(t){c(this,{type:l,string:r(t),index:0})},function(){var t,e=u(this),n=e.string,r=e.index;return r>=n.length?s(void 0,!0):(t=i(n,r),e.index+=t.length,s(t,!1))})},7801:(t,e,n)=>{"use strict";n(7495),n(2762),n(2953),n(8408),t=n.hmd(t);class i{constructor(){this.refreshInterval=null,this.autoRefreshEnabled=!1,this.init()}init(){const t=window.location.pathname;t.includes("/error-monitoring/dashboard")?this.initDashboard():t.includes("/error-monitoring/errors")?this.initErrorsList():t.includes("/error-monitoring/error/")&&this.initErrorDetail(),this.bindGlobalEvents()}initDashboard(){console.log("Initializing Error Monitoring Dashboard"),this.loadDashboardStats(),this.loadRecentErrors(),this.startAutoRefresh()}initErrorsList(){console.log("Initializing Error Monitoring Errors List"),this.showActiveFilters(),this.loadErrors(),this.initFilters()}initErrorDetail(){console.log("Initializing Error Monitoring Error Detail"),this.initErrorDetailActions()}bindGlobalEvents(){document.addEventListener("click",t=>{t.target.matches('[data-action="refresh-errors"]')&&(t.preventDefault(),this.refreshCurrentPage()),t.target.matches('[data-action="toggle-auto-refresh"]')&&(t.preventDefault(),this.toggleAutoRefresh())})}loadDashboardStats(){const t=document.getElementById("dashboard-stats");t&&(this.showLoading(t),fetch("/api/error-monitoring/dashboard").then(t=>t.json()).then(e=>{e.success?this.updateDashboardStats(e.data):this.showError(t,"Failed to load dashboard stats")}).catch(e=>{console.error("Error loading dashboard stats:",e),this.showError(t,"Network error loading stats")}))}updateDashboardStats(t){this.updateCounter("total-errors",t.total_errors),this.updateCounter("critical-errors",t.critical_errors),this.updateCounter("resolved-errors",t.resolved_errors),this.updateCounter("projects-count",t.monitored_projects),this.updateCounter("project-errors",t.total_errors);const e=document.getElementById("last-updated");e&&(e.textContent="Last updated: ".concat((new Date).toLocaleTimeString()))}updateCounter(t,e){const n=document.getElementById(t);if(n){const t=parseInt(n.textContent)||0;this.animateCounter(n,t,e)}}animateCounter(t,e,n){const i=(n-e)/62.5;let r=e;const o=setInterval(()=>{r+=i,(i>0&&r>=n||i<0&&r<=n)&&(r=n,clearInterval(o)),t.textContent=Math.floor(r)},16)}loadRecentErrors(){const t=document.getElementById("recent-errors-container");t?(this.showLoading(t),fetch("/api/error-monitoring/recent-errors").then(t=>t.json()).then(e=>{e.success?this.renderRecentErrors(t,e.data):this.showError(t,"Failed to load recent errors")}).catch(e=>{console.error("Error loading recent errors:",e),this.showError(t,"Network error loading recent errors")})):console.warn("Recent errors container not found")}renderRecentErrors(t,e){if(!e||0===e.length)return void(t.innerHTML='\n <div class="text-center py-5">\n <div class="avatar-lg mx-auto mb-4">\n <div class="avatar-title bg-success-subtle text-success rounded-circle fs-1">\n <i class="ri-checkbox-circle-line"></i>\n </div>\n </div>\n <h5 class="mb-1">Nenhum erro encontrado!</h5>\n <p class="text-muted mb-0">O sistema está funcionando perfeitamente.</p>\n <div class="mt-3">\n <a href="/error-monitoring/test-error" class="btn btn-outline-primary btn-sm">\n <i class="ri-flask-line me-1"></i> Testar Sistema\n </a>\n </div>\n </div>\n ');let n='\n <div class="table-responsive table-card">\n <table class="table table-borderless table-centered align-middle table-nowrap mb-0">\n <thead class="text-muted table-light">\n <tr>\n <th scope="col">Error</th>\n <th scope="col">File</th>\n <th scope="col">Severity</th>\n <th scope="col">Time</th>\n <th scope="col">Action</th>\n </tr>\n </thead>\n <tbody>\n ';e.forEach(t=>{const e=this.getSeverityColor(t.severity),i=t.file_path?t.file_path.split("/").pop():"unknown";n+='\n <tr>\n <td>\n <div class="d-flex align-items-center">\n <div class="flex-shrink-0 me-2">\n <div class="avatar-xs">\n <div class="avatar-title bg-'.concat(e,"-subtle text-").concat(e,' rounded fs-16">\n <i class="ri-bug-line"></i>\n </div>\n </div>\n </div>\n <div class="flex-grow-1">\n <h6 class="fs-14 mb-1">\n <a href="/error-monitoring/error/').concat(t.id,'" class="text-dark">\n ').concat(this.truncateText(t.message,50),'\n </a>\n </h6>\n <p class="text-muted mb-0 fs-12">').concat(t.unique_id||"N/A",'</p>\n </div>\n </div>\n </td>\n <td>\n <span class="text-muted fs-12">\n ').concat(i,":").concat(t.line_number||"?",'\n </span>\n </td>\n <td>\n <span class="badge bg-').concat(e,"-subtle text-").concat(e,'">\n ').concat(t.severity.charAt(0).toUpperCase()+t.severity.slice(1),'\n </span>\n </td>\n <td>\n <span class="text-muted fs-12">').concat(new Date(t.created_at).toLocaleString(),'</span>\n </td>\n <td>\n <a href="/error-monitoring/error/').concat(t.id,'" class="text-primary">\n <i class="ri-eye-line"></i>\n </a>\n </td>\n </tr>\n ')}),n+="\n </tbody>\n </table>\n </div>\n ",t&&t.parentNode&&(t.innerHTML=n)}showActiveFilters(){const t=new URLSearchParams(window.location.search),e=document.getElementById("active-filters");if(!e)return;const n=[];t.get("severity")&&n.push('<span class="badge bg-warning-subtle text-warning me-1">Severity: '.concat(t.get("severity"),"</span>")),t.get("status")&&n.push('<span class="badge bg-info-subtle text-info me-1">Status: '.concat(t.get("status"),"</span>")),t.get("file")&&n.push('<span class="badge bg-secondary-subtle text-secondary me-1">File: '.concat(t.get("file"),"</span>")),t.get("project")&&n.push('<span class="badge bg-primary-subtle text-primary me-1">Project: '.concat(t.get("project"),"</span>")),e.innerHTML=n.length>0?n.join(""):""}loadErrors(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=document.getElementById("errors-container");if(!e)return;this.showLoading(e);const n=new URLSearchParams(window.location.search),i=[];["severity","status","file","project"].forEach(t=>{n.get(t)&&i.push("".concat(t,"=").concat(encodeURIComponent(n.get(t))))});const r=["page=".concat(t),...i].join("&");fetch("/api/error-monitoring/errors?".concat(r)).then(t=>t.json()).then(t=>{t.success&&t.data.errors.length>0?this.renderErrorsList(e,t.data):this.showNoErrors(e)}).catch(t=>{console.error("Error loading errors:",t),this.showError(e,"Failed to load errors")})}renderErrorsList(t,e){console.log("Errors loaded:",e.errors.length)}initErrorDetailActions(){this.bindCopyActions(),this.bindResolutionActions()}bindCopyActions(){document.addEventListener("click",t=>{if(t.target.matches('[data-action="copy-error-id"]')){t.preventDefault();const e=t.target.dataset.errorId;this.copyToClipboard(e)}})}bindResolutionActions(){document.addEventListener("click",t=>{if(t.target.matches('[data-action="mark-resolved"]')){t.preventDefault();const e=t.target.dataset.uniqueId;this.markAsResolved(e)}})}async markAsResolved(t){(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&fetch("/api/error-monitoring/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({unique_id:t})}).then(t=>t.json()).then(t=>{t.success?(this.showSuccessMessage("Error marked as resolved"),this.refreshCurrentPage()):this.showErrorMessage("Error: "+t.message)}).catch(t=>{console.error("Error:",t),this.showErrorMessage("Failed to mark error as resolved")})}copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this.showSuccessMessage("Copied to clipboard")}).catch(t=>{console.error("Failed to copy:",t),this.showErrorMessage("Failed to copy to clipboard")})}clearFilters(){window.location.href="/error-monitoring/errors"}refreshCurrentPage(){const t=window.location.pathname;t.includes("/error-monitoring/dashboard")?(this.loadDashboardStats(),this.loadRecentErrors()):t.includes("/error-monitoring/errors")&&this.loadErrors()}startAutoRefresh(){this.autoRefreshEnabled=!0,this.refreshInterval=setInterval(()=>{this.autoRefreshEnabled&&this.refreshCurrentPage()},3e4)}stopAutoRefresh(){this.autoRefreshEnabled=!1,this.refreshInterval&&(clearInterval(this.refreshInterval),this.refreshInterval=null)}toggleAutoRefresh(){this.autoRefreshEnabled?(this.stopAutoRefresh(),this.showSuccessMessage("Auto-refresh disabled")):(this.startAutoRefresh(),this.showSuccessMessage("Auto-refresh enabled"))}showLoading(t){t&&t.parentNode&&(t.innerHTML='\n <div class="text-center py-4">\n <div class="spinner-border text-primary" role="status">\n <span class="visually-hidden">Loading...</span>\n </div>\n <p class="mt-2">Loading...</p>\n </div>\n ')}showError(t,e){t&&t.parentNode&&(t.innerHTML='\n <div class="alert alert-danger" role="alert">\n <i class="ri-error-warning-line me-2"></i>\n '.concat(e,"\n </div>\n "))}showNoErrors(t){t&&t.parentNode&&(t.innerHTML='\n <div class="text-center py-5">\n <i class="ri-checkbox-circle-line text-success fs-48 mb-3"></i>\n <h5 class="text-muted">No errors found</h5>\n <p class="text-muted">Great! No errors match your current filters.</p>\n </div>\n ')}showSuccessMessage(t){this.showToast(t,"success")}showErrorMessage(t){this.showToast(t,"error")}showToast(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";"success"===e?console.log("✅ "+t):"error"===e&&console.error("❌ "+t);const n=document.createElement("div");n.className="alert alert-".concat("success"===e?"success":"danger"," position-fixed"),n.style.cssText="top: 20px; right: 20px; z-index: 9999; min-width: 300px;",n.innerHTML='\n <i class="ri-'.concat("success"===e?"check":"error-warning",'-line me-2"></i>\n ').concat(t,"\n "),document.body.appendChild(n),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n)},3e3)}getSeverityColor(t){switch(t){case"critical":return"danger";case"error":return"warning";case"warning":return"info";default:return"secondary"}}truncateText(t,e){return t.length<=e?t:t.substring(0,e)+"..."}initFilters(){const t=new URLSearchParams(window.location.search);t.get("severity")&&(document.getElementById("severity-filter").value=t.get("severity")),t.get("status")&&(document.getElementById("status-filter").value=t.get("status")),t.get("file")&&(document.getElementById("file-filter").value=t.get("file")),t.get("project")&&(document.getElementById("project-filter").value=t.get("project"));const e=document.getElementById("filters-form");e&&e.addEventListener("submit",t=>{t.preventDefault(),this.applyFilters()})}applyFilters(){const t=document.getElementById("filters-form"),e=new FormData(t),n=new URLSearchParams;for(const[t,i]of e.entries())""!==i.trim()&&n.append(t,i.trim());const i="/error-monitoring/errors".concat(n.toString()?"?"+n.toString():"");window.location.href=i}}window.loadErrors=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;window.errorMonitoring&&window.errorMonitoring.loadErrors(t)},window.markAsResolved=function(t){window.errorMonitoring&&window.errorMonitoring.markAsResolved(t)},window.clearFilters=function(){window.errorMonitoring&&window.errorMonitoring.clearFilters()},window.refreshErrors=function(){window.errorMonitoring&&window.errorMonitoring.refreshCurrentPage()},document.addEventListener("DOMContentLoaded",function(){window.location.pathname.includes("/error-monitoring/")&&(window.errorMonitoring=new i,console.log("Error Monitoring JavaScript initialized"))}),t.exports&&(t.exports=i)},7829:(t,e,n)=>{"use strict";var i=n(8183).charAt;t.exports=function(t,e,n){return e+(n?i(t,e).length:1)}},7916:(t,e,n)=>{"use strict";var i=n(6080),r=n(9565),o=n(8981),a=n(6319),s=n(4209),l=n(3517),c=n(6198),u=n(4659),h=n(81),d=n(851),p=Array;t.exports=function(t){var e=o(t),n=l(this),f=arguments.length,g=f>1?arguments[1]:void 0,m=void 0!==g;m&&(g=i(g,f>2?arguments[2]:void 0));var y,v,_,x,b,w,S=d(e),M=0;if(!S||this===p&&s(S))for(y=c(e),v=n?new this(y):p(y);y>M;M++)w=m?g(e[M],M):e[M],u(v,M,w);else for(v=n?new this:[],b=(x=h(e,S)).next;!(_=r(b,x)).done;M++)w=m?a(x,g,[_.value,M],!0):_.value,u(v,M,w);return v.length=M,v}},7979:(t,e,n)=>{"use strict";var i=n(8551);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},8014:(t,e,n)=>{"use strict";var i=n(1291),r=Math.min;t.exports=function(t){var e=i(t);return e>0?r(e,9007199254740991):0}},8056:function(t,e,n){var i;t.exports=(i=n(9021),function(){var t=i,e=t.lib,n=e.WordArray,r=e.Hasher,o=t.algo,a=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=n.create([0,1518500249,1859775393,2400959708,2840853838]),h=n.create([1352829926,1548603684,1836072691,2053994217,0]),d=o.RIPEMD160=r.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var i=e+n,r=t[i];t[i]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o,d,_,x,b,w,S,M,C,T,I,D=this._hash.words,k=u.words,A=h.words,E=a.words,L=s.words,P=l.words,O=c.words;for(w=o=D[0],S=d=D[1],M=_=D[2],C=x=D[3],T=b=D[4],n=0;n<80;n+=1)I=o+t[e+E[n]]|0,I+=n<16?p(d,_,x)+k[0]:n<32?f(d,_,x)+k[1]:n<48?g(d,_,x)+k[2]:n<64?m(d,_,x)+k[3]:y(d,_,x)+k[4],I=(I=v(I|=0,P[n]))+b|0,o=b,b=x,x=v(_,10),_=d,d=I,I=w+t[e+L[n]]|0,I+=n<16?y(S,M,C)+A[0]:n<32?m(S,M,C)+A[1]:n<48?g(S,M,C)+A[2]:n<64?f(S,M,C)+A[3]:p(S,M,C)+A[4],I=(I=v(I|=0,O[n]))+T|0,w=T,T=C,C=v(M,10),M=S,S=I;I=D[1]+_+C|0,D[1]=D[2]+x+T|0,D[2]=D[3]+b+w|0,D[3]=D[4]+o+S|0,D[4]=D[0]+d+M|0,D[0]=I},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var r=this._hash,o=r.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return r},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,n){return t^e^n}function f(t,e,n){return t&e|~t&n}function g(t,e,n){return(t|~e)^n}function m(t,e,n){return t&n|e&~n}function y(t,e,n){return t^(e|~n)}function v(t,e){return t<<e|t>>>32-e}t.RIPEMD160=r._createHelper(d),t.HmacRIPEMD160=r._createHmacHelper(d)}(Math),i.RIPEMD160)},8124:function(t,e,n){var i;t.exports=(i=n(9021),n(7165),i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding)},8183:(t,e,n)=>{"use strict";var i=n(9504),r=n(1291),o=n(655),a=n(7750),s=i("".charAt),l=i("".charCodeAt),c=i("".slice),u=function(t){return function(e,n){var i,u,h=o(a(e)),d=r(n),p=h.length;return d<0||d>=p?t?"":void 0:(i=l(h,d))<55296||i>56319||d+1===p||(u=l(h,d+1))<56320||u>57343?t?s(h,d):i:t?c(h,d,d+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},8227:(t,e,n)=>{"use strict";var i=n(4576),r=n(5745),o=n(9297),a=n(3392),s=n(4495),l=n(7040),c=i.Symbol,u=r("wks"),h=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return o(u,t)||(u[t]=s&&o(c,t)?c[t]:h("Symbol."+t)),u[t]}},8406:(t,e,n)=>{"use strict";n(3792),n(7337);var i=n(6518),r=n(4576),o=n(3389),a=n(7751),s=n(9565),l=n(9504),c=n(3724),u=n(7416),h=n(6840),d=n(2106),p=n(6279),f=n(687),g=n(3994),m=n(1181),y=n(679),v=n(4901),_=n(9297),x=n(6080),b=n(6955),w=n(8551),S=n(34),M=n(655),C=n(2360),T=n(6980),I=n(81),D=n(851),k=n(2529),A=n(2812),E=n(8227),L=n(4488),P=E("iterator"),O="URLSearchParams",R=O+"Iterator",B=m.set,N=m.getterFor(O),z=m.getterFor(R),F=o("fetch"),V=o("Request"),H=o("Headers"),j=V&&V.prototype,W=H&&H.prototype,G=r.TypeError,U=r.encodeURIComponent,q=String.fromCharCode,Y=a("String","fromCodePoint"),X=parseInt,$=l("".charAt),Z=l([].join),K=l([].push),J=l("".replace),Q=l([].shift),tt=l([].splice),et=l("".split),nt=l("".slice),it=l(/./.exec),rt=/\+/g,ot=/^[0-9a-f]+$/i,at=function(t,e){var n=nt(t,e,e+2);return it(ot,n)?X(n,16):NaN},st=function(t){for(var e=0,n=128;n>0&&0!==(t&n);n>>=1)e++;return e},lt=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3]}return e>1114111?null:e},ct=function(t){for(var e=(t=J(t,rt," ")).length,n="",i=0;i<e;){var r=$(t,i);if("%"===r){if("%"===$(t,i+1)||i+3>e){n+="%",i++;continue}var o=at(t,i+1);if(o!=o){n+=r,i++;continue}i+=2;var a=st(o);if(0===a)r=q(o);else{if(1===a||a>4){n+="�",i++;continue}for(var s=[o],l=1;l<a&&!(3+ ++i>e||"%"!==$(t,i));){var c=at(t,i+1);if(c!=c){i+=3;break}if(c>191||c<128)break;K(s,c),i+=2,l++}if(s.length!==a){n+="�";continue}var u=lt(s);null===u?n+="�":r=Y(u)}}n+=r,i++}return n},ut=/[!'()~]|%20/g,ht={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},dt=function(t){return ht[t]},pt=function(t){return J(U(t),ut,dt)},ft=g(function(t,e){B(this,{type:R,target:N(t).entries,index:0,kind:e})},O,function(){var t=z(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,k(void 0,!0);var i=e[n];switch(t.kind){case"keys":return k(i.key,!1);case"values":return k(i.value,!1)}return k([i.key,i.value],!1)},!0),gt=function(t){this.entries=[],this.url=null,void 0!==t&&(S(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===$(t,0)?nt(t,1):t:M(t)))};gt.prototype={type:O,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,n,i,r,o,a,l,c=this.entries,u=D(t);if(u)for(n=(e=I(t,u)).next;!(i=s(n,e)).done;){if(o=(r=I(w(i.value))).next,(a=s(o,r)).done||(l=s(o,r)).done||!s(o,r).done)throw new G("Expected sequence with length 2");K(c,{key:M(a.value),value:M(l.value)})}else for(var h in t)_(t,h)&&K(c,{key:h,value:M(t[h])})},parseQuery:function(t){if(t)for(var e,n,i=this.entries,r=et(t,"&"),o=0;o<r.length;)(e=r[o++]).length&&(n=et(e,"="),K(i,{key:ct(Q(n)),value:ct(Z(n,"="))}))},serialize:function(){for(var t,e=this.entries,n=[],i=0;i<e.length;)t=e[i++],K(n,pt(t.key)+"="+pt(t.value));return Z(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var mt=function(){y(this,yt);var t=B(this,new gt(arguments.length>0?arguments[0]:void 0));c||(this.size=t.entries.length)},yt=mt.prototype;if(p(yt,{append:function(t,e){var n=N(this);A(arguments.length,2),K(n.entries,{key:M(t),value:M(e)}),c||this.length++,n.updateURL()},delete:function(t){for(var e=N(this),n=A(arguments.length,1),i=e.entries,r=M(t),o=n<2?void 0:arguments[1],a=void 0===o?o:M(o),s=0;s<i.length;){var l=i[s];if(l.key!==r||void 0!==a&&l.value!==a)s++;else if(tt(i,s,1),void 0!==a)break}c||(this.size=i.length),e.updateURL()},get:function(t){var e=N(this).entries;A(arguments.length,1);for(var n=M(t),i=0;i<e.length;i++)if(e[i].key===n)return e[i].value;return null},getAll:function(t){var e=N(this).entries;A(arguments.length,1);for(var n=M(t),i=[],r=0;r<e.length;r++)e[r].key===n&&K(i,e[r].value);return i},has:function(t){for(var e=N(this).entries,n=A(arguments.length,1),i=M(t),r=n<2?void 0:arguments[1],o=void 0===r?r:M(r),a=0;a<e.length;){var s=e[a++];if(s.key===i&&(void 0===o||s.value===o))return!0}return!1},set:function(t,e){var n=N(this);A(arguments.length,1);for(var i,r=n.entries,o=!1,a=M(t),s=M(e),l=0;l<r.length;l++)(i=r[l]).key===a&&(o?tt(r,l--,1):(o=!0,i.value=s));o||K(r,{key:a,value:s}),c||(this.size=r.length),n.updateURL()},sort:function(){var t=N(this);L(t.entries,function(t,e){return t.key>e.key?1:-1}),t.updateURL()},forEach:function(t){for(var e,n=N(this).entries,i=x(t,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((e=n[r++]).value,e.key,this)},keys:function(){return new ft(this,"keys")},values:function(){return new ft(this,"values")},entries:function(){return new ft(this,"entries")}},{enumerable:!0}),h(yt,P,yt.entries,{name:"entries"}),h(yt,"toString",function(){return N(this).serialize()},{enumerable:!0}),c&&d(yt,"size",{get:function(){return N(this).entries.length},configurable:!0,enumerable:!0}),f(mt,O),i({global:!0,constructor:!0,forced:!u},{URLSearchParams:mt}),!u&&v(H)){var vt=l(W.has),_t=l(W.set),xt=function(t){if(S(t)){var e,n=t.body;if(b(n)===O)return e=t.headers?new H(t.headers):new H,vt(e,"content-type")||_t(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),C(t,{body:T(0,M(n)),headers:T(0,e)})}return t};if(v(F)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return F(t,arguments.length>1?xt(arguments[1]):{})}}),v(V)){var bt=function(t){return y(this,j),new V(t,arguments.length>1?xt(arguments[1]):{})};j.constructor=bt,bt.prototype=j,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:bt})}}t.exports={URLSearchParams:mt,getState:N}},8408:(t,e,n)=>{"use strict";n(8406)},8429:(t,e,n)=>{"use strict";var i=n(9039),r=n(4576).RegExp,o=i(function(){var t=r("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),a=o||i(function(){return!r("a","y").sticky}),s=o||i(function(){var t=r("^r","gy");return t.lastIndex=2,null!==t.exec("str")});t.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8454:function(t,e,n){var i,r;t.exports=(r=n(9021),n(7165),r.mode.ECB=((i=r.lib.BlockCipherMode.extend()).Encryptor=i.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),i.Decryptor=i.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),i),r.mode.ECB)},8480:(t,e,n)=>{"use strict";var i=n(1828),r=n(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,r)}},8551:(t,e,n)=>{"use strict";var i=n(34),r=String,o=TypeError;t.exports=function(t){if(i(t))return t;throw new o(r(t)+" is not an object")}},8622:(t,e,n)=>{"use strict";var i=n(4576),r=n(4901),o=i.WeakMap;t.exports=r(o)&&/native code/.test(String(o))},8686:(t,e,n)=>{"use strict";var i=n(3724),r=n(9039);t.exports=i&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8727:t=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(t,e,n)=>{"use strict";var i=n(616),r=Function.prototype,o=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?a.bind(o):function(){return a.apply(o,arguments)})},8773:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!n.call({1:2},1);e.f=r?function(t){var e=i(this,t);return!!e&&e.enumerable}:n},8814:(t,e,n)=>{"use strict";var i=n(9039),r=n(4576).RegExp;t.exports=i(function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})},8981:(t,e,n)=>{"use strict";var i=n(7750),r=Object;t.exports=function(t){return r(i(t))}},9021:function(t,e,n){var i;t.exports=(i=i||function(t){var e;if("undefined"!=typeof window&&window.crypto&&(e=window.crypto),"undefined"!=typeof self&&self.crypto&&(e=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(e=globalThis.crypto),!e&&"undefined"!=typeof window&&window.msCrypto&&(e=window.msCrypto),!e&&void 0!==n.g&&n.g.crypto&&(e=n.g.crypto),!e)try{e=n(477)}catch(t){}var i=function(){if(e){if("function"==typeof e.getRandomValues)try{return e.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof e.randomBytes)try{return e.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),o={},a=o.lib={},s=a.Base={extend:function(t){var e=r(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,i=this.sigBytes,r=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o<r;o++){var a=n[o>>>2]>>>24-o%4*8&255;e[i+o>>>2]|=a<<24-(i+o)%4*8}else for(var s=0;s<r;s+=4)e[i+s>>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n<t;n+=4)e.push(i());return new l.init(e,t)}}),c=o.enc={},u=c.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r<n;r++){var o=e[r>>>2]>>>24-r%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i<e;i+=2)n[i>>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new l.init(n,e/2)}},h=c.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,i=[],r=0;r<n;r++){var o=e[r>>>2]>>>24-r%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,n=[],i=0;i<e;i++)n[i>>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new l.init(n,e)}},d=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,i=this._data,r=i.words,o=i.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,u=t.min(4*c,o);if(c){for(var h=0;h<c;h+=a)this._doProcessBlock(r,h);n=r.splice(0,c),i.sigBytes-=u}return new l.init(n,u)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),f=(a.Hasher=p.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),o.algo={});return o}(Math),i)},9039:t=>{"use strict";t.exports=function(t){try{return!!t()}catch(t){return!0}}},9228:(t,e,n)=>{"use strict";n(7495);var i=n(9565),r=n(6840),o=n(7323),a=n(9039),s=n(8227),l=n(6699),c=s("species"),u=RegExp.prototype;t.exports=function(t,e,n,h){var d=s(t),p=!a(function(){var e={};return e[d]=function(){return 7},7!==""[t](e)}),f=p&&!a(function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e});if(!p||!f||n){var g=/./[d],m=e(d,""[t],function(t,e,n,r,a){var s=e.exec;return s===o||s===u.exec?p&&!a?{done:!0,value:i(g,e,n,r)}:{done:!0,value:i(t,n,e,r)}:{done:!1}});r(String.prototype,t,m[0]),r(u,d,m[1])}h&&l(u[d],"sham",!0)}},9296:(t,e,n)=>{"use strict";var i=n(4055)("span").classList,r=i&&i.constructor&&i.constructor.prototype;t.exports=r===Object.prototype?void 0:r},9297:(t,e,n)=>{"use strict";var i=n(9504),r=n(8981),o=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(r(t),e)}},9306:(t,e,n)=>{"use strict";var i=n(4901),r=n(6823),o=TypeError;t.exports=function(t){if(i(t))return t;throw new o(r(t)+" is not a function")}},9412:()=>{console.log("✅ Landing Types Manager loaded")},9433:(t,e,n)=>{"use strict";var i=n(4576),r=Object.defineProperty;t.exports=function(t,e){try{r(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},9463:(t,e,n)=>{"use strict";var i=n(6518),r=n(3724),o=n(4576),a=n(9504),s=n(9297),l=n(4901),c=n(1625),u=n(655),h=n(2106),d=n(7740),p=o.Symbol,f=p&&p.prototype;if(r&&l(p)&&(!("description"in f)||void 0!==p().description)){var g={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),e=c(f,this)?new p(t):void 0===t?p():p(t);return""===t&&(g[e]=!0),e};d(m,p),m.prototype=f,f.constructor=m;var y="Symbol(description detection)"===String(p("description detection")),v=a(f.valueOf),_=a(f.toString),x=/^Symbol\((.*)\)[^)]+$/,b=a("".replace),w=a("".slice);h(f,"description",{configurable:!0,get:function(){var t=v(this);if(s(g,t))return"";var e=_(t),n=y?w(e,7,-1):b(e,x,"$1");return""===n?void 0:n}}),i({global:!0,constructor:!0,forced:!0},{Symbol:m})}},9504:(t,e,n)=>{"use strict";var i=n(616),r=Function.prototype,o=r.call,a=i&&r.bind.bind(o,o);t.exports=i?a:function(t){return function(){return o.apply(t,arguments)}}},9506:function(t,e,n){var i,r,o,a,s,l,c,u;t.exports=(u=n(9021),n(5471),n(1025),o=(r=(i=u).lib).Base,a=r.WordArray,l=(s=i.algo).MD5,c=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,i=this.cfg,r=i.hasher.create(),o=a.create(),s=o.words,l=i.keySize,c=i.iterations;s.length<l;){n&&r.update(n),n=r.update(t).finalize(e),r.reset();for(var u=1;u<c;u++)n=r.finalize(n),r.reset();o.concat(n)}return o.sigBytes=4*l,o}}),i.EvpKDF=function(t,e,n){return c.create(n).compute(t,e)},u.EvpKDF)},9519:(t,e,n)=>{"use strict";var i,r,o=n(4576),a=n(2839),s=o.process,l=o.Deno,c=s&&s.versions||l&&l.version,u=c&&c.v8;u&&(r=(i=u.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!r&&a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(r=+i[1]),t.exports=r},9539:(t,e,n)=>{"use strict";var i=n(9565),r=n(8551),o=n(5966);t.exports=function(t,e,n){var a,s;r(t);try{if(!(a=o(t,"return"))){if("throw"===e)throw n;return n}a=i(a,t)}catch(t){s=!0,a=t}if("throw"===e)throw n;if(s)throw a;return r(a),n}},9557:function(t,e,n){var i,r,o,a,s,l,c,u;t.exports=(u=n(9021),n(3240),n(1380),r=(i=u).x64,o=r.Word,a=r.WordArray,s=i.algo,l=s.SHA512,c=s.SHA384=l.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=l._doFinalize.call(this);return t.sigBytes-=16,t}}),i.SHA384=l._createHelper(c),i.HmacSHA384=l._createHmacHelper(c),u.SHA384)},9565:(t,e,n)=>{"use strict";var i=n(616),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},9617:(t,e,n)=>{"use strict";var i=n(5397),r=n(5610),o=n(6198),a=function(t){return function(e,n,a){var s=i(e),l=o(s);if(0===l)return!t&&-1;var c,u=r(a,l);if(t&&n!=n){for(;l>u;)if((c=s[u++])!=c)return!0}else for(;l>u;u++)if((t||u in s)&&s[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"use strict";var t={};n.r(t),n.d(t,{HashMap:()=>zs,RADIAN_TO_DEGREE:()=>Us,assert:()=>Es,bind:()=>hs,clone:()=>$a,concatArray:()=>Vs,createCanvas:()=>ts,createHashMap:()=>Fs,createObject:()=>Hs,curry:()=>ds,defaults:()=>Qa,disableUserSelect:()=>js,each:()=>os,eqNaN:()=>Cs,extend:()=>Ja,filter:()=>ls,find:()=>cs,guid:()=>Ya,hasOwn:()=>Ws,indexOf:()=>es,inherits:()=>ns,isArray:()=>ps,isArrayLike:()=>rs,isBuiltInObject:()=>_s,isDom:()=>bs,isFunction:()=>fs,isGradientObject:()=>ws,isImagePatternObject:()=>Ss,isNumber:()=>ys,isObject:()=>vs,isPrimitive:()=>Rs,isRegExp:()=>Ms,isString:()=>gs,isStringSafe:()=>ms,isTypedArray:()=>xs,keys:()=>us,logError:()=>Xa,map:()=>as,merge:()=>Za,mergeAll:()=>Ka,mixin:()=>is,noop:()=>Gs,normalizeCssArray:()=>As,reduce:()=>ss,retrieve:()=>Ts,retrieve2:()=>Is,retrieve3:()=>Ds,setAsPrimitive:()=>Os,slice:()=>ks,trim:()=>Ls});var e={};n.r(e),n.d(e,{add:()=>Zs,applyTransform:()=>fl,clone:()=>Xs,copy:()=>Ys,create:()=>qs,dist:()=>cl,distSquare:()=>hl,distance:()=>ll,distanceSquare:()=>ul,div:()=>rl,dot:()=>ol,len:()=>Qs,lenSquare:()=>el,length:()=>tl,lengthSquare:()=>nl,lerp:()=>pl,max:()=>ml,min:()=>gl,mul:()=>il,negate:()=>dl,normalize:()=>sl,scale:()=>al,scaleAndAdd:()=>Ks,set:()=>$s,sub:()=>Js});var i={};n.r(i),n.d(i,{clone:()=>tc,copy:()=>Xl,create:()=>ql,identity:()=>Yl,invert:()=>Ql,mul:()=>$l,rotate:()=>Kl,scale:()=>Jl,translate:()=>Zl});var r={};n.r(r),n.d(r,{fastLerp:()=>Eu,fastMapToColor:()=>Lu,lerp:()=>Pu,lift:()=>ku,liftColor:()=>Hu,lum:()=>zu,mapToColor:()=>Ou,modifyAlpha:()=>Bu,modifyHSL:()=>Ru,parse:()=>Iu,random:()=>Fu,stringify:()=>Nu,toHex:()=>Au});var o={};n.r(o),n.d(o,{dispose:()=>Cd,disposeAll:()=>Td,getElementSSRData:()=>kd,getInstance:()=>Id,init:()=>Md,registerPainter:()=>Dd,registerSSRDataGetter:()=>Ad,version:()=>Ed});var a={};n.r(a),n.d(a,{Arc:()=>Qw,BezierCurve:()=>Zw,BoundingRect:()=>dc,Circle:()=>pw,CompoundPath:()=>eS,Ellipse:()=>mw,Group:()=>_d,Image:()=>Cg,IncrementalDisplayable:()=>mS,Line:()=>Uw,LinearGradient:()=>oS,OrientedBoundingRect:()=>pS,Path:()=>vg,Point:()=>nc,Polygon:()=>zw,Polyline:()=>Hw,RadialGradient:()=>sS,Rect:()=>Pg,Ring:()=>Ow,Sector:()=>Ew,Text:()=>$g,applyTransform:()=>OS,clipPointsByRect:()=>zS,clipRectByRect:()=>FS,createIcon:()=>VS,extendPath:()=>wS,extendShape:()=>xS,getShapeClass:()=>MS,getTransform:()=>PS,groupTransition:()=>NS,initProps:()=>Qm,isElementRemoved:()=>ty,lineLineIntersect:()=>jS,linePolygonIntersect:()=>HS,makeImage:()=>TS,makePath:()=>CS,mergePath:()=>DS,registerShape:()=>SS,removeElement:()=>ey,removeElementWithFadeOut:()=>iy,resizePath:()=>kS,setTooltipConfig:()=>GS,subPixelOptimize:()=>LS,subPixelOptimizeLine:()=>AS,subPixelOptimizeRect:()=>ES,transformDirection:()=>RS,traverseElements:()=>qS,updateProps:()=>Jm});var s={};n.r(s),n.d(s,{createDimensions:()=>KI,createList:()=>_k,createScale:()=>bk,createSymbol:()=>hC,createTextStyle:()=>Sk,dataStack:()=>xk,enableHoverEmphasis:()=>Fm,getECData:()=>Zg,getLayoutRect:()=>Nv,mixinAxisModelCommonMethods:()=>wk});var l={};n.r(l),n.d(l,{MAX_SAFE_INTEGER:()=>Gd,asc:()=>Nd,getPercentWithPrecision:()=>Hd,getPixelPrecision:()=>Vd,getPrecision:()=>zd,getPrecisionSafe:()=>Fd,isNumeric:()=>ep,isRadianAroundZero:()=>qd,linearMap:()=>Od,nice:()=>Kd,numericToNumber:()=>tp,parseDate:()=>Xd,quantile:()=>Jd,quantity:()=>$d,quantityExponent:()=>Zd,reformIntervals:()=>Qd,remRadian:()=>Ud,round:()=>Bd});var c={};n.r(c),n.d(c,{format:()=>iv,parse:()=>Xd});var u={};n.r(u),n.d(u,{Arc:()=>Qw,BezierCurve:()=>Zw,BoundingRect:()=>dc,Circle:()=>pw,CompoundPath:()=>eS,Ellipse:()=>mw,Group:()=>_d,Image:()=>Cg,IncrementalDisplayable:()=>mS,Line:()=>Uw,LinearGradient:()=>oS,Polygon:()=>zw,Polyline:()=>Hw,RadialGradient:()=>sS,Rect:()=>Pg,Ring:()=>Ow,Sector:()=>Ew,Text:()=>$g,clipPointsByRect:()=>zS,clipRectByRect:()=>FS,createIcon:()=>VS,extendPath:()=>wS,extendShape:()=>xS,getShapeClass:()=>MS,getTransform:()=>PS,initProps:()=>Qm,makeImage:()=>TS,makePath:()=>CS,mergePath:()=>DS,registerShape:()=>SS,resizePath:()=>kS,updateProps:()=>Jm});var h={};n.r(h),n.d(h,{addCommas:()=>xv,capitalFirst:()=>kv,encodeHTML:()=>El,formatTime:()=>Dv,formatTpl:()=>Tv,getTextRect:()=>Nk,getTooltipMarker:()=>Iv,normalizeCssArray:()=>wv,toCamelCase:()=>bv,truncateText:()=>Xp});var d={};n.r(d),n.d(d,{bind:()=>hs,clone:()=>$a,curry:()=>ds,defaults:()=>Qa,each:()=>os,extend:()=>Ja,filter:()=>ls,indexOf:()=>es,inherits:()=>ns,isArray:()=>ps,isFunction:()=>fs,isObject:()=>vs,isString:()=>gs,map:()=>as,merge:()=>Za,reduce:()=>ss});var p={};function f(t){return t+.5|0}n.r(p),n.d(p,{Axis:()=>$k,ChartView:()=>eM,ComponentModel:()=>Uv,ComponentView:()=>Wb,List:()=>ZI,Model:()=>Oy,PRIORITY:()=>nT,SeriesModel:()=>Hb,color:()=>r,connect:()=>XT,dataTool:()=>vI,dependencies:()=>ZC,disConnect:()=>ZT,disconnect:()=>$T,dispose:()=>KT,env:()=>Ia,extendChartView:()=>Qk,extendComponentModel:()=>Zk,extendComponentView:()=>Kk,extendSeriesModel:()=>Jk,format:()=>h,getCoordinateSystemDimensions:()=>lI,getInstanceByDom:()=>JT,getInstanceById:()=>QT,getMap:()=>mI,graphic:()=>u,helper:()=>s,init:()=>YT,innerDrawElementOnCanvas:()=>NC,matrix:()=>i,number:()=>l,parseGeoJSON:()=>Bk,parseGeoJson:()=>Bk,registerAction:()=>aI,registerCoordinateSystem:()=>sI,registerLayout:()=>cI,registerLoading:()=>pI,registerLocale:()=>Gy,registerMap:()=>gI,registerPostInit:()=>iI,registerPostUpdate:()=>rI,registerPreprocessor:()=>eI,registerProcessor:()=>nI,registerTheme:()=>tI,registerTransform:()=>yI,registerUpdateLifecycle:()=>oI,registerVisual:()=>uI,setCanvasCreator:()=>fI,setPlatformAPI:()=>Oa,throttle:()=>oM,time:()=>c,use:()=>bI,util:()=>d,vector:()=>e,version:()=>$C,zrUtil:()=>t,zrender:()=>o});const g=(t,e,n)=>Math.max(Math.min(t,n),e);function m(t){return g(f(2.55*t),0,255)}function y(t){return g(f(255*t),0,255)}function v(t){return g(f(t/2.55)/100,0,1)}function _(t){return g(f(100*t),0,100)}const x={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},b=[..."0123456789ABCDEF"],w=t=>b[15&t],S=t=>b[(240&t)>>4]+b[15&t],M=t=>(240&t)>>4==(15&t);const C=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function T(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function I(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function D(t,e,n){const i=T(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function k(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),a=(r+o)/2;let s,l,c;return r!==o&&(c=r-o,l=a>.5?c/(2-r-o):c/(r+o),s=function(t,e,n,i,r){return t===r?(e-n)/i+(e<n?6:0):e===r?(n-t)/i+2:(t-e)/i+4}(e,n,i,c,r),s=60*s+.5),[0|s,l||0,a]}function A(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(y)}function E(t,e,n){return A(T,t,e,n)}function L(t){return(t%360+360)%360}const P={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},O={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let R;const B=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,N=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,z=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function F(t,e,n){if(t){let i=k(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=E(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function V(t,e){return t?Object.assign(e||{},t):t}function H(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=y(t[3]))):(e=V(t,{r:0,g:0,b:0,a:1})).a=y(e.a),e}function j(t){return"r"===t.charAt(0)?function(t){const e=B.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=e[8]?m(t):g(255*t,0,255)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?m(n):g(n,0,255)),i=255&(e[4]?m(i):g(i,0,255)),r=255&(e[6]?m(r):g(r,0,255)),{r:n,g:i,b:r,a:o}}}(t):function(t){const e=C.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?m(+e[5]):y(+e[5]));const r=L(+e[2]),o=+e[3]/100,a=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return A(D,t,e,n)}(r,o,a):"hsv"===e[1]?function(t,e,n){return A(I,t,e,n)}(r,o,a):E(r,o,a),{r:n[0],g:n[1],b:n[2],a:i}}(t)}class W{constructor(t){if(t instanceof W)return t;const e=typeof t;let n;"object"===e?n=H(t):"string"===e&&(n=function(t){var e,n=t.length;return"#"===t[0]&&(4===n||5===n?e={r:255&17*x[t[1]],g:255&17*x[t[2]],b:255&17*x[t[3]],a:5===n?17*x[t[4]]:255}:7!==n&&9!==n||(e={r:x[t[1]]<<4|x[t[2]],g:x[t[3]]<<4|x[t[4]],b:x[t[5]]<<4|x[t[6]],a:9===n?x[t[7]]<<4|x[t[8]]:255})),e}(t)||function(t){R||(R=function(){const t={},e=Object.keys(O),n=Object.keys(P);let i,r,o,a,s;for(i=0;i<e.length;i++){for(a=s=e[i],r=0;r<n.length;r++)o=n[r],s=s.replace(o,P[o]);o=parseInt(O[a],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),R.transparent=[0,0,0,0]);const e=R[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(t)||j(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=V(this._rgb);return t&&(t.a=v(t.a)),t}set rgb(t){this._rgb=H(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${v(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?function(t){var e=(t=>M(t.r)&&M(t.g)&&M(t.b)&&M(t.a))(t)?w:S;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=k(t),n=e[0],i=_(e[1]),r=_(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${v(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,i=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,s=n.a-i.a,l=((a*s===-1?a:(a+s)/(1+a*s))+1)/2;r=1-l,n.r=255&l*n.r+r*i.r+.5,n.g=255&l*n.g+r*i.g+.5,n.b=255&l*n.b+r*i.b+.5,n.a=o*n.a+(1-o)*i.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,n){const i=z(v(t.r)),r=z(v(t.g)),o=z(v(t.b));return{r:y(N(i+n*(z(v(e.r))-i))),g:y(N(r+n*(z(v(e.g))-r))),b:y(N(o+n*(z(v(e.b))-o))),a:t.a+n*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new W(this.rgb)}alpha(t){return this._rgb.a=y(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=f(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return F(this._rgb,2,t),this}darken(t){return F(this._rgb,2,-t),this}saturate(t){return F(this._rgb,1,t),this}desaturate(t){return F(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=k(t);n[0]=L(n[0]+e),n=E(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function G(){}const U=(()=>{let t=0;return()=>t++})();function q(t){return null==t}function Y(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function X(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function $(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function Z(t,e){return $(t)?t:e}function K(t,e){return void 0===t?e:t}const J=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Q(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function tt(t,e,n,i){let r,o,a;if(Y(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(X(t))for(a=Object.keys(t),o=a.length,r=0;r<o;r++)e.call(n,t[a[r]],a[r])}function et(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function nt(t){if(Y(t))return t.map(nt);if(X(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=nt(t[n[r]]);return e}return t}function it(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function rt(t,e,n,i){if(!it(t))return;const r=e[t],o=n[t];X(r)&&X(o)?ot(r,o,i):e[t]=nt(o)}function ot(t,e,n){const i=Y(e)?e:[e],r=i.length;if(!X(t))return t;const o=(n=n||{}).merger||rt;let a;for(let e=0;e<r;++e){if(a=i[e],!X(a))continue;const r=Object.keys(a);for(let e=0,i=r.length;e<i;++e)o(r[e],t,a,n)}return t}function at(t,e){return ot(t,e,{merger:st})}function st(t,e,n){if(!it(t))return;const i=e[t],r=n[t];X(i)&&X(r)?at(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=nt(r))}const lt={"":t=>t,x:t=>t.x,y:t=>t.y};function ct(t,e){const n=lt[e]||(lt[e]=function(t){const e=function(t){const e=t.split("."),n=[];let i="";for(const t of e)i+=t,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}(t);return t=>{for(const n of e){if(""===n)break;t=t&&t[n]}return t}}(e));return n(t)}function ut(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ht=t=>void 0!==t,dt=t=>"function"==typeof t,pt=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},ft=Math.PI,gt=2*ft,mt=gt+ft,yt=Number.POSITIVE_INFINITY,vt=ft/180,_t=ft/2,xt=ft/4,bt=2*ft/3,wt=Math.log10,St=Math.sign;function Mt(t,e,n){return Math.abs(t-e)<n}function Ct(t){const e=Math.round(t);t=Mt(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(wt(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Tt(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function It(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Dt(t){return t*(ft/180)}function kt(t){return t*(180/ft)}function At(t){if(!$(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Et(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*ft&&(o+=gt),{angle:o,distance:r}}function Lt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pt(t,e){return(t-e+mt)%gt-ft}function Ot(t){return(t%gt+gt)%gt}function Rt(t,e,n,i){const r=Ot(t),o=Ot(e),a=Ot(n),s=Ot(o-r),l=Ot(a-r),c=Ot(r-o),u=Ot(r-a);return r===o||r===a||i&&o===a||s>l&&c<u}function Bt(t,e,n){return Math.max(e,Math.min(n,t))}function Nt(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}function zt(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Ft=(t,e,n,i)=>zt(t,n,i?i=>{const r=t[i][e];return r<n||r===n&&t[i+1][e]===n}:i=>t[i][e]<n),Vt=(t,e,n)=>zt(t,n,i=>t[i][e]>=n),Ht=["push","pop","shift","splice","unshift"];function jt(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(Ht.forEach(e=>{delete t[e]}),delete t._chartjs)}function Wt(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Gt="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function Ut(t,e){let n=[],i=!1;return function(...r){n=r,i||(i=!0,Gt.call(window,()=>{i=!1,t.apply(e,n)}))}}const qt=t=>"start"===t?"left":"end"===t?"right":"center",Yt=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function Xt(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:a,vScale:s,_parsed:l}=t,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=a.axis,{min:h,max:d,minDefined:p,maxDefined:f}=a.getUserBounds();if(p){if(r=Math.min(Ft(l,u,h).lo,n?i:Ft(e,u,a.getPixelForValue(h)).lo),c){const t=l.slice(0,r+1).reverse().findIndex(t=>!q(t[s.axis]));r-=Math.max(0,t)}r=Bt(r,0,i-1)}if(f){let t=Math.max(Ft(l,a.axis,d,!0).hi+1,n?0:Ft(e,u,a.getPixelForValue(d),!0).hi+1);if(c){const e=l.slice(t-1).findIndex(t=>!q(t[s.axis]));t+=Math.max(0,e)}o=Bt(t,r,i)-r}else o=i-r}return{start:r,count:o}}function $t(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}const Zt=t=>0===t||1===t,Kt=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*gt/n),Jt=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*gt/n)+1,Qt={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*_t),easeOutSine:t=>Math.sin(t*_t),easeInOutSine:t=>-.5*(Math.cos(ft*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Zt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Zt(t)?t:Kt(t,.075,.3),easeOutElastic:t=>Zt(t)?t:Jt(t,.075,.3),easeInOutElastic(t){const e=.1125;return Zt(t)?t:t<.5?.5*Kt(2*t,e,.45):.5+.5*Jt(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Qt.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*Qt.easeInBounce(2*t):.5*Qt.easeOutBounce(2*t-1)+.5};function te(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function ee(t){return te(t)?t:new W(t)}function ne(t){return te(t)?t:new W(t).saturate(.5).darken(.1).hexString()}const ie=["x","y","borderWidth","radius","tension"],re=["color","borderColor","backgroundColor"],oe=new Map;function ae(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=oe.get(n);return i||(i=new Intl.NumberFormat(t,e),oe.set(n,i)),i}(e,n).format(t)}const se={values:t=>Y(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}(t,n)}const a=wt(Math.abs(o)),s=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(l,this.options.ticks.format),ae(t,i,l)},logarithmic(t,e,n){if(0===t)return"0";const i=n[e].significand||t/Math.pow(10,Math.floor(wt(t)));return[1,2,3,5,10,15].includes(i)||e>.8*n.length?se.numeric.call(this,t,e,n):""}};var le={formatters:se};const ce=Object.create(null),ue=Object.create(null);function he(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function de(t,e,n){return"string"==typeof e?ot(he(t,e),n):ot(he(t,""),e)}class pe{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>ne(e.backgroundColor),this.hoverBorderColor=(t,e)=>ne(e.borderColor),this.hoverColor=(t,e)=>ne(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return de(this,t,e)}get(t){return he(this,t)}describe(t,e){return de(ue,t,e)}override(t,e){return de(ce,t,e)}route(t,e,n,i){const r=he(this,t),o=he(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[i];return X(t)?Object.assign({},e,t):K(t,e)},set(t){this[a]=t}}})}apply(t){t.forEach(t=>t(this))}}var fe=new pe({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:re},numbers:{type:"number",properties:ie}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:le.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function ge(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function me(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const s=n.length;let l,c,u,h,d;for(l=0;l<s;l++)if(h=n[l],null==h||Y(h)){if(Y(h))for(c=0,u=h.length;c<u;c++)d=h[c],null==d||Y(d)||(a=ge(t,r,o,a,d))}else a=ge(t,r,o,a,h);t.restore();const p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete r[o[l]];o.splice(0,p)}return a}function ye(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function ve(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function _e(t,e,n,i){xe(t,e,n,i,null)}function xe(t,e,n,i,r){let o,a,s,l,c,u,h,d;const p=e.pointStyle,f=e.rotation,g=e.radius;let m=(f||0)*vt;if(p&&"object"==typeof p&&(o=p.toString(),"[object HTMLImageElement]"===o||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(n,i),t.rotate(m),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void t.restore();if(!(isNaN(g)||g<=0)){switch(t.beginPath(),p){default:r?t.ellipse(n,i,r/2,g,0,0,gt):t.arc(n,i,g,0,gt),t.closePath();break;case"triangle":u=r?r/2:g,t.moveTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=bt,t.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),m+=bt,t.lineTo(n+Math.sin(m)*u,i-Math.cos(m)*g),t.closePath();break;case"rectRounded":c=.516*g,l=g-c,a=Math.cos(m+xt)*l,h=Math.cos(m+xt)*(r?r/2-c:l),s=Math.sin(m+xt)*l,d=Math.sin(m+xt)*(r?r/2-c:l),t.arc(n-h,i-s,c,m-ft,m-_t),t.arc(n+d,i-a,c,m-_t,m),t.arc(n+h,i+s,c,m,m+_t),t.arc(n-d,i+a,c,m+_t,m+ft),t.closePath();break;case"rect":if(!f){l=Math.SQRT1_2*g,u=r?r/2:l,t.rect(n-u,i-l,2*u,2*l);break}m+=xt;case"rectRot":h=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-s),t.lineTo(n+d,i-a),t.lineTo(n+h,i+s),t.lineTo(n-d,i+a),t.closePath();break;case"crossRot":m+=xt;case"cross":h=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-s),t.lineTo(n+h,i+s),t.moveTo(n+d,i-a),t.lineTo(n-d,i+a);break;case"star":h=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-s),t.lineTo(n+h,i+s),t.moveTo(n+d,i-a),t.lineTo(n-d,i+a),m+=xt,h=Math.cos(m)*(r?r/2:g),a=Math.cos(m)*g,s=Math.sin(m)*g,d=Math.sin(m)*(r?r/2:g),t.moveTo(n-h,i-s),t.lineTo(n+h,i+s),t.moveTo(n+d,i-a),t.lineTo(n-d,i+a);break;case"line":a=r?r/2:Math.cos(m)*g,s=Math.sin(m)*g,t.moveTo(n-a,i-s),t.lineTo(n+a,i+s);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(m)*(r?r/2:g),i+Math.sin(m)*g);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function be(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function we(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Se(t){t.restore()}function Me(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Ce(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Te(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,u),t.lineTo(s,u),t.stroke()}}function Ie(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function De(t,e,n,i,r,o={}){const a=Y(e)?e:[e],s=o.strokeWidth>0&&""!==o.strokeColor;let l,c;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),q(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Ie(t,o.backdrop),s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),q(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(c,n,i,o.maxWidth)),t.fillText(c,n,i,o.maxWidth),Te(t,n,i,c,o),i+=Number(r.lineHeight);t.restore()}function ke(t,e){const{x:n,y:i,w:r,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*ft,ft,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,ft,_t,!0),t.lineTo(n+r-a.bottomRight,i+o),t.arc(n+r-a.bottomRight,i+o-a.bottomRight,a.bottomRight,_t,0,!0),t.lineTo(n+r,i+a.topRight),t.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-_t,!0),t.lineTo(n+a.topLeft,i)}const Ae=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ee=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Le(t,e){const n=(""+t).match(Ae);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}const Pe=t=>+t||0;function Oe(t,e){const n={},i=X(e),r=i?Object.keys(e):e,o=X(t)?i?n=>K(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=Pe(o(t));return n}function Re(t){return Oe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Be(t){return Oe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ne(t){const e=Re(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ze(t,e){t=t||{},e=e||fe.font;let n=K(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=K(t.style,e.style);i&&!(""+i).match(Ee)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:K(t.family,e.family),lineHeight:Le(K(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:K(t.weight,e.weight),string:""};return r.string=function(t){return!t||q(t.size)||q(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function Fe(t,e,n,i){let r,o,a,s=!0;for(r=0,o=t.length;r<o;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),s=!1),void 0!==n&&Y(a)&&(a=a[n%a.length],s=!1),void 0!==a))return i&&!s&&(i.cacheable=!1),a}function Ve(t,e){return Object.assign(Object.create(t),e)}function He(t,e=[""],n,i,r=()=>t[0]){const o=n||t;void 0===i&&(i=Je("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:i,_getTarget:r,override:n=>He([n,...t],e,o,i)};return new Proxy(a,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>qe(n,i,()=>function(t,e,n,i){let r;for(const o of e)if(r=Je(Ge(o,t),n),void 0!==r)return Ue(t,r)?Ze(n,i,t,r):r}(i,e,t,n)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Qe(t).includes(e),ownKeys:t=>Qe(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function je(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:We(t,i),setContext:e=>je(t,e,n,i),override:r=>je(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>qe(t,e,()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=t;let s=i[e];return dt(s)&&a.isScriptable(e)&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);let l=e(o,a||i);return s.delete(t),Ue(t,l)&&(l=Ze(r._scopes,r,t,l)),l}(e,s,t,n)),Y(s)&&s.length&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=n;if(void 0!==o.index&&i(t))return e[o.index%e.length];if(X(e[0])){const n=e,i=r._scopes.filter(t=>t!==n);e=[];for(const l of n){const n=Ze(i,r,t,l);e.push(je(n,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable)),Ue(e,s)&&(s=je(s,r,o&&o[e],a)),s}(t,e,n)),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function We(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:dt(n)?n:()=>n,isIndexable:dt(i)?i:()=>i}}const Ge=(t,e)=>t?t+ut(e):e,Ue=(t,e)=>X(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function qe(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const i=n();return t[e]=i,i}function Ye(t,e,n){return dt(t)?t(e,n):t}const Xe=(t,e)=>!0===t?e:"string"==typeof t?ct(e,t):void 0;function $e(t,e,n,i,r){for(const o of e){const e=Xe(n,o);if(e){t.add(e);const o=Ye(e._fallback,n,r);if(void 0!==o&&o!==n&&o!==i)return o}else if(!1===e&&void 0!==i&&n!==i)return null}return!1}function Ze(t,e,n,i){const r=e._rootScopes,o=Ye(e._fallback,n,i),a=[...t,...r],s=new Set;s.add(i);let l=Ke(s,a,n,o||n,i);return null!==l&&(void 0===o||o===n||(l=Ke(s,a,o,l,i),null!==l))&&He(Array.from(s),[""],r,o,()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];return Y(r)&&X(n)?n:r||{}}(e,n,i))}function Ke(t,e,n,i,r){for(;n;)n=$e(t,e,n,i,r);return n}function Je(t,e){for(const n of e){if(!n)continue;const e=n[t];if(void 0!==e)return e}}function Qe(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function tn(t,e,n,i){const{iScale:r}=t,{key:o="r"}=this._parsing,a=new Array(i);let s,l,c,u;for(s=0,l=i;s<l;++s)c=s+n,u=e[c],a[s]={r:r.parse(ct(u,o),c)};return a}const en=Number.EPSILON||1e-14,nn=(t,e)=>e<t.length&&!t[e].skip&&t[e],rn=t=>"x"===t?"y":"x";function on(t,e,n,i){const r=t.skip?e:t,o=e,a=n.skip?e:n,s=Lt(o,r),l=Lt(a,o);let c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,d=i*u;return{previous:{x:o.x-h*(a.x-r.x),y:o.y-h*(a.y-r.y)},next:{x:o.x+d*(a.x-r.x),y:o.y+d*(a.y-r.y)}}}function an(t,e,n){return Math.max(Math.min(t,n),e)}function sn(t,e,n,i,r){let o,a,s,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){const n=rn(e),i=t.length,r=Array(i).fill(0),o=Array(i);let a,s,l,c=nn(t,0);for(a=0;a<i;++a)if(s=l,l=c,c=nn(t,a+1),l){if(c){const t=c[e]-l[e];r[a]=0!==t?(c[n]-l[n])/t:0}o[a]=s?c?St(r[a-1])!==St(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}!function(t,e,n){const i=t.length;let r,o,a,s,l,c=nn(t,0);for(let u=0;u<i-1;++u)l=c,c=nn(t,u+1),l&&c&&(Mt(e[u],0,en)?n[u]=n[u+1]=0:(r=n[u]/e[u],o=n[u+1]/e[u],s=Math.pow(r,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),n[u]=r*a*e[u],n[u+1]=o*a*e[u])))}(t,r,o),function(t,e,n="x"){const i=rn(n),r=t.length;let o,a,s,l=nn(t,0);for(let c=0;c<r;++c){if(a=s,s=l,l=nn(t,c+1),!s)continue;const r=s[n],u=s[i];a&&(o=(r-a[n])/3,s[`cp1${n}`]=r-o,s[`cp1${i}`]=u-o*e[c]),l&&(o=(l[n]-r)/3,s[`cp2${n}`]=r+o,s[`cp2${i}`]=u+o*e[c])}}(t,o,e)}(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],l=on(n,s,t[Math.min(o+1,a-(i?0:1))%a],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,n=s}e.capBezierPoints&&function(t,e){let n,i,r,o,a,s=be(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=s,s=n<i-1&&be(t[n+1],e),o&&(r=t[n],a&&(r.cp1x=an(r.cp1x,e.left,e.right),r.cp1y=an(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=an(r.cp2x,e.left,e.right),r.cp2y=an(r.cp2y,e.top,e.bottom)))}(t,n)}function ln(){return"undefined"!=typeof window&&"undefined"!=typeof document}function cn(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function un(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const hn=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),dn=["top","right","bottom","left"];function pn(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=dn[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function fn(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:i}=e,r=hn(n),o="border-box"===r.boxSizing,a=pn(r,"padding"),s=pn(r,"border","width"),{x:l,y:c,box:u}=function(t,e){const n=t.touches,i=n&&n.length?n[0]:t,{offsetX:r,offsetY:o}=i;let a,s,l=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(r,o,t.target))a=r,s=o;else{const t=e.getBoundingClientRect();a=i.clientX-t.left,s=i.clientY-t.top,l=!0}return{x:a,y:s,box:l}}(t,n),h=a.left+(u&&s.left),d=a.top+(u&&s.top);let{width:p,height:f}=e;return o&&(p-=a.width+s.width,f-=a.height+s.height),{x:Math.round((l-h)/p*n.width/i),y:Math.round((c-d)/f*n.height/i)}}const gn=t=>Math.round(10*t)/10;function mn(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=Math.floor(t.height),t.width=Math.floor(t.width);const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=i,a.height=r,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const yn=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ln()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function vn(t,e){const n=function(t,e){return hn(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function _n(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function xn(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function bn(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=_n(t,r,n),s=_n(r,o,n),l=_n(o,e,n),c=_n(a,s,n),u=_n(s,l,n);return _n(c,u,n)}function wn(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Sn(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function Mn(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Cn(t){return"angle"===t?{between:Rt,compare:Pt,normalize:Ot}:{between:Nt,compare:(t,e)=>t-e,normalize:t=>t}}function Tn({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function In(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,a=e.length,{compare:s,between:l,normalize:c}=Cn(i),{start:u,end:h,loop:d,style:p}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:a,normalize:s}=Cn(i),l=e.length;let c,u,{start:h,end:d,loop:p}=t;if(p){for(h+=l,d+=l,c=0,u=l;c<u&&a(s(e[h%l][i]),r,o);++c)h--,d--;h%=l,d%=l}return d<h&&(d+=l),{start:h,end:d,loop:p,style:t.style}}(t,e,n),f=[];let g,m,y,v=!1,_=null;const x=()=>v||l(r,y,g)&&0!==s(r,y),b=()=>!v||0===s(o,g)||l(o,y,g);for(let t=u,n=u;t<=h;++t)m=e[t%a],m.skip||(g=c(m[i]),g!==y&&(v=l(g,r,o),null===_&&x()&&(_=0===s(g,r)?t:n),null!==_&&b()&&(f.push(Tn({start:_,end:t,loop:d,count:a,style:p})),_=null),n=t,y=g));return null!==_&&f.push(Tn({start:_,end:h,loop:d,count:a,style:p})),f}function Dn(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=In(i[r],t.points,e);o.length&&n.push(...o)}return n}function kn(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function An(t,e){if(!e)return!1;const n=[],i=function(t,e){return te(e)?(n.includes(e)||n.push(e),n.indexOf(e)):e};return JSON.stringify(t,i)!==JSON.stringify(e,i)}function En(t,e,n){return t.options.clip?t[n]:e[n]}function Ln(t,e){const n=e._clip;if(n.disabled)return!1;const i=function(t,e){const{xScale:n,yScale:i}=t;return n&&i?{left:En(n,e,"left"),right:En(n,e,"right"),top:En(i,e,"top"),bottom:En(i,e,"bottom")}:e}(e,t.chartArea);return{left:!1===n.left?0:i.left-(!0===n.left?0:n.left),right:!1===n.right?t.width:i.right+(!0===n.right?0:n.right),top:!1===n.top?0:i.top-(!0===n.top?0:n.top),bottom:!1===n.bottom?t.height:i.bottom+(!0===n.bottom?0:n.bottom)}}class Pn{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach(i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o,a=r.length-1,s=!1;for(;a>=0;--a)o=r[a],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),s=!0):(r[a]=r[r.length-1],r.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var On=new Pn;const Rn="transparent",Bn={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=ee(t||Rn),r=i.valid&&ee(e||Rn);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Nn{constructor(t,e,n,i){const r=e[n];i=Fe([t.to,i,r,t.from]);const o=Fe([t.from,r,i]);this._active=!0,this._fn=t.fn||Bn[t.type||typeof o],this._easing=Qt[t.easing]||Qt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Fe([t.to,e,i,t.from]),this._from=Fe([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let s;if(this._active=r!==a&&(o||e<n),!this._active)return this._target[i]=a,void this._notify(!0);e<0?this._target[i]=r:(s=e/n%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[i]=this._fn(r,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}class zn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!X(t))return;const e=Object.keys(fe.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const r=t[i];if(!X(r))return;const o={};for(const t of e)o[t]=r[t];(Y(r.properties)&&r.properties||[i]).forEach(t=>{t!==i&&n.has(t)||n.set(t,o)})})}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(n)return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n;t.options=e}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then(()=>{t.options=n},()=>{}),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const l=o[s];if("$"===l.charAt(0))continue;if("options"===l){i.push(...this._animateOptions(t,e));continue}const c=e[l];let u=r[l];const h=n.get(l);if(u){if(h&&u.active()){u.update(h,c,a);continue}u.cancel()}h&&h.duration?(r[l]=u=new Nn(h,t,l,c),i.push(u)):t[l]=c}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(On.add(this._chart,n),!0):void 0}}function Fn(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function Vn(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function Hn(t,e,n,i={}){const r=t.keys,o="single"===i.mode;let a,s,l,c;if(null===e)return;let u=!1;for(a=0,s=r.length;a<s;++a){if(l=+r[a],l===n){if(u=!0,i.all)continue;break}c=t.values[l],$(c)&&(o||0===e||St(e)===St(c))&&(e+=c)}return u||i.all?e:0}function jn(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Wn(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Gn(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function Un(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=i,l=o.axis,c=a.axis,u=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,i),h=e.length;let d;for(let t=0;t<h;++t){const n=e[t],{[l]:o,[c]:h}=n;d=(n._stacks||(n._stacks={}))[c]=Wn(r,u,o),d[s]=h,d._top=Gn(d,a,!0,i.type),d._bottom=Gn(d,a,!1,i.type),(d._visualValues||(d._visualValues={}))[s]=h}}function qn(t,e){const n=t.scales;return Object.keys(n).filter(t=>n[t].axis===e).shift()}function Yn(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n],void 0!==e[i]._visualValues&&void 0!==e[i]._visualValues[n]&&delete e[i]._visualValues[n]}}}const Xn=t=>"reset"===t||"none"===t,$n=(t,e)=>e?t:Object.assign({},t);class Zn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Yn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=K(n.xAxisID,qn(t,"x")),o=e.yAxisID=K(n.yAxisID,qn(t,"y")),a=e.rAxisID=K(n.rAxisID,qn(t,"r")),s=e.indexAxis,l=e.iAxisID=i(s,r,o,a),c=e.vAxisID=i(s,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&jt(this._data,this),t._stacked&&Yn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(X(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:n,vScale:i}=e,r="x"===n.axis?"x":"y",o="x"===i.axis?"x":"y",a=Object.keys(t),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[r]:u,[o]:t[u]};return s}(e,t)}else if(n!==e){if(n){jt(n,this);const t=this._cachedMeta;Yn(t),t._parsed=[]}e&&Object.isExtensible(e)&&((i=e)._chartjs?i._chartjs.listeners.push(this):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[this]}}),Ht.forEach(t=>{const e="_onData"+ut(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach(n=>{"function"==typeof n[e]&&n[e](...t)}),r}})}))),this._syncList=[],this._data=e}var i}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=jn(e.vScale,e),e.stack!==n.stack&&(i=!0,Yn(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&(Un(this,e._parsed),e._stacked=jn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,a=r.axis;let s,l,c,u=0===t&&e===i.length||n._sorted,h=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,c=i;else{c=Y(i[t])?this.parseArrayData(n,i,t,e):X(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===l[a]||h&&l[a]<h[a];for(s=0;s<e;++s)n._parsed[s+t]=l=c[s],u&&(r()&&(u=!1),h=l);n._sorted=u}o&&Un(this,c)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,a=r.axis,s=o.axis,l=r.getLabels(),c=r===o,u=new Array(i);let h,d,p;for(h=0,d=i;h<d;++h)p=h+n,u[h]={[a]:c||r.parse(l[p],p),[s]:o.parse(e[p],p)};return u}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let s,l,c,u;for(s=0,l=i;s<l;++s)c=s+n,u=e[c],a[s]={x:r.parse(u[0],c),y:o.parse(u[1],c)};return a}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(i);let c,u,h,d;for(c=0,u=i;c<u;++c)h=c+n,d=e[h],l[c]={x:r.parse(ct(d,a),h),y:o.parse(ct(d,s),h)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis];return Hn({keys:Vn(i,!0),values:e._stacks[t.axis]._visualValues},o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=null===r?NaN:r;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,o=Hn(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,o=i.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Vn(n,!0),values:null})(e,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(a);let h,d;function p(){d=i[h];const e=d[a.axis];return!$(d[t.axis])||c>e||u<e}for(h=0;h<o&&(p()||(this.updateRangeFromParsed(l,t,d,s),!r));++h);if(r)for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(l,t,d,s);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],$(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,r;return X(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(K(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=Fn(t,n),r=Fn(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||i.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(t,r,a,s),c=a;c<a+s;++c){const e=i[c];e.hidden||(e.active&&l?o.push(e):e.draw(t,r))}for(c=0;c<o.length;++c)o[c].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,n){return Ve(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return Ve(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i="active"===e,r=this._cachedDataOpts,o=t+"-"+e,a=r[o],s=this.enableOptionSharing&&ht(n);if(a)return $n(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),u=i?[`${t}Hover`,"hover",t,""]:[t,""],h=l.getOptionScopes(this.getDataset(),c),d=Object.keys(fe.elements[t]),p=l.resolveNamedOptions(h,d,()=>this.getContext(n,i,e),u);return p.$shared&&(p.$shared=s,r[o]=Object.freeze($n(p,s))),p}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let s;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),o=i.getOptionScopes(this.getDataset(),r);s=i.createResolver(o,this.getContext(t,n,e))}const l=new zn(i,s&&s.animations);return s&&s._cacheable&&(r[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Xn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),i=this._sharedOptions,r=this.getSharedOptions(n),o=this.includeOptions(e,r)||r!==i;return this.updateSharedOptions(r,e,n),{sharedOptions:r,includeOptions:o}}updateElement(t,e,n,i){Xn(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!Xn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,r=e.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,e,n=!0){const i=this._cachedMeta,r=i.data,o=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(s(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&s(i._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&Yn(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Kn(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,r=n.length;e<r;e++)i=i.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=Wt(i.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let i,r,o,a,s=e._length;const l=()=>{32767!==o&&-32768!==o&&(ht(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(i=0,r=n.length;i<r;++i)o=e.getPixelForValue(n[i]),l();for(a=void 0,i=0,r=e.ticks.length;i<r;++i)o=e.getPixelForTick(i),l();return s}function Jn(t,e,n,i){return Y(t)?function(t,e,n,i){const r=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(r,o),s=Math.max(r,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),e[n.axis]=c,e._custom={barStart:l,barEnd:c,start:r,end:o,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Qn(t,e,n,i){const r=t.iScale,o=t.vScale,a=r.getLabels(),s=r===o,l=[];let c,u,h,d;for(c=n,u=n+i;c<u;++c)d=e[c],h={},h[r.axis]=s||r.parse(a[c],c),l.push(Jn(d,h,o,c));return l}function ti(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function ei(t,e,n,i){let r=e.borderSkipped;const o={};if(!r)return void(t.borderSkipped=o);if(!0===r)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(t){let e,n,i,r,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",o="start"):(r="start",o="end"),{start:n,end:i,reverse:e,top:r,bottom:o}}(t);"middle"===r&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=c:(n._bottom||0)===i?r=u:(o[ni(u,a,s,l)]=!0,r=c)),o[ni(r,a,s,l)]=!0,t.borderSkipped=o}function ni(t,e,n,i){return i?(t=function(t,e,n){return t===e?n:t===n?e:t}(t,e,n),t=ii(t,n,e)):t=ii(t,e,n),t}function ii(t,e,n){return"start"===t?e:"end"===t?n:t}function ri(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}class oi extends Zn{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:i}}=t.legend.options;return e.labels.map((e,r)=>{const o=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:i,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,o,a=t=>+n[t];if(X(n[t])){const{key:t="value"}=this._parsing;a=e=>+ct(n[e],t)}for(r=t,o=t+e;r<o;++r)i._parsed[r]=a(r)}}_getRotation(){return Dt(this.options.rotation-90)}_getCircumference(){return Dt(this.options.circumference)}_getRotationExtents(){let t=gt,e=-gt;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),o=i._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,r=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),s=Math.min((c=a,"string"==typeof(l=this.options.cutout)&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:g,offsetY:m}=function(t,e,n){let i=1,r=1,o=0,a=0;if(e<gt){const s=t,l=s+e,c=Math.cos(s),u=Math.sin(s),h=Math.cos(l),d=Math.sin(l),p=(t,e,i)=>Rt(t,s,l,!0)?1:Math.max(e,e*n,i,i*n),f=(t,e,i)=>Rt(t,s,l,!0)?-1:Math.min(e,e*n,i,i*n),g=p(0,c,h),m=p(_t,u,d),y=f(ft,c,h),v=f(ft+_t,u,d);i=(g-y)/2,r=(m-v)/2,o=-(g+y)/2,a=-(m+v)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:a}}(d,h,s),y=(n.width-o)/p,v=(n.height-o)/f,_=Math.max(Math.min(y,v)/2,0),x=J(this.options.radius,_),b=(x-Math.max(x*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=m*x,i.total=this.calculateTotal(),this.outerRadius=x-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*u,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/gt)}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,a=o.chartArea,s=o.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=r&&s.animateScale,h=u?0:this.innerRadius,d=u?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(e,i);let g,m=this._getRotation();for(g=0;g<e;++g)m+=this._circumference(g,r);for(g=e;g<e+n;++g){const e=this._circumference(g,r),n=t[g],o={x:l+this.offsetX,y:c+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:d,innerRadius:h};f&&(o.options=p||this.resolveDataElementOptions(g,n.active?"active":i)),m+=e,this.updateElement(n,g,o,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?gt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=ae(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,o,a,s;if(!t)for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),t=o.data,a=o.controller;break}if(!t)return 0;for(i=0,r=t.length;i<r;++i)s=a.resolveDataElementOptions(i),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(K(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class ai extends Zn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:i}}=t.legend.options;return e.labels.map((e,r)=>{const o=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,fontColor:i,lineWidth:o.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=ae(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}parseObjectData(t,e,n,i){return tn.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,n)=>{const i=this.getParsed(n).r;!isNaN(i)&&this.chart.getDataVisibility(n)&&(i<e.min&&(e.min=i),i>e.max&&(e.max=i))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),o=(r-Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,a=o.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*ft;let h,d=u;const p=360/this.countVisibleElements();for(h=0;h<e;++h)d+=this._computeAngle(h,i,p);for(h=e;h<e+n;h++){const e=t[h];let n=d,f=d+this._computeAngle(h,i,p),g=o.getDataVisibility(h)?s.getDistanceFromCenterForValue(this.getParsed(h).r):0;d=f,r&&(a.animateScale&&(g=0),a.animateRotate&&(n=f=u));const m={x:l,y:c,innerRadius:0,outerRadius:g,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(h,e.active?"active":i)};this.updateElement(e,h,m,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((t,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Dt(this.resolveDataElementOptions(t,e).angle||n):0}}var si=Object.freeze({__proto__:null,BarController:class extends Zn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,n,i){return Qn(t,e,n,i)}parseArrayData(t,e,n,i){return Qn(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===r.axis?a:s,c="x"===o.axis?a:s,u=[];let h,d,p,f;for(h=n,d=n+i;h<d;++h)f=e[h],p={},p[r.axis]=r.parse(ct(f,l),h),u.push(Jn(ct(f,c),p,o,h));return u}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,r=this.getParsed(t),o=r._custom,a=ti(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const r="reset"===i,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,i);for(let d=e;d<e+n;d++){const e=this.getParsed(d),n=r||q(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(d),p=this._calculateBarIndexPixels(d,c),f=(e._stacks||{})[a.axis],g={horizontal:l,base:n.base,enableBorderRadius:!f||ti(e._custom)||o===f._top||o===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};h&&(g.options=u||this.resolveDataElementOptions(d,t[d].active?"active":i));const m=g.options||t[d].options;ei(g,m,f,o),ri(g,m,c.ratio),this.updateElement(t[d],d,g,i)}}_getStacks(t,e){const{iScale:n}=this._cachedMeta,i=n.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),r=n.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),s=a&&a[n.axis],l=t=>{const e=t._parsed.find(t=>t[n.axis]===s),i=e&&e[t.vScale.axis];if(q(i)||isNaN(i))return!0};for(const n of i)if((void 0===e||!l(n))&&((!1===r||-1===o.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&o.push(n.stack),n.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const n of this.chart.data.datasets)t[K("x"===this.chart.options.indexAxis?n.xAxisID:n.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,o;for(r=0,o=e.data.length;r<o;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||Kn(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n,index:i},options:{base:r,minBarLength:o}}=this,a=r||0,s=this.getParsed(t),l=s._custom,c=ti(l);let u,h,d=s[e.axis],p=0,f=n?this.applyStack(e,s,n):d;f!==d&&(p=f-d,f=d),c&&(d=l.barStart,f=l.barEnd-l.barStart,0!==d&&St(d)!==St(l.barEnd)&&(p=0),p+=d);const g=q(r)||c?p:r;let m=e.getPixelForValue(g);if(u=this.chart.getDataVisibility(t)?e.getPixelForValue(p+f):m,h=u-m,Math.abs(h)<o){h=function(t,e,n){return 0!==t?St(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(h,e,a)*o,d===a&&(m-=h/2);const t=e.getPixelForDecimal(0),r=e.getPixelForDecimal(1),l=Math.min(t,r),p=Math.max(t,r);m=Math.max(Math.min(m,p),l),u=m+h,n&&!c&&(s._stacks[e.axis]._visualValues[i]=e.getValueForPixel(u)-e.getValueForPixel(m))}if(m===e.getPixelForValue(a)){const t=St(h)*e.getLineWidthForValue(a)/2;m+=t,h-=t}return{size:h,base:m,head:u,center:u+h/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,r=i.skipNull,o=K(i.maxBarThickness,1/0);let a,s;const l=this._getAxisCount();if(e.grouped){const n=r?this._getStackCount(t):e.stackCount,c="flex"===i.barThickness?function(t,e,n,i){const r=e.pixels,o=r[t];let a=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const l=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/i,ratio:n.barPercentage,start:c}}(t,e,i,n*l):function(t,e,n,i){const r=n.barThickness;let o,a;return q(r)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=r*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}(t,e,i,n*l),u="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(K(u,this.getFirstScaleIdForIndexAxis())),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+h;a=c.start+c.chunk*d+c.chunk/2,s=Math.min(o,c.chunk*c.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(o,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,i=n.length;let r=0;for(;r<i;++r)null===this.getParsed(r)[e.axis]||n[r].hidden||n[r].draw(this._ctx)}},BubbleController:class extends Zn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+n).radius;return r}parseArrayData(t,e,n,i){const r=super.parseArrayData(t,e,n,i);for(let t=0;t<r.length;t++){const i=e[n+t];r[t]._custom=K(i[2],this.resolveDataElementOptions(t+n).radius)}return r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);for(let t=0;t<r.length;t++){const i=e[n+t];r[t]._custom=K(i&&i.r&&+i.r,this.resolveDataElementOptions(t+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,o=this.getParsed(t),a=i.getLabelForValue(o.x),s=r.getLabelForValue(o.y),l=o._custom;return{label:n[t]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(e,i),c=o.axis,u=a.axis;for(let h=e;h<e+n;h++){const e=t[h],n=!r&&this.getParsed(h),d={},p=d[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(n[c]),f=d[u]=r?a.getBasePixel():a.getPixelForValue(n[u]);d.skip=isNaN(p)||isNaN(f),l&&(d.options=s||this.resolveDataElementOptions(h,e.active?"active":i),r&&(d.options.radius=0)),this.updateElement(e,h,d,i)}}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return"active"!==e&&(i.radius=0),i.radius+=K(n&&n._custom,r),i}},DoughnutController:oi,LineController:class extends Zn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=Xt(e,i,o);this._drawStart=a,this._drawCount=s,$t(e)&&(a=0,s=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:l},t),this.updateElements(i,a,s,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(e,i),h=o.axis,d=a.axis,{spanGaps:p,segment:f}=this.options,g=Tt(p)?p:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||r||"none"===i,y=e+n,v=t.length;let _=e>0&&this.getParsed(e-1);for(let n=0;n<v;++n){const p=t[n],v=m?p:{};if(n<e||n>=y){v.skip=!0;continue}const x=this.getParsed(n),b=q(x[d]),w=v[h]=o.getPixelForValue(x[h],n),S=v[d]=r||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,x,s):x[d],n);v.skip=isNaN(w)||isNaN(S)||b,v.stop=n>0&&Math.abs(x[h]-_[h])>g,f&&(v.parsed=x,v.raw=l.data[n]),u&&(v.options=c||this.resolveDataElementOptions(n,p.active?"active":i)),m||this.updateElement(p,n,v,i),_=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends oi{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:ai,RadarController:class extends Zn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,i){return tn.bind(this)(t,e,n,i)}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===i.length,options:e};this.updateElement(n,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this._cachedMeta.rScale,o="reset"===i;for(let a=e;a<e+n;a++){const e=t[a],n=this.resolveDataElementOptions(a,e.active?"active":i),s=r.getPointPositionForValue(a,this.getParsed(a).r),l=o?r.xCenter:s.x,c=o?r.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(e,a,u,i)}}},ScatterController:class extends Zn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:i,yScale:r}=e,o=this.getParsed(t),a=i.getLabelForValue(o.x),s=r.getLabelForValue(o.y);return{label:n[t]||"",value:"("+a+", "+s+")"}}update(t){const e=this._cachedMeta,{data:n=[]}=e,i=this.chart._animationsDisabled;let{start:r,count:o}=Xt(e,n,i);if(this._drawStart=r,this._drawCount=o,$t(e)&&(r=0,o=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:o}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=n;const a=this.resolveDatasetElementOptions(t);a.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:a},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,i),u=this.getSharedOptions(c),h=this.includeOptions(i,u),d=o.axis,p=a.axis,{spanGaps:f,segment:g}=this.options,m=Tt(f)?f:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||r||"none"===i;let v=e>0&&this.getParsed(e-1);for(let c=e;c<e+n;++c){const e=t[c],n=this.getParsed(c),f=y?e:{},_=q(n[p]),x=f[d]=o.getPixelForValue(n[d],c),b=f[p]=r||_?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(x)||isNaN(b)||_,f.stop=c>0&&Math.abs(n[d]-v[d])>m,g&&(f.parsed=n,f.raw=l.data[c]),h&&(f.options=u||this.resolveDataElementOptions(c,e.active?"active":i)),y||this.updateElement(e,c,f,i),v=n}this.updateSharedOptions(u,i,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}const n=t.dataset,i=n.options&&n.options.borderWidth||0;if(!e.length)return i;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,r,o)/2}}});function li(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ci{static override(t){Object.assign(ci.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return li()}parse(){return li()}format(){return li()}add(){return li()}diff(){return li()}startOf(){return li()}endOf(){return li()}}var ui=ci;function hi(t,e,n,i){const{controller:r,data:o,_sorted:a}=t,s=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(s&&e===s.axis&&"r"!==e&&a&&o.length){const a=s._reversePixels?Vt:Ft;if(!i){const i=a(o,e,n);if(l){const{vScale:e}=r._cachedMeta,{_parsed:n}=t,o=n.slice(0,i.lo+1).reverse().findIndex(t=>!q(t[e.axis]));i.lo-=Math.max(0,o);const a=n.slice(i.hi).findIndex(t=>!q(t[e.axis]));i.hi+=Math.max(0,a)}return i}if(r._sharedOptions){const t=o[0],i="function"==typeof t.getRange&&t.getRange(e);if(i){const t=a(o,e,n-i),r=a(o,e,n+i);return{lo:t.lo,hi:r.hi}}}}return{lo:0,hi:o.length-1}}function di(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:l,hi:c}=hi(o[t],e,a,r);for(let t=l;t<=c;++t){const e=s[t];e.skip||i(e,n,t)}}}function pi(t,e,n,i,r){const o=[];return r||t.isPointInArea(e)?(di(t,n,e,function(n,a,s){(r||be(n,t.chartArea,0))&&n.inRange(e.x,e.y,i)&&o.push({element:n,datasetIndex:a,index:s})},!0),o):o}function fi(t,e,n,i,r,o){return o||t.isPointInArea(e)?"r"!==n||i?function(t,e,n,i,r,o){let a=[];const s=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(n);let l=Number.POSITIVE_INFINITY;return di(t,n,e,function(n,c,u){const h=n.inRange(e.x,e.y,r);if(i&&!h)return;const d=n.getCenterPoint(r);if(!o&&!t.isPointInArea(d)&&!h)return;const p=s(e,d);p<l?(a=[{element:n,datasetIndex:c,index:u}],l=p):p===l&&a.push({element:n,datasetIndex:c,index:u})}),a}(t,e,n,i,r,o):function(t,e,n,i){let r=[];return di(t,n,e,function(t,n,o){const{startAngle:a,endAngle:s}=t.getProps(["startAngle","endAngle"],i),{angle:l}=Et(t,{x:e.x,y:e.y});Rt(l,a,s)&&r.push({element:t,datasetIndex:n,index:o})}),r}(t,e,n,r):[]}function gi(t,e,n,i,r){const o=[],a="x"===n?"inXRange":"inYRange";let s=!1;return di(t,n,e,(t,i,l)=>{t[a]&&t[a](e[n],r)&&(o.push({element:t,datasetIndex:i,index:l}),s=s||t.inRange(e.x,e.y,r))}),i&&!s?[]:o}var mi={evaluateInteractionItems:di,modes:{index(t,e,n,i){const r=fn(e,t),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?pi(t,r,o,i,a):fi(t,r,o,!1,i,a),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=s[0].index,n=t.data[e];n&&!n.skip&&l.push({element:n,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,n,i){const r=fn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?pi(t,r,o,i,a):fi(t,r,o,!1,i,a);if(s.length>0){const e=s[0].datasetIndex,n=t.getDatasetMeta(e).data;s=[];for(let t=0;t<n.length;++t)s.push({element:n[t],datasetIndex:e,index:t})}return s},point:(t,e,n,i)=>pi(t,fn(e,t),n.axis||"xy",i,n.includeInvisible||!1),nearest(t,e,n,i){const r=fn(e,t),o=n.axis||"xy",a=n.includeInvisible||!1;return fi(t,r,o,n.intersect,i,a)},x:(t,e,n,i)=>gi(t,fn(e,t),"x",n.intersect,i),y:(t,e,n,i)=>gi(t,fn(e,t),"y",n.intersect,i)}};const yi=["left","top","right","bottom"];function vi(t,e){return t.filter(t=>t.pos===e)}function _i(t,e){return t.filter(t=>-1===yi.indexOf(t.pos)&&t.box.axis===e)}function xi(t,e){return t.sort((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight})}function bi(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function wi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Si(t,e,n,i){const{pos:r,box:o}=n,a=t.maxPadding;if(!X(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[r]+=n.size}o.getPadding&&wi(a,o.getPadding());const s=Math.max(0,e.outerWidth-bi(a,t,"left","right")),l=Math.max(0,e.outerHeight-bi(a,t,"top","bottom")),c=s!==t.w,u=l!==t.h;return t.w=s,t.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Mi(t,e){const n=e.maxPadding;return function(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{i[t]=Math.max(e[t],n[t])}),i}(t?["left","right"]:["top","bottom"])}function Ci(t,e,n,i){const r=[];let o,a,s,l,c,u;for(o=0,a=t.length,c=0;o<a;++o){s=t[o],l=s.box,l.update(s.width||e.w,s.height||e.h,Mi(s.horizontal,e));const{same:a,other:h}=Si(e,n,s,i);c|=a&&r.length,u=u||h,l.fullSize||r.push(s)}return c&&Ci(r,e,n,i)||u}function Ti(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function Ii(t,e,n,i){const r=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,l=i[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const i=e.w*c,o=l.size||t.height;ht(l.start)&&(a=l.start),t.fullSize?Ti(t,r.left,a,n.outerWidth-r.right-r.left,o):Ti(t,e.left+l.placed,a,i,o),l.start=a,l.placed+=i,a=t.bottom}else{const i=e.h*c,a=l.size||t.width;ht(l.start)&&(o=l.start),t.fullSize?Ti(t,o,r.top,a,n.outerHeight-r.bottom-r.top):Ti(t,o,e.top+l.placed,a,i),l.start=o,l.placed+=i,o=t.right}}e.x=o,e.y=a}var Di={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=Ne(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(n-r.height,0),s=function(t){const e=function(t){const e=[];let n,i,r,o,a,s;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=r),e.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=xi(e.filter(t=>t.box.fullSize),!0),i=xi(vi(e,"left"),!0),r=xi(vi(e,"right")),o=xi(vi(e,"top"),!0),a=xi(vi(e,"bottom")),s=_i(e,"x"),l=_i(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(l).concat(a).concat(s),chartArea:vi(e,"chartArea"),vertical:i.concat(r).concat(l),horizontal:o.concat(a).concat(s)}}(t.boxes),l=s.vertical,c=s.horizontal;tt(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const u=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),d=Object.assign({},r);wi(d,Ne(i));const p=Object.assign({maxPadding:d,w:o,h:a,x:r.left,y:r.top},r),f=function(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!yi.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*i:a&&e.availableWidth,s.height=r):(s.width=i,s.height=c?c*r:a&&e.availableHeight)}return n}(l.concat(c),h);Ci(s.fullSize,p,h,f),Ci(l,p,h,f),Ci(c,p,h,f)&&Ci(l,p,h,f),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(p),Ii(s.leftAndTop,p,h,f),p.x+=p.w,p.y+=p.h,Ii(s.rightAndBottom,p,h,f),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},tt(s.chartArea,e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class ki{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Ai extends ki{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ei="$chartjs",Li={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pi=t=>null===t||""===t,Oi=!!yn&&{passive:!0};function Ri(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Oi)}function Bi(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Ni(t,e,n){const i=t.canvas,r=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Bi(n.addedNodes,i),e=e&&!Bi(n.removedNodes,i);e&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function zi(t,e,n){const i=t.canvas,r=new MutationObserver(t=>{let e=!1;for(const n of t)e=e||Bi(n.removedNodes,i),e=e&&!Bi(n.addedNodes,i);e&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const Fi=new Map;let Vi=0;function Hi(){const t=window.devicePixelRatio;t!==Vi&&(Vi=t,Fi.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function ji(t,e,n){const i=t.canvas,r=i&&cn(i);if(!r)return;const o=Ut((t,e)=>{const i=r.clientWidth;n(t,e),i<r.clientWidth&&n()},window),a=new ResizeObserver(t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||o(n,i)});return a.observe(r),function(t,e){Fi.size||window.addEventListener("resize",Hi),Fi.set(t,e)}(t,o),a}function Wi(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){Fi.delete(t),Fi.size||window.removeEventListener("resize",Hi)}(t)}function Gi(t,e,n){const i=t.canvas,r=Ut(e=>{null!==t.ctx&&n(function(t,e){const n=Li[t.type]||t.type,{x:i,y:r}=fn(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))},t);return function(t,e,n){t&&t.addEventListener(e,n,Oi)}(i,e,r),r}class Ui extends ki{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t[Ei]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Pi(r)){const e=vn(t,"width");void 0!==e&&(t.width=e)}if(Pi(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=vn(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Ei])return!1;const n=e[Ei].initial;["height","width"].forEach(t=>{const i=n[t];q(i)?e.removeAttribute(t):e.setAttribute(t,i)});const i=n.style||{};return Object.keys(i).forEach(t=>{e.style[t]=i[t]}),e.width=e.width,delete e[Ei],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:Ni,detach:zi,resize:ji}[e]||Gi;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];i&&(({attach:Wi,detach:Wi,resize:Wi}[e]||Ri)(t,e,i),n[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return function(t,e,n,i){const r=hn(t),o=pn(r,"margin"),a=un(r.maxWidth,t,"clientWidth")||yt,s=un(r.maxHeight,t,"clientHeight")||yt,l=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=t&&cn(t);if(o){const t=o.getBoundingClientRect(),a=hn(o),s=pn(a,"border","width"),l=pn(a,"padding");e=t.width-l.width-s.width,n=t.height-l.height-s.height,i=un(a.maxWidth,o,"clientWidth"),r=un(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||yt,maxHeight:r||yt}}(t,e,n);let{width:c,height:u}=l;if("content-box"===r.boxSizing){const t=pn(r,"border","width"),e=pn(r,"padding");c-=e.width+t.width,u-=e.height+t.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=gn(Math.min(c,a,l.maxWidth)),u=gn(Math.min(u,s,l.maxHeight)),c&&!u&&(u=gn(c/2)),(void 0!==e||void 0!==n)&&i&&l.height&&u>l.height&&(u=l.height,c=gn(Math.floor(u*i))),{width:c,height:u}}(t,e,n,i)}isAttached(t){const e=t&&cn(t);return!(!e||!e.isConnected)}}class qi{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Tt(this.x)&&Tt(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach(t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]}),i}}function Yi(t,e,n,i,r){const o=K(i,0),a=Math.min(K(r,t.length),t.length);let s,l,c,u=0;for(n=Math.ceil(n),r&&(s=r-i,n=s/Math.floor(s/n)),c=o;c<0;)u++,c=Math.round(o+u*n);for(l=Math.max(o,0);l<a;l++)l===c&&(e.push(t[l]),u++,c=Math.round(o+u*n))}const Xi=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n,$i=(t,e)=>Math.min(e||t,t);function Zi(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;o<r;o+=i)n.push(t[Math.floor(o)]);return n}function Ki(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,s=1e-6;let l,c=t.getPixelForTick(r);if(!(n&&(l=1===i?Math.max(c-o,a-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(r-1))/2,c+=r<e?l:-l,c<o-s||c>a+s)))return c}function Ji(t){return t.drawTicks?t.tickLength:0}function Qi(t,e){if(!t.display)return 0;const n=ze(t.font,e),i=Ne(t.padding);return(Y(t.text)?t.text.length:1)*n.lineHeight+i.height}function tr(t,e,n){let i=qt(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class er extends qi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=Z(t,Number.POSITIVE_INFINITY),e=Z(e,Number.NEGATIVE_INFINITY),n=Z(n,Number.POSITIVE_INFINITY),i=Z(i,Number.NEGATIVE_INFINITY),{min:Z(t,n),max:Z(e,i),minDefined:$(t),maxDefined:$(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:o}=this.getUserBounds();if(r&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)e=a[s].controller.getMinMax(this,t),r||(n=Math.min(n,e.min)),o||(i=Math.max(i,e.max));return n=o&&n>i?i:n,i=r&&n>i?n:i,{min:Z(n,Z(i,n)),max:Z(i,Z(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Q(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:r}=t,o=J(e,(r-i)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(i,-Math.abs(o)),max:a(r,o)}}(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?Zi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=function(t,e){const n=t.options.ticks,i=function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>r)return function(t,e,n,i){let r,o=0,a=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===a&&(e.push(t[r]),o++,a=n[o*i])}(e,c,o,a/r),c;const u=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const o=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i===0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort((t,e)=>t-e).pop(),e}(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(o,e,r);if(a>0){let t,n;const i=a>1?Math.round((l-s)/(a-1)):null;for(Yi(e,c,u,q(i)?0:s-i,s),t=0,n=a-1;t<n;t++)Yi(e,c,u,o[t],o[t+1]);return Yi(e,c,u,l,q(i)?e.length:l+i),c}return Yi(e,c,u),c}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Q(this.options.afterUpdate,[this])}beforeSetDimensions(){Q(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Q(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Q(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Q(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=Q(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){Q(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Q(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=$i(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,r=e.maxRotation;let o,a,s,l=i;if(!this._isVisible()||!e.display||i>=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const c=this._getLabelSizes(),u=c.widest.width,h=c.highest.height,d=Bt(this.chart.width-u,0,this.maxWidth);o=t.offset?this.maxWidth/n:d/(n-1),u+6>o&&(o=d/(n-(t.offset?.5:1)),a=this.maxHeight-Ji(t.grid)-e.padding-Qi(t.title,this.chart.options.font),s=Math.sqrt(u*u+h*h),l=kt(Math.min(Math.asin(Bt((c.highest.height+6)/o,-1,1)),Math.asin(Bt(a/s,-1,1))-Math.asin(Bt(h/s,-1,1)))),l=Math.max(i,Math.min(r,l))),this.labelRotation=l}afterCalculateLabelRotation(){Q(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Q(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Qi(i,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ji(r)+o):(t.height=this.maxHeight,t.width=Ji(r)+o),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:o}=this._getLabelSizes(),s=2*n.padding,l=Dt(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const e=n.mirror?0:u*r.width+c*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:c*r.width+u*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,i,u,c)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:o},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,h=0;s?l?(u=i*t.width,h=n*e.height):(u=n*t.height,h=i*e.width):"start"===r?h=e.width:"end"===r?u=t.width:"inner"!==r&&(u=t.width/2,h=e.width/2),this.paddingLeft=Math.max((u-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+o,this.paddingBottom=i+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Q(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)q(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Zi(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,n){const{ctx:i,_longestTextCache:r}=this,o=[],a=[],s=Math.floor(e/$i(e,n));let l,c,u,h,d,p,f,g,m,y,v,_=0,x=0;for(l=0;l<e;l+=s){if(h=t[l].label,d=this._resolveTickFontOptions(l),i.font=p=d.string,f=r[p]=r[p]||{data:{},gc:[]},g=d.lineHeight,m=y=0,q(h)||Y(h)){if(Y(h))for(c=0,u=h.length;c<u;++c)v=h[c],q(v)||Y(v)||(m=ge(i,f.data,f.gc,m,v),y+=g)}else m=ge(i,f.data,f.gc,m,h),y=g;o.push(m),a.push(y),_=Math.max(m,_),x=Math.max(y,x)}!function(t,e){tt(t,t=>{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}})}(r,e);const b=o.indexOf(_),w=a.indexOf(x),S=t=>({width:o[t]||0,height:a[t]||0});return{first:S(0),last:S(e-1),widest:S(b),highest:S(w),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Bt(this._alignToPixels?ye(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=function(t,e,n){return Ve(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=function(t,e){return Ve(t,{scale:e,type:"scale"})}(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Dt(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,s=r?r.highest.height+o:0;return this.isHorizontal()?s*n>a*i?a/n:s/i:s*i<a*n?s/n:a/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:o,border:a}=i,s=r.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=Ji(r),h=[],d=a.setContext(this.getContext()),p=d.display?d.width:0,f=p/2,g=function(t){return ye(n,t,p)};let m,y,v,_,x,b,w,S,M,C,T,I;if("top"===o)m=g(this.bottom),b=this.bottom-u,S=m-f,C=g(t.top)+f,I=t.bottom;else if("bottom"===o)m=g(this.top),C=t.top,I=g(t.bottom)-f,b=m+f,S=this.top+u;else if("left"===o)m=g(this.right),x=this.right-u,w=m-f,M=g(t.left)+f,T=t.right;else if("right"===o)m=g(this.left),M=t.left,T=g(t.right)-f,x=m+f,w=this.left+u;else if("x"===e){if("center"===o)m=g((t.top+t.bottom)/2+.5);else if(X(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}C=t.top,I=t.bottom,b=m+f,S=b+u}else if("y"===e){if("center"===o)m=g((t.left+t.right)/2);else if(X(o)){const t=Object.keys(o)[0],e=o[t];m=g(this.chart.scales[t].getPixelForValue(e))}x=m-f,w=x-u,M=t.left,T=t.right}const D=K(i.ticks.maxTicksLimit,c),k=Math.max(1,Math.ceil(c/D));for(y=0;y<c;y+=k){const t=this.getContext(y),e=r.setContext(t),i=a.setContext(t),o=e.lineWidth,c=e.color,u=i.dash||[],d=i.dashOffset,p=e.tickWidth,f=e.tickColor,g=e.tickBorderDash||[],m=e.tickBorderDashOffset;v=Ki(this,y,s),void 0!==v&&(_=ye(n,v,o),l?x=w=M=T=_:b=S=C=I=_,h.push({tx1:x,ty1:b,tx2:w,ty2:S,x1:M,y1:C,x2:T,y2:I,width:o,color:c,borderDash:u,borderDashOffset:d,tickWidth:p,tickColor:f,tickBorderDash:g,tickBorderDashOffset:m}))}return this._ticksLength=c,this._borderValue=m,h}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=r,h=Ji(n.grid),d=h+c,p=u?-c:d,f=-Dt(this.labelRotation),g=[];let m,y,v,_,x,b,w,S,M,C,T,I,D="middle";if("top"===i)b=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===i)b=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,x=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(h);w=t.textAlign,x=t.x}else if("x"===e){if("center"===i)b=(t.top+t.bottom)/2+d;else if(X(i)){const t=Object.keys(i)[0],e=i[t];b=this.chart.scales[t].getPixelForValue(e)+d}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)x=(t.left+t.right)/2-d;else if(X(i)){const t=Object.keys(i)[0],e=i[t];x=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(h).textAlign}"y"===e&&("start"===s?D="top":"end"===s&&(D="bottom"));const k=this._getLabelSizes();for(m=0,y=a.length;m<y;++m){v=a[m],_=v.label;const t=r.setContext(this.getContext(m));S=this.getPixelForTick(m)+r.labelOffset,M=this._resolveTickFontOptions(m),C=M.lineHeight,T=Y(_)?_.length:1;const e=T/2,n=t.color,s=t.textStrokeColor,c=t.textStrokeWidth;let h,d=w;if(o?(x=S,"inner"===w&&(d=m===y-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),I="top"===i?"near"===l||0!==f?-T*C+C/2:"center"===l?-k.highest.height/2-e*C+C:-k.highest.height+C/2:"near"===l||0!==f?C/2:"center"===l?k.highest.height/2-e*C:k.highest.height-T*C,u&&(I*=-1),0===f||t.showLabelBackdrop||(x+=C/2*Math.sin(f))):(b=S,I=(1-T)*C/2),t.showLabelBackdrop){const e=Ne(t.backdropPadding),n=k.heights[m],i=k.widths[m];let r=I-e.top,o=0-e.left;switch(D){case"middle":r-=n/2;break;case"bottom":r-=n}switch(w){case"center":o-=i/2;break;case"right":o-=i;break;case"inner":m===y-1?o-=i:m>0&&(o-=i/2)}h={left:o,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}g.push({label:_,font:M,textOffset:I,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:d,textBaseline:D,translation:[x,b],backdrop:h}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Dt(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align?n="right":"inner"===e.align&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,o=t+r,a=this._getLabelSizes().widest.width;let s,l;return"left"===e?i?(l=this.right+r,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===e?i?(l=this.left+r,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(e=>e.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=i.length;r<o;++r){const t=i[r];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:n,grid:i}}=this,r=n.setContext(this.getContext()),o=n.display?r.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,h;this.isHorizontal()?(l=ye(t,this.left,o)-o/2,c=ye(t,this.right,a)+a/2,u=h=s):(u=ye(t,this.top,o)-o/2,h=ye(t,this.bottom,a)+a/2,l=c=s),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(l,u),e.lineTo(c,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&we(e,n);const i=this.getLabelItems(t);for(const t of i){const n=t.options,i=t.font;De(e,t.label,0,t.textOffset,i,n)}n&&Se(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=ze(n.font),o=Ne(n.padding),a=n.align;let s=r.lineHeight/2;"bottom"===e||"center"===e||X(e)?(s+=o.bottom,Y(n.text)&&(s+=r.lineHeight*(n.text.length-1))):s+=o.top;const{titleX:l,titleY:c,maxWidth:u,rotation:h}=function(t,e,n,i){const{top:r,left:o,bottom:a,right:s,chart:l}=t,{chartArea:c,scales:u}=l;let h,d,p,f=0;const g=a-r,m=s-o;if(t.isHorizontal()){if(d=Yt(i,o,s),X(n)){const t=Object.keys(n)[0],i=n[t];p=u[t].getPixelForValue(i)+g-e}else p="center"===n?(c.bottom+c.top)/2+g-e:Xi(t,n,e);h=s-o}else{if(X(n)){const t=Object.keys(n)[0],i=n[t];d=u[t].getPixelForValue(i)-m+e}else d="center"===n?(c.left+c.right)/2-m+e:Xi(t,n,e);p=Yt(i,a,r),f="left"===n?-_t:_t}return{titleX:d,titleY:p,maxWidth:h,rotation:f}}(this,s,e,a);De(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:h,textAlign:tr(a,e,i),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=K(t.grid&&t.grid.z,-1),i=K(t.border&&t.border.z,0);return this._isVisible()&&this.draw===er.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=e.length;r<o;++r){const o=e[r];o[n]!==this.id||t&&o.type!==t||i.push(o)}return i}_resolveTickFontOptions(t){return ze(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class nr{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,function(t,e,n){const i=ot(Object.create(null),[n?fe.get(n):{},fe.get(e),t.defaults]);fe.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(n=>{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),l=a.join(".");fe.route(o,r,l,s)})}(e,t.defaultRoutes),t.descriptors&&fe.describe(e,t.descriptors)}(t,o,n),this.override&&fe.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in fe[i]&&(delete fe[i][n],this.override&&delete ce[n])}}class ir{constructor(){this.controllers=new nr(Zn,"datasets",!0),this.elements=new nr(qi,"elements"),this.plugins=new nr(Object,"plugins"),this.scales=new nr(er,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach(e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):tt(e,e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)})})}_exec(t,e,n){const i=ut(t);Q(n["before"+i],[],n),e[t](n),Q(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}}var rr=new ir;class or{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,e,n);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===Q(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){q(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=K(n.options&&n.options.plugins,{}),r=function(t){const e={},n=[],i=Object.keys(rr.plugins.items);for(let t=0;t<i.length;t++)n.push(rr.getPlugin(i[t]));const r=t.plugins||[];for(let t=0;t<r.length;t++){const i=r[t];-1===n.indexOf(i)&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}(n);return!1!==i||e?function(t,{plugins:e,localIds:n},i,r){const o=[],a=t.getContext();for(const s of e){const e=s.id,l=ar(i[e],r);null!==l&&o.push({plugin:s,options:sr(t.config,{plugin:s,local:n[e]},l,a)})}return o}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function ar(t,e){return e||!1!==t?!0===t?{}:t:null}function sr(t,{plugin:e,local:n},i,r){const o=t.pluginScopeKeys(e),a=t.getOptionScopes(i,o);return n&&e.defaults&&a.push(e.defaults),t.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lr(t,e){const n=fe.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function cr(t){if("x"===t||"y"===t||"r"===t)return t}function ur(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function hr(t,...e){if(cr(t))return t;for(const n of e){const e=n.axis||ur(n.position)||t.length>1&&cr(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function dr(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function pr(t){const e=t.options||(t.options={});e.plugins=K(e.plugins,{}),e.scales=function(t,e){const n=ce[t.type]||{scales:{}},i=e.scales||{},r=lr(t.type,e),o=Object.create(null);return Object.keys(i).forEach(e=>{const a=i[e];if(!X(a))return console.error(`Invalid scale configuration for scale: ${e}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const s=hr(e,a,function(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(n.length)return dr(t,"x",n[0])||dr(t,"y",n[0])}return{}}(e,t),fe.scales[a.type]),l=function(t,e){return t===e?"_index_":"_value_"}(s,r),c=n.scales||{};o[e]=at(Object.create(null),[{axis:s},a,c[s],c[l]])}),t.data.datasets.forEach(n=>{const r=n.type||t.type,a=n.indexAxis||lr(r,e),s=(ce[r]||{}).scales||{};Object.keys(s).forEach(t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,a),r=n[e+"AxisID"]||e;o[r]=o[r]||Object.create(null),at(o[r],[{axis:e},i[r],s[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];at(e,[fe.scales[e.type],fe.scale])}),o}(t,e)}function fr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const gr=new Map,mr=new Set;function yr(t,e){let n=gr.get(t);return n||(n=e(),gr.set(t,n),mr.add(n)),n}const vr=(t,e,n)=>{const i=ct(e,n);void 0!==i&&t.add(i)};class _r{constructor(t){this._config=function(t){return(t=t||{}).data=fr(t.data),pr(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=fr(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),pr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return yr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return yr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return yr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return yr(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach(e=>{t&&(s.add(t),e.forEach(e=>vr(s,t,e))),e.forEach(t=>vr(s,i,t)),e.forEach(t=>vr(s,ce[r]||{},t)),e.forEach(t=>vr(s,fe,t)),e.forEach(t=>vr(s,ue,t))});const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),mr.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ce[e]||{},fe.datasets[e]||{},{type:e},fe,ue]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=xr(this._resolverCache,t,i);let s=o;(function(t,e){const{isScriptable:n,isIndexable:i}=We(t);for(const r of e){const e=n(r),o=i(r),a=(o||e)&&t[r];if(e&&(dt(a)||br(a))||o&&Y(a))return!0}return!1})(o,e)&&(r.$shared=!1,s=je(o,n=dt(n)?n():n,this.createResolver(t,n,a)));for(const t of e)r[t]=s[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=xr(this._resolverCache,t,n);return X(e)?je(r,e,void 0,i):r}}function xr(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);return o||(o={resolver:He(e,n),subPrefixes:n.filter(t=>!t.toLowerCase().includes("hover"))},i.set(r,o)),o}const br=t=>X(t)&&Object.getOwnPropertyNames(t).some(e=>dt(t[e])),wr=["top","bottom","left","right","chartArea"];function Sr(t,e){return"top"===t||"bottom"===t||-1===wr.indexOf(t)&&"x"===e}function Mr(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Cr(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Q(n&&n.onComplete,[t],e)}function Tr(t){const e=t.chart,n=e.options.animation;Q(n&&n.onProgress,[t],e)}function Ir(t){return ln()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Dr={},kr=t=>{const e=Ir(t);return Object.values(Dr).filter(t=>t.canvas===e).pop()};function Ar(t,e,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}class Er{static defaults=fe;static instances=Dr;static overrides=ce;static registry=rr;static version="4.5.0";static getChart=kr;static register(...t){rr.add(...t),Lr()}static unregister(...t){rr.remove(...t),Lr()}constructor(t,e){const n=this.config=new _r(e),i=Ir(t),r=kr(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!ln()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ai:Ui}(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,o.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=U(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new or,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}(t=>this.update(t),o.resizeDelay||0),this._dataChanges=[],Dr[this.id]=this,a&&s?(On.listen(this,"complete",Cr),On.listen(this,"progress",Tr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return q(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return rr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():mn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ve(this.canvas,this.ctx),this}stop(){return On.stop(this),this}resize(t,e){On.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,mn(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Q(n.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){tt(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce((t,e)=>(t[e]=!1,t),{});let r=[];e&&(r=r.concat(Object.keys(e).map(t=>{const n=e[t],i=hr(t,n),r="r"===i,o="x"===i;return{options:n,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}}))),tt(r,e=>{const r=e.options,o=r.id,a=hr(o,r),s=K(r.type,e.dtype);void 0!==r.position&&Sr(r.position,a)===Sr(e.dposition)||(r.position=e.dposition),i[o]=!0;let l=null;o in n&&n[o].type===s?l=n[o]:(l=new(rr.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),n[l.id]=l),l.init(r,t)}),tt(i,(t,e)=>{t||delete n[e]}),tt(n,t=>{Di.configure(this,t,t.options),Di.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((t,e)=>t.index-e.index),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(Mr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,n)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let r=this.getDatasetMeta(n);const o=i.type||this.config.type;if(r.type&&r.type!==o&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=o,r.indexAxis=i.indexAxis||lr(o,this.options),r.order=i.order||0,r.index=n,r.label=""+i.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const e=rr.getController(o),{datasetElementType:i,dataElementType:a}=fe.datasets[o];Object.assign(e,{dataElementType:rr.getElement(a),datasetElementType:i&&rr.getElement(i)}),r.controller=new e(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){tt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!i&&-1===r.indexOf(e);e.buildOrUpdateElements(n),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||tt(r,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Mr("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){tt(this.scales,t=>{Di.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);pt(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e)Ar(t,i,"_removeElements"===n?-r:r)}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),i=n(0);for(let t=1;t<e;t++)if(!pt(i,n(t)))return;return Array.from(i).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Di.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],tt(this.boxes,t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(On.has(this)?this.attached&&!On.running(this)&&On.start(this):(this.draw(),Cr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n={meta:t,index:t.index,cancelable:!0},i=Ln(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(i&&we(e,i),t.controller.draw(),i&&Se(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return be(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,i){const r=mi.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter(t=>t&&t._dataset===e).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=Ve(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);ht(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update(e=>e.datasetIndex===t?i:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),On.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ve(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Dr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};tt(this.options.events,t=>n(t,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){tt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},tt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,a,s;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map(({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}});!et(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:i=[],options:r}=this,o=e,a=this._getActiveElements(t,i,n,o),s=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,n,i){return n&&"mouseout"!==t.type?i?e:t:null}(t,this._lastEvent,n,s);n&&(this._lastEvent=null,Q(r.onHover,[t,a,this],this),s&&Q(r.onClick,[t,a,this],this));const c=!et(a,i);return(c||e)&&(this._active=a,this._updateHoverStyles(a,i,e)),this._lastEvent=l,c}_getActiveElements(t,e,n,i){if("mouseout"===t.type)return[];if(!n)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,i)}}function Lr(){return tt(Er.instances,t=>t._plugins.invalidate())}function Pr(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Or(t,e,n,i,r,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=e,h=Math.max(e.outerRadius+i+n-c,0),d=u>0?u+i+n+c:0;let p=0;const f=r-l;if(i){const t=((u>0?u-i:0)+(h>0?h-i:0))/2;p=(f-(0!==t?f*t/(t+i):f))/2}const g=(f-Math.max(.001,f*h-n/ft)/h)/2,m=l+g+p,y=r-g-p,{outerStart:v,outerEnd:_,innerStart:x,innerEnd:b}=function(t,e,n,i){const r=Oe(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(n-e)/2,a=Math.min(o,i*e/2),s=t=>{const e=(n-Math.min(o,t))*i/2;return Bt(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:Bt(r.innerStart,0,a),innerEnd:Bt(r.innerEnd,0,a)}}(e,d,h,y-m),w=h-v,S=h-_,M=m+v/w,C=y-_/S,T=d+x,I=d+b,D=m+x/T,k=y-b/I;if(t.beginPath(),o){const e=(M+C)/2;if(t.arc(a,s,h,M,e),t.arc(a,s,h,e,C),_>0){const e=Pr(S,C,a,s);t.arc(e.x,e.y,_,C,y+_t)}const n=Pr(I,y,a,s);if(t.lineTo(n.x,n.y),b>0){const e=Pr(I,k,a,s);t.arc(e.x,e.y,b,y+_t,k+Math.PI)}const i=(y-b/d+(m+x/d))/2;if(t.arc(a,s,d,y-b/d,i,!0),t.arc(a,s,d,i,m+x/d,!0),x>0){const e=Pr(T,D,a,s);t.arc(e.x,e.y,x,D+Math.PI,m-_t)}const r=Pr(w,m,a,s);if(t.lineTo(r.x,r.y),v>0){const e=Pr(w,M,a,s);t.arc(e.x,e.y,v,m-_t,M)}}else{t.moveTo(a,s);const e=Math.cos(M)*h+a,n=Math.sin(M)*h+s;t.lineTo(e,n);const i=Math.cos(C)*h+a,r=Math.sin(C)*h+s;t.lineTo(i,r)}t.closePath()}function Rr(t,e,n=e){t.lineCap=K(n.borderCapStyle,e.borderCapStyle),t.setLineDash(K(n.borderDash,e.borderDash)),t.lineDashOffset=K(n.borderDashOffset,e.borderDashOffset),t.lineJoin=K(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=K(n.borderWidth,e.borderWidth),t.strokeStyle=K(n.borderColor,e.borderColor)}function Br(t,e,n){t.lineTo(n.x,n.y)}function Nr(t,e,n={}){const i=t.length,{start:r=0,end:o=i-1}=n,{start:a,end:s}=e,l=Math.max(r,a),c=Math.min(o,s),u=r<a&&o<a||r>s&&o>s;return{count:i,start:l,loop:e.loop,ilen:c<l&&!u?i+c-l:c-l}}function zr(t,e,n,i){const{points:r,options:o}=e,{count:a,start:s,loop:l,ilen:c}=Nr(r,n,i),u=function(t){return t.stepped?Me:t.tension||"monotone"===t.cubicInterpolationMode?Ce:Br}(o);let h,d,p,{move:f=!0,reverse:g}=i||{};for(h=0;h<=c;++h)d=r[(s+(g?c-h:h))%a],d.skip||(f?(t.moveTo(d.x,d.y),f=!1):u(t,p,d,g,o.stepped),p=d);return l&&(d=r[(s+(g?c:0))%a],u(t,p,d,g,o.stepped)),!!l}function Fr(t,e,n,i){const r=e.points,{count:o,start:a,ilen:s}=Nr(r,n,i),{move:l=!0,reverse:c}=i||{};let u,h,d,p,f,g,m=0,y=0;const v=t=>(a+(c?s-t:t))%o,_=()=>{p!==f&&(t.lineTo(m,f),t.lineTo(m,p),t.lineTo(m,g))};for(l&&(h=r[v(0)],t.moveTo(h.x,h.y)),u=0;u<=s;++u){if(h=r[v(u)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===d?(n<p?p=n:n>f&&(f=n),m=(y*m+e)/++y):(_(),t.lineTo(e,n),d=i,y=0,p=f=n),g=n}_()}function Vr(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n?zr:Fr}const Hr="function"==typeof Path2D;class jr extends qi{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;sn(this._points,n,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return function(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),o=kn(t.options),{_datasetIndex:a,options:{spanGaps:s}}=t,l=n.length,c=[];let u=o,h=e[0].start,d=h;function p(t,e,i,r){const o=s?-1:1;if(t!==e){for(t+=l;n[t%l].skip;)t-=o;for(;n[e%l].skip;)e+=o;t%l!==e%l&&(c.push({start:t%l,end:e%l,loop:i,style:r}),u=r,h=e%l)}}for(const t of e){h=s?h:t.start;let e,o=n[h%l];for(d=h+1;d<=t.end;d++){const s=n[d%l];e=kn(i.setContext(Ve(r,{type:"segment",p0:o,p1:s,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:a}))),An(e,u)&&p(h,d-1,t.loop,u),o=s,u=e}h<d-1&&p(h,d-1,t.loop,u)}return c}(t,e,n,i):e}(t,!0===i?[{start:a,end:s,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let a,s=e,l=t[e];for(a=e+1;a<=n;++a){const n=t[a%r];n.skip||n.stop?l.skip||(i=!1,o.push({start:e%r,end:(a-1)%r,loop:i}),e=s=n.stop?a:null):(s=a,l.skip&&(e=a)),l=n}return null!==s&&o.push({start:e%r,end:s%r,loop:i}),o}(n,a,s<a?s+r:s,!!t._fullLoop&&0===a&&s===r-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],r=this.points,o=Dn(this,{property:e,start:i,end:i});if(!o.length)return;const a=[],s=function(t){return t.stepped?xn:t.tension||"monotone"===t.cubicInterpolationMode?bn:_n}(n);let l,c;for(l=0,c=o.length;l<c;++l){const{start:c,end:u}=o[l],h=r[c],d=r[u];if(h===d){a.push(h);continue}const p=s(h,d,Math.abs((i-h[e])/(d[e]-h[e])),n.stepped);p[e]=t[e],a.push(p)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return Vr(this)(t,this,e,n)}path(t,e,n){const i=this.segments,r=Vr(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of i)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),function(t,e,n,i){Hr&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),Rr(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,a=Vr(e);for(const s of r)Rr(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Wr(t,e,n,i){const r=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<r.radius+r.hitRadius}function Gr(t,e){const{x:n,y:i,base:r,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,l,c,u,h;return t.horizontal?(h=a/2,s=Math.min(n,r),l=Math.max(n,r),c=i-h,u=i+h):(h=o/2,s=n-h,l=n+h,c=Math.min(i,r),u=Math.max(i,r)),{left:s,top:c,right:l,bottom:u}}function Ur(t,e,n,i){return t?0:Bt(e,n,i)}function qr(t,e,n,i){const r=null===e,o=null===n,a=t&&!(r&&o)&&Gr(t,i);return a&&(r||Nt(e,a.left,a.right))&&(o||Nt(n,a.top,a.bottom))}function Yr(t,e){t.rect(e.x,e.y,e.w,e.h)}function Xr(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+o,h:t.h+a,radius:t.radius}}var $r=Object.freeze({__proto__:null,ArcElement:class extends qi{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=Et(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,d=K(u,s-a),p=Rt(r,a,s)&&a!==s,f=d>=gt||p,g=Nt(o,l+h,c+h);return f&&g}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:s,spacing:l}=this.options,c=(i+r)/2,u=(o+a+l+s)/2;return{x:e+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/4,r=(e.spacing||0)/2,o=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>gt?Math.floor(n/gt):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*i,Math.sin(a)*i);const s=i*(1-Math.sin(Math.min(ft,n||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,n,i,r){const{fullCircles:o,startAngle:a,circumference:s}=e;let l=e.endAngle;if(o){Or(t,e,n,i,l,r);for(let e=0;e<o;++e)t.fill();isNaN(s)||(l=a+(s%gt||gt))}Or(t,e,n,i,l,r),t.fill()}(t,this,s,r,o),function(t,e,n,i,r){const{fullCircles:o,startAngle:a,circumference:s,options:l}=e,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:d,borderRadius:p}=l,f="inner"===l.borderAlign;if(!c)return;t.setLineDash(h||[]),t.lineDashOffset=d,f?(t.lineWidth=2*c,t.lineJoin=u||"round"):(t.lineWidth=c,t.lineJoin=u||"bevel");let g=e.endAngle;if(o){Or(t,e,n,i,g,r);for(let e=0;e<o;++e)t.stroke();isNaN(s)||(g=a+(s%gt||gt))}f&&function(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:a,outerRadius:s,innerRadius:l}=e;let c=r/s;t.beginPath(),t.arc(o,a,s,i-c,n+c),l>r?(c=r/l,t.arc(o,a,l,n+c,i-c,!0)):t.arc(o,a,r,n+_t,i-_t),t.closePath(),t.clip()}(t,e,g),l.selfJoin&&g-a>=ft&&0===p&&"miter"!==u&&function(t,e,n){const{startAngle:i,x:r,y:o,outerRadius:a,innerRadius:s,options:l}=e,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,Ot(i-n));if(t.beginPath(),t.arc(r,o,a-c/2,i+h/2,n-h/2),s>0){const e=Math.min(c/s,Ot(i-n));t.arc(r,o,s+c/2,n-e/2,i+e/2,!0)}else{const e=Math.min(c/2,a*Ot(i-n));if("round"===u)t.arc(r,o,e,n-ft/2,i+ft/2,!0);else if("bevel"===u){const a=2*e*e,s=-a*Math.cos(n+ft/2)+r,l=-a*Math.sin(n+ft/2)+o,c=a*Math.cos(i+ft/2)+r,u=a*Math.sin(i+ft/2)+o;t.lineTo(s,l),t.lineTo(c,u)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,g),o||(Or(t,e,n,i,g,r),t.stroke())}(t,this,s,r,o),t.restore()}},BarElement:class extends qi{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:o}=function(t){const e=Gr(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,o=Re(i);return{t:Ur(r.top,o.top,0,n),r:Ur(r.right,o.right,0,e),b:Ur(r.bottom,o.bottom,0,n),l:Ur(r.left,o.left,0,e)}}(t,n/2,i/2),o=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=Be(r),a=Math.min(e,n),s=t.borderSkipped,l=i||X(r);return{topLeft:Ur(!l||s.top||s.left,o.topLeft,0,a),topRight:Ur(!l||s.top||s.right,o.topRight,0,a),bottomLeft:Ur(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Ur(!l||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?ke:Yr;var s;t.save(),o.w===r.w&&o.h===r.h||(t.beginPath(),a(t,Xr(o,e,r)),t.clip(),a(t,Xr(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Xr(r,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return qr(this,t,e,n)}inXRange(t,e){return qr(this,t,null,e)}inYRange(t,e){return qr(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:jr,PointElement:class extends qi{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return Wr(this,t,"x",e)}inYRange(t,e){return Wr(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;return e=Math.max(e,e&&t.hoverRadius||0),2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!be(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,_e(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}});const Zr=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Kr=Zr.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Jr(t){return Zr[t%Zr.length]}function Qr(t){return Kr[t%Kr.length]}function to(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var eo={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=t.config,{elements:o}=r,a=to(i)||(s=r)&&(s.borderColor||s.backgroundColor)||o&&to(o)||"rgba(0,0,0,0.1)"!==fe.borderColor||"rgba(0,0,0,0.1)"!==fe.backgroundColor;var s;if(!n.forceOverride&&a)return;const l=function(t){let e=0;return(n,i)=>{const r=t.getDatasetMeta(i).controller;r instanceof oi?e=function(t,e){return t.backgroundColor=t.data.map(()=>Jr(e++)),e}(n,e):r instanceof ai?e=function(t,e){return t.backgroundColor=t.data.map(()=>Qr(e++)),e}(n,e):r&&(e=function(t,e){return t.borderColor=Jr(e),t.backgroundColor=Qr(e),++e}(n,e))}}(t);i.forEach(l)}};function no(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function io(t){t.data.datasets.forEach(t=>{no(t)})}var ro={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void io(t);const i=t.width;t.data.datasets.forEach((e,r)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(r),l=o||e.data;if("y"===Fe([a,t.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=t.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(t.options.parsing)return;let u,{start:h,count:d}=function(t,e){const n=e.length;let i,r=0;const{iScale:o}=t,{min:a,max:s,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(r=Bt(Ft(e,o.axis,a).lo,0,n-1)),i=c?Bt(Ft(e,o.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}(s,l);if(d<=(n.threshold||4*i))no(e);else{switch(q(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":u=function(t,e,n,i,r){const o=r.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let l=0;const c=e+n-1;let u,h,d,p,f,g=e;for(a[l++]=t[g],u=0;u<o-2;u++){let i,r=0,o=0;const c=Math.floor((u+1)*s)+1+e,m=Math.min(Math.floor((u+2)*s)+1,n)+e,y=m-c;for(i=c;i<m;i++)r+=t[i].x,o+=t[i].y;r/=y,o/=y;const v=Math.floor(u*s)+1+e,_=Math.min(Math.floor((u+1)*s)+1,n)+e,{x,y:b}=t[g];for(d=p=-1,i=v;i<_;i++)p=.5*Math.abs((x-r)*(t[i].y-b)-(x-t[i].x)*(o-b)),p>d&&(d=p,h=t[i],f=i);a[l++]=h,g=f}return a[l++]=t[c],a}(l,h,d,i,n);break;case"min-max":u=function(t,e,n,i){let r,o,a,s,l,c,u,h,d,p,f=0,g=0;const m=[],y=e+n-1,v=t[e].x,_=t[y].x-v;for(r=e;r<e+n;++r){o=t[r],a=(o.x-v)/_*i,s=o.y;const e=0|a;if(e===l)s<d?(d=s,c=r):s>p&&(p=s,u=r),f=(g*f+o.x)/++g;else{const n=r-1;if(!q(c)&&!q(u)){const e=Math.min(c,u),i=Math.max(c,u);e!==h&&e!==n&&m.push({...t[e],x:f}),i!==h&&i!==n&&m.push({...t[i],x:f})}r>0&&n!==h&&m.push(t[n]),m.push(o),l=e,g=0,d=p=s,c=u=h=r}}return m}(l,h,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=u}})},destroy(t){io(t)}};function oo(t,e,n,i){if(i)return;let r=e[t],o=n[t];return"angle"===t&&(r=Ot(r),o=Ot(o)),{property:t,start:r,end:o}}function ao(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function so(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function lo(t,e){let n=[],i=!1;return Y(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,o=[];return e.segments.forEach(({start:t,end:e})=>{e=ao(t,e,r);const a=r[t],s=r[e];null!==i?(o.push({x:a.x,y:i}),o.push({x:s.x,y:i})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))}),o}(t,e),n.length?new jr({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function co(t){return t&&!1!==t.fill}function uo(t,e,n){let i=t[e].fill;const r=[e];let o;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!$(i))return i;if(o=t[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function ho(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=K(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(X(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return $(r)&&Math.floor(r)===r?function(t,e,n,i){return"-"!==t&&"+"!==t||(n=e+n),!(n===e||n<0||n>=i)&&n}(i[0],e,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function po(t,e,n){const i=[];for(let r=0;r<n.length;r++){const o=n[r],{first:a,last:s,point:l}=fo(o,e,"x");if(!(!l||a&&s))if(a)i.unshift(l);else if(t.push(l),!s)break}t.push(...i)}function fo(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],o=t.segments,a=t.points;let s=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],i=a[e.start][n],c=a[e.end][n];if(Nt(r,i,c)){s=r===i,l=r===c;break}}return{first:s,last:l,point:i}}class go{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:gt},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function mo(t,e,n){const i=function(t){const{chart:e,fill:n,line:i}=t;if($(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,r=[],o=i.segments,a=i.points,s=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let t=0;t<i.length;t++){const r=i[t];if(r.index===e)break;r.hidden||n.unshift(r.dataset)}return n}(e,n);s.push(lo({x:null,y:e.bottom},i));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)po(r,a[t],s)}return new jr({points:r,options:{}})}(t);if("shape"===n)return!0;const r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,o=i.reverse?e.max:e.min,a=function(t,e,n){let i;return i="start"===t?n:"end"===t?e.options.reverse?e.min:e.max:X(t)?t.value:e.getBaseValue(),i}(n,e,o),s=[];if(i.grid.circular){const t=e.getPointPositionForValue(0,o);return new go({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<r;++t)s.push(e.getPointPositionForValue(t,a));return s}(t):function(t){const{scale:e={},fill:n}=t,i=function(t,e){let n=null;return"start"===t?n=e.bottom:"end"===t?n=e.top:X(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}(n,e);if($(i)){const t=e.isHorizontal();return{x:t?i:null,y:t?null:i}}return null}(t)}(t);return r instanceof go?r:lo(r,i)}(e),{chart:r,index:o,line:a,scale:s,axis:l}=e,c=a.options,u=c.fill,h=c.backgroundColor,{above:d=h,below:p=h}=u||{},f=r.getDatasetMeta(o),g=Ln(r,f);i&&a.points.length&&(we(t,n),function(t,e){const{line:n,target:i,above:r,below:o,area:a,scale:s,clip:l}=e,c=n._loop?"angle":e.axis;t.save();let u=o;o!==r&&("x"===c?(yo(t,i,a.top),_o(t,{line:n,target:i,color:r,scale:s,property:c,clip:l}),t.restore(),t.save(),yo(t,i,a.bottom)):"y"===c&&(vo(t,i,a.left),_o(t,{line:n,target:i,color:o,scale:s,property:c,clip:l}),t.restore(),t.save(),vo(t,i,a.right),u=r)),_o(t,{line:n,target:i,color:u,scale:s,property:c,clip:l}),t.restore()}(t,{line:a,target:i,above:d,below:p,area:n,scale:s,axis:l,clip:g}),Se(t))}function yo(t,e,n){const{segments:i,points:r}=e;let o=!0,a=!1;t.beginPath();for(const s of i){const{start:i,end:l}=s,c=r[i],u=r[ao(i,l,r)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(c.x,n),t.lineTo(c.x,c.y)),a=!!e.pathSegment(t,s,{move:a}),a?t.closePath():t.lineTo(u.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function vo(t,e,n){const{segments:i,points:r}=e;let o=!0,a=!1;t.beginPath();for(const s of i){const{start:i,end:l}=s,c=r[i],u=r[ao(i,l,r)];o?(t.moveTo(c.x,c.y),o=!1):(t.lineTo(n,c.y),t.lineTo(c.x,c.y)),a=!!e.pathSegment(t,s,{move:a}),a?t.closePath():t.lineTo(n,u.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function _o(t,e){const{line:n,target:i,property:r,color:o,scale:a,clip:s}=e,l=function(t,e,n){const i=t.segments,r=t.points,o=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=ao(i,s,r);const l=oo(n,r[i],r[s],t.loop);if(!e.segments){a.push({source:t,target:l,start:r[i],end:r[s]});continue}const c=Dn(e,l);for(const e of c){const i=oo(n,o[e.start],o[e.end],e.loop),s=In(t,r,i);for(const t of s)a.push({source:t,target:e,start:{[n]:so(l,i,"start",Math.max)},end:{[n]:so(l,i,"end",Math.min)}})}}return a}(n,i,r);for(const{source:e,target:c,start:u,end:h}of l){const{style:{backgroundColor:l=o}={}}=e,d=!0!==i;t.save(),t.fillStyle=l,xo(t,a,s,d&&oo(r,u,h)),t.beginPath();const p=!!n.pathSegment(t,e);let f;if(d){p?t.closePath():bo(t,i,h,r);const e=!!i.pathSegment(t,c,{move:p,reverse:!0});f=p&&e,f||bo(t,i,u,r)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function xo(t,e,n,i){const r=e.chart.chartArea,{property:o,start:a,end:s}=i||{};if("x"===o||"y"===o){let e,i,l,c;"x"===o?(e=a,i=r.top,l=s,c=r.bottom):(e=r.left,i=a,l=r.right,c=s),t.beginPath(),n&&(e=Math.max(e,n.left),l=Math.min(l,n.right),i=Math.max(i,n.top),c=Math.min(c,n.bottom)),t.rect(e,i,l-e,c-i),t.clip()}}function bo(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}var wo={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let o,a,s,l;for(a=0;a<i;++a)o=t.getDatasetMeta(a),s=o.dataset,l=null,s&&s.options&&s instanceof jr&&(l={visible:t.isDatasetVisible(a),index:a,fill:ho(s,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=l,r.push(l);for(a=0;a<i;++a)l=r[a],l&&!1!==l.fill&&(l.fill=uo(r,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),i&&n.fill&&mo(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;co(n)&&mo(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;co(i)&&"beforeDatasetDraw"===n.drawTime&&mo(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const So=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=t.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class Mo extends qi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Q(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,n)=>t.sort(e,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=ze(n.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=So(n,r);let l,c;e.font=i.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(o,r,a,s)+10):(c=this.maxHeight,l=this._fitCols(o,i,a,s)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=i+a;let u=t;r.textAlign="left",r.textBaseline="middle";let h=-1,d=-c;return this.legendItems.forEach((t,p)=>{const f=n+e/2+r.measureText(t.text).width;(0===p||l[l.length-1]+f+2*a>o)&&(u+=c,l[l.length-(p>0?0:1)]=0,d+=c,h++),s[p]={left:0,top:d,row:h,width:f,height:i},l[l.length-1]+=f+a}),u}_fitCols(t,e,n,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=o-t;let u=a,h=0,d=0,p=0,f=0;return this.legendItems.forEach((t,o)=>{const{itemWidth:g,itemHeight:m}=function(t,e,n,i,r){const o=function(t,e,n,i){let r=t.text;return r&&"string"!=typeof r&&(r=r.reduce((t,e)=>t.length>e.length?t:e)),e+n.size/2+i.measureText(r).width}(i,t,e,n),a=function(t,e,n){let i=t;return"string"!=typeof e.text&&(i=Co(e,n)),i}(r,i,e.lineHeight);return{itemWidth:o,itemHeight:a}}(n,e,r,t,i);o>0&&d+m+2*a>c&&(u+=h+a,l.push({width:h,height:d}),p+=h+a,f++,h=d=0),s[o]={left:p,top:d,col:f,width:g,height:m},h=Math.max(h,g),d+=m+a}),u+=h,l.push({width:h,height:d}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:r}}=this,o=wn(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=Yt(n,this.left+i,this.right-this.lineWidths[r]);for(const s of e)r!==s.row&&(r=s.row,a=Yt(n,this.left+i,this.right-this.lineWidths[r])),s.top+=this.top+t+i,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+i}else{let r=0,a=Yt(n,this.top+t+i,this.bottom-this.columnSizes[r].height);for(const s of e)s.col!==r&&(r=s.col,a=Yt(n,this.top+t+i,this.bottom-this.columnSizes[r].height)),s.top=a,s.left+=this.left+i,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;we(t,this),this._draw(),Se(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:r,labels:o}=t,a=fe.color,s=wn(t.rtl,this.left,this.width),l=ze(o.font),{padding:c}=o,u=l.size,h=u/2;let d;this.drawTitle(),i.textAlign=s.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:g}=So(o,u),m=this.isHorizontal(),y=this._computeTitleHeight();d=m?{x:Yt(r,this.left+c,this.right-n[0]),y:this.top+c+y,line:0}:{x:this.left+c,y:Yt(r,this.top+y+c,this.bottom-e[0].height),line:0},Sn(this.ctx,t.textDirection);const v=g+c;this.legendItems.forEach((_,x)=>{i.strokeStyle=_.fontColor,i.fillStyle=_.fontColor;const b=i.measureText(_.text).width,w=s.textAlign(_.textAlign||(_.textAlign=o.textAlign)),S=p+h+b;let M=d.x,C=d.y;if(s.setWidth(this.width),m?x>0&&M+S+c>this.right&&(C=d.y+=v,d.line++,M=d.x=Yt(r,this.left+c,this.right-n[d.line])):x>0&&C+v>this.bottom&&(M=d.x=M+e[d.line].width+c,d.line++,C=d.y=Yt(r,this.top+y+c,this.bottom-e[d.line].height)),function(t,e,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;i.save();const r=K(n.lineWidth,1);if(i.fillStyle=K(n.fillStyle,a),i.lineCap=K(n.lineCap,"butt"),i.lineDashOffset=K(n.lineDashOffset,0),i.lineJoin=K(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=K(n.strokeStyle,a),i.setLineDash(K(n.lineDash,[])),o.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},l=s.xPlus(t,p/2);xe(i,a,l,e+h,o.pointStyleWidth&&p)}else{const o=e+Math.max((u-f)/2,0),a=s.leftForLtr(t,p),l=Be(n.borderRadius);i.beginPath(),Object.values(l).some(t=>0!==t)?ke(i,{x:a,y:o,w:p,h:f,radius:l}):i.rect(a,o,p,f),i.fill(),0!==r&&i.stroke()}i.restore()}(s.x(M),C,_),M=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(w,M+p+h,m?M+S:this.right,t.rtl),function(t,e,n){De(i,n.text,t,e+g/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(M),C,_),m)d.x+=S+c;else if("string"!=typeof _.text){const t=l.lineHeight;d.y+=Co(_,t)+c}else d.y+=v}),Mn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=ze(e.font),i=Ne(e.padding);if(!e.display)return;const r=wn(t.rtl,this.left,this.width),o=this.ctx,a=e.position,s=n.size/2,l=i.top+s;let c,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),c=this.top+l,u=Yt(t.align,u,this.right-h);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);c=l+Yt(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=Yt(a,u,u+h);o.textAlign=r.textAlign(qt(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,De(o,e.text,d,c,n)}_computeTitleHeight(){const t=this.options.title,e=ze(t.font),n=Ne(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom))for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],Nt(t,i.left,i.left+i.width)&&Nt(e,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const i=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(i,n);i&&!r&&Q(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&Q(e.onHover,[t,n,this],this)}else n&&Q(e.onClick,[t,n,this],this)}}function Co(t,e){return e*(t.text?t.text.length:0)}var To={id:"legend",_element:Mo,start(t,e,n){const i=t.legend=new Mo({ctx:t.ctx,options:n,chart:t});Di.configure(t,i,n),Di.addBox(t,i)},stop(t){Di.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;Di.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:o,useBorderRadius:a,borderRadius:s}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(n?0:void 0),c=Ne(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Io extends qi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const i=Y(n.text)?n.text.length:1;this._padding=Ne(n.padding);const r=i*ze(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,a=o.align;let s,l,c,u=0;return this.isHorizontal()?(l=Yt(a,n,r),c=e+t,s=r-n):("left"===o.position?(l=n+t,c=Yt(a,i,e),u=-.5*ft):(l=r-t,c=Yt(a,e,i),u=.5*ft),s=i-e),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=ze(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:o,maxWidth:a,rotation:s}=this._drawArgs(i);De(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:s,textAlign:qt(e.align),textBaseline:"middle",translation:[r,o]})}}var Do={id:"title",_element:Io,start(t,e,n){!function(t,e){const n=new Io({ctx:t.ctx,options:e,chart:t});Di.configure(t,n,e),Di.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;Di.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;Di.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ko=new WeakMap;var Ao={id:"subtitle",start(t,e,n){const i=new Io({ctx:t.ctx,options:n,chart:t});Di.configure(t,i,n),Di.addBox(t,i),ko.set(t,i)},stop(t){Di.removeBox(t,ko.get(t)),ko.delete(t)},beforeUpdate(t,e,n){const i=ko.get(t);Di.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(t){if(!t.length)return!1;let e,n,i=new Set,r=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i.add(t.x),r+=t.y,++o}}if(0===o||0===i.size)return!1;const a=[...i].reduce((t,e)=>t+e)/i.size;return{x:a,y:r/o}},nearest(t,e){if(!t.length)return!1;let n,i,r,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=Lt(e,i.getCenterPoint());t<s&&(s=t,r=i)}}if(r){const t=r.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Lo(t,e){return e&&(Y(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Po(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Oo(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:a,value:s}=o.getLabelAndValue(r);return{chart:t,label:a,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:s,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Ro(t,e){const n=t.chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,l=ze(e.bodyFont),c=ze(e.titleFont),u=ze(e.footerFont),h=o.length,d=r.length,p=i.length,f=Ne(e.padding);let g=f.height,m=0,y=i.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);y+=t.beforeBody.length+t.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y&&(g+=p*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(y-p)*l.lineHeight+(y-1)*e.bodySpacing),d&&(g+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let v=0;const _=function(t){m=Math.max(m,n.measureText(t).width+v)};return n.save(),n.font=c.string,tt(t.title,_),n.font=l.string,tt(t.beforeBody.concat(t.afterBody),_),v=e.displayColors?a+2+e.boxPadding:0,tt(i,t=>{tt(t.before,_),tt(t.lines,_),tt(t.after,_)}),v=0,n.font=u.string,tt(t.footer,_),n.restore(),m+=f.width,{width:m,height:g}}function Bo(t,e,n,i){const{x:r,width:o}=n,{width:a,chartArea:{left:s,right:l}}=t;let c="center";return"center"===i?c=r<=(s+l)/2?"left":"right":r<=o/2?c="left":r>=a-o/2&&(c="right"),function(t,e,n,i){const{x:r,width:o}=i,a=n.caretSize+n.caretPadding;return"left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0||void 0}(c,t,e,n)&&(c="center"),c}function No(t,e,n){const i=n.yAlign||e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:n.xAlign||e.xAlign||Bo(t,e,n,i),yAlign:i}}function zo(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:l}=n,c=r+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:p}=Be(a);let f=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,d)+r:"right"===s&&(f+=Math.max(h,p)+r),{x:Bt(f,0,i.width-e.width),y:Bt(g,0,i.height-e.height)}}function Fo(t,e,n){const i=Ne(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function Vo(t){return Lo([],Po(t))}function Ho(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const jo={beforeTitle:G,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:G,beforeBody:G,beforeLabel:G,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return q(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:G,afterBody:G,beforeFooter:G,footer:G,afterFooter:G};function Wo(t,e,n,i){const r=t[e].call(n,i);return void 0===r?jo[e].call(n,i):r}class Go extends qi{static positioners=Eo;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new zn(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Ve(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){const{callbacks:n}=e,i=Wo(n,"beforeTitle",this,t),r=Wo(n,"title",this,t),o=Wo(n,"afterTitle",this,t);let a=[];return a=Lo(a,Po(i)),a=Lo(a,Po(r)),a=Lo(a,Po(o)),a}getBeforeBody(t,e){return Vo(Wo(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,i=[];return tt(t,t=>{const e={before:[],lines:[],after:[]},r=Ho(n,t);Lo(e.before,Po(Wo(r,"beforeLabel",this,t))),Lo(e.lines,Wo(r,"label",this,t)),Lo(e.after,Po(Wo(r,"afterLabel",this,t))),i.push(e)}),i}getAfterBody(t,e){return Vo(Wo(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,i=Wo(n,"beforeFooter",this,t),r=Wo(n,"footer",this,t),o=Wo(n,"afterFooter",this,t);let a=[];return a=Lo(a,Po(i)),a=Lo(a,Po(r)),a=Lo(a,Po(o)),a}_createItems(t){const e=this._active,n=this.chart.data,i=[],r=[],o=[];let a,s,l=[];for(a=0,s=e.length;a<s;++a)l.push(Oo(this.chart,e[a]));return t.filter&&(l=l.filter((e,i,r)=>t.filter(e,i,r,n))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,n))),tt(l,e=>{const n=Ho(t.callbacks,e);i.push(Wo(n,"labelColor",this,e)),r.push(Wo(n,"labelPointStyle",this,e)),o.push(Wo(n,"labelTextColor",this,e))}),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(i.length){const t=Eo[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=Ro(this,n),a=Object.assign({},t,e),s=No(this.chart,n,a),l=zo(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,r={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=Be(a),{x:h,y:d}=t,{width:p,height:f}=e;let g,m,y,v,_,x;return"center"===r?(_=d+f/2,"left"===i?(g=h,m=g-o,v=_+o,x=_-o):(g=h+p,m=g+o,v=_-o,x=_+o),y=g):(m="left"===i?h+Math.max(s,c)+o:"right"===i?h+p-Math.max(l,u)-o:this.caretX,"top"===r?(v=d,_=v-o,g=m-o,y=m+o):(v=d+f,_=v+o,g=m+o,y=m-o),x=v),{x1:g,x2:m,x3:y,y1:v,y2:_,y3:x}}drawTitle(t,e,n){const i=this.title,r=i.length;let o,a,s;if(r){const l=wn(n.rtl,this.x,this.width);for(t.x=Fo(this,n.titleAlign,n),e.textAlign=l.textAlign(n.titleAlign),e.textBaseline="middle",o=ze(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,s=0;s<r;++s)e.fillText(i[s],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,s+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,i,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=r,c=ze(r.bodyFont),u=Fo(this,"left",r),h=i.x(u),d=s<c.lineHeight?(c.lineHeight-s)/2:0,p=e.y+d;if(r.usePointStyle){const e={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=i.leftForLtr(h,l)+l/2,c=p+s/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,_e(t,e,n,c),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,_e(t,e,n,c)}else{t.lineWidth=X(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=i.leftForLtr(h,l),n=i.leftForLtr(i.xPlus(h,1),l-2),a=Be(o.borderRadius);Object.values(a).some(t=>0!==t)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ke(t,{x:e,y:p,w:l,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ke(t,{x:n,y:p+1,w:l-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,l,s),t.strokeRect(e,p,l,s),t.fillStyle=o.backgroundColor,t.fillRect(n,p+1,l-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=ze(n.bodyFont);let h=u.lineHeight,d=0;const p=wn(n.rtl,this.x,this.width),f=function(n){e.fillText(n,p.x(t.x+d),t.y+h/2),t.y+=h+r},g=p.textAlign(o);let m,y,v,_,x,b,w;for(e.textAlign=o,e.textBaseline="middle",e.font=u.string,t.x=Fo(this,g,n),e.fillStyle=n.bodyColor,tt(this.beforeBody,f),d=a&&"right"!==g?"center"===o?l/2+c:l+2+c:0,_=0,b=i.length;_<b;++_){for(m=i[_],y=this.labelTextColors[_],e.fillStyle=y,tt(m.before,f),v=m.lines,a&&v.length&&(this._drawColorBox(e,t,_,p,n),h=Math.max(u.lineHeight,s)),x=0,w=v.length;x<w;++x)f(v[x]),h=u.lineHeight;tt(m.after,f)}d=0,h=u.lineHeight,tt(this.afterBody,f),t.y-=r}drawFooter(t,e,n){const i=this.footer,r=i.length;let o,a;if(r){const s=wn(n.rtl,this.x,this.width);for(t.x=Fo(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",o=ze(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(i[a],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:s}=t,{width:l,height:c}=n,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:p}=Be(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+u,s),"top"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+l-h,s),e.quadraticCurveTo(a+l,s,a+l,s+h),"center"===o&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+l,s+c-p),e.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+d,s+c),e.quadraticCurveTo(a,s+c,a,s+c-d),"center"===o&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(a,s+u),e.quadraticCurveTo(a,s,a+u,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Eo[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=Ro(this,t),a=Object.assign({},n,this._size),s=No(e,t,a),l=zo(t,a,s,e);i._to===l.x&&r._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=Ne(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),Sn(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Mn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map(({datasetIndex:t,index:e})=>{const n=this.chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}),r=!et(n,i),o=this._positionChanged(i,e);(r||o)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,n),a=this._positionChanged(o,t),s=e||!et(o,r)||a;return s&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}_getActiveElements(t,e,n,i){const r=this.options;if("mouseout"===t.type)return[];if(!i)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const o=this.chart.getElementsAtEventForMode(t,r.mode,r,n);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Eo[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}var Uo={id:"tooltip",_element:Go,positioners:Eo,afterInit(t,e,n){n&&(t.tooltip=new Go({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},qo=Object.freeze({__proto__:null,Colors:eo,Decimation:ro,Filler:wo,Legend:To,SubTitle:Ao,Title:Do,Tooltip:Uo});function Yo(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function Xo(t,e,{horizontal:n,minRotation:i}){const r=Dt(i),o=(n?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}class $o extends er{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return q(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this;const o=t=>i=e?i:t,a=t=>r=n?r:t;if(t){const t=St(i),e=St(r);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(i===r){let e=0===r?1:Math.abs(.05*r);a(r+e),t||o(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=function(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:h}=t,d=r||1,p=c-1,{min:f,max:g}=e,m=!q(o),y=!q(a),v=!q(l),_=(g-f)/(u+1);let x,b,w,S,M=Ct((g-f)/p/d)*d;if(M<1e-14&&!m&&!y)return[{value:f},{value:g}];S=Math.ceil(g/M)-Math.floor(f/M),S>p&&(M=Ct(S*M/p/d)*d),q(s)||(x=Math.pow(10,s),M=Math.ceil(M*x)/x),"ticks"===i?(b=Math.floor(f/M)*M,w=Math.ceil(g/M)*M):(b=f,w=g),m&&y&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/r,M/1e3)?(S=Math.round(Math.min((a-o)/M,c)),M=(a-o)/S,b=o,w=a):v?(b=m?o:b,w=y?a:w,S=l-1,M=(w-b)/S):(S=(w-b)/M,S=Mt(S,Math.round(S),M/1e3)?Math.round(S):Math.ceil(S));const C=Math.max(At(M),At(b));x=Math.pow(10,q(s)?C:s),b=Math.round(b*x)/x,w=Math.round(w*x)/x;let T=0;for(m&&(h&&b!==o?(n.push({value:o}),b<o&&T++,Mt(Math.round((b+T*M)*x)/x,o,Xo(o,_,t))&&T++):b<o&&T++);T<S;++T){const t=Math.round((b+T*M)*x)/x;if(y&&t>a)break;n.push({value:t})}return y&&h&&w!==a?n.length&&Mt(n[n.length-1].value,a,Xo(a,_,t))?n[n.length-1].value=a:n.push({value:a}):y&&w!==a||n.push({value:w}),n}({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&It(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return ae(t,this.chart.options.locale,this.options.ticks.format)}}class Zo extends $o{static id="linear";static defaults={ticks:{callback:le.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Dt(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Ko=t=>Math.floor(wt(t)),Jo=(t,e)=>Math.pow(10,Ko(t)+e);function Qo(t){return 1===t/Math.pow(10,Ko(t))}function ta(t,e,n){const i=Math.pow(10,n),r=Math.floor(t/i);return Math.ceil(e/i)-r}class ea extends er{static id="logarithmic";static defaults={ticks:{callback:le.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=$o.prototype.parse.apply(this,[t,e]);if(0!==n)return $(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===Jo(this.min,0)?Jo(this.min,-1):Jo(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const r=e=>n=t?n:e,o=t=>i=e?i:t;n===i&&(n<=0?(r(1),o(10)):(r(Jo(n,-1)),o(Jo(i,1)))),n<=0&&r(Jo(i,-1)),i<=0&&o(Jo(n,1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,{min:e,max:n}){e=Z(t.min,e);const i=[],r=Ko(e);let o=function(t,e){let n=Ko(e-t);for(;ta(t,e,n)>10;)n++;for(;ta(t,e,n)<10;)n--;return Math.min(n,Ko(t))}(e,n),a=o<0?Math.pow(10,Math.abs(o)):1;const s=Math.pow(10,o),l=r>o?Math.pow(10,r):0,c=Math.round((e-l)*a)/a,u=Math.floor((e-l)/s/10)*s*10;let h=Math.floor((c-u)/Math.pow(10,o)),d=Z(t.min,Math.round((l+u+h*Math.pow(10,o))*a)/a);for(;d<n;)i.push({value:d,major:Qo(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),d=Math.round((l+u+h*Math.pow(10,o))*a)/a;const p=Z(t.max,d);return i.push({value:p,major:Qo(p),significand:h}),i}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&It(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ae(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=wt(t),this._valueRange=wt(this.max)-wt(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(wt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function na(t){const e=t.ticks;if(e.display&&t.display){const t=Ne(e.backdropPadding);return K(e.font&&e.font.size,fe.font.size)+t.height}return 0}function ia(t,e,n){return n=Y(n)?n:[n],{w:me(t,e.string,n),h:n.length*e.lineHeight}}function ra(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}function oa(t,e,n,i,r){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;i.start<e.l?(s=(e.l-i.start)/o,t.l=Math.min(t.l,e.l-s)):i.end>e.r&&(s=(i.end-e.r)/o,t.r=Math.max(t.r,e.r+s)),r.start<e.t?(l=(e.t-r.start)/a,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function aa(t,e,n){const i=t.drawingArea,{extra:r,additionalAngle:o,padding:a,size:s}=n,l=t.getPointPosition(e,i+r+a,o),c=Math.round(kt(Ot(l.angle+_t))),u=function(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}(l.y,s.h,c),h=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(c),d=function(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}(l.x,s.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:d,top:u,right:d+s.w,bottom:u+s.h}}function sa(t,e){if(!e)return!0;const{left:n,top:i,right:r,bottom:o}=t;return!(be({x:n,y:i},e)||be({x:n,y:o},e)||be({x:r,y:i},e)||be({x:r,y:o},e))}function la(t,e,n){const{left:i,top:r,right:o,bottom:a}=n,{backdropColor:s}=e;if(!q(s)){const n=Be(e.borderRadius),l=Ne(e.backdropPadding);t.fillStyle=s;const c=i-l.left,u=r-l.top,h=o-i+l.width,d=a-r+l.height;Object.values(n).some(t=>0!==t)?(t.beginPath(),ke(t,{x:c,y:u,w:h,h:d,radius:n}),t.fill()):t.fillRect(c,u,h,d)}}function ca(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,gt);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let o=1;o<i;o++)n=t.getPointPosition(o,e),r.lineTo(n.x,n.y)}}class ua extends $o{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:le.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ne(na(this.options)/2),e=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(e,n)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=$(t)&&!isNaN(t)?t:0,this.max=$(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/na(this.options))}generateTickLabels(t){$o.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const n=Q(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?function(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),i=[],r=[],o=t._pointLabels.length,a=t.options.pointLabels,s=a.centerPointLabels?ft/o:0;for(let l=0;l<o;l++){const o=a.setContext(t.getPointLabelContext(l));r[l]=o.padding;const c=t.getPointPosition(l,t.drawingArea+r[l],s),u=ze(o.font),h=ia(t.ctx,u,t._pointLabels[l]);i[l]=h;const d=Ot(t.getIndexAngle(l)+s),p=Math.round(kt(d));oa(n,e,d,ra(p,c.x,h.w,0,180),ra(p,c.y,h.h,90,270))}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=function(t,e,n){const i=[],r=t._pointLabels.length,o=t.options,{centerPointLabels:a,display:s}=o.pointLabels,l={extra:na(o)/2,additionalAngle:a?ft/r:0};let c;for(let o=0;o<r;o++){l.padding=n[o],l.size=e[o];const r=aa(t,o,l);i.push(r),"auto"===s&&(r.visible=sa(r,c),r.visible&&(c=r))}return i}(t,i,r)}(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,i))}getIndexAngle(t){return Ot(t*(gt/(this._pointLabels.length||1))+Dt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(q(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(q(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return Ve(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e,n=0){const i=this.getIndexAngle(t)-_t+n;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),ca(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i,border:r}=e,o=this._pointLabels.length;let a,s,l;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const e=t._pointLabelItems[r];if(!e.visible)continue;const o=i.setContext(t.getPointLabelContext(r));la(n,o,e);const a=ze(o.font),{x:s,y:l,textAlign:c}=e;De(n,t._pointLabels[r],s,l+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}(this,o),i.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){s=this.getDistanceFromCenterForValue(t.value);const n=this.getContext(e),a=i.setContext(n),l=r.setContext(n);!function(t,e,n,i,r){const o=t.ctx,a=e.circular,{color:s,lineWidth:l}=e;!a&&!i||!s||!l||n<0||(o.save(),o.strokeStyle=s,o.lineWidth=l,o.setLineDash(r.dash||[]),o.lineDashOffset=r.dashOffset,o.beginPath(),ca(t,n,a,i),o.closePath(),o.stroke(),o.restore())}(this,a,s,o,l)}}),n.display){for(t.save(),a=o-1;a>=0;a--){const i=n.setContext(this.getPointLabelContext(a)),{color:r,lineWidth:o}=i;o&&r&&(t.lineWidth=o,t.strokeStyle=r,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,s=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,s),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((i,a)=>{if(0===a&&this.min>=0&&!e.reverse)return;const s=n.setContext(this.getContext(a)),l=ze(s.font);if(r=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=l.string,o=t.measureText(i.label).width,t.fillStyle=s.backdropColor;const e=Ne(s.backdropPadding);t.fillRect(-o/2-e.left,-r-l.size/2-e.top,o+e.width,l.size+e.height)}De(t,i.label,0,-r,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),t.restore()}drawTitle(){}}const ha={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},da=Object.keys(ha);function pa(t,e){return t-e}function fa(t,e){if(q(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),$(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(r&&(a="week"!==r||!Tt(o)&&!0!==o?n.startOf(a,r):n.startOf(a,"isoWeek",o)),+a)}function ga(t,e,n,i){const r=da.length;for(let o=da.indexOf(t);o<r-1;++o){const t=ha[da[o]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(r*t.size))<=i)return da[o]}return da[r-1]}function ma(t,e,n){if(n){if(n.length){const{lo:i,hi:r}=zt(n,e);t[n[i]>=e?n[i]:n[r]]=!0}}else t[e]=!0}function ya(t,e,n){const i=[],r={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],r[s]=a,i.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,i){const r=t._adapter,o=+r.startOf(e[0].value,i),a=e[e.length-1].value;let s,l;for(s=o;s<=a;s=+r.add(s,1,i))l=n[s],l>=0&&(e[l].major=!0);return e}(t,i,r,n):i}class va extends er{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const n=t.time||(t.time={}),i=this._adapter=new ui(t.adapters.date);i.init(e),at(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(i=Math.min(i,t.min)),a||isNaN(t.max)||(r=Math.max(r,t.max))}o&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),i=$(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=$(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,o=function(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}(i,r,this.max);return this._unit=e.unit||(n.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,n,i,r){for(let o=da.length-1;o>=da.indexOf(n);o--){const n=da[o];if(ha[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return da[n?da.indexOf(n):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=da.indexOf(t)+1,n=da.length;e<n;++e)if(ha[da[e]].common)return da[e]}(this._unit):void 0,this.initOffsets(i),t.reverse&&o.reverse(),ya(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=Bt(i,0,o),r=Bt(r,0,o),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,o=r.unit||ga(r.minUnit,e,n,this._getLabelCapacity(e)),a=K(i.ticks.stepSize,1),s="week"===o&&r.isoWeekday,l=Tt(s)||!0===s,c={};let u,h,d=e;if(l&&(d=+t.startOf(d,"isoWeek",s)),d=+t.startOf(d,l?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const p="data"===i.ticks.source&&this.getDataTimestamps();for(u=d,h=0;u<n;u=+t.add(u,a,o),h++)ma(c,u,p);return u!==n&&"ticks"!==i.bounds&&1!==h||ma(c,u,p),Object.keys(c).sort(pa).map(t=>+t)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,i=this._unit,r=e||n[i];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,i){const r=this.options,o=r.ticks.callback;if(o)return Q(o,[t,e,n],this);const a=r.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],h=n[e],d=l&&u&&h&&h.major;return this._adapter.format(t,i||(d?u:c))}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=Dt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,ya(this,[t],this._majorUnit),i),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t<e;++t)n=n.concat(i[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(fa(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Wt(t.sort(pa))}}function _a(t,e,n){let i,r,o,a,s=0,l=t.length-1;n?(e>=t[s].pos&&e<=t[l].pos&&({lo:s,hi:l}=Ft(t,"pos",e)),({pos:i,time:o}=t[s]),({pos:r,time:a}=t[l])):(e>=t[s].time&&e<=t[l].time&&({lo:s,hi:l}=Ft(t,"time",e)),({time:i,pos:o}=t[s]),({time:r,pos:a}=t[l]));const c=r-i;return c?o+(a-o)*(e-i)/c:o}var xa=Object.freeze({__proto__:null,CategoryScale:class extends er{static id="category";static defaults={ticks:{callback:Yo}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(q(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:Bt(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:function(t,e,n,i){const r=t.indexOf(e);return-1===r?((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i):r!==t.lastIndexOf(e)?n:r}(n,t,K(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){return Yo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:Zo,LogarithmicScale:ea,RadialLinearScale:ua,TimeScale:va,TimeSeriesScale:class extends va{static id="timeseries";static defaults=va.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=_a(e,this.min),this._tableRange=_a(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,a,s,l,c;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=n&&i.push(l);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)c=i[o+1],s=i[o-1],l=i[o],Math.round((c+s)/2)!==l&&r.push({time:l,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let n=super.getDataTimestamps();return n.includes(t)&&n.length||n.splice(0,0,t),n.includes(e)&&1!==n.length||n.push(e),n.sort((t,e)=>t-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(_a(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return _a(this._table,n*this._tableRange+this._minPos,!0)}}});const ba=[si,$r,qo,xa];Er.register(...ba);const wa=Er;var Sa=function(t,e){return Sa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Sa(t,e)};function Ma(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Sa(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create,Object.create;var Ca=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},Ta=new function(){this.browser=new Ca,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Ta.wxa=!0,Ta.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?Ta.worker=!0:!Ta.hasGlobalWindow||"Deno"in window?(Ta.node=!0,Ta.svgSupported=!0):function(t,e){var n=e.browser,i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(n.firefox=!0,n.version=i[1]),r&&(n.ie=!0,n.version=r[1]),o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18),a&&(n.weChat=!0),e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in s||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}(navigator.userAgent,Ta);const Ia=Ta;var Da,ka,Aa="sans-serif",Ea="12px "+Aa,La=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n<95;n++){var i=String.fromCharCode(n+32),r=(t.charCodeAt(n)-20)/100;e[i]=r}return e}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),Pa={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!Da){var n=Pa.createCanvas();Da=n&&n.getContext("2d")}if(Da)return ka!==e&&(ka=Da.font=e||Ea),Da.measureText(t);t=t||"";var i=/((?:\d+)?\.?\d*)px/.exec(e=e||Ea),r=i&&+i[1]||12,o=0;if(e.indexOf("mono")>=0)o=r*t.length;else for(var a=0;a<t.length;a++){var s=La[t[a]];o+=null==s?r:s*r}return{width:o}},loadImage:function(t,e,n){var i=new Image;return i.onload=e,i.onerror=n,i.src=t,i}};function Oa(t){for(var e in Pa)t[e]&&(Pa[e]=t[e])}var Ra=ss(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),Ba=ss(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Na=Object.prototype.toString,za=Array.prototype,Fa=za.forEach,Va=za.filter,Ha=za.slice,ja=za.map,Wa=function(){}.constructor,Ga=Wa?Wa.prototype:null,Ua="__proto__",qa=2311;function Ya(){return qa++}function Xa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function $a(t){if(null==t||"object"!=typeof t)return t;var e=t,n=Na.call(t);if("[object Array]"===n){if(!Rs(t)){e=[];for(var i=0,r=t.length;i<r;i++)e[i]=$a(t[i])}}else if(Ba[n]){if(!Rs(t)){var o=t.constructor;if(o.from)e=o.from(t);else for(e=new o(t.length),i=0,r=t.length;i<r;i++)e[i]=t[i]}}else if(!Ra[n]&&!Rs(t)&&!bs(t))for(var a in e={},t)t.hasOwnProperty(a)&&a!==Ua&&(e[a]=$a(t[a]));return e}function Za(t,e,n){if(!vs(e)||!vs(t))return n?$a(e):t;for(var i in e)if(e.hasOwnProperty(i)&&i!==Ua){var r=t[i],o=e[i];!vs(o)||!vs(r)||ps(o)||ps(r)||bs(o)||bs(r)||_s(o)||_s(r)||Rs(o)||Rs(r)?!n&&i in t||(t[i]=$a(e[i])):Za(r,o,n)}return t}function Ka(t,e){for(var n=t[0],i=1,r=t.length;i<r;i++)n=Za(n,t[i],e);return n}function Ja(t,e){if(Object.assign)Object.assign(t,e);else for(var n in e)e.hasOwnProperty(n)&&n!==Ua&&(t[n]=e[n]);return t}function Qa(t,e,n){for(var i=us(e),r=0,o=i.length;r<o;r++){var a=i[r];(n?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}var ts=Pa.createCanvas;function es(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n}return-1}function ns(t,e){var n=t.prototype;function i(){}for(var r in i.prototype=e.prototype,t.prototype=new i,n)n.hasOwnProperty(r)&&(t.prototype[r]=n[r]);t.prototype.constructor=t,t.superClass=e}function is(t,e,n){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++){var o=i[r];"constructor"!==o&&(n?null!=e[o]:null==t[o])&&(t[o]=e[o])}else Qa(t,e,n)}function rs(t){return!!t&&"string"!=typeof t&&"number"==typeof t.length}function os(t,e,n){if(t&&e)if(t.forEach&&t.forEach===Fa)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function as(t,e,n){if(!t)return[];if(!e)return ks(t);if(t.map&&t.map===ja)return t.map(e,n);for(var i=[],r=0,o=t.length;r<o;r++)i.push(e.call(n,t[r],r,t));return i}function ss(t,e,n,i){if(t&&e){for(var r=0,o=t.length;r<o;r++)n=e.call(i,n,t[r],r,t);return n}}function ls(t,e,n){if(!t)return[];if(!e)return ks(t);if(t.filter&&t.filter===Va)return t.filter(e,n);for(var i=[],r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t)&&i.push(t[r]);return i}function cs(t,e,n){if(t&&e)for(var i=0,r=t.length;i<r;i++)if(e.call(n,t[i],i,t))return t[i]}function us(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}var hs=Ga&&fs(Ga.bind)?Ga.call.bind(Ga.bind):function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return function(){return t.apply(e,n.concat(Ha.call(arguments)))}};function ds(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(this,e.concat(Ha.call(arguments)))}}function ps(t){return Array.isArray?Array.isArray(t):"[object Array]"===Na.call(t)}function fs(t){return"function"==typeof t}function gs(t){return"string"==typeof t}function ms(t){return"[object String]"===Na.call(t)}function ys(t){return"number"==typeof t}function vs(t){var e=typeof t;return"function"===e||!!t&&"object"===e}function _s(t){return!!Ra[Na.call(t)]}function xs(t){return!!Ba[Na.call(t)]}function bs(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function ws(t){return null!=t.colorStops}function Ss(t){return null!=t.image}function Ms(t){return"[object RegExp]"===Na.call(t)}function Cs(t){return t!=t}function Ts(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,i=t.length;n<i;n++)if(null!=t[n])return t[n]}function Is(t,e){return null!=t?t:e}function Ds(t,e,n){return null!=t?t:null!=e?e:n}function ks(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Ha.apply(t,e)}function As(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function Es(t,e){if(!t)throw new Error(e)}function Ls(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Ps="__ec_primitive__";function Os(t){t[Ps]=!0}function Rs(t){return t[Ps]}var Bs=function(){function t(){this.data={}}return t.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},t.prototype.has=function(t){return this.data.hasOwnProperty(t)},t.prototype.get=function(t){return this.data[t]},t.prototype.set=function(t,e){return this.data[t]=e,this},t.prototype.keys=function(){return us(this.data)},t.prototype.forEach=function(t){var e=this.data;for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},t}(),Ns="function"==typeof Map,zs=function(){function t(e){var n=ps(e);this.data=Ns?new Map:new Bs;var i=this;function r(t,e){n?i.set(t,e):i.set(e,t)}e instanceof t?e.each(r):e&&os(e,r)}return t.prototype.hasKey=function(t){return this.data.has(t)},t.prototype.get=function(t){return this.data.get(t)},t.prototype.set=function(t,e){return this.data.set(t,e),e},t.prototype.each=function(t,e){this.data.forEach(function(n,i){t.call(e,n,i)})},t.prototype.keys=function(){var t=this.data.keys();return Ns?Array.from(t):t},t.prototype.removeKey=function(t){this.data.delete(t)},t}();function Fs(t){return new zs(t)}function Vs(t,e){for(var n=new t.constructor(t.length+e.length),i=0;i<t.length;i++)n[i]=t[i];var r=t.length;for(i=0;i<e.length;i++)n[i+r]=e[i];return n}function Hs(t,e){var n;if(Object.create)n=Object.create(t);else{var i=function(){};i.prototype=t,n=new i}return e&&Ja(n,e),n}function js(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Ws(t,e){return t.hasOwnProperty(e)}function Gs(){}var Us=180/Math.PI;function qs(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function Ys(t,e){return t[0]=e[0],t[1]=e[1],t}function Xs(t){return[t[0],t[1]]}function $s(t,e,n){return t[0]=e,t[1]=n,t}function Zs(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function Ks(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t}function Js(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function Qs(t){return Math.sqrt(el(t))}var tl=Qs;function el(t){return t[0]*t[0]+t[1]*t[1]}var nl=el;function il(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function rl(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ol(t,e){return t[0]*e[0]+t[1]*e[1]}function al(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function sl(t,e){var n=Qs(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t}function ll(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var cl=ll;function ul(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var hl=ul;function dl(t,e){return t[0]=-e[0],t[1]=-e[1],t}function pl(t,e,n,i){return t[0]=e[0]+i*(n[0]-e[0]),t[1]=e[1]+i*(n[1]-e[1]),t}function fl(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function gl(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ml(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}var yl=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},vl=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new yl(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var n=t.offsetX,i=t.offsetY,r=n-this._x,o=i-this._y;this._x=n,this._y=i,e.drift(r,o,t),this.handler.dispatchToElement(new yl(e,t),"drag",t.event);var a=this.handler.findHover(n,i,e).target,s=this._dropTarget;this._dropTarget=a,e!==a&&(s&&a!==s&&this.handler.dispatchToElement(new yl(s,t),"dragleave",t.event),a&&a!==s&&this.handler.dispatchToElement(new yl(a,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new yl(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new yl(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}();const _l=vl;var xl=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,n,i){this._$handlers||(this._$handlers={});var r=this._$handlers;if("function"==typeof e&&(i=n,n=e,e=null),!n||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),r[t]||(r[t]=[]);for(var a=0;a<r[t].length;a++)if(r[t][a].h===n)return this;var s={h:n,query:e,ctx:i||this,callAtLast:n.zrEventfulCallAtLast},l=r[t].length-1,c=r[t][l];return c&&c.callAtLast?r[t].splice(l,0,s):r[t].push(s),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var n=this._$handlers;if(!n)return this;if(!t)return this._$handlers={},this;if(e){if(n[t]){for(var i=[],r=0,o=n[t].length;r<o;r++)n[t][r].h!==e&&i.push(n[t][r]);n[t]=i}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[t],r=this._$eventProcessor;if(i)for(var o=e.length,a=i.length,s=0;s<a;s++){var l=i[s];if(!r||!r.filter||null==l.query||r.filter(t,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,e[0]);break;case 2:l.h.call(l.ctx,e[0],e[1]);break;default:l.h.apply(l.ctx,e)}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var i=this._$handlers[t],r=this._$eventProcessor;if(i)for(var o=e.length,a=e[o-1],s=i.length,l=0;l<s;l++){var c=i[l];if(!r||!r.filter||null==c.query||r.filter(t,c.query))switch(o){case 0:c.h.call(a);break;case 1:c.h.call(a,e[0]);break;case 2:c.h.call(a,e[0],e[1]);break;default:c.h.apply(a,e.slice(1,o-1))}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t}();const bl=xl;var wl=Math.log(2);function Sl(t,e,n,i,r,o){var a=i+"-"+r,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var l=Math.round(Math.log((1<<s)-1&~r)/wl);return t[n][l]}for(var c=i|1<<n,u=n+1;i&1<<u;)u++;for(var h=0,d=0,p=0;d<s;d++){var f=1<<d;f&r||(h+=(p%2?-1:1)*t[n][d]*Sl(t,e-1,u,c,r|f,o),p++)}return o[a]=h,h}function Ml(t,e){var n=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},r=Sl(n,8,0,0,0,i);if(0!==r){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*Sl(n,7,0===a?1:0,1<<a,1<<s,i)/r*e[a];return function(t,e,n){var i=e*o[6]+n*o[7]+1;t[0]=(e*o[0]+n*o[1]+o[2])/i,t[1]=(e*o[3]+n*o[4]+o[5])/i}}}var Cl="___zrEVENTSAVED",Tl=[];function Il(t,e,n,i,r){if(e.getBoundingClientRect&&Ia.domSupported&&!Dl(e)){var o=e[Cl]||(e[Cl]={}),a=function(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var i=["left","right"],r=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",r[l]+":0",i[1-s]+":auto",r[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return n}(e,o),s=function(t,e,n){for(var i=n?"invTrans":"trans",r=e[i],o=e.srcCoords,a=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),h=2*c,d=u.left,p=u.top;a.push(d,p),l=l&&o&&d===o[h]&&p===o[h+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&r?r:(e.srcCoords=a,e[i]=n?Ml(s,a):Ml(a,s))}(a,o,r);if(s)return s(t,n,i),!0}return!1}function Dl(t){return"CANVAS"===t.nodeName.toUpperCase()}var kl=/([&<>"'])/g,Al={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function El(t){return null==t?"":(t+"").replace(kl,function(t,e){return Al[e]})}var Ll=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Pl=[],Ol=Ia.browser.firefox&&+Ia.browser.version.split(".")[0]<39;function Rl(t,e,n,i){return n=n||{},i?Bl(t,e,n):Ol&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):Bl(t,e,n),n}function Bl(t,e,n){if(Ia.domSupported&&t.getBoundingClientRect){var i=e.clientX,r=e.clientY;if(Dl(t)){var o=t.getBoundingClientRect();return n.zrX=i-o.left,void(n.zrY=r-o.top)}if(Il(Pl,t,i,r))return n.zrX=Pl[0],void(n.zrY=Pl[1])}n.zrX=n.zrY=0}function Nl(t){return t||window.event}function zl(t,e,n){if(null!=(e=Nl(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var r="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];r&&Rl(t,r,e,n)}else{Rl(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,i=t.deltaY;return null==n||null==i?e:3*(0!==i?Math.abs(i):Math.abs(n))*(i>0?-1:i<0?1:n>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Ll.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Fl(t,e,n,i){t.addEventListener(e,n,i)}function Vl(t,e,n,i){t.removeEventListener(e,n,i)}var Hl=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function jl(t){return 2===t.which||3===t.which}var Wl=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var i=t.touches;if(i){for(var r={points:[],touches:[],target:e,event:t},o=0,a=i.length;o<a;o++){var s=i[o],l=Rl(n,s,{});r.points.push([l.zrX,l.zrY]),r.touches.push(s)}this._track.push(r)}},t.prototype._recognize=function(t){for(var e in Ul)if(Ul.hasOwnProperty(e)){var n=Ul[e](this._track,t);if(n)return n}},t}();function Gl(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}var Ul={pinch:function(t,e){var n=t.length;if(n){var i,r=(t[n-1]||{}).points,o=(t[n-2]||{}).points||r;if(o&&o.length>1&&r&&r.length>1){var a=Gl(r)/Gl(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((i=r)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function ql(){return[1,0,0,1,0,0]}function Yl(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Xl(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function $l(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function Zl(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function Kl(t,e,n,i){void 0===i&&(i=[0,0]);var r=e[0],o=e[2],a=e[4],s=e[1],l=e[3],c=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=r*h+s*u,t[1]=-r*u+s*h,t[2]=o*h+l*u,t[3]=-o*u+h*l,t[4]=h*(a-i[0])+u*(c-i[1])+i[0],t[5]=h*(c-i[1])-u*(a-i[0])+i[1],t}function Jl(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t}function Ql(t,e){var n=e[0],i=e[2],r=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*i;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-a*r)*l,t[5]=(o*r-n*s)*l,t):null}function tc(t){var e=[1,0,0,1,0,0];return Xl(e,t),e}var ec=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,i){t.x=e.x+n.x*i,t.y=e.y+n.y*i},t.lerp=function(t,e,n,i){var r=1-i;t.x=r*e.x+i*n.x,t.y=r*e.y+i*n.y},t}();const nc=ec;var ic=Math.min,rc=Math.max,oc=new nc,ac=new nc,sc=new nc,lc=new nc,cc=new nc,uc=new nc,hc=function(){function t(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}return t.prototype.union=function(t){var e=ic(t.x,this.x),n=ic(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=rc(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=rc(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=[1,0,0,1,0,0];return Zl(r,r,[-e.x,-e.y]),Jl(r,r,[n,i]),Zl(r,r,[t.x,t.y]),r},t.prototype.intersect=function(e,n){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,r=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,l=e.x,c=e.x+e.width,u=e.y,h=e.y+e.height,d=!(o<l||c<r||s<u||h<a);if(n){var p=1/0,f=0,g=Math.abs(o-l),m=Math.abs(c-r),y=Math.abs(s-u),v=Math.abs(h-a),_=Math.min(g,m),x=Math.min(y,v);o<l||c<r?_>f&&(f=_,g<m?nc.set(uc,-g,0):nc.set(uc,m,0)):_<p&&(p=_,g<m?nc.set(cc,g,0):nc.set(cc,-m,0)),s<u||h<a?x>f&&(f=x,y<v?nc.set(uc,0,-y):nc.set(uc,0,v)):_<p&&(p=_,y<v?nc.set(cc,0,y):nc.set(cc,0,-v))}return n&&nc.copy(n,d?cc:uc),d},t.prototype.contain=function(t,e){var n=this;return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,n,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var r=i[0],o=i[3],a=i[4],s=i[5];return e.x=n.x*r+a,e.y=n.y*o+s,e.width=n.width*r,e.height=n.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}oc.x=sc.x=n.x,oc.y=lc.y=n.y,ac.x=lc.x=n.x+n.width,ac.y=sc.y=n.y+n.height,oc.transform(i),lc.transform(i),ac.transform(i),sc.transform(i),e.x=ic(oc.x,ac.x,sc.x,lc.x),e.y=ic(oc.y,ac.y,sc.y,lc.y);var l=rc(oc.x,ac.x,sc.x,lc.x),c=rc(oc.y,ac.y,sc.y,lc.y);e.width=l-e.x,e.height=c-e.y}else e!==n&&t.copy(e,n)},t}();const dc=hc;var pc="silent";function fc(){Hl(this.event)}var gc=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return Ma(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(bl),mc=function(t,e){this.x=t,this.y=e},yc=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],vc=new dc(0,0,0,0),_c=function(t){function e(e,n,i,r,o){var a=t.call(this)||this;return a._hovered=new mc(0,0),a.storage=e,a.painter=n,a.painterRoot=r,a._pointerSize=o,i=i||new gc,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new _l(a),a}return Ma(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(os(yc,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,i=wc(this,e,n),r=this._hovered,o=r.target;o&&!o.__zr&&(o=(r=this.findHover(r.x,r.y)).target);var a=this._hovered=i?new mc(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(r,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new mc(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var i=(t=t||{}).target;if(!i||!i.silent){for(var r="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:fc}}(e,t,n);i&&(i[r]&&(o.cancelBubble=!!i[r].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[r]&&t[r].call(t,o),t.trigger&&t.trigger(e,o)}))}},e.prototype.findHover=function(t,e,n){var i=this.storage.getDisplayList(),r=new mc(t,e);if(bc(i,r,t,e,n),this._pointerSize&&!r.target){for(var o=[],a=this._pointerSize,s=a/2,l=new dc(t-s,e-s,a,a),c=i.length-1;c>=0;c--){var u=i[c];u===n||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(vc.copy(u.getBoundingRect()),u.transform&&vc.applyTransform(u.transform),vc.intersect(l)&&o.push(u))}if(o.length)for(var h=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=h)if(bc(o,r,t+p*Math.cos(f),e+p*Math.sin(f),n),r.target)return r}return r},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new Wl);var n=this._gestureMgr;"start"===e&&n.clear();var i=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),i){var r=i.type;t.gestureEvent=r;var o=new mc;o.target=i.target,this.dispatchToElement(o,r,i.event)}},e}(bl);function xc(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var i=t,r=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(e,n))return!1}i.silent&&(r=!0),i=i.__hostTarget||i.parent}return!r||pc}return!1}function bc(t,e,n,i,r){for(var o=t.length-1;o>=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=xc(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==pc)){e.target=a;break}}}function wc(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}os(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){_c.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=wc(this,r,o);if("mouseup"===t&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||cl(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});const Sc=_c;function Mc(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r<n&&i(t[r],t[r-1])<0;)r++;!function(t,e,n){for(n--;e<n;){var i=t[e];t[e++]=t[n],t[n--]=i}}(t,e,r)}else for(;r<n&&i(t[r],t[r-1])>=0;)r++;return r-e}function Cc(t,e,n,i,r){for(i===e&&i++;i<n;i++){for(var o,a=t[i],s=e,l=i;s<l;)r(a,t[o=s+l>>>1])<0?l=o:s=o+1;var c=i-s;switch(c){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;c>0;)t[s+c]=t[s+c-1],c--}t[s]=a}}function Tc(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])>0){for(s=i-r;l<s&&o(t,e[n+r+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;l<s&&o(t,e[n+r-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var c=a;a=r-l,l=r-c}for(a++;a<l;){var u=a+(l-a>>>1);o(t,e[n+u])>0?a=u+1:l=u}return l}function Ic(t,e,n,i,r,o){var a=0,s=0,l=1;if(o(t,e[n+r])<0){for(s=r+1;l<s&&o(t,e[n+r-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var c=a;a=r-l,l=r-c}else{for(s=i-r;l<s&&o(t,e[n+r+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a<l;){var u=a+(l-a>>>1);o(t,e[n+u])<0?l=u:a=u+1}return l}function Dc(t,e,n,i){n||(n=0),i||(i=t.length);var r=i-n;if(!(r<2)){var o=0;if(r<32)Cc(t,n,i,n+(o=Mc(t,n,i,e)),e);else{var a=function(t,e){var n,i,r=7,o=0,a=[];function s(s){var l=n[s],c=i[s],u=n[s+1],h=i[s+1];i[s]=c+h,s===o-3&&(n[s+1]=n[s+2],i[s+1]=i[s+2]),o--;var d=Ic(t[u],t,l,c,0,e);l+=d,0!==(c-=d)&&0!==(h=Tc(t[l+c-1],t,u,h,h-1,e))&&(c<=h?function(n,i,o,s){var l=0;for(l=0;l<i;l++)a[l]=t[n+l];var c=0,u=o,h=n;if(t[h++]=t[u++],0!==--s)if(1!==i){for(var d,p,f,g=r;;){d=0,p=0,f=!1;do{if(e(t[u],a[c])<0){if(t[h++]=t[u++],p++,d=0,0===--s){f=!0;break}}else if(t[h++]=a[c++],d++,p=0,1===--i){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=Ic(t[u],a,c,i,0,e))){for(l=0;l<d;l++)t[h+l]=a[c+l];if(h+=d,c+=d,(i-=d)<=1){f=!0;break}}if(t[h++]=t[u++],0===--s){f=!0;break}if(0!==(p=Tc(a[c],t,u,s,0,e))){for(l=0;l<p;l++)t[h+l]=t[u+l];if(h+=p,u+=p,0===(s-=p)){f=!0;break}}if(t[h++]=a[c++],1===--i){f=!0;break}g--}while(d>=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((r=g)<1&&(r=1),1===i){for(l=0;l<s;l++)t[h+l]=t[u+l];t[h+s]=a[c]}else{if(0===i)throw new Error;for(l=0;l<i;l++)t[h+l]=a[c+l]}}else{for(l=0;l<s;l++)t[h+l]=t[u+l];t[h+s]=a[c]}else for(l=0;l<i;l++)t[h+l]=a[c+l]}(l,c,u,h):function(n,i,o,s){var l=0;for(l=0;l<s;l++)a[l]=t[o+l];var c=n+i-1,u=s-1,h=o+s-1,d=0,p=0;if(t[h--]=t[c--],0!==--i)if(1!==s){for(var f=r;;){var g=0,m=0,y=!1;do{if(e(a[u],t[c])<0){if(t[h--]=t[c--],g++,m=0,0===--i){y=!0;break}}else if(t[h--]=a[u--],m++,g=0,1===--s){y=!0;break}}while((g|m)<f);if(y)break;do{if(0!==(g=i-Ic(a[u],t,n,i,i-1,e))){for(i-=g,p=1+(h-=g),d=1+(c-=g),l=g-1;l>=0;l--)t[p+l]=t[d+l];if(0===i){y=!0;break}}if(t[h--]=a[u--],1===--s){y=!0;break}if(0!==(m=s-Tc(t[c],a,0,s,s-1,e))){for(s-=m,p=1+(h-=m),d=1+(u-=m),l=0;l<m;l++)t[p+l]=a[d+l];if(s<=1){y=!0;break}}if(t[h--]=t[c--],0===--i){y=!0;break}f--}while(g>=7||m>=7);if(y)break;f<0&&(f=0),f+=2}if((r=f)<1&&(r=1),1===s){for(p=1+(h-=i),d=1+(c-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[h]=a[u]}else{if(0===s)throw new Error;for(d=h-(s-1),l=0;l<s;l++)t[d+l]=a[l]}}else{for(p=1+(h-=i),d=1+(c-=i),l=i-1;l>=0;l--)t[p+l]=t[d+l];t[h]=a[u]}else for(d=h-(s-1),l=0;l<s;l++)t[d+l]=a[l]}(l,c,u,h))}return n=[],i=[],{mergeRuns:function(){for(;o>1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]<i[t+1]&&t--;else if(i[t]>i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]<i[t+1]&&t--,s(t)}},pushRun:function(t,e){n[o]=t,i[o]=e,o+=1}}}(t,e),s=function(t){for(var e=0;t>=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=Mc(t,n,i,e))<s){var l=r;l>s&&(l=s),Cc(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}var kc=1,Ac=4,Ec=!1;function Lc(){Ec||(Ec=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Pc(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Oc=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Pc}return t.prototype.traverse=function(t,e){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(t,e)},t.prototype.getDisplayList=function(t,e){e=e||!1;var n=this._displayList;return!t&&n.length||this.updateDisplayList(e),n},t.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,n=this._displayList,i=0,r=e.length;i<r;i++)this._updateAndAddDisplayable(e[i],null,t);n.length=this._displayListLen,Dc(n,Pc)},t.prototype._updateAndAddDisplayable=function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.update(),t.afterUpdate();var i=t.getClipPath();if(t.ignoreClip)e=null;else if(i){e=e?e.slice():[];for(var r=i,o=t;r;)r.parent=o,r.updateTransform(),e.push(r),o=r,r=r.getClipPath()}if(t.childrenRef){for(var a=t.childrenRef(),s=0;s<a.length;s++){var l=a[s];t.__dirty&&(l.__dirty|=kc),this._updateAndAddDisplayable(l,e,n)}t.__dirty=0}else{var c=t;e&&e.length?c.__clipPaths=e:c.__clipPaths&&c.__clipPaths.length>0&&(c.__clipPaths=[]),isNaN(c.z)&&(Lc(),c.z=0),isNaN(c.z2)&&(Lc(),c.z2=0),isNaN(c.zlevel)&&(Lc(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,n);var h=t.getTextGuideLine();h&&this._updateAndAddDisplayable(h,e,n);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,e,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e<n;e++)this.delRoot(t[e]);else{var i=es(this._roots,t);i>=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const Rc=Oc,Bc=Ia.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var Nc={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Nc.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*Nc.bounceIn(2*t):.5*Nc.bounceOut(2*t-1)+.5}};const zc=Nc;var Fc=Math.pow,Vc=Math.sqrt,Hc=1e-4,jc=Vc(3),Wc=1/3,Gc=qs(),Uc=qs(),qc=qs();function Yc(t){return t>-1e-8&&t<1e-8}function Xc(t){return t>1e-8||t<-1e-8}function $c(t,e,n,i,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*i+3*o*n)}function Zc(t,e,n,i,r){var o=1-r;return 3*(((e-t)*o+2*(n-e)*r)*o+(i-n)*r*r)}function Kc(t,e,n,i,r,o){var a=i+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),c=t-r,u=s*s-3*a*l,h=s*l-9*a*c,d=l*l-3*s*c,p=0;if(Yc(u)&&Yc(h))Yc(s)?o[0]=0:(M=-l/s)>=0&&M<=1&&(o[p++]=M);else{var f=h*h-4*u*d;if(Yc(f)){var g=h/u,m=-g/2;(M=-s/a+g)>=0&&M<=1&&(o[p++]=M),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var y=Vc(f),v=u*s+1.5*a*(-h+y),_=u*s+1.5*a*(-h-y);(M=(-s-((v=v<0?-Fc(-v,Wc):Fc(v,Wc))+(_=_<0?-Fc(-_,Wc):Fc(_,Wc))))/(3*a))>=0&&M<=1&&(o[p++]=M)}else{var x=(2*u*s-3*a*h)/(2*Vc(u*u*u)),b=Math.acos(x)/3,w=Vc(u),S=Math.cos(b),M=(-s-2*w*S)/(3*a),C=(m=(-s+w*(S+jc*Math.sin(b)))/(3*a),(-s+w*(S-jc*Math.sin(b)))/(3*a));M>=0&&M<=1&&(o[p++]=M),m>=0&&m<=1&&(o[p++]=m),C>=0&&C<=1&&(o[p++]=C)}}return p}function Jc(t,e,n,i,r){var o=6*n-12*e+6*t,a=9*e+3*i-3*t-9*n,s=3*e-3*t,l=0;if(Yc(a))Xc(o)&&(u=-s/o)>=0&&u<=1&&(r[l++]=u);else{var c=o*o-4*a*s;if(Yc(c))r[0]=-o/(2*a);else if(c>0){var u,h=Vc(c),d=(-o-h)/(2*a);(u=(-o+h)/(2*a))>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}function Qc(t,e,n,i,r,o){var a=(e-t)*r+t,s=(n-e)*r+e,l=(i-n)*r+n,c=(s-a)*r+a,u=(l-s)*r+s,h=(u-c)*r+c;o[0]=t,o[1]=a,o[2]=c,o[3]=h,o[4]=h,o[5]=u,o[6]=l,o[7]=i}function tu(t,e,n,i,r,o,a,s,l,c,u){var h,d,p,f,g,m=.005,y=1/0;Gc[0]=l,Gc[1]=c;for(var v=0;v<1;v+=.05)Uc[0]=$c(t,n,r,a,v),Uc[1]=$c(e,i,o,s,v),(f=hl(Gc,Uc))<y&&(h=v,y=f);y=1/0;for(var _=0;_<32&&!(m<Hc);_++)d=h-m,p=h+m,Uc[0]=$c(t,n,r,a,d),Uc[1]=$c(e,i,o,s,d),f=hl(Uc,Gc),d>=0&&f<y?(h=d,y=f):(qc[0]=$c(t,n,r,a,p),qc[1]=$c(e,i,o,s,p),g=hl(qc,Gc),p<=1&&g<y?(h=p,y=g):m*=.5);return u&&(u[0]=$c(t,n,r,a,h),u[1]=$c(e,i,o,s,h)),Vc(y)}function eu(t,e,n,i,r,o,a,s,l){for(var c=t,u=e,h=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=$c(t,n,r,a,f),m=$c(e,i,o,s,f),y=g-c,v=m-u;h+=Math.sqrt(y*y+v*v),c=g,u=m}return h}function nu(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function iu(t,e,n,i){return 2*((1-i)*(e-t)+i*(n-e))}function ru(t,e,n){var i=t+n-2*e;return 0===i?.5:(t-e)/i}function ou(t,e,n,i,r){var o=(e-t)*i+t,a=(n-e)*i+e,s=(a-o)*i+o;r[0]=t,r[1]=o,r[2]=s,r[3]=s,r[4]=a,r[5]=n}function au(t,e,n,i,r,o,a,s,l){var c,u=.005,h=1/0;Gc[0]=a,Gc[1]=s;for(var d=0;d<1;d+=.05)Uc[0]=nu(t,n,r,d),Uc[1]=nu(e,i,o,d),(m=hl(Gc,Uc))<h&&(c=d,h=m);h=1/0;for(var p=0;p<32&&!(u<Hc);p++){var f=c-u,g=c+u;Uc[0]=nu(t,n,r,f),Uc[1]=nu(e,i,o,f);var m=hl(Uc,Gc);if(f>=0&&m<h)c=f,h=m;else{qc[0]=nu(t,n,r,g),qc[1]=nu(e,i,o,g);var y=hl(qc,Gc);g<=1&&y<h?(c=g,h=y):u*=.5}}return l&&(l[0]=nu(t,n,r,c),l[1]=nu(e,i,o,c)),Vc(h)}function su(t,e,n,i,r,o,a){for(var s=t,l=e,c=0,u=1/a,h=1;h<=a;h++){var d=h*u,p=nu(t,n,r,d),f=nu(e,i,o,d),g=p-s,m=f-l;c+=Math.sqrt(g*g+m*m),s=p,l=f}return c}var lu=/cubic-bezier\(([0-9,\.e ]+)\)/;function cu(t){var e=t&&lu.exec(t);if(e){var n=e[1].split(","),i=+Ls(n[0]),r=+Ls(n[1]),o=+Ls(n[2]),a=+Ls(n[3]);if(isNaN(i+r+o+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Kc(0,i,o,1,t,s)&&$c(0,r,a,1,s[0])}}}const uu=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||Gs,this.ondestroy=t.ondestroy||Gs,this.onrestart=t.onrestart||Gs,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,i=t-this._startTime-this._pausedTime,r=i/n;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),1===r){if(!this.loop)return!0;var s=i%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=fs(t)?t:zc[t]||cu(t)},t}();var hu=function(t){this.value=t},du=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new hu(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),pu=function(){function t(t){this._list=new du,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,i=this._map,r=null;if(null==i[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete i[s.key],r=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new hu(e),a.key=t,n.insertEntry(a),i[t]=a}return r},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const fu=pu;var gu={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function mu(t){return(t=Math.round(t))<0?0:t>255?255:t}function yu(t){return t<0?0:t>1?1:t}function vu(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?mu(parseFloat(e)/100*255):mu(parseInt(e,10))}function _u(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?yu(parseFloat(e)/100):yu(parseFloat(e))}function xu(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function bu(t,e,n){return t+(e-t)*n}function wu(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Su(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Mu=new fu(20),Cu=null;function Tu(t,e){Cu&&Su(Cu,e),Cu=Mu.put(t,Cu||e.slice())}function Iu(t,e){if(t){e=e||[];var n=Mu.get(t);if(n)return Su(e,n);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in gu)return Su(e,gu[i]),Tu(t,e),e;var r,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(r=parseInt(i.slice(1,4),16))>=0&&r<=4095?(wu(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,5===o?parseInt(i.slice(4),16)/15:1),Tu(t,e),e):void wu(e,0,0,0,1):7===o||9===o?(r=parseInt(i.slice(1,7),16))>=0&&r<=16777215?(wu(e,(16711680&r)>>16,(65280&r)>>8,255&r,9===o?parseInt(i.slice(7),16)/255:1),Tu(t,e),e):void wu(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var l=i.substr(0,a),c=i.substr(a+1,s-(a+1)).split(","),u=1;switch(l){case"rgba":if(4!==c.length)return 3===c.length?wu(e,+c[0],+c[1],+c[2],1):wu(e,0,0,0,1);u=_u(c.pop());case"rgb":return c.length>=3?(wu(e,vu(c[0]),vu(c[1]),vu(c[2]),3===c.length?u:_u(c[3])),Tu(t,e),e):void wu(e,0,0,0,1);case"hsla":return 4!==c.length?void wu(e,0,0,0,1):(c[3]=_u(c[3]),Du(c,e),Tu(t,e),e);case"hsl":return 3!==c.length?void wu(e,0,0,0,1):(Du(c,e),Tu(t,e),e);default:return}}wu(e,0,0,0,1)}}function Du(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=_u(t[1]),r=_u(t[2]),o=r<=.5?r*(i+1):r+i-r*i,a=2*r-o;return wu(e=e||[],mu(255*xu(a,o,n+1/3)),mu(255*xu(a,o,n)),mu(255*xu(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ku(t,e){var n=Iu(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0,n[i]>255?n[i]=255:n[i]<0&&(n[i]=0);return Nu(n,4===n.length?"rgba":"rgb")}}function Au(t){var e=Iu(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Eu(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=e[r],s=e[o],l=i-r;return n[0]=mu(bu(a[0],s[0],l)),n[1]=mu(bu(a[1],s[1],l)),n[2]=mu(bu(a[2],s[2],l)),n[3]=yu(bu(a[3],s[3],l)),n}}var Lu=Eu;function Pu(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),o=Math.ceil(i),a=Iu(e[r]),s=Iu(e[o]),l=i-r,c=Nu([mu(bu(a[0],s[0],l)),mu(bu(a[1],s[1],l)),mu(bu(a[2],s[2],l)),yu(bu(a[3],s[3],l))],"rgba");return n?{color:c,leftIndex:r,rightIndex:o,value:i}:c}}var Ou=Pu;function Ru(t,e,n,i){var r=Iu(t);if(t)return r=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(i,r,o),s=Math.max(i,r,o),l=s-a,c=(s+a)/2;if(0===l)e=0,n=0;else{n=c<.5?l/(s+a):l/(2-s-a);var u=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-o)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+u-d:o===s&&(e=2/3+h-u),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,c];return null!=t[3]&&p.push(t[3]),p}}(r),null!=e&&(r[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=n&&(r[1]=_u(n)),null!=i&&(r[2]=_u(i)),Nu(Du(r),"rgba")}function Bu(t,e){var n=Iu(t);if(n&&null!=e)return n[3]=yu(e),Nu(n,"rgba")}function Nu(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function zu(t,e){var n=Iu(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}function Fu(){return Nu([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}var Vu=new fu(100);function Hu(t){if(gs(t)){var e=Vu.get(t);return e||(e=ku(t,-.1),Vu.put(t,e)),e}if(ws(t)){var n=Ja({},t);return n.colorStops=as(t.colorStops,function(t){return{offset:t.offset,color:ku(t.color,-.1)}}),n}return t}var ju=Math.round;function Wu(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=Iu(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}function Gu(t){return t<1e-4&&t>-1e-4}function Uu(t){return ju(1e3*t)/1e3}function qu(t){return ju(1e4*t)/1e4}var Yu={left:"start",right:"end",center:"middle",middle:"middle"};function Xu(t){return t&&!!t.image}function $u(t){return Xu(t)||function(t){return t&&!!t.svgElement}(t)}function Zu(t){return"linear"===t.type}function Ku(t){return"radial"===t.type}function Ju(t){return t&&("linear"===t.type||"radial"===t.type)}function Qu(t){return"url(#"+t+")"}function th(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function eh(t){var e=t.x||0,n=t.y||0,i=(t.rotation||0)*Us,r=Is(t.scaleX,1),o=Is(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),i&&l.push("rotate("+i+")"),1===r&&1===o||l.push("scale("+r+","+o+")"),(a||s)&&l.push("skew("+ju(a*Us)+"deg, "+ju(s*Us)+"deg)"),l.join(" ")}var nh=Ia.hasGlobalWindow&&fs(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},ih=Array.prototype.slice;function rh(t,e,n){return(e-t)*n+t}function oh(t,e,n,i){for(var r=e.length,o=0;o<r;o++)t[o]=rh(e[o],n[o],i);return t}function ah(t,e,n,i){for(var r=e.length,o=0;o<r;o++)t[o]=e[o]+n[o]*i;return t}function sh(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a<r;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=e[a][s]+n[a][s]*i}return t}function lh(t,e){for(var n=t.length,i=e.length,r=n>i?e:t,o=Math.min(n,i),a=r[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,i);s++)r.push({offset:a.offset,color:a.color.slice()})}function ch(t,e,n){var i=t,r=e;if(i.push&&r.push){var o=i.length,a=r.length;if(o!==a)if(o>a)i.length=a;else for(var s=o;s<a;s++)i.push(1===n?r[s]:ih.call(r[s]));var l=i[0]&&i[0].length;for(s=0;s<i.length;s++)if(1===n)isNaN(i[s])&&(i[s]=r[s]);else for(var c=0;c<l;c++)isNaN(i[s][c])&&(i[s][c]=r[s][c])}}function uh(t){if(rs(t)){var e=t.length;if(rs(t[0])){for(var n=[],i=0;i<e;i++)n.push(ih.call(t[i]));return n}return ih.call(t)}return t}function hh(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=null==t[3]?1:t[3],"rgba("+t.join(",")+")"}function dh(t){return 4===t||5===t}function ph(t){return 1===t||2===t}var fh=[0,0,0,0],gh=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var i=this.keyframes,r=i.length,o=!1,a=6,s=e;if(rs(e)){var l=function(t){return rs(t&&t[0])?2:1}(e);a=l,(1===l&&!ys(e[0])||2===l&&!ys(e[0][0]))&&(o=!0)}else if(ys(e)&&!Cs(e))a=0;else if(gs(e))if(isNaN(+e)){var c=Iu(e);c&&(s=c,a=3)}else a=0;else if(ws(e)){var u=Ja({},s);u.colorStops=as(e.colorStops,function(t){return{offset:t.offset,color:Iu(t.color)}}),Zu(e)?a=4:Ku(e)&&(a=5),s=u}0===r?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var h={time:t,value:s,rawValue:e,percent:0};return n&&(h.easing=n,h.easingFunc=fs(n)?n:zc[n]||cu(n)),i.push(h),h},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var i=this.valType,r=n.length,o=n[r-1],a=this.discrete,s=ph(i),l=dh(i),c=0;c<r;c++){var u=n[c],h=u.value,d=o.value;u.percent=u.time/t,a||(s&&c!==r-1?ch(h,d,i):l&&lh(h.colorStops,d.colorStops))}if(!a&&5!==i&&e&&this.needsAnimate()&&e.needsAnimate()&&i===e.valType&&!e._finished){this._additiveTrack=e;var p=n[0].value;for(c=0;c<r;c++)0===i?n[c].additiveValue=n[c].value-p:3===i?n[c].additiveValue=ah([],n[c].value,p,-1):ph(i)&&(n[c].additiveValue=1===i?ah([],n[c].value,p,-1):sh([],n[c].value,p,-1))}},t.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,i,r,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,c=l.length,u=this.propName,h=3===s,d=this._lastFr,p=Math.min;if(1===c)i=r=l[0];else{if(e<0)n=0;else if(e<this._lastFrP){for(n=p(d+1,c-1);n>=0&&!(l[n].percent<=e);n--);n=p(n,c-2)}else{for(n=d;n<c&&!(l[n].percent>e);n++);n=p(n-1,c-2)}r=l[n+1],i=l[n]}if(i&&r){this._lastFr=n,this._lastFrP=e;var f=r.percent-i.percent,g=0===f?1:p((e-i.percent)/f,1);r.easingFunc&&(g=r.easingFunc(g));var m=o?this._additiveValue:h?fh:t[u];if(!ph(s)&&!h||m||(m=this._additiveValue=[]),this.discrete)t[u]=g<1?i.rawValue:r.rawValue;else if(ph(s))1===s?oh(m,i[a],r[a],g):function(t,e,n,i){for(var r=e.length,o=r&&e[0].length,a=0;a<r;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=rh(e[a][s],n[a][s],i)}}(m,i[a],r[a],g);else if(dh(s)){var y=i[a],v=r[a],_=4===s;t[u]={type:_?"linear":"radial",x:rh(y.x,v.x,g),y:rh(y.y,v.y,g),colorStops:as(y.colorStops,function(t,e){var n=v.colorStops[e];return{offset:rh(t.offset,n.offset,g),color:hh(oh([],t.color,n.color,g))}}),global:v.global},_?(t[u].x2=rh(y.x2,v.x2,g),t[u].y2=rh(y.y2,v.y2,g)):t[u].r=rh(y.r,v.r,g)}else if(h)oh(m,i[a],r[a],g),o||(t[u]=hh(m));else{var x=rh(i[a],r[a],g);o?this._additiveValue=x:t[u]=x}o&&this._addToTarget(t)}}},t.prototype._addToTarget=function(t){var e=this.valType,n=this.propName,i=this._additiveValue;0===e?t[n]=t[n]+i:3===e?(Iu(t[n],fh),ah(fh,fh,i,1),t[n]=hh(fh)):1===e?ah(t[n],t[n],i,1):2===e&&sh(t[n],t[n],i,1)},t}(),mh=function(){function t(t,e,n,i){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&i?Xa("Can' use additive animation on looped animation."):(this._additiveAnimators=i,this._allowDiscrete=n)}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(t){this._target=t},t.prototype.when=function(t,e,n){return this.whenWithKeys(t,e,us(e),n)},t.prototype.whenWithKeys=function(t,e,n,i){for(var r=this._tracks,o=0;o<n.length;o++){var a=n[o],s=r[a];if(!s){s=r[a]=new gh(a);var l=void 0,c=this._getAdditiveTrack(a);if(c){var u=c.keyframes,h=u[u.length-1];l=h&&h.value,3===c.valType&&l&&(l=hh(l))}else l=this._target[a];if(null==l)continue;t>0&&s.addKeyframe(0,uh(l),i),this._trackKeys.push(a)}s.addKeyframe(t,uh(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n<e;n++)t[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedCbs;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var n=0;n<e.length;n++)e[n].call(this)},t.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,n=0;n<e.length;n++)t[e[n]].setFinished()},t.prototype._getAdditiveTrack=function(t){var e,n=this._additiveAnimators;if(n)for(var i=0;i<n.length;i++){var r=n[i].getTrack(t);r&&(e=r)}return e},t.prototype.start=function(t){if(!(this._started>0)){this._started=1;for(var e=this,n=[],i=this._maxTime||0,r=0;r<this._trackKeys.length;r++){var o=this._trackKeys[r],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,c=l.length;if(a.prepare(i,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var u=l[c-1];u&&(e._target[a.propName]=u.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var h=new uu({life:i,loop:this._loop,delay:this._delay||0,onframe:function(t){e._started=2;var i=e._additiveAnimators;if(i){for(var r=!1,o=0;o<i.length;o++)if(i[o]._clip){r=!0;break}r||(e._additiveAnimators=null)}for(o=0;o<n.length;o++)n[o].step(e._target,t);var a=e._onframeCbs;if(a)for(o=0;o<a.length;o++)a[o](e._target,t)},ondestroy:function(){e._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),t&&h.setEasing(t)}else this._doneCallback();return this}},t.prototype.stop=function(t){if(this._clip){var e=this._clip;t&&e.onframe(1),this._abortedCallback()}},t.prototype.delay=function(t){return this._delay=t,this},t.prototype.during=function(t){return t&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(t)),this},t.prototype.done=function(t){return t&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(t)),this},t.prototype.aborted=function(t){return t&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(t)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(t){return this._tracks[t]},t.prototype.getTracks=function(){var t=this;return as(this._trackKeys,function(e){return t._tracks[e]})},t.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var n=this._tracks,i=this._trackKeys,r=0;r<t.length;r++){var o=n[t[r]];o&&!o.isFinished()&&(e?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(r=0;r<i.length;r++)if(!n[i[r]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},t.prototype.saveTo=function(t,e,n){if(t){e=e||this._trackKeys;for(var i=0;i<e.length;i++){var r=e[i],o=this._tracks[r];if(o&&!o.isFinished()){var a=o.keyframes,s=a[n?0:a.length-1];s&&(t[r]=uh(s.rawValue))}}}},t.prototype.__changeFinalValue=function(t,e){e=e||us(t);for(var n=0;n<e.length;n++){var i=e[n],r=this._tracks[i];if(r){var o=r.keyframes;if(o.length>1){var a=o.pop();r.addKeyframe(a.time,t[i]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},t}();const yh=mh;function vh(){return(new Date).getTime()}var _h=function(t){function e(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return Ma(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=vh()-this._pausedTime,n=e-this._time,i=this._head;i;){var r=i.next;i.step(e,n)?(i.ondestroy(),this.removeClip(i),i=r):i=r}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,Bc(function e(){t._running&&(Bc(e),!t._paused&&t.update())})},e.prototype.start=function(){this._running||(this._time=vh(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=vh(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=vh()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var n=new yh(t,e.loop);return this.addAnimator(n),n},e}(bl);const xh=_h;var bh,wh,Sh=Ia.domSupported,Mh=(wh={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:bh=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:as(bh,function(t){var e=t.replace("mouse","pointer");return wh.hasOwnProperty(e)?e:t})}),Ch=["mousemove","mouseup"],Th=["pointermove","pointerup"],Ih=!1;function Dh(t){var e=t.pointerType;return"pen"===e||"touch"===e}function kh(t){t&&(t.zrByTouch=!0)}function Ah(t,e){for(var n=e,i=!1;n&&9!==n.nodeType&&!(i=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return i}var Eh=function(t,e){this.stopPropagation=Gs,this.stopImmediatePropagation=Gs,this.preventDefault=Gs,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},Lh={mousedown:function(t){t=zl(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=zl(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=zl(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Ah(this,(t=zl(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Ih=!0,t=zl(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Ih||(t=zl(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){kh(t=zl(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Lh.mousemove.call(this,t),Lh.mousedown.call(this,t)},touchmove:function(t){kh(t=zl(this.dom,t)),this.handler.processGesture(t,"change"),Lh.mousemove.call(this,t)},touchend:function(t){kh(t=zl(this.dom,t)),this.handler.processGesture(t,"end"),Lh.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Lh.click.call(this,t)},pointerdown:function(t){Lh.mousedown.call(this,t)},pointermove:function(t){Dh(t)||Lh.mousemove.call(this,t)},pointerup:function(t){Lh.mouseup.call(this,t)},pointerout:function(t){Dh(t)||Lh.mouseout.call(this,t)}};os(["click","dblclick","contextmenu"],function(t){Lh[t]=function(e){e=zl(this.dom,e),this.trigger(t,e)}});var Ph={pointermove:function(t){Dh(t)||Ph.mousemove.call(this,t)},pointerup:function(t){Ph.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function Oh(t,e,n,i){t.mounted[e]=n,t.listenerOpts[e]=i,Fl(t.domTarget,e,n,i)}function Rh(t){var e=t.mounted;for(var n in e)e.hasOwnProperty(n)&&Vl(t.domTarget,n,e[n],t.listenerOpts[n]);t.mounted={}}var Bh=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e};const Nh=function(t){function e(e,n){var i,r,o,a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=e,a.painterRoot=n,a._localHandlerScope=new Bh(e,Lh),Sh&&(a._globalHandlerScope=new Bh(document,Ph)),i=a,r=a._localHandlerScope,o=r.domHandlers,Ia.pointerEventsSupported?os(Mh.pointer,function(t){Oh(r,t,function(e){o[t].call(i,e)})}):(Ia.touchEventsSupported&&os(Mh.touch,function(t){Oh(r,t,function(e){o[t].call(i,e),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(r)})}),os(Mh.mouse,function(t){Oh(r,t,function(e){e=Nl(e),r.touching||o[t].call(i,e)})})),a}return Ma(e,t),e.prototype.dispose=function(){Rh(this._localHandlerScope),Sh&&Rh(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Sh&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?function(t,e){function n(n){Oh(e,n,function(i){i=Nl(i),Ah(t,i.target)||(i=function(t,e){return zl(t.dom,new Eh(t,e),!0)}(t,i),e.domHandlers[n].call(t,i))},{capture:!0})}Ia.pointerEventsSupported?os(Th,n):Ia.touchEventsSupported||os(Ch,n)}(this,e):Rh(e)}},e}(bl);var zh=1;Ia.hasGlobalWindow&&(zh=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Fh=zh,Vh="#333",Hh="#ccc",jh=Yl;function Wh(t){return t>5e-5||t<-5e-5}var Gh=[],Uh=[],qh=[1,0,0,1,0,0],Yh=Math.abs,Xh=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Wh(this.rotation)||Wh(this.x)||Wh(this.y)||Wh(this.scaleX-1)||Wh(this.scaleY-1)||Wh(this.skewX)||Wh(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):jh(n),t&&(e?$l(n,t,n):Xl(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n)):n&&(jh(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Gh);var n=Gh[0]<0?-1:1,i=Gh[1]<0?-1:1,r=((Gh[0]-n)*e+n)/Gh[0]||0,o=((Gh[1]-i)*e+i)/Gh[1]||0;t[0]*=r,t[1]*=r,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],Ql(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),r=Math.PI/2+i-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(r),e=Math.sqrt(e),this.skewX=r,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],$l(Uh,t.invTransform,e),e=Uh);var n=this.originX,i=this.originY;(n||i)&&(qh[4]=n,qh[5]=i,$l(Uh,e,qh),Uh[4]-=n,Uh[5]-=i,e=Uh),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],i=this.invTransform;return i&&fl(n,n,i),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],i=this.transform;return i&&fl(n,n,i),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&Yh(t[0]-1)>1e-10&&Yh(t[3]-1)>1e-10?Math.sqrt(Yh(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Zh(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,i=t.originY||0,r=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,c=t.x,u=t.y,h=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||i||a||s){var p=n+a,f=i+s;e[4]=-p*r-h*f*o,e[5]=-f*o-d*p*r}else e[4]=e[5]=0;return e[0]=r,e[3]=o,e[1]=d*r,e[2]=h*o,l&&Kl(e,e,l),e[4]+=n+c,e[5]+=i+u,e},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),$h=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Zh(t,e){for(var n=0;n<$h.length;n++){var i=$h[n];t[i]=e[i]}}const Kh=Xh;var Jh={};function Qh(t,e){var n=Jh[e=e||Ea];n||(n=Jh[e]=new fu(500));var i=n.get(t);return null==i&&(i=Pa.measureText(t,e).width,n.put(t,i)),i}function td(t,e,n,i){var r=Qh(t,e),o=rd(e),a=nd(0,r,n),s=id(0,o,i);return new dc(a,s,r,o)}function ed(t,e,n,i){var r=((t||"")+"").split("\n");if(1===r.length)return td(r[0],e,n,i);for(var o=new dc(0,0,0,0),a=0;a<r.length;a++){var s=td(r[a],e,n,i);0===a?o.copy(s):o.union(s)}return o}function nd(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function id(t,e,n){return"middle"===n?t-=e/2:"bottom"===n&&(t-=e),t}function rd(t){return Qh("国",t)}function od(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function ad(t,e,n){var i=e.position||"inside",r=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,c=n.y,u="left",h="top";if(i instanceof Array)l+=od(i[0],n.width),c+=od(i[1],n.height),u=null,h=null;else switch(i){case"left":l-=r,c+=s,u="right",h="middle";break;case"right":l+=r+a,c+=s,h="middle";break;case"top":l+=a/2,c-=r,u="center",h="bottom";break;case"bottom":l+=a/2,c+=o+r,u="center";break;case"inside":l+=a/2,c+=s,u="center",h="middle";break;case"insideLeft":l+=r,c+=s,h="middle";break;case"insideRight":l+=a-r,c+=s,u="right",h="middle";break;case"insideTop":l+=a/2,c+=r,u="center";break;case"insideBottom":l+=a/2,c+=o-r,u="center",h="bottom";break;case"insideTopLeft":l+=r,c+=r;break;case"insideTopRight":l+=a-r,c+=r,u="right";break;case"insideBottomLeft":l+=r,c+=o-r,h="bottom";break;case"insideBottomRight":l+=a-r,c+=o-r,u="right",h="bottom"}return(t=t||{}).x=l,t.y=c,t.align=u,t.verticalAlign=h,t}var sd="__zr_normal__",ld=$h.concat(["ignore"]),cd=ss($h,function(t,e){return t[e]=!0,t},{ignore:!1}),ud={},hd=new dc(0,0,0,0),dd=function(){function t(t){this.id=Ya(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,r=e.innerTransformable,o=void 0,a=void 0,s=!1;r.parent=i?this:null;var l=!1;if(r.copyTransform(e),null!=n.position){var c=hd;n.layoutRect?c.copy(n.layoutRect):c.copy(this.getBoundingRect()),i||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(ud,n,c):ad(ud,n,c),r.x=ud.x,r.y=ud.y,o=ud.align,a=ud.verticalAlign;var u=n.origin;if(u&&null!=n.rotation){var h=void 0,d=void 0;"center"===u?(h=.5*c.width,d=.5*c.height):(h=od(u[0],c.width),d=od(u[1],c.height)),l=!0,r.originX=-r.x+h+(i?0:c.x),r.originY=-r.y+d+(i?0:c.y)}}null!=n.rotation&&(r.rotation=n.rotation);var p=n.offset;p&&(r.x+=p[0],r.y+=p[1],l||(r.originX=-p[0],r.originY=-p[1]));var f=null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,y=void 0,v=void 0;f&&this.canBeInsideText()?(m=n.insideFill,y=n.insideStroke,null!=m&&"auto"!==m||(m=this.getInsideTextFill()),null!=y&&"auto"!==y||(y=this.getInsideTextStroke(m),v=!0)):(m=n.outsideFill,y=n.outsideStroke,null!=m&&"auto"!==m||(m=this.getOutsideFill()),null!=y&&"auto"!==y||(y=this.getOutsideStroke(m),v=!0)),(m=m||"#000")===g.fill&&y===g.stroke&&v===g.autoStroke&&o===g.align&&a===g.verticalAlign||(s=!0,g.fill=m,g.stroke=y,g.autoStroke=v,g.align=o,g.verticalAlign=a,e.setDefaultTextStyle(g)),e.__dirty|=kc,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Hh:Vh},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Iu(e);n||(n=[255,255,255,1]);for(var i=n[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(r?0:255)*(1-i);return n[3]=1,Nu(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},Ja(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(vs(t))for(var n=us(t),i=0;i<n.length;i++){var r=n[i];this.attrKV(r,t[r])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,n=0;n<this.animators.length;n++){var i=this.animators[n],r=i.__fromStateTransition;if(!(i.getLoop()||r&&r!==sd)){var o=i.targetName,a=o?e[o]:e;i.saveTo(a)}}},t.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,ld)},t.prototype._savePrimaryToNormal=function(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];null==t[r]||r in e||(e[r]=this[r])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(sd,!1,t)},t.prototype.useState=function(t,e,n,i){var r=t===sd;if(this.hasState()||!r){var o=this.currentStates,a=this.stateTransition;if(!(es(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!r&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||r){r||this.saveCurrentToNormalState(s);var l=!!(s&&s.hoverLayer||i);l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!n&&!this.__inHover&&a&&a.duration>0,a);var c=this._textContent,u=this._textGuide;return c&&c.useState(t,e,n,l),u&&u.useState(t,e,n,l),r?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~kc),s}Xa("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var i=[],r=this.currentStates,o=t.length,a=o===r.length;if(a)for(var s=0;s<o;s++)if(t[s]!==r[s]){a=!1;break}if(a)return;for(s=0;s<o;s++){var l=t[s],c=void 0;this.stateProxy&&(c=this.stateProxy(l,t)),c||(c=this.states[l]),c&&i.push(c)}var u=i[o-1],h=!!(u&&u.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(i),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(t.join(","),d,this._normalState,!1,!e&&!this.__inHover&&p&&p.duration>0,p);var f=this._textContent,g=this._textGuide;f&&f.useStates(t,e,h),g&&g.useStates(t,e,h),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~kc)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},t.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},t.prototype.removeState=function(t){var e=es(this.currentStates,t);if(e>=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var i=this.currentStates.slice(),r=es(i,t),o=es(i,e)>=0;r>=0?o?i.splice(r,1):i[r]=e:n&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},i=0;i<t.length;i++){var r=t[i];Ja(n,r),r.textConfig&&Ja(e=e||{},r.textConfig)}return e&&(n.textConfig=e),n},t.prototype._applyStateObj=function(t,e,n,i,r,o){var a=!(e&&i);e&&e.textConfig?(this.textConfig=Ja({},i?this.textConfig:n.textConfig),Ja(this.textConfig,e.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,c=0;c<ld.length;c++){var u=ld[c],h=r&&cd[u];e&&null!=e[u]?h?(l=!0,s[u]=e[u]):this[u]=e[u]:a&&null!=n[u]&&(h?(l=!0,s[u]=n[u]):this[u]=n[u])}if(!r)for(c=0;c<this.animators.length;c++){var d=this.animators[c],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(e||n)[p]:e||n)}l&&this._transitionState(t,s,o)},t.prototype._attachComponent=function(t){if((!t.__zr||t.__hostTarget)&&t!==this){var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this}},t.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},t.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(t){var e=this._textContent;e!==t&&(e&&e!==t&&this.removeTextContent(),t.innerTransformable=new Kh,this._attachComponent(t),this._textContent=t,this.markRedraw())},t.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),Ja(this.textConfig,t),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.innerTransformable=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=kc;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var e=this._textContent,n=this._textGuide;e&&(e.__inHover=t),n&&(n.__inHover=t)},t.prototype.addSelfToZr=function(t){if(this.__zr!==t){this.__zr=t;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.addAnimator(e[n]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){if(this.__zr){this.__zr=null;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.removeAnimator(e[n]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)}},t.prototype.animate=function(t,e,n){var i=t?this[t]:this,r=new yh(i,e,n);return t&&(r.targetName=t),this.addAnimator(r,t),r},t.prototype.addAnimator=function(t,e){var n=this.__zr,i=this;t.during(function(){i.updateDuringAnimation(e)}).done(function(){var e=i.animators,n=es(e,t);n>=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,i=n.length,r=[],o=0;o<i;o++){var a=n[o];t&&t!==a.scope?r.push(a):a.stop(e)}return this.animators=r,this},t.prototype.animateTo=function(t,e,n){pd(this,t,e,n)},t.prototype.animateFrom=function(t,e,n){pd(this,t,e,n,!0)},t.prototype._transitionState=function(t,e,n,i){for(var r=pd(this,e,n,i),o=0;o<r.length;o++)r[o].__fromStateTransition=t},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=function(){var e=t.prototype;function n(t,n,i,r){function o(t,e){Object.defineProperty(e,0,{get:function(){return t[i]},set:function(e){t[i]=e}}),Object.defineProperty(e,1,{get:function(){return t[r]},set:function(e){t[r]=e}})}Object.defineProperty(e,t,{get:function(){return this[n]||o(this,this[n]=[]),this[n]},set:function(t){this[i]=t[0],this[r]=t[1],this[n]=t,o(this,t)}})}e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=kc,Object.defineProperty&&(n("position","_legacyPos","x","y"),n("scale","_legacyScale","scaleX","scaleY"),n("origin","_legacyOrigin","originX","originY"))}(),t}();function pd(t,e,n,i,r){var o=[];md(t,"",t,e,n=n||{},i,o,r);var a=o.length,s=!1,l=n.done,c=n.aborted,u=function(){s=!0,--a<=0&&(s?l&&l():c&&c())},h=function(){--a<=0&&(s?l&&l():c&&c())};a||l&&l(),o.length>0&&n.during&&o[0].during(function(t,e){n.during(e)});for(var d=0;d<o.length;d++){var p=o[d];u&&p.done(u),h&&p.aborted(h),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function fd(t,e,n){for(var i=0;i<n;i++)t[i]=e[i]}function gd(t,e,n){if(rs(e[n]))if(rs(t[n])||(t[n]=[]),xs(e[n])){var i=e[n].length;t[n].length!==i&&(t[n]=new e[n].constructor(i),fd(t[n],e[n],i))}else{var r=e[n],o=t[n],a=r.length;if(rs(r[0]))for(var s=r[0].length,l=0;l<a;l++)o[l]?fd(o[l],r[l],s):o[l]=Array.prototype.slice.call(r[l]);else fd(o,r,a);o.length=r.length}else t[n]=e[n]}function md(t,e,n,i,r,o,a,s){for(var l=us(i),c=r.duration,u=r.delay,h=r.additive,d=r.setToFinal,p=!vs(o),f=t.animators,g=[],m=0;m<l.length;m++){var y=l[m],v=i[y];if(null!=v&&null!=n[y]&&(p||o[y]))if(!vs(v)||rs(v)||ws(v))g.push(y);else{if(e){s||(n[y]=v,t.updateDuringAnimation(e));continue}md(t,y,n[y],v,r,o&&o[y],a,s)}else s||(n[y]=v,t.updateDuringAnimation(e),g.push(y))}var _=g.length;if(!h&&_)for(var x=0;x<f.length;x++)if((w=f[x]).targetName===e&&w.stopTracks(g)){var b=es(f,w);f.splice(b,1)}if(r.force||(g=ls(g,function(t){return!((e=i[t])===(r=n[t])||rs(e)&&rs(r)&&function(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}(e,r));var e,r}),_=g.length),_>0||r.force&&!a.length){var w,S=void 0,M=void 0,C=void 0;if(s)for(M={},d&&(S={}),x=0;x<_;x++)M[y=g[x]]=n[y],d?S[y]=i[y]:n[y]=i[y];else if(d)for(C={},x=0;x<_;x++)C[y=g[x]]=uh(n[y]),gd(n,i,y);(w=new yh(n,!1,!1,h?ls(f,function(t){return t.targetName===e}):null)).targetName=e,r.scope&&(w.scope=r.scope),d&&S&&w.whenWithKeys(0,S,g),C&&w.whenWithKeys(0,C,g),w.whenWithKeys(null==c?500:c,s?M:i,g).delay(u||0),t.addAnimator(w,e),a.push(w)}}is(dd,bl),is(dd,Kh);const yd=dd;var vd=function(t){function e(e){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(e),n}return Ma(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},e.prototype.addBefore=function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var n=this._children,i=n.indexOf(e);i>=0&&(n.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var n=es(this._children,t);return n>=0&&this.replaceAt(e,n),this},e.prototype.replaceAt=function(t,e){var n=this._children,i=n[e];if(t&&t!==this&&t.parent!==this&&t!==i){n[e]=t,i.parent=null;var r=this.__zr;r&&i.removeSelfFromZr(r),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,n=this._children,i=es(n,t);return i<0||(n.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n<t.length;n++){var i=t[n];e&&i.removeSelfFromZr(e),i.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,e){for(var n=this._children,i=0;i<n.length;i++){var r=n[i];t.call(e,r,i)}return this},e.prototype.traverse=function(t,e){for(var n=0;n<this._children.length;n++){var i=this._children[n],r=t.call(e,i);i.isGroup&&!r&&i.traverse(t,e)}return this},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(e)},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(e)},e.prototype.getBoundingRect=function(t){for(var e=new dc(0,0,0,0),n=t||this._children,i=[],r=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(i);l?(dc.applyTransform(e,s,l),(r=r||e.clone()).union(e)):(r=r||s.clone()).union(s)}}return r||e},e}(yd);vd.prototype.type="group";const _d=vd;var xd,bd={},wd={},Sd=function(){function t(t,e,n){var i=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=e,this.id=t;var r=new Rc,o=n.renderer||"canvas";bd[o]||(o=us(bd)[0]),n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var a=new bd[o](e,r,n,t),s=n.ssr||a.ssrOnly;this.storage=r,this.painter=a;var l,c=Ia.node||Ia.worker||s?null:new Nh(a.getViewportRoot(),a.root),u=n.useCoarsePointer;(null==u||"auto"===u?Ia.touchEventsSupported:!!u)&&(l=Is(n.pointerSize,44)),this.handler=new Sc(r,a,c,a.root,l),this.animation=new xh({stage:{update:s?null:function(){return i._flush(!0)}}}),s||this.animation.start()}return t.prototype.add=function(t){!this._disposed&&t&&(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},t.prototype.remove=function(t){!this._disposed&&t&&(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(t,e){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh())},t.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=function(t){if(!t)return!1;if("string"==typeof t)return zu(t,1)<.4;if(t.colorStops){for(var e=t.colorStops,n=0,i=e.length,r=0;r<i;r++)n+=zu(e[r].color,1);return(n/=i)<.4}return!1}(t))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(t){this._darkMode=t},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(t){this._disposed||(t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(t){var e,n=vh();this._needsRefresh&&(e=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately());var i=vh();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof _d&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.prototype.dispose=function(){var t;this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,t=this.id,delete wd[t])},t}();function Md(t,e){var n=new Sd(Ya(),t,e);return wd[n.id]=n,n}function Cd(t){t.dispose()}function Td(){for(var t in wd)wd.hasOwnProperty(t)&&wd[t].dispose();wd={}}function Id(t){return wd[t]}function Dd(t,e){bd[t]=e}function kd(t){if("function"==typeof xd)return xd(t)}function Ad(t){xd=t}var Ed="5.6.1",Ld=1e-4,Pd=20;function Od(t,e,n,i){var r=e[0],o=e[1],a=n[0],s=n[1],l=o-r,c=s-a;if(0===l)return 0===c?a:(a+s)/2;if(i)if(l>0){if(t<=r)return a;if(t>=o)return s}else{if(t>=r)return a;if(t<=o)return s}else{if(t===r)return a;if(t===o)return s}return(t-r)/l*c+a}function Rd(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return gs(t)?(n=t,n.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n}function Bd(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),Pd),t=(+t).toFixed(e),n?t:+t}function Nd(t){return t.sort(function(t,e){return t-e}),t}function zd(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Math.round(t*e)/e===t)return n;return Fd(t)}function Fd(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),i=n>0?+e.slice(n+1):0,r=n>0?n:e.length,o=e.indexOf("."),a=o<0?0:r-1-o;return Math.max(0,a-i)}function Vd(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),o=Math.round(n(Math.abs(e[1]-e[0]))/i),a=Math.min(Math.max(-r+o,0),20);return isFinite(a)?a:20}function Hd(t,e,n){return t[e]&&jd(t,n)[e]||0}function jd(t,e){var n=ss(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return[];for(var i=Math.pow(10,e),r=as(t,function(t){return(isNaN(t)?0:t)/n*i*100}),o=100*i,a=as(r,function(t){return Math.floor(t)}),s=ss(a,function(t,e){return t+e},0),l=as(r,function(t,e){return t-a[e]});s<o;){for(var c=Number.NEGATIVE_INFINITY,u=null,h=0,d=l.length;h<d;++h)l[h]>c&&(c=l[h],u=h);++a[u],l[u]=0,++s}return as(a,function(t){return t/i})}function Wd(t,e){var n=Math.max(zd(t),zd(e)),i=t+e;return n>Pd?i:Bd(i,n)}var Gd=9007199254740991;function Ud(t){var e=2*Math.PI;return(t%e+e)%e}function qd(t){return t>-Ld&&t<Ld}var Yd=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Xd(t){if(t instanceof Date)return t;if(gs(t)){var e=Yd.exec(t);if(!e)return new Date(NaN);if(e[8]){var n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}return null==t?new Date(NaN):new Date(Math.round(t))}function $d(t){return Math.pow(10,Zd(t))}function Zd(t){if(0===t)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function Kd(t,e){var n=Zd(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t}function Jd(t,e){var n=(t.length-1)*e+1,i=Math.floor(n),r=+t[i-1],o=n-i;return o?r+o*(t[i]-r):r}function Qd(t){t.sort(function(t,e){return s(t,e,0)?-1:1});for(var e=-1/0,n=1,i=0;i<t.length;){for(var r=t[i].interval,o=t[i].close,a=0;a<2;a++)r[a]<=e&&(r[a]=e,o[a]=a?1:1-n),e=r[a],n=o[a];r[0]===r[1]&&o[0]*o[1]!==1?t.splice(i,1):i++}return t;function s(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]===(n?-1:1)||!n&&s(t,e,1))}}function tp(t){var e=parseFloat(t);return e==t&&(0!==e||!gs(t)||t.indexOf("x")<=0)?e:NaN}function ep(t){return!isNaN(tp(t))}function np(){return Math.round(9*Math.random())}function ip(t,e){return 0===e?t:ip(e,t%e)}function rp(t,e){return null==t?e:null==e?t:t*e/ip(t,e)}function op(t,e,n){return(e-t)*n+t}var ap="series\0",sp="\0_ec_\0";function lp(t){return t instanceof Array?t:null==t?[]:[t]}function cp(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,r=n.length;i<r;i++){var o=n[i];!t.emphasis[e].hasOwnProperty(o)&&t[e].hasOwnProperty(o)&&(t.emphasis[e][o]=t[e][o])}}}var up=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function hp(t){return!vs(t)||ps(t)||t instanceof Date?t:t.value}function dp(t){return vs(t)&&!(t instanceof Array)}function pp(t,e,n){var i="normalMerge"===n,r="replaceMerge"===n,o="replaceAll"===n;t=t||[],e=(e||[]).slice();var a=Fs();os(e,function(t,n){vs(t)||(e[n]=null)});var s,l,c=function(t,e,n){var i=[];if("replaceAll"===n)return i;for(var r=0;r<t.length;r++){var o=t[r];o&&null!=o.id&&e.set(o.id,r),i.push({existing:"replaceMerge"===n||vp(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return i}(t,a,n);return(i||r)&&function(t,e,n,i){os(i,function(r,o){if(r&&null!=r.id){var a=gp(r.id),s=n.get(a);if(null!=s){var l=t[s];Es(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=r,l.existing=e[s],i[o]=null}}})}(c,t,a,e),i&&function(t,e){os(e,function(n,i){if(n&&null!=n.name)for(var r=0;r<t.length;r++){var o=t[r].existing;if(!t[r].newOption&&o&&(null==o.id||null==n.id)&&!vp(n)&&!vp(o)&&fp("name",o,n))return t[r].newOption=n,void(e[i]=null)}})}(c,e),i||r?function(t,e,n){os(e,function(e){if(e){for(var i,r=0;(i=t[r])&&(i.newOption||vp(i.existing)||i.existing&&null!=e.id&&!fp("id",e,i.existing));)r++;i?(i.newOption=e,i.brandNew=n):t.push({newOption:e,brandNew:n,existing:null,keyInfo:null}),r++}})}(c,e,r):o&&function(t,e){os(e,function(e){t.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})}(c,e),s=c,l=Fs(),os(s,function(t){var e=t.existing;e&&l.set(e.id,t)}),os(s,function(t){var e=t.newOption;Es(!e||null==e.id||!l.get(e.id)||l.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&l.set(e.id,t),!t.keyInfo&&(t.keyInfo={})}),os(s,function(t,e){var n=t.existing,i=t.newOption,r=t.keyInfo;if(vs(i)){if(r.name=null!=i.name?gp(i.name):n?n.name:ap+e,n)r.id=gp(n.id);else if(null!=i.id)r.id=gp(i.id);else{var o=0;do{r.id="\0"+r.name+"\0"+o++}while(l.get(r.id))}l.set(r.id,t)}}),c}function fp(t,e,n){var i=mp(e[t],null),r=mp(n[t],null);return null!=i&&null!=r&&i===r}function gp(t){return mp(t,"")}function mp(t,e){return null==t?e:gs(t)?t:ys(t)||ms(t)?t+"":e}function yp(t){var e=t.name;return!(!e||!e.indexOf(ap))}function vp(t){return t&&null!=t.id&&0===gp(t.id).indexOf(sp)}function _p(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?ps(e.dataIndex)?as(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?ps(e.name)?as(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}function xp(){var t="__ec_inner_"+bp++;return function(e){return e[t]||(e[t]={})}}var bp=np();function wp(t,e,n){var i=Sp(e,n),r=i.mainTypeSpecified,o=i.queryOptionMap,a=i.others,s=n?n.defaultMainType:null;return!r&&s&&o.set(s,{}),o.each(function(e,i){var r=Tp(t,i,e,{useDefault:s===i,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[i+"Models"]=r.models,a[i+"Model"]=r.models[0]}),a}function Sp(t,e){var n;if(gs(t)){var i={};i[t+"Index"]=0,n=i}else n=t;var r=Fs(),o={},a=!1;return os(n,function(t,n){if("dataIndex"!==n&&"dataIndexInside"!==n){var i=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=i[1],l=(i[2]||"").toLowerCase();!s||!l||e&&e.includeMainTypes&&es(e.includeMainTypes,s)<0||(a=a||!!s,(r.get(s)||r.set(s,{}))[l]=t)}else o[n]=t}),{mainTypeSpecified:a,queryOptionMap:r,others:o}}var Mp={useDefault:!0,enableAll:!1,enableNone:!1},Cp={useDefault:!1,enableAll:!0,enableNone:!0};function Tp(t,e,n,i){i=i||Mp;var r=n.index,o=n.id,a=n.name,s={models:null,specified:null!=r||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=t.getComponent(e))?[l]:[],s}return"none"===r||!1===r?(Es(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):("all"===r&&(Es(i.enableAll,'`"all"` is not a valid value on index option.'),r=o=a=null),s.models=t.queryComponents({mainType:e,index:r,id:o,name:a}),s)}function Ip(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}function Dp(t,e){var n=Fs(),i=[];return os(t,function(t){var r=e(t);(n.get(r)||(i.push(r),n.set(r,[]))).push(t)}),{keys:i,buckets:n}}function kp(t,e,n,i,r){var o=null==e||"auto"===e;if(null==i)return i;if(ys(i))return Bd(f=op(n||0,i,r),o?Math.max(zd(n||0),zd(i)):e);if(gs(i))return r<1?n:i;for(var a=[],s=n,l=i,c=Math.max(s?s.length:0,l.length),u=0;u<c;++u){var h=t.getDimensionInfo(u);if(h&&"ordinal"===h.type)a[u]=(r<1&&s?s:l)[u];else{var d=s&&s[u]?s[u]:0,p=l[u],f=op(d,p,r);a[u]=Bd(f,o?Math.max(zd(d),zd(p)):e)}}return a}var Ap="___EC__COMPONENT__CONTAINER___",Ep="___EC__EXTENDED_CLASS___";function Lp(t){var e={main:"",sub:""};if(t){var n=t.split(".");e.main=n[0]||"",e.sub=n[1]||""}return e}function Pp(t,e){t.$constructor=t,t.extend=function(t){var e,n,i=this;return fs(n=i)&&/^class\s/.test(Function.prototype.toString.call(n))?e=function(t){function e(){return t.apply(this,arguments)||this}return Ma(e,t),e}(i):(e=function(){(t.$constructor||i).apply(this,arguments)},ns(e,this)),Ja(e.prototype,t),e[Ep]=!0,e.extend=this.extend,e.superCall=Bp,e.superApply=Np,e.superClass=i,e}}function Op(t,e){t.extend=e.extend}var Rp=Math.round(10*Math.random());function Bp(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return this.superClass.prototype[e].apply(t,n)}function Np(t,e,n){return this.superClass.prototype[e].apply(t,n)}function zp(t){var e={};t.registerClass=function(t){var n,i=t.type||t.prototype.type;if(i){Es(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=i),'componentType "'+n+'" illegal'),t.prototype.type=i;var r=Lp(i);if(r.sub){if(r.sub!==Ap){var o=function(t){var n=e[t.main];return n&&n[Ap]||((n=e[t.main]={})[Ap]=!0),n}(r);o[r.sub]=t}}else e[r.main]=t}return t},t.getClass=function(t,n,i){var r=e[t];if(r&&r[Ap]&&(r=n?r[n]:null),i&&!r)throw new Error(n?"Component "+t+"."+(n||"")+" is used but not imported.":t+".type should be specified.");return r},t.getClassesByMainType=function(t){var n=Lp(t),i=[],r=e[n.main];return r&&r[Ap]?os(r,function(t,e){e!==Ap&&i.push(t)}):i.push(r),i},t.hasClass=function(t){var n=Lp(t);return!!e[n.main]},t.getAllClassMainTypes=function(){var t=[];return os(e,function(e,n){t.push(n)}),t},t.hasSubTypes=function(t){var n=Lp(t),i=e[n.main];return i&&i[Ap]}}function Fp(t,e){for(var n=0;n<t.length;n++)t[n][1]||(t[n][1]=t[n][0]);return e=e||!1,function(n,i,r){for(var o={},a=0;a<t.length;a++){var s=t[a][1];if(!(i&&es(i,s)>=0||r&&es(r,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var Vp=Fp([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Hp=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return Vp(this,t,e)},t}(),jp=new fu(50);function Wp(t){if("string"==typeof t){var e=jp.get(t);return e&&e.image}return t}function Gp(t,e,n,i,r){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=jp.get(t),a={hostEl:n,cb:i,cbPayload:r};return o?!qp(e=o.image)&&o.pending.push(a):((e=Pa.loadImage(t,Up,Up)).__zrImageSrc=t,jp.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Up(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var n=t.pending[e],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}t.pending.length=0}function qp(t){return t&&t.width&&t.height}var Yp=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Xp(t,e,n,i,r){var o={};return $p(o,t,e,n,i,r),o.text}function $p(t,e,n,i,r,o){if(!n)return t.text="",void(t.isTruncated=!1);var a=(e+"").split("\n");o=Zp(n,i,r,o);for(var s=!1,l={},c=0,u=a.length;c<u;c++)Kp(l,a[c],o),a[c]=l.textLine,s=s||l.isTruncated;t.text=a.join("\n"),t.isTruncated=s}function Zp(t,e,n,i){var r=Ja({},i=i||{});r.font=e,n=Is(n,"..."),r.maxIterations=Is(i.maxIterations,2);var o=r.minChar=Is(i.minChar,0);r.cnCharWidth=Qh("国",e);var a=r.ascCharWidth=Qh("a",e);r.placeholder=Is(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<o&&s>=a;l++)s-=a;var c=Qh(n,e);return c>s&&(n="",c=0),s=t-c,r.ellipsis=n,r.ellipsisWidth=c,r.contentWidth=s,r.containerWidth=t,r}function Kp(t,e,n){var i=n.containerWidth,r=n.font,o=n.contentWidth;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=Qh(e,r);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?Jp(e,o,n.ascCharWidth,n.cnCharWidth):a>0?Math.floor(e.length*o/a):0;a=Qh(e=e.substr(0,l),r)}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function Jp(t,e,n,i){for(var r=0,o=0,a=t.length;o<a&&r<e;o++){var s=t.charCodeAt(o);r+=0<=s&&s<=127?n:i}return o}var Qp=function(){},tf=function(t){this.tokens=[],t&&(this.tokens=t)},ef=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1};function nf(t,e,n,i,r){var o,a,s=""===e,l=r&&n.rich[r]||{},c=t.lines,u=l.font||n.font,h=!1;if(i){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=od(l.width,i.width)+p;c.length>0&&f+i.accumWidth>i.width&&(o=e.split("\n"),h=!0),i.accumWidth=f}else{var g=af(e,u,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}else o=e.split("\n");for(var m=0;m<o.length;m++){var y=o[m],v=new Qp;if(v.styleName=r,v.text=y,v.isLineHolder=!y&&!s,"number"==typeof l.width?v.width=l.width:v.width=a?a[m]:Qh(y,u),m||h)c.push(new tf([v]));else{var _=(c[c.length-1]||(c[0]=new tf)).tokens,x=_.length;1===x&&_[0].isLineHolder?_[0]=v:(y||!x||s)&&_.push(v)}}}var rf=ss(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function of(t){return!function(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!rf[t]}function af(t,e,n,i,r){for(var o=[],a=[],s="",l="",c=0,u=0,h=0;h<t.length;h++){var d=t.charAt(h);if("\n"!==d){var p=Qh(d,e),f=!i&&!of(d);(o.length?u+p>n:r+u+p>n)?u?(s||l)&&(f?(s||(s=l,l="",u=c=0),o.push(s),a.push(u-c),l+=d,s="",u=c+=p):(l&&(s+=l,l="",c=0),o.push(s),a.push(u),s=d,u=p)):f?(o.push(l),a.push(c),l=d,c=p):(o.push(d),a.push(p)):(u+=p,f?(l+=d,c+=p):(l&&(s+=l,l="",c=0),s+=d))}else l&&(s+=l,u+=c),o.push(s),a.push(u),s="",l="",c=0,u=0}return o.length||s||(s=t,l="",c=0),l&&(s+=l),s&&(o.push(s),a.push(u)),1===o.length&&(u+=r),{accumWidth:u,lines:o,linesWidths:a}}var sf="__zr_style_"+Math.round(10*Math.random()),lf={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},cf={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};lf[sf]=!0;var uf=["z","z2","invisible"],hf=["invisible"],df=function(t){function e(e){return t.call(this,e)||this}var n;return Ma(e,t),e.prototype._init=function(e){for(var n=us(e),i=0;i<n.length;i++){var r=n[i];"style"===r?this.useStyle(e[r]):t.prototype.attrKV.call(this,r,e[r])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,e,n,i){var r,o,a,s=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&(r=this,o=t,a=e,pf.copy(r.getBoundingRect()),r.transform&&pf.applyTransform(r.transform),ff.width=o,ff.height=a,!pf.intersect(ff))||s&&!s[0]&&!s[3])return!1;if(n&&this.__clipPaths)for(var l=0;l<this.__clipPaths.length;++l)if(this.__clipPaths[l].isZeroArea())return!1;if(i&&this.parent)for(var c=this.parent;c;){if(c.ignore)return!1;c=c.parent}return!0},e.prototype.contain=function(t,e){return this.rectContain(t,e)},e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.rectContain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(n[0],n[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var e=this.transform,n=this.getBoundingRect(),i=this.style,r=i.shadowBlur||0,o=i.shadowOffsetX||0,a=i.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new dc(0,0,0,0)),e?dc.applyTransform(t,n,e):t.copy(n),(r||o||a)&&(t.width+=2*r+Math.abs(o),t.height+=2*r+Math.abs(a),t.x=Math.min(t.x,t.x+o-r),t.y=Math.min(t.y,t.y+a-r));var s=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-s),t.y=Math.floor(t.y-s),t.width=Math.ceil(t.width+1+2*s),t.height=Math.ceil(t.height+1+2*s))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new dc(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(e,n){"style"!==e?t.prototype.attrKV.call(this,e,n):this.style?this.setStyle(n):this.useStyle(n)},e.prototype.setStyle=function(t,e){return"string"==typeof t?this.style[t]=e:Ja(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(2&this.__dirty)},e.prototype.styleUpdated=function(){this.__dirty&=-3},e.prototype.createStyle=function(t){return Hs(lf,t)},e.prototype.useStyle=function(t){t[sf]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[sf]},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,n,uf)},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.style?o?r?s=n.style:(s=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),r?this.style:i.style),this._mergeStyle(s,n.style)):l&&(s=i.style),s)if(o){var c=this.style;if(this.style=this.createStyle(l?{}:c),l)for(var u=us(c),h=0;h<u.length;h++)(p=u[h])in s&&(s[p]=s[p],this.style[p]=c[p]);var d=us(s);for(h=0;h<d.length;h++){var p=d[h];this.style[p]=this.style[p]}this._transitionState(e,{style:s},a,this.getAnimationStyleProps())}else this.useStyle(s);var f=this.__inHover?hf:uf;for(h=0;h<f.length;h++)p=f[h],n&&null!=n[p]?this[p]=n[p]:l&&null!=i[p]&&(this[p]=i[p])},e.prototype._mergeStates=function(e){for(var n,i=t.prototype._mergeStates.call(this,e),r=0;r<e.length;r++){var o=e[r];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},e.prototype._mergeStyle=function(t,e){return Ja(t,e),t},e.prototype.getAnimationStyleProps=function(){return cf},e.initDefaultProps=((n=e.prototype).type="displayable",n.invisible=!1,n.z=0,n.z2=0,n.zlevel=0,n.culling=!1,n.cursor="pointer",n.rectHover=!1,n.incremental=!1,n._rect=null,n.dirtyRectTolerance=0,void(n.__dirty=2|kc)),e}(yd),pf=new dc(0,0,0,0),ff=new dc(0,0,0,0);const gf=df;var mf=Math.min,yf=Math.max,vf=Math.sin,_f=Math.cos,xf=2*Math.PI,bf=qs(),wf=qs(),Sf=qs();function Mf(t,e,n){if(0!==t.length){for(var i=t[0],r=i[0],o=i[0],a=i[1],s=i[1],l=1;l<t.length;l++)i=t[l],r=mf(r,i[0]),o=yf(o,i[0]),a=mf(a,i[1]),s=yf(s,i[1]);e[0]=r,e[1]=a,n[0]=o,n[1]=s}}function Cf(t,e,n,i,r,o){r[0]=mf(t,n),r[1]=mf(e,i),o[0]=yf(t,n),o[1]=yf(e,i)}var Tf=[],If=[];function Df(t,e,n,i,r,o,a,s,l,c){var u=Jc,h=$c,d=u(t,n,r,a,Tf);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var p=0;p<d;p++){var f=h(t,n,r,a,Tf[p]);l[0]=mf(f,l[0]),c[0]=yf(f,c[0])}for(d=u(e,i,o,s,If),p=0;p<d;p++){var g=h(e,i,o,s,If[p]);l[1]=mf(g,l[1]),c[1]=yf(g,c[1])}l[0]=mf(t,l[0]),c[0]=yf(t,c[0]),l[0]=mf(a,l[0]),c[0]=yf(a,c[0]),l[1]=mf(e,l[1]),c[1]=yf(e,c[1]),l[1]=mf(s,l[1]),c[1]=yf(s,c[1])}function kf(t,e,n,i,r,o,a,s){var l=ru,c=nu,u=yf(mf(l(t,n,r),1),0),h=yf(mf(l(e,i,o),1),0),d=c(t,n,r,u),p=c(e,i,o,h);a[0]=mf(t,r,d),a[1]=mf(e,o,p),s[0]=yf(t,r,d),s[1]=yf(e,o,p)}function Af(t,e,n,i,r,o,a,s,l){var c=gl,u=ml,h=Math.abs(r-o);if(h%xf<1e-4&&h>1e-4)return s[0]=t-n,s[1]=e-i,l[0]=t+n,void(l[1]=e+i);if(bf[0]=_f(r)*n+t,bf[1]=vf(r)*i+e,wf[0]=_f(o)*n+t,wf[1]=vf(o)*i+e,c(s,bf,wf),u(l,bf,wf),(r%=xf)<0&&(r+=xf),(o%=xf)<0&&(o+=xf),r>o&&!a?o+=xf:r<o&&a&&(r+=xf),a){var d=o;o=r,r=d}for(var p=0;p<o;p+=Math.PI/2)p>r&&(Sf[0]=_f(p)*n+t,Sf[1]=vf(p)*i+e,c(s,Sf,s),u(l,Sf,l))}var Ef={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Lf=[],Pf=[],Of=[],Rf=[],Bf=[],Nf=[],zf=Math.min,Ff=Math.max,Vf=Math.cos,Hf=Math.sin,jf=Math.abs,Wf=Math.PI,Gf=2*Wf,Uf="undefined"!=typeof Float32Array,qf=[];function Yf(t){return Math.round(t/Wf*1e8)/1e8%2*Wf}function Xf(t,e){var n=Yf(t[0]);n<0&&(n+=Gf);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=Gf?r=n+Gf:e&&n-r>=Gf?r=n-Gf:!e&&n>r?r=n+(Gf-Yf(n-r)):e&&n<r&&(r=n-(Gf-Yf(r-n))),t[0]=n,t[1]=r}var $f=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,n){(n=n||0)>0&&(this._ux=jf(n/Fh/t)||0,this._uy=jf(n/Fh/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Ef.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=jf(t-this._xi),i=jf(e-this._yi),r=n>this._ux||i>this._uy;if(this.addData(Ef.L,t,e),this._ctx&&r&&this._ctx.lineTo(t,e),r)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){return this._drawPendingPt(),this.addData(Ef.C,t,e,n,i,r,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,o),this._xi=r,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,i){return this._drawPendingPt(),this.addData(Ef.Q,t,e,n,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this._xi=n,this._yi=i,this},t.prototype.arc=function(t,e,n,i,r,o){this._drawPendingPt(),qf[0]=i,qf[1]=r,Xf(qf,o),i=qf[0];var a=(r=qf[1])-i;return this.addData(Ef.A,t,e,n,n,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,i,r,o),this._xi=Vf(r)*n+t,this._yi=Hf(r)*n+e,this},t.prototype.arcTo=function(t,e,n,i,r){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this},t.prototype.rect=function(t,e,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,i),this.addData(Ef.R,t,e,n,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ef.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&t.closePath(),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!Uf||(this.data=new Float32Array(e));for(var n=0;n<e;n++)this.data[n]=t[n];this._len=e},t.prototype.appendPath=function(t){t instanceof Array||(t=[t]);for(var e=t.length,n=0,i=this._len,r=0;r<e;r++)n+=t[r].len();for(Uf&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+n)),r=0;r<e;r++)for(var o=t[r].data,a=0;a<o.length;a++)this.data[i++]=o[a];this._len=i},t.prototype.addData=function(t,e,n,i,r,o,a,s,l){if(this._saveData){var c=this.data;this._len+arguments.length>c.length&&(this._expandData(),c=this.data);for(var u=0;u<arguments.length;u++)c[this._len++]=arguments[u]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,Uf&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Of[0]=Of[1]=Bf[0]=Bf[1]=Number.MAX_VALUE,Rf[0]=Rf[1]=Nf[0]=Nf[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,i=0,r=0,o=0;for(t=0;t<this._len;){var a=e[t++],s=1===t;switch(s&&(r=n=e[t],o=i=e[t+1]),a){case Ef.M:n=r=e[t++],i=o=e[t++],Bf[0]=r,Bf[1]=o,Nf[0]=r,Nf[1]=o;break;case Ef.L:Cf(n,i,e[t],e[t+1],Bf,Nf),n=e[t++],i=e[t++];break;case Ef.C:Df(n,i,e[t++],e[t++],e[t++],e[t++],e[t],e[t+1],Bf,Nf),n=e[t++],i=e[t++];break;case Ef.Q:kf(n,i,e[t++],e[t++],e[t],e[t+1],Bf,Nf),n=e[t++],i=e[t++];break;case Ef.A:var l=e[t++],c=e[t++],u=e[t++],h=e[t++],d=e[t++],p=e[t++]+d;t+=1;var f=!e[t++];s&&(r=Vf(d)*u+l,o=Hf(d)*h+c),Af(l,c,u,h,d,p,f,Bf,Nf),n=Vf(p)*u+l,i=Hf(p)*h+c;break;case Ef.R:Cf(r=n=e[t++],o=i=e[t++],r+e[t++],o+e[t++],Bf,Nf);break;case Ef.Z:n=r,i=o}gl(Of,Of,Bf),ml(Rf,Rf,Nf)}return 0===t&&(Of[0]=Of[1]=Rf[0]=Rf[1]=0),new dc(Of[0],Of[1],Rf[0]-Of[0],Rf[1]-Of[1])},t.prototype._calculateLength=function(){var t=this.data,e=this._len,n=this._ux,i=this._uy,r=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,c=0,u=0,h=0;h<e;){var d=t[h++],p=1===h;p&&(a=r=t[h],s=o=t[h+1]);var f=-1;switch(d){case Ef.M:r=a=t[h++],o=s=t[h++];break;case Ef.L:var g=t[h++],m=(_=t[h++])-o;(jf(k=g-r)>n||jf(m)>i||h===e-1)&&(f=Math.sqrt(k*k+m*m),r=g,o=_);break;case Ef.C:var y=t[h++],v=t[h++],_=(g=t[h++],t[h++]),x=t[h++],b=t[h++];f=eu(r,o,y,v,g,_,x,b,10),r=x,o=b;break;case Ef.Q:f=su(r,o,y=t[h++],v=t[h++],g=t[h++],_=t[h++],10),r=g,o=_;break;case Ef.A:var w=t[h++],S=t[h++],M=t[h++],C=t[h++],T=t[h++],I=t[h++],D=I+T;h+=1,p&&(a=Vf(T)*M+w,s=Hf(T)*C+S),f=Ff(M,C)*zf(Gf,Math.abs(I)),r=Vf(D)*M+w,o=Hf(D)*C+S;break;case Ef.R:a=r=t[h++],s=o=t[h++],f=2*t[h++]+2*t[h++];break;case Ef.Z:var k=a-r;m=s-o,f=Math.sqrt(k*k+m*m),r=a,o=s}f>=0&&(l[u++]=f,c+=f)}return this._pathLen=c,c},t.prototype.rebuildPath=function(t,e){var n,i,r,o,a,s,l,c,u,h,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,y=0,v=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,c=e*this._pathLen))t:for(var x=0;x<g;){var b=d[x++],w=1===x;switch(w&&(n=r=d[x],i=o=d[x+1]),b!==Ef.L&&_>0&&(t.lineTo(u,h),_=0),b){case Ef.M:n=r=d[x++],i=o=d[x++],t.moveTo(r,o);break;case Ef.L:a=d[x++],s=d[x++];var S=jf(a-r),M=jf(s-o);if(S>p||M>f){if(m){if(y+(X=l[v++])>c){var C=(c-y)/X;t.lineTo(r*(1-C)+a*C,o*(1-C)+s*C);break t}y+=X}t.lineTo(a,s),r=a,o=s,_=0}else{var T=S*S+M*M;T>_&&(u=a,h=s,_=T)}break;case Ef.C:var I=d[x++],D=d[x++],k=d[x++],A=d[x++],E=d[x++],L=d[x++];if(m){if(y+(X=l[v++])>c){Qc(r,I,k,E,C=(c-y)/X,Lf),Qc(o,D,A,L,C,Pf),t.bezierCurveTo(Lf[1],Pf[1],Lf[2],Pf[2],Lf[3],Pf[3]);break t}y+=X}t.bezierCurveTo(I,D,k,A,E,L),r=E,o=L;break;case Ef.Q:if(I=d[x++],D=d[x++],k=d[x++],A=d[x++],m){if(y+(X=l[v++])>c){ou(r,I,k,C=(c-y)/X,Lf),ou(o,D,A,C,Pf),t.quadraticCurveTo(Lf[1],Pf[1],Lf[2],Pf[2]);break t}y+=X}t.quadraticCurveTo(I,D,k,A),r=k,o=A;break;case Ef.A:var P=d[x++],O=d[x++],R=d[x++],B=d[x++],N=d[x++],z=d[x++],F=d[x++],V=!d[x++],H=R>B?R:B,j=jf(R-B)>.001,W=N+z,G=!1;if(m&&(y+(X=l[v++])>c&&(W=N+z*(c-y)/X,G=!0),y+=X),j&&t.ellipse?t.ellipse(P,O,R,B,F,N,W,V):t.arc(P,O,H,N,W,V),G)break t;w&&(n=Vf(N)*R+P,i=Hf(N)*B+O),r=Vf(W)*R+P,o=Hf(W)*B+O;break;case Ef.R:n=r=d[x],i=o=d[x+1],a=d[x++],s=d[x++];var U=d[x++],q=d[x++];if(m){if(y+(X=l[v++])>c){var Y=c-y;t.moveTo(a,s),t.lineTo(a+zf(Y,U),s),(Y-=U)>0&&t.lineTo(a+U,s+zf(Y,q)),(Y-=q)>0&&t.lineTo(a+Ff(U-Y,0),s+q),(Y-=U)>0&&t.lineTo(a,s+Ff(q-Y,0));break t}y+=X}t.rect(a,s,U,q);break;case Ef.Z:if(m){var X;if(y+(X=l[v++])>c){C=(c-y)/X,t.lineTo(r*(1-C)+n*C,o*(1-C)+i*C);break t}y+=X}t.closePath(),r=n,o=i}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.CMD=Ef,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();const Zf=$f;function Kf(t,e,n,i,r,o,a){if(0===r)return!1;var s,l=r;if(a>e+l&&a>i+l||a<e-l&&a<i-l||o>t+l&&o>n+l||o<t-l&&o<n-l)return!1;if(t===n)return Math.abs(o-t)<=l/2;var c=(s=(e-i)/(t-n))*o-a+(t*i-n*e)/(t-n);return c*c/(s*s+1)<=l/2*l/2}function Jf(t,e,n,i,r,o,a,s,l,c,u){if(0===l)return!1;var h=l;return!(u>e+h&&u>i+h&&u>o+h&&u>s+h||u<e-h&&u<i-h&&u<o-h&&u<s-h||c>t+h&&c>n+h&&c>r+h&&c>a+h||c<t-h&&c<n-h&&c<r-h&&c<a-h)&&tu(t,e,n,i,r,o,a,s,c,u,null)<=h/2}function Qf(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var c=a;return!(l>e+c&&l>i+c&&l>o+c||l<e-c&&l<i-c&&l<o-c||s>t+c&&s>n+c&&s>r+c||s<t-c&&s<n-c&&s<r-c)&&au(t,e,n,i,r,o,s,l,null)<=c/2}var tg=2*Math.PI;function eg(t){return(t%=tg)<0&&(t+=tg),t}var ng=2*Math.PI;function ig(t,e,n,i,r,o,a,s,l){if(0===a)return!1;var c=a;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-c>n||u+c<n)return!1;if(Math.abs(i-r)%ng<1e-4)return!0;if(o){var h=i;i=eg(r),r=eg(h)}else i=eg(i),r=eg(r);i>r&&(r+=ng);var d=Math.atan2(l,s);return d<0&&(d+=ng),d>=i&&d<=r||d+ng>=i&&d+ng<=r}function rg(t,e,n,i,r,o){if(o>e&&o>i||o<e&&o<i)return 0;if(i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;1!==a&&0!==a||(s=i<e?.5:-.5);var l=a*(n-t)+t;return l===r?1/0:l>r?s:0}var og=Zf.CMD,ag=2*Math.PI,sg=[-1,-1,-1],lg=[-1,-1];function cg(){var t=lg[0];lg[0]=lg[1],lg[1]=t}function ug(t,e,n,i,r,o,a,s,l,c){if(c>e&&c>i&&c>o&&c>s||c<e&&c<i&&c<o&&c<s)return 0;var u=Kc(e,i,o,s,c,sg);if(0===u)return 0;for(var h=0,d=-1,p=void 0,f=void 0,g=0;g<u;g++){var m=sg[g],y=0===m||1===m?.5:1;$c(t,n,r,a,m)<l||(d<0&&(d=Jc(e,i,o,s,lg),lg[1]<lg[0]&&d>1&&cg(),p=$c(e,i,o,s,lg[0]),d>1&&(f=$c(e,i,o,s,lg[1]))),2===d?m<lg[0]?h+=p<e?y:-y:m<lg[1]?h+=f<p?y:-y:h+=s<f?y:-y:m<lg[0]?h+=p<e?y:-y:h+=s<p?y:-y)}return h}function hg(t,e,n,i,r,o,a,s){if(s>e&&s>i&&s>o||s<e&&s<i&&s<o)return 0;var l=function(t,e,n,i,r){var o=t-2*e+n,a=2*(e-t),s=t-i,l=0;if(Yc(o))Xc(a)&&(u=-s/a)>=0&&u<=1&&(r[l++]=u);else{var c=a*a-4*o*s;if(Yc(c))(u=-a/(2*o))>=0&&u<=1&&(r[l++]=u);else if(c>0){var u,h=Vc(c),d=(-a-h)/(2*o);(u=(-a+h)/(2*o))>=0&&u<=1&&(r[l++]=u),d>=0&&d<=1&&(r[l++]=d)}}return l}(e,i,o,s,sg);if(0===l)return 0;var c=ru(e,i,o);if(c>=0&&c<=1){for(var u=0,h=nu(e,i,o,c),d=0;d<l;d++){var p=0===sg[d]||1===sg[d]?.5:1;nu(t,n,r,sg[d])<a||(sg[d]<c?u+=h<e?p:-p:u+=o<h?p:-p)}return u}return p=0===sg[0]||1===sg[0]?.5:1,nu(t,n,r,sg[0])<a?0:o<e?p:-p}function dg(t,e,n,i,r,o,a,s){if((s-=e)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);sg[0]=-l,sg[1]=l;var c=Math.abs(i-r);if(c<1e-4)return 0;if(c>=ag-1e-4){i=0,r=ag;var u=o?1:-1;return a>=sg[0]+t&&a<=sg[1]+t?u:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=ag,r+=ag);for(var d=0,p=0;p<2;p++){var f=sg[p];if(f+t>a){var g=Math.atan2(s,f);u=o?1:-1,g<0&&(g=ag+g),(g>=i&&g<=r||g+ag>=i&&g+ag<=r)&&(g>Math.PI/2&&g<1.5*Math.PI&&(u=-u),d+=u)}}return d}function pg(t,e,n,i,r){for(var o,a,s=t.data,l=t.len(),c=0,u=0,h=0,d=0,p=0,f=0;f<l;){var g=s[f++],m=1===f;switch(g===og.M&&f>1&&(n||(c+=rg(u,h,d,p,i,r))),m&&(d=u=s[f],p=h=s[f+1]),g){case og.M:u=d=s[f++],h=p=s[f++];break;case og.L:if(n){if(Kf(u,h,s[f],s[f+1],e,i,r))return!0}else c+=rg(u,h,s[f],s[f+1],i,r)||0;u=s[f++],h=s[f++];break;case og.C:if(n){if(Jf(u,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else c+=ug(u,h,s[f++],s[f++],s[f++],s[f++],s[f],s[f+1],i,r)||0;u=s[f++],h=s[f++];break;case og.Q:if(n){if(Qf(u,h,s[f++],s[f++],s[f],s[f+1],e,i,r))return!0}else c+=hg(u,h,s[f++],s[f++],s[f],s[f+1],i,r)||0;u=s[f++],h=s[f++];break;case og.A:var y=s[f++],v=s[f++],_=s[f++],x=s[f++],b=s[f++],w=s[f++];f+=1;var S=!!(1-s[f++]);o=Math.cos(b)*_+y,a=Math.sin(b)*x+v,m?(d=o,p=a):c+=rg(u,h,o,a,i,r);var M=(i-y)*x/_+y;if(n){if(ig(y,v,x,b,b+w,S,e,M,r))return!0}else c+=dg(y,v,x,b,b+w,S,M,r);u=Math.cos(b+w)*_+y,h=Math.sin(b+w)*x+v;break;case og.R:if(d=u=s[f++],p=h=s[f++],o=d+s[f++],a=p+s[f++],n){if(Kf(d,p,o,p,e,i,r)||Kf(o,p,o,a,e,i,r)||Kf(o,a,d,a,e,i,r)||Kf(d,a,d,p,e,i,r))return!0}else c+=rg(o,p,o,a,i,r),c+=rg(d,a,d,p,i,r);break;case og.Z:if(n){if(Kf(u,h,d,p,e,i,r))return!0}else c+=rg(u,h,d,p,i,r);u=d,h=p}}return n||function(t,e){return Math.abs(t-e)<1e-4}(h,p)||(c+=rg(u,h,d,p,i,r)||0),0!==c}var fg=Qa({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},lf),gg={style:Qa({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},cf.style)},mg=$h.concat(["invisible","culling","z","z2","zlevel","parent"]),yg=function(t){function e(e){return t.call(this,e)||this}var n;return Ma(e,t),e.prototype.update=function(){var n=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var r=this._decalEl=this._decalEl||new e;r.buildPath===e.prototype.buildPath&&(r.buildPath=function(t){n.buildPath(t,n.shape)}),r.silent=!0;var o=r.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s<mg.length;++s)r[mg[s]]=this[mg[s]];r.__dirty|=kc}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(e){var n=us(e);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var r=0;r<n.length;r++){var o=n[r],a=e[o];"style"===o?this.style?Ja(this.style,a):this.useStyle(a):"shape"===o?Ja(this.shape,a):t.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if("none"!==t){if(gs(t)){var e=zu(t,0);return e>.5?Vh:e>.2?"#eee":Hh}if(t)return Hh}return Vh},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(gs(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())==zu(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,n){},e.prototype.pathUpdated=function(){this.__dirty&=~Ac},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Zf(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var i=!1;this.path||(i=!0,this.createPathProxy());var r=this.path;(i||this.__dirty&Ac)&&(r.beginPath(),this.buildPath(r,this.shape,!1),this.pathUpdated()),t=r.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),r=this.style;if(t=n[0],e=n[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=r.lineWidth,s=r.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,i){return pg(t,e,!0,n,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return pg(t,0,!1,e,n)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Ac,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},e.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:Ja(n,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Ac)},e.prototype.createStyle=function(t){return Hs(fg,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=Ja({},this.shape))},e.prototype._applyStateObj=function(e,n,i,r,o,a){t.prototype._applyStateObj.call(this,e,n,i,r,o,a);var s,l=!(n&&r);if(n&&n.shape?o?r?s=n.shape:(s=Ja({},i.shape),Ja(s,n.shape)):(s=Ja({},r?this.shape:i.shape),Ja(s,n.shape)):l&&(s=i.shape),s)if(o){this.shape=Ja({},this.shape);for(var c={},u=us(s),h=0;h<u.length;h++){var d=u[h];"object"==typeof s[d]?this.shape[d]=s[d]:c[d]=s[d]}this._transitionState(e,{shape:c},a)}else this.shape=s,this.dirtyShape()},e.prototype._mergeStates=function(e){for(var n,i=t.prototype._mergeStates.call(this,e),r=0;r<e.length;r++){var o=e[r];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},e.prototype.getAnimationStyleProps=function(){return gg},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var n=function(e){function n(n){var i=e.call(this,n)||this;return t.init&&t.init.call(i,n),i}return Ma(n,e),n.prototype.getDefaultStyle=function(){return $a(t.style)},n.prototype.getDefaultShape=function(){return $a(t.shape)},n}(e);for(var i in t)"function"==typeof t[i]&&(n.prototype[i]=t[i]);return n},e.initDefaultProps=((n=e.prototype).type="path",n.strokeContainThreshold=5,n.segmentIgnoreThreshold=0,n.subPixelOptimize=!1,n.autoBatch=!1,void(n.__dirty=2|kc|Ac)),e}(gf);const vg=yg;var _g=Qa({strokeFirst:!0,font:Ea,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},fg),xg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return Hs(_g,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var n=ed(e,t.font,t.textAlign,t.textBaseline);if(n.x+=t.x||0,n.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i}this._rect=n}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(gf);xg.prototype.type="tspan";const bg=xg;var wg=Qa({x:0,y:0},lf),Sg={style:Qa({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},cf.style)},Mg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.createStyle=function(t){return Hs(wg,t)},e.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var i,r=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!r)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?r[t]:r[t]/r[o]*a},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Sg},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new dc(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(gf);Mg.prototype.type="image";const Cg=Mg;var Tg=Math.round;function Ig(t,e,n){if(e){var i=e.x1,r=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=r,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(Tg(2*i)===Tg(2*r)&&(t.x1=t.x2=kg(i,s,!0)),Tg(2*o)===Tg(2*a)&&(t.y1=t.y2=kg(o,s,!0)),t):t}}function Dg(t,e,n){if(e){var i=e.x,r=e.y,o=e.width,a=e.height;t.x=i,t.y=r,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=kg(i,s,!0),t.y=kg(r,s,!0),t.width=Math.max(kg(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(kg(r+a,s,!1)-t.y,0===a?0:1),t):t}}function kg(t,e,n){if(!e)return t;var i=Tg(2*t);return(i+Tg(e))%2==0?i/2:(i+(n?1:-1))/2}var Ag=function(){this.x=0,this.y=0,this.width=0,this.height=0},Eg={},Lg=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new Ag},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=Dg(Eg,e,this.style);n=a.x,i=a.y,r=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,i=e.y,r=e.width,o=e.height;e.r?function(t,e){var n,i,r,o,a,s=e.x,l=e.y,c=e.width,u=e.height,h=e.r;c<0&&(s+=c,c=-c),u<0&&(l+=u,u=-u),"number"==typeof h?n=i=r=o=h:h instanceof Array?1===h.length?n=i=r=o=h[0]:2===h.length?(n=r=h[0],i=o=h[1]):3===h.length?(n=h[0],i=o=h[1],r=h[2]):(n=h[0],i=h[1],r=h[2],o=h[3]):n=i=r=o=0,n+i>c&&(n*=c/(a=n+i),i*=c/a),r+o>c&&(r*=c/(a=r+o),o*=c/a),i+r>u&&(i*=u/(a=i+r),r*=u/a),n+o>u&&(n*=u/(a=n+o),o*=u/a),t.moveTo(s+n,l),t.lineTo(s+c-i,l),0!==i&&t.arc(s+c-i,l+i,i,-Math.PI/2,0),t.lineTo(s+c,l+u-r),0!==r&&t.arc(s+c-r,l+u-r,r,0,Math.PI/2),t.lineTo(s+o,l+u),0!==o&&t.arc(s+o,l+u-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI)}(t,e):t.rect(n,i,r,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(vg);Lg.prototype.type="rect";const Pg=Lg;var Og={fill:"#000"},Rg={style:Qa({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},cf.style)},Bg=function(t){function e(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Og,n.attr(e),n}return Ma(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e<this._children.length;e++){var n=this._children[e];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},e.prototype.updateTransform=function(){var e=this.innerTransformable;e?(e.updateTransform(),e.transform&&(this.transform=e.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(e){var n=this.innerTransformable;return n?n.getLocalTransform(e):t.prototype.getLocalTransform.call(this,e)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){var t;this._childCursor=0,Wg(t=this.style),os(t.rich,Wg),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].__zr=e},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new dc(0,0,0,0),e=this._children,n=[],i=null,r=0;r<e.length;r++){var o=e[r],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(t.copy(a),t.applyTransform(s),(i=i||t.clone()).union(t)):(i=i||a.clone()).union(a)}this._rect=i||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||Og},e.prototype.setTextContent=function(t){},e.prototype._mergeStyle=function(t,e){if(!e)return t;var n=e.rich,i=t.rich||n&&{};return Ja(t,e),n&&i?(this._mergeRich(i,n),t.rich=i):i&&(t.rich=i),t},e.prototype._mergeRich=function(t,e){for(var n=us(e),i=0;i<n.length;i++){var r=n[i];t[r]=t[r]||{},Ja(t[r],e[r])}},e.prototype.getAnimationStyleProps=function(){return Rg},e.prototype._getOrCreateChild=function(t){var e=this._children[this._childCursor];return e&&e instanceof t||(e=new t),this._children[this._childCursor++]=e,e.__zr=this.__zr,e.parent=this,e},e.prototype._updatePlainTexts=function(){var t=this.style,e=t.font||Ea,n=t.padding,i=function(t,e){null!=t&&(t+="");var n,i=e.overflow,r=e.padding,o=e.font,a="truncate"===i,s=rd(o),l=Is(e.lineHeight,s),c=!!e.backgroundColor,u="truncate"===e.lineOverflow,h=!1,d=e.width,p=(n=null==d||"break"!==i&&"breakAll"!==i?t?t.split("\n"):[]:t?af(t,e.font,d,"breakAll"===i,0).lines:[]).length*l,f=Is(e.height,p);if(p>f&&u){var g=Math.floor(f/l);h=h||n.length>g,n=n.slice(0,g)}if(t&&a&&null!=d)for(var m=Zp(d,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),y={},v=0;v<n.length;v++)Kp(y,n[v],m),n[v]=y.textLine,h=h||y.isTruncated;var _=f,x=0;for(v=0;v<n.length;v++)x=Math.max(Qh(n[v],o),x);null==d&&(d=x);var b=x;return r&&(_+=r[0]+r[2],b+=r[1]+r[3],d+=r[1]+r[3]),c&&(b=d),{lines:n,height:f,outerWidth:b,outerHeight:_,lineHeight:l,calculatedLineHeight:s,contentWidth:x,contentHeight:p,width:d,isTruncated:h}}(Yg(t),t),r=Xg(t),o=!!t.backgroundColor,a=i.outerHeight,s=i.outerWidth,l=i.contentWidth,c=i.lines,u=i.lineHeight,h=this._defaultStyle;this.isTruncated=!!i.isTruncated;var d=t.x||0,p=t.y||0,f=t.align||h.align||"left",g=t.verticalAlign||h.verticalAlign||"top",m=d,y=id(p,i.contentHeight,g);if(r||n){var v=nd(d,s,f),_=id(p,a,g);r&&this._renderBackground(t,t,v,_,s,a)}y+=u/2,n&&(m=qg(d,f,n),"top"===g?y+=n[0]:"bottom"===g&&(y-=n[2]));for(var x=0,b=!1,w=(Ug("fill"in t?t.fill:(b=!0,h.fill))),S=(Gg("stroke"in t?t.stroke:o||h.autoStroke&&!b?null:(x=2,h.stroke))),M=t.textShadowBlur>0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),T=i.calculatedLineHeight,I=0;I<c.length;I++){var D=this._getOrCreateChild(bg),k=D.createStyle();D.useStyle(k),k.text=c[I],k.x=m,k.y=y,f&&(k.textAlign=f),k.textBaseline="middle",k.opacity=t.opacity,k.strokeFirst=!0,M&&(k.shadowBlur=t.textShadowBlur||0,k.shadowColor=t.textShadowColor||"transparent",k.shadowOffsetX=t.textShadowOffsetX||0,k.shadowOffsetY=t.textShadowOffsetY||0),k.stroke=S,k.fill=w,S&&(k.lineWidth=t.lineWidth||x,k.lineDash=t.lineDash,k.lineDashOffset=t.lineDashOffset||0),k.font=e,Hg(k,t),y+=u,C&&D.setBoundingRect(new dc(nd(k.x,l,k.textAlign),id(k.y,T,k.textBaseline),l,T))}},e.prototype._updateRichTexts=function(){var t=this.style,e=function(t,e){var n=new ef;if(null!=t&&(t+=""),!t)return n;for(var i,r=e.width,o=e.height,a=e.overflow,s="break"!==a&&"breakAll"!==a||null==r?null:{width:r,accumWidth:0,breakAll:"breakAll"===a},l=Yp.lastIndex=0;null!=(i=Yp.exec(t));){var c=i.index;c>l&&nf(n,t.substring(l,c),e,s),nf(n,i[2],e,s,i[1]),l=Yp.lastIndex}l<t.length&&nf(n,t.substring(l,t.length),e,s);var u=[],h=0,d=0,p=e.padding,f="truncate"===a,g="truncate"===e.lineOverflow,m={};function y(t,e,n){t.width=e,t.lineHeight=n,h+=n,d=Math.max(d,e)}t:for(var v=0;v<n.lines.length;v++){for(var _=n.lines[v],x=0,b=0,w=0;w<_.tokens.length;w++){var S=(O=_.tokens[w]).styleName&&e.rich[O.styleName]||{},M=O.textPadding=S.padding,C=M?M[1]+M[3]:0,T=O.font=S.font||e.font;O.contentHeight=rd(T);var I=Is(S.height,O.contentHeight);if(O.innerHeight=I,M&&(I+=M[0]+M[2]),O.height=I,O.lineHeight=Ds(S.lineHeight,e.lineHeight,I),O.align=S&&S.align||e.align,O.verticalAlign=S&&S.verticalAlign||"middle",g&&null!=o&&h+O.lineHeight>o){var D=n.lines.length;w>0?(_.tokens=_.tokens.slice(0,w),y(_,b,x),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v),n.isTruncated=n.isTruncated||n.lines.length<D;break t}var k=S.width,A=null==k||"auto"===k;if("string"==typeof k&&"%"===k.charAt(k.length-1))O.percentWidth=k,u.push(O),O.contentWidth=Qh(O.text,T);else{if(A){var E=S.backgroundColor,L=E&&E.image;L&&qp(L=Wp(L))&&(O.width=Math.max(O.width,L.width*I/L.height))}var P=f&&null!=r?r-b:null;null!=P&&P<O.width?!A||P<C?(O.text="",O.width=O.contentWidth=0):($p(m,O.text,P-C,T,e.ellipsis,{minChar:e.truncateMinChar}),O.text=m.text,n.isTruncated=n.isTruncated||m.isTruncated,O.width=O.contentWidth=Qh(O.text,T)):O.contentWidth=Qh(O.text,T)}O.width+=C,b+=O.width,S&&(x=Math.max(x,O.lineHeight))}y(_,b,x)}for(n.outerWidth=n.width=Is(r,d),n.outerHeight=n.height=Is(o,h),n.contentHeight=h,n.contentWidth=d,p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),v=0;v<u.length;v++){var O,R=(O=u[v]).percentWidth;O.width=parseInt(R,10)/100*n.width}return n}(Yg(t),t),n=e.width,i=e.outerWidth,r=e.outerHeight,o=t.padding,a=t.x||0,s=t.y||0,l=this._defaultStyle,c=t.align||l.align,u=t.verticalAlign||l.verticalAlign;this.isTruncated=!!e.isTruncated;var h=nd(a,i,c),d=id(s,r,u),p=h,f=d;o&&(p+=o[3],f+=o[0]);var g=p+n;Xg(t)&&this._renderBackground(t,t,h,d,i,r);for(var m=!!t.backgroundColor,y=0;y<e.lines.length;y++){for(var v=e.lines[y],_=v.tokens,x=_.length,b=v.lineHeight,w=v.width,S=0,M=p,C=g,T=x-1,I=void 0;S<x&&(!(I=_[S]).align||"left"===I.align);)this._placeToken(I,t,b,f,M,"left",m),w-=I.width,M+=I.width,S++;for(;T>=0&&"right"===(I=_[T]).align;)this._placeToken(I,t,b,f,C,"right",m),w-=I.width,C-=I.width,T--;for(M+=(n-(M-p)-(g-C)-w)/2;S<=T;)I=_[S],this._placeToken(I,t,b,f,M+I.width/2,"center",m),M+=I.width,S++;f+=b}},e.prototype._placeToken=function(t,e,n,i,r,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,c=i+n/2;"top"===l?c=i+t.height/2:"bottom"===l&&(c=i+n-t.height/2),!t.isLineHolder&&Xg(s)&&this._renderBackground(s,e,"right"===o?r-t.width:"center"===o?r-t.width/2:r,c-t.height/2,t.width,t.height);var u=!!s.backgroundColor,h=t.textPadding;h&&(r=qg(r,o,h),c-=t.height/2-h[0]-t.innerHeight/2);var d=this._getOrCreateChild(bg),p=d.createStyle();d.useStyle(p);var f=this._defaultStyle,g=!1,m=0,y=Ug("fill"in s?s.fill:"fill"in e?e.fill:(g=!0,f.fill)),v=Gg("stroke"in s?s.stroke:"stroke"in e?e.stroke:u||a||f.autoStroke&&!g?null:(m=2,f.stroke)),_=s.textShadowBlur>0||e.textShadowBlur>0;p.text=t.text,p.x=r,p.y=c,_&&(p.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,p.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",p.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),p.textAlign=o,p.textBaseline="middle",p.font=t.font||Ea,p.opacity=Ds(s.opacity,e.opacity,1),Hg(p,s),v&&(p.lineWidth=Ds(s.lineWidth,e.lineWidth,m),p.lineDash=Is(s.lineDash,e.lineDash),p.lineDashOffset=e.lineDashOffset||0,p.stroke=v),y&&(p.fill=y);var x=t.contentWidth,b=t.contentHeight;d.setBoundingRect(new dc(nd(p.x,x,p.textAlign),id(p.y,b,p.textBaseline),x,b))},e.prototype._renderBackground=function(t,e,n,i,r,o){var a,s,l,c=t.backgroundColor,u=t.borderWidth,h=t.borderColor,d=c&&c.image,p=c&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||u&&h){(a=this._getOrCreateChild(Pg)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=i,m.width=r,m.height=o,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=c||null,l.fillOpacity=Is(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(Cg)).onload=function(){g.dirtyStyle()};var y=s.style;y.image=c.image,y.x=n,y.y=i,y.width=r,y.height=o}u&&h&&((l=a.style).lineWidth=u,l.stroke=h,l.strokeOpacity=Is(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=Ds(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return jg(t)&&(e=[t.fontStyle,t.fontWeight,Vg(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&Ls(e)||t.textFont||t.font},e}(gf),Ng={left:!0,right:1,center:1},zg={top:1,bottom:1,middle:1},Fg=["fontStyle","fontWeight","fontSize","fontFamily"];function Vg(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Hg(t,e){for(var n=0;n<Fg.length;n++){var i=Fg[n],r=e[i];null!=r&&(t[i]=r)}}function jg(t){return null!=t.fontSize||t.fontFamily||t.fontWeight}function Wg(t){if(t){t.font=Bg.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||Ng[e]?e:"left";var n=t.verticalAlign;"center"===n&&(n="middle"),t.verticalAlign=null==n||zg[n]?n:"top",t.padding&&(t.padding=As(t.padding))}}function Gg(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Ug(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function qg(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function Yg(t){var e=t.text;return null!=e&&(e+=""),e}function Xg(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}const $g=Bg;var Zg=xp(),Kg=function(t,e,n,i){if(i){var r=Zg(i);r.dataIndex=n,r.dataType=e,r.seriesIndex=t,r.ssrType="chart","group"===i.type&&i.traverse(function(i){var r=Zg(i);r.seriesIndex=t,r.dataIndex=n,r.dataType=e,r.ssrType="chart"})}},Jg=1,Qg={},tm=xp(),em=xp(),nm=["emphasis","blur","select"],im=["normal","emphasis","blur","select"],rm=10,om=9,am="highlight",sm="downplay",lm="select",cm="unselect",um="toggleSelect";function hm(t){return null!=t&&"none"!==t}function dm(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function pm(t){dm(t,"emphasis",2)}function fm(t){2===t.hoverState&&dm(t,"normal",0)}function gm(t){dm(t,"blur",1)}function mm(t){1===t.hoverState&&dm(t,"normal",0)}function ym(t){t.selected=!0}function vm(t){t.selected=!1}function _m(t,e,n){e(t,n)}function xm(t,e,n){_m(t,e,n),t.isGroup&&t.traverse(function(t){_m(t,e,n)})}function bm(t,e){switch(e){case"emphasis":t.hoverState=2;break;case"normal":t.hoverState=0;break;case"blur":t.hoverState=1;break;case"select":t.selected=!0}}function wm(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,n,i){var r=n&&es(n,"select")>=0,o=!1;if(t instanceof vg){var a=tm(t),s=r&&a.selectFill||a.normalFill,l=r&&a.selectStroke||a.normalStroke;if(hm(s)||hm(l)){var c=(i=i||{}).style||{};"inherit"===c.fill?(o=!0,i=Ja({},i),(c=Ja({},c)).fill=s):!hm(c.fill)&&hm(s)?(o=!0,i=Ja({},i),(c=Ja({},c)).fill=Hu(s)):!hm(c.stroke)&&hm(l)&&(o||(i=Ja({},i),c=Ja({},c)),c.stroke=Hu(l)),i.style=c}}if(i&&null==i.z2){o||(i=Ja({},i));var u=t.z2EmphasisLift;i.z2=t.z2+(null!=u?u:rm)}return i}(this,0,e,n);if("blur"===t)return function(t,e,n){var i=es(t.currentStates,e)>=0,r=t.style.opacity,o=i?null:function(t,e,n,i){for(var r=t.style,o={},a=0;a<e.length;a++){var s=e[a],l=r[s];o[s]=null==l?i&&i[s]:l}for(a=0;a<t.animators.length;a++){var c=t.animators[a];c.__fromStateTransition&&c.__fromStateTransition.indexOf(n)<0&&"style"===c.targetName&&c.saveTo(o,e)}return o}(t,["opacity"],e,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(n=Ja({},n),a=Ja({opacity:i?r:.1*o.opacity},a),n.style=a),n}(this,t,n);if("select"===t)return function(t,e,n){if(n&&null==n.z2){n=Ja({},n);var i=t.z2SelectLift;n.z2=t.z2+(null!=i?i:om)}return n}(this,0,n)}return n}function Sm(t){t.stateProxy=wm;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=wm),n&&(n.stateProxy=wm)}function Mm(t,e){!Lm(t,e)&&!t.__highByOuter&&xm(t,pm)}function Cm(t,e){!Lm(t,e)&&!t.__highByOuter&&xm(t,fm)}function Tm(t,e){t.__highByOuter|=1<<(e||0),xm(t,pm)}function Im(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&xm(t,fm)}function Dm(t){xm(t,gm)}function km(t){xm(t,mm)}function Am(t){xm(t,ym)}function Em(t){xm(t,vm)}function Lm(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Pm(t){var e=t.getModel(),n=[],i=[];e.eachComponent(function(e,r){var o=em(r),a="series"===e,s=a?t.getViewOfSeriesModel(r):t.getViewOfComponentModel(r);!a&&i.push(s),o.isBlured&&(s.group.traverse(function(t){mm(t)}),a&&n.push(r)),o.isBlured=!1}),os(i,function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)})}function Om(t,e,n,i){var r=i.getModel();function o(t,e){for(var n=0;n<e.length;n++){var i=t.getItemGraphicEl(e[n]);i&&km(i)}}if(n=n||"coordinateSystem",null!=t&&e&&"none"!==e){var a=r.getSeriesByIndex(t),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];r.eachSeries(function(t){var r=a===t,c=t.coordinateSystem;if(c&&c.master&&(c=c.master),!("series"===n&&!r||"coordinateSystem"===n&&!(c&&s?c===s:r)||"series"===e&&r)){if(i.getViewOfSeriesModel(t).group.traverse(function(t){t.__highByOuter&&r&&"self"===e||gm(t)}),rs(e))o(t.getData(),e);else if(vs(e))for(var u=us(e),h=0;h<u.length;h++)o(t.getData(u[h]),e[u[h]]);l.push(t),em(t).isBlured=!0}}),r.eachComponent(function(t,e){if("series"!==t){var n=i.getViewOfComponentModel(e);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,r)}})}}function Rm(t,e,n){if(null!=t&&null!=e){var i=n.getModel().getComponent(t,e);if(i){em(i).isBlured=!0;var r=n.getViewOfComponentModel(i);r&&r.focusBlurEnabled&&r.group.traverse(function(t){gm(t)})}}}function Bm(t,e,n,i){var r={focusSelf:!1,dispatchers:null};if(null==t||"series"===t||null==e||null==n)return r;var o=i.getModel().getComponent(t,e);if(!o)return r;var a=i.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return r;for(var s,l=a.findHighDownDispatchers(n),c=0;c<l.length;c++)if("self"===Zg(l[c]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function Nm(t){os(t.getAllData(),function(e){var n=e.data,i=e.type;n.eachItemGraphicEl(function(e,n){t.isSelected(n,i)?Am(e):Em(e)})})}function zm(t){var e=[];return t.eachSeries(function(t){os(t.getAllData(),function(n){n.data;var i=n.type,r=t.getSelectedDataIndices();if(r.length>0){var o={dataIndex:r,seriesIndex:t.seriesIndex};null!=i&&(o.dataType=i),e.push(o)}})}),e}function Fm(t,e,n){Um(t,!0),xm(t,Sm),Hm(t,e,n)}function Vm(t,e,n,i){i?function(t){Um(t,!1)}(t):Fm(t,e,n)}function Hm(t,e,n){var i=Zg(t);null!=e?(i.focus=e,i.blurScope=n):i.focus&&(i.focus=null)}var jm=["emphasis","blur","select"],Wm={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Gm(t,e,n,i){n=n||"itemStyle";for(var r=0;r<jm.length;r++){var o=jm[r],a=e.getModel([o,n]);t.ensureState(o).style=i?i(a):a[Wm[n]]()}}function Um(t,e){var n=!1===e,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!i.__highDownDispatcher||(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!n)}function qm(t){return!(!t||!t.__highDownDispatcher)}function Ym(t){var e=t.type;return e===lm||e===cm||e===um}function Xm(t){var e=t.type;return e===am||e===sm}var $m=xp();function Zm(t,e,n,i,r){var o;if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,c=void 0,u=void 0;return i?(l=Is(i.duration,200),c=Is(i.easing,"cubicOut"),u=0):(l=e.getShallow(s?"animationDurationUpdate":"animationDuration"),c=e.getShallow(s?"animationEasingUpdate":"animationEasing"),u=e.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(c=o.easing),null!=o.delay&&(u=o.delay)),fs(u)&&(u=u(n,r)),fs(l)&&(l=l(n)),{duration:l||0,delay:u,easing:c}}return null}function Km(t,e,n,i,r,o,a){var s,l=!1;fs(r)?(a=o,o=r,r=null):vs(r)&&(o=r.cb,a=r.during,l=r.isFrom,s=r.removeOpt,r=r.dataIndex);var c="leave"===t;c||e.stopAnimation("leave");var u=Zm(t,i,r,c?s||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,r):null);if(u&&u.duration>0){var h={duration:u.duration,delay:u.delay||0,easing:u.easing,done:o,force:!!o||!!a,setToFinal:!c,scope:t,during:a};l?e.animateFrom(n,h):e.animateTo(n,h)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Jm(t,e,n,i,r,o){Km("update",t,e,n,i,r,o)}function Qm(t,e,n,i,r,o){Km("enter",t,e,n,i,r,o)}function ty(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++)if("leave"===t.animators[e].scope)return!0;return!1}function ey(t,e,n,i,r,o){ty(t)||Km("leave",t,e,n,i,r,o)}function ny(t,e,n,i){t.removeTextContent(),t.removeTextGuideLine(),ey(t,{style:{opacity:0}},e,n,i)}function iy(t,e,n){function i(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(t){t.isGroup||ny(t,e,n,i)}):ny(t,e,n,i)}function ry(t){$m(t).oldStyle=t.style}var oy={};function ay(t,e){for(var n=0;n<nm.length;n++){var i=nm[n],r=e[i],o=t.ensureState(i);o.style=o.style||{},o.style.text=r}var a=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(a,!0)}function sy(t,e,n){var i,r=t.labelFetcher,o=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;r&&(i=r.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==i&&(i=fs(t.defaultText)?t.defaultText(o,t,n):t.defaultText);for(var l={normal:i},c=0;c<nm.length;c++){var u=nm[c],h=e[u];l[u]=Is(r?r.getFormattedLabel(o,u,null,a,h&&h.get("formatter")):null,i)}return l}function ly(t,e,n,i){n=n||oy;for(var r=t instanceof $g,o=!1,a=0;a<im.length;a++)if((d=e[im[a]])&&d.getShallow("show")){o=!0;break}var s=r?t:t.getTextContent();if(o){r||(s||(s=new $g,t.setTextContent(s)),t.stateProxy&&(s.stateProxy=t.stateProxy));var l=sy(n,e),c=e.normal,u=!!c.getShallow("show"),h=uy(c,i&&i.normal,n,!1,!r);for(h.text=l.normal,r||t.setTextConfig(hy(c,n,!1)),a=0;a<nm.length;a++){var d,p=nm[a];if(d=e[p]){var f=s.ensureState(p),g=!!Is(d.getShallow("show"),u);g!==u&&(f.ignore=!g),f.style=uy(d,i&&i[p],n,!0,!r),f.style.text=l[p],r||(t.ensureState(p).textConfig=hy(d,n,!0))}}s.silent=!!c.getShallow("silent"),null!=s.style.x&&(h.x=s.style.x),null!=s.style.y&&(h.y=s.style.y),s.ignore=!u,s.useStyle(h),s.dirty(),n.enableTextSetter&&(yy(s).setLabelText=function(t){var i=sy(n,e,t);ay(s,i)})}else s&&(s.ignore=!0);t.dirty()}function cy(t,e){e=e||"label";for(var n={normal:t.getModel(e)},i=0;i<nm.length;i++){var r=nm[i];n[r]=t.getModel([r,e])}return n}function uy(t,e,n,i,r){var o={};return function(t,e,n,i,r){n=n||oy;var o,a=e.ecModel,s=a&&a.option.textStyle,l=function(t){for(var e;t&&t!==t.ecModel;){var n=(t.option||oy).rich;if(n){e=e||{};for(var i=us(n),r=0;r<i.length;r++)e[i[r]]=1}t=t.parentModel}return e}(e);if(l)for(var c in o={},l)if(l.hasOwnProperty(c)){var u=e.getModel(["rich",c]);gy(o[c]={},u,s,n,i,r,!1,!0)}o&&(t.rich=o);var h=e.get("overflow");h&&(t.overflow=h);var d=e.get("minMargin");null!=d&&(t.margin=d),gy(t,e,s,n,i,r,!0,!1)}(o,t,n,i,r),e&&Ja(o,e),o}function hy(t,e,n){e=e||{};var i,r={},o=t.getShallow("rotate"),a=Is(t.getShallow("distance"),n?null:5),s=t.getShallow("offset");return"outside"===(i=t.getShallow("position")||(n?null:"inside"))&&(i=e.defaultOutsidePosition||"top"),null!=i&&(r.position=i),null!=s&&(r.offset=s),null!=o&&(o*=Math.PI/180,r.rotation=o),null!=a&&(r.distance=a),r.outsideFill="inherit"===t.get("color")?e.inheritColor||null:"auto",r}var dy=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],py=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],fy=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function gy(t,e,n,i,r,o,a,s){n=!r&&n||oy;var l=i&&i.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),h=Is(e.getShallow("opacity"),n.opacity);"inherit"!==c&&"auto"!==c||(c=l||null),"inherit"!==u&&"auto"!==u||(u=l||null),o||(c=c||n.color,u=u||n.textBorderColor),null!=c&&(t.fill=c),null!=u&&(t.stroke=u);var d=Is(e.getShallow("textBorderWidth"),n.textBorderWidth);null!=d&&(t.lineWidth=d);var p=Is(e.getShallow("textBorderType"),n.textBorderType);null!=p&&(t.lineDash=p);var f=Is(e.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=f&&(t.lineDashOffset=f),r||null!=h||s||(h=i&&i.defaultOpacity),null!=h&&(t.opacity=h),r||o||null==t.fill&&i.inheritColor&&(t.fill=i.inheritColor);for(var g=0;g<dy.length;g++){var m=dy[g];null!=(v=Is(e.getShallow(m),n[m]))&&(t[m]=v)}for(g=0;g<py.length;g++)m=py[g],null!=(v=e.getShallow(m))&&(t[m]=v);if(null==t.verticalAlign){var y=e.getShallow("baseline");null!=y&&(t.verticalAlign=y)}if(!a||!i.disableBox){for(g=0;g<fy.length;g++){var v;m=fy[g],null!=(v=e.getShallow(m))&&(t[m]=v)}var _=e.getShallow("borderType");null!=_&&(t.borderDash=_),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!l||(t.backgroundColor=l),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!l||(t.borderColor=l)}}function my(t,e){var n=e&&e.getModel("textStyle");return Ls([t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var yy=xp();function vy(t,e,n,i){if(t){var r=yy(t);r.prevValue=r.value,r.value=n;var o=e.normal;r.valueAnimation=o.get("valueAnimation"),r.valueAnimation&&(r.precision=o.get("precision"),r.defaultInterpolatedText=i,r.statesModels=e)}}function _y(t,e,n,i,r){var o=yy(t);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=Is(o.interpolatedValue,o.prevValue),l=o.value;t.percent=0,(null==o.prevValue?Qm:Jm)(t,{percent:1},i,e,null,function(i){var c=kp(n,o.precision,s,l,i);o.interpolatedValue=1===i?null:c;var u=sy({labelDataIndex:e,labelFetcher:r,defaultText:a?a(c):c+""},o.statesModels,c);ay(t,u)})}}var xy=["textStyle","color"],by=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],wy=new $g,Sy=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(xy):null)},t.prototype.getFont=function(){return my({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<by.length;n++)e[by[n]]=this.getShallow(by[n]);return wy.useStyle(e),wy.update(),wy.getBoundingRect()},t}();const My=Sy;var Cy,Ty,Iy=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],Dy=Fp(Iy),ky=function(){function t(){}return t.prototype.getLineStyle=function(t){return Dy(this,t)},t}(),Ay=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],Ey=Fp(Ay),Ly=function(){function t(){}return t.prototype.getItemStyle=function(t,e){return Ey(this,t,e)},t}(),Py=function(){function t(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}return t.prototype.init=function(t,e,n){for(var i=[],r=3;r<arguments.length;r++)i[r-3]=arguments[r]},t.prototype.mergeOption=function(t,e){Za(this.option,t,!0)},t.prototype.get=function(t,e){return null==t?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},t.prototype.getShallow=function(t,e){var n=this.option,i=null==n?n:n[t];if(null==i&&!e){var r=this.parentModel;r&&(i=r.getShallow(t))}return i},t.prototype.getModel=function(e,n){var i=null!=e,r=i?this.parsePath(e):null;return new t(i?this._doGet(r):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(r)),this.ecModel)},t.prototype.isEmpty=function(){return null==this.option},t.prototype.restoreData=function(){},t.prototype.clone=function(){return new(0,this.constructor)($a(this.option))},t.prototype.parsePath=function(t){return"string"==typeof t?t.split("."):t},t.prototype.resolveParentPath=function(t){return t},t.prototype.isAnimationEnabled=function(){if(!Ia.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(t,e){var n=this.option;if(!t)return n;for(var i=0;i<t.length&&(!t[i]||null!=(n=n&&"object"==typeof n?n[t[i]]:null));i++);return null==n&&e&&(n=e._doGet(this.resolveParentPath(t),e.parentModel)),n},t}();Pp(Py),Cy=Py,Ty=["__\0is_clz",Rp++].join("_"),Cy.prototype[Ty]=!0,Cy.isInstance=function(t){return!(!t||!t[Ty])},is(Py,ky),is(Py,Ly),is(Py,Hp),is(Py,My);const Oy=Py;var Ry=Math.round(10*Math.random());function By(t){return[t||"",Ry++].join("_")}function Ny(t,e){return Za(Za({},t,!0),e,!0)}var zy="ZH",Fy="EN",Vy=Fy,Hy={},jy={},Wy=Ia.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||Vy).toUpperCase().indexOf(zy)>-1?zy:Vy;function Gy(t,e){t=t.toUpperCase(),jy[t]=new Oy(e),Hy[t]=e}function Uy(t){return jy[t]}Gy(Fy,{time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}}),Gy(zy,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var qy=36e5,Yy=864e5,Xy=31536e6,$y={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Zy="{yyyy}-{MM}-{dd}",Ky={year:"{yyyy}",month:"{yyyy}-{MM}",day:Zy,hour:Zy+" "+$y.hour,minute:Zy+" "+$y.minute,second:Zy+" "+$y.second,millisecond:$y.none},Jy=["year","month","day","hour","minute","second","millisecond"],Qy=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function tv(t,e){return"0000".substr(0,e-(t+="").length)+t}function ev(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function nv(t){return t===ev(t)}function iv(t,e,n,i){var r=Xd(t),o=r[av(n)](),a=r[sv(n)]()+1,s=Math.floor((a-1)/3)+1,l=r[lv(n)](),c=r["get"+(n?"UTC":"")+"Day"](),u=r[cv(n)](),h=(u-1)%12+1,d=r[uv(n)](),p=r[hv(n)](),f=r[dv(n)](),g=u>=12?"pm":"am",m=g.toUpperCase(),y=(i instanceof Oy?i:Uy(i||Wy)||jy[Vy]).getModel("time"),v=y.get("month"),_=y.get("monthAbbr"),x=y.get("dayOfWeek"),b=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,tv(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,v[a-1]).replace(/{MMM}/g,_[a-1]).replace(/{MM}/g,tv(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,tv(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[c]).replace(/{ee}/g,b[c]).replace(/{e}/g,c+"").replace(/{HH}/g,tv(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,tv(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,tv(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,tv(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,tv(f,3)).replace(/{S}/g,f+"")}function rv(t,e){var n=Xd(t),i=n[sv(e)]()+1,r=n[lv(e)](),o=n[cv(e)](),a=n[uv(e)](),s=n[hv(e)](),l=0===n[dv(e)](),c=l&&0===s,u=c&&0===a,h=u&&0===o,d=h&&1===r;return d&&1===i?"year":d?"month":h?"day":u?"hour":c?"minute":l?"second":"millisecond"}function ov(t,e,n){var i=ys(t)?Xd(t):t;switch(e=e||rv(t,n)){case"year":return i[av(n)]();case"half-year":return i[sv(n)]()>=6?1:0;case"quarter":return Math.floor((i[sv(n)]()+1)/4);case"month":return i[sv(n)]();case"day":return i[lv(n)]();case"half-day":return i[cv(n)]()/24;case"hour":return i[cv(n)]();case"minute":return i[uv(n)]();case"second":return i[hv(n)]();case"millisecond":return i[dv(n)]()}}function av(t){return t?"getUTCFullYear":"getFullYear"}function sv(t){return t?"getUTCMonth":"getMonth"}function lv(t){return t?"getUTCDate":"getDate"}function cv(t){return t?"getUTCHours":"getHours"}function uv(t){return t?"getUTCMinutes":"getMinutes"}function hv(t){return t?"getUTCSeconds":"getSeconds"}function dv(t){return t?"getUTCMilliseconds":"getMilliseconds"}function pv(t){return t?"setUTCFullYear":"setFullYear"}function fv(t){return t?"setUTCMonth":"setMonth"}function gv(t){return t?"setUTCDate":"setDate"}function mv(t){return t?"setUTCHours":"setHours"}function yv(t){return t?"setUTCMinutes":"setMinutes"}function vv(t){return t?"setUTCSeconds":"setSeconds"}function _v(t){return t?"setUTCMilliseconds":"setMilliseconds"}function xv(t){if(!ep(t))return gs(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function bv(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var wv=As;function Sv(t,e,n){function i(t){return t&&Ls(t)?t:"-"}function r(t){return!(null==t||isNaN(t)||!isFinite(t))}var o="time"===e,a=t instanceof Date;if(o||a){var s=o?Xd(t):t;if(!isNaN(+s))return iv(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return ms(t)?i(t):ys(t)&&r(t)?t+"":"-";var l=tp(t);return r(l)?xv(l):ms(t)?i(t):"boolean"==typeof t?t+"":"-"}var Mv=["a","b","c","d","e","f","g"],Cv=function(t,e){return"{"+t+(null==e?"":e)+"}"};function Tv(t,e,n){ps(e)||(e=[e]);var i=e.length;if(!i)return"";for(var r=e[0].$vars||[],o=0;o<r.length;o++){var a=Mv[o];t=t.replace(Cv(a),Cv(a,0))}for(var s=0;s<i;s++)for(var l=0;l<r.length;l++){var c=e[s][r[l]];t=t.replace(Cv(Mv[l],s),n?El(c):c)}return t}function Iv(t,e){var n=gs(t)?{color:t,extraCssText:e}:t||{},i=n.color,r=n.type;e=n.extraCssText;var o=n.renderMode||"html";return i?"html"===o?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+El(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+El(i)+";"+(e||"")+'"></span>':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===r?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}:""}function Dv(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=Xd(e),r=n?"getUTC":"get",o=i[r+"FullYear"](),a=i[r+"Month"]()+1,s=i[r+"Date"](),l=i[r+"Hours"](),c=i[r+"Minutes"](),u=i[r+"Seconds"](),h=i[r+"Milliseconds"]();return t.replace("MM",tv(a,2)).replace("M",a).replace("yyyy",o).replace("yy",tv(o%100+"",2)).replace("dd",tv(s,2)).replace("d",s).replace("hh",tv(l,2)).replace("h",l).replace("mm",tv(c,2)).replace("m",c).replace("ss",tv(u,2)).replace("s",u).replace("SSS",tv(h,3))}function kv(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}function Av(t,e){return e=e||"transparent",gs(t)?t:vs(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Ev(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Lv=os,Pv=["left","right","top","bottom","width","height"],Ov=[["width","left","right"],["height","top","bottom"]];function Rv(t,e,n,i,r){var o=0,a=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild(function(l,c){var u,h,d=l.getBoundingRect(),p=e.childAt(c+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=d.width+(f?-f.x+d.x:0);(u=o+g)>i||l.newline?(o=0,u=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(h=a+m)>r||l.newline?(o+=s+n,a=0,h=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=u+n:a=h+n)})}var Bv=Rv;function Nv(t,e,n){n=wv(n||0);var i=e.width,r=e.height,o=Rd(t.left,i),a=Rd(t.top,r),s=Rd(t.right,i),l=Rd(t.bottom,r),c=Rd(t.width,i),u=Rd(t.height,r),h=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(c)&&(c=i-s-d-o),isNaN(u)&&(u=r-l-h-a),null!=p&&(isNaN(c)&&isNaN(u)&&(p>i/r?c=.8*i:u=.8*r),isNaN(c)&&(c=p*u),isNaN(u)&&(u=c/p)),isNaN(o)&&(o=i-s-c-d),isNaN(a)&&(a=r-l-u-h),t.left||t.right){case"center":o=i/2-c/2-n[3];break;case"right":o=i-c-d}switch(t.top||t.bottom){case"middle":case"center":a=r/2-u/2-n[0];break;case"bottom":a=r-u-h}o=o||0,a=a||0,isNaN(c)&&(c=i-d-o-(s||0)),isNaN(u)&&(u=r-h-a-(l||0));var f=new dc(o+n[3],a+n[0],c,u);return f.margin=n,f}function zv(t,e,n,i,r,o){var a,s=!r||!r.hv||r.hv[0],l=!r||!r.hv||r.hv[1],c=r&&r.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===c)a="group"===t.type?new dc(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var u=t.getLocalTransform();(a=a.clone()).applyTransform(u)}var h=Nv(Qa({width:a.width,height:a.height},e),n,i),d=s?h.x-a.x:0,p=l?h.y-a.y:0;return"raw"===c?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===t&&t.markRedraw(),!0}function Fv(t){var e=t.layoutMode||t.constructor.layoutMode;return vs(e)?e:e?{type:e}:null}function Vv(t,e,n){var i=n&&n.ignoreSize;!ps(i)&&(i=[i,i]);var r=a(Ov[0],0),o=a(Ov[1],1);function a(n,r){var o={},a=0,c={},u=0;if(Lv(n,function(e){c[e]=t[e]}),Lv(n,function(t){s(e,t)&&(o[t]=c[t]=e[t]),l(o,t)&&a++,l(c,t)&&u++}),i[r])return l(e,n[1])?c[n[2]]=null:l(e,n[2])&&(c[n[1]]=null),c;if(2!==u&&a){if(a>=2)return o;for(var h=0;h<n.length;h++){var d=n[h];if(!s(o,d)&&s(t,d)){o[d]=t[d];break}}return o}return c}function s(t,e){return t.hasOwnProperty(e)}function l(t,e){return null!=t[e]&&"auto"!==t[e]}function c(t,e,n){Lv(t,function(t){e[t]=n[t]})}c(Ov[0],t,r),c(Ov[1],t,o)}function Hv(t){return jv({},t)}function jv(t,e){return e&&t&&Lv(Pv,function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}ds(Rv,"vertical"),ds(Rv,"horizontal");var Wv=xp(),Gv=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.uid=By("ec_cpt_model"),r}return Ma(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Fv(this),i=n?Hv(t):{};Za(t,e.getTheme().get(this.mainType)),Za(t,this.getDefaultOption()),n&&Vv(t,i,n)},e.prototype.mergeOption=function(t,e){Za(this.option,t,!0);var n=Fv(this);n&&Vv(this.option,t,n)},e.prototype.optionUpdated=function(t,e){},e.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Ep])}(t))return t.defaultOption;var e=Wv(this);if(!e.defaultOption){for(var n=[],i=t;i;){var r=i.prototype.defaultOption;r&&n.push(r),i=i.superClass}for(var o={},a=n.length-1;a>=0;a--)o=Za(o,n[a],!0);e.defaultOption=o}return e.defaultOption},e.prototype.getReferringComponents=function(t,e){var n=t+"Index",i=t+"Id";return Tp(this.ecModel,t,{index:this.get(n,!0),id:this.get(i,!0)},e)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(Oy);Op(Gv,Oy),zp(Gv),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var i=Lp(t);e[i.main]=n},t.determineSubType=function(n,i){var r=i.type;if(!r){var o=Lp(n).main;t.hasSubTypes(n)&&e[o]&&(r=e[o](i))}return r}}(Gv),function(t){function e(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,n,i,r){if(t.length){var o=function(t){var n={},i=[];return os(t,function(r){var o,a,s=e(n,r),l=function(t,e){var n=[];return os(t,function(t){es(e,t)>=0&&n.push(t)}),n}(s.originalDeps=(o=r,a=[],os(Gv.getClassesByMainType(o),function(t){a=a.concat(t.dependencies||t.prototype.dependencies||[])}),a=as(a,function(t){return Lp(t).main}),"dataset"!==o&&es(a,"dataset")<=0&&a.unshift("dataset"),a),t);s.entryCount=l.length,0===s.entryCount&&i.push(r),os(l,function(t){es(s.predecessor,t)<0&&s.predecessor.push(t);var i=e(n,t);es(i.successor,t)<0&&i.successor.push(r)})}),{graph:n,noEntryList:i}}(n),a=o.graph,s=o.noEntryList,l={};for(os(t,function(t){l[t]=!0});s.length;){var c=s.pop(),u=a[c],h=!!l[c];h&&(i.call(r,c,u.originalDeps.slice()),delete l[c]),os(u.successor,h?p:d)}os(l,function(){throw new Error("")})}function d(t){a[t].entryCount--,0===a[t].entryCount&&s.push(t)}function p(t){l[t]=!0,d(t)}}}(Gv);const Uv=Gv;var qv="";"undefined"!=typeof navigator&&(qv=navigator.platform||"");var Yv="rgba(0, 0, 0, 0.2)";const Xv={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Yv,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Yv,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Yv,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Yv,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Yv,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Yv,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:qv.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var $v=Fs(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Zv="original",Kv="arrayRows",Jv="objectRows",Qv="keyedColumns",t_="typedArray",e_="unknown",n_="column",i_="row",r_={Must:1,Might:2,Not:3},o_=xp();function a_(t,e,n){var i={},r=l_(e);if(!r||!t)return i;var o,a,s=[],l=[],c=e.ecModel,u=o_(c).datasetMap,h=r.uid+"_"+n.seriesLayoutBy;os(t=t.slice(),function(e,n){var r=vs(e)?e:t[n]={name:e};"ordinal"===r.type&&null==o&&(o=n,a=f(r)),i[r.name]=[]});var d=u.get(h)||u.set(h,{categoryWayDim:a,valueWayDim:0});function p(t,e,n){for(var i=0;i<n;i++)t.push(e+i)}function f(t){var e=t.dimsDef;return e?e.length:1}return os(t,function(t,e){var n=t.name,r=f(t);if(null==o){var a=d.valueWayDim;p(i[n],a,r),p(l,a,r),d.valueWayDim+=r}else o===e?(p(i[n],0,r),p(s,0,r)):(a=d.categoryWayDim,p(i[n],a,r),p(l,a,r),d.categoryWayDim+=r)}),s.length&&(i.itemName=s),l.length&&(i.seriesName=l),i}function s_(t,e,n){var i={};if(!l_(t))return i;var r,o=e.sourceFormat,a=e.dimensionsDefine;o!==Jv&&o!==Qv||os(a,function(t,e){"name"===(vs(t)?t.name:t)&&(r=e)});var s=function(){for(var t={},i={},s=[],l=0,c=Math.min(5,n);l<c;l++){var u=u_(e.data,o,e.seriesLayoutBy,a,e.startIndex,l);s.push(u);var h=u===r_.Not;if(h&&null==t.v&&l!==r&&(t.v=l),(null==t.n||t.n===t.v||!h&&s[t.n]===r_.Not)&&(t.n=l),d(t)&&s[t.n]!==r_.Not)return t;h||(u===r_.Might&&null==i.v&&l!==r&&(i.v=l),null!=i.n&&i.n!==i.v||(i.n=l))}function d(t){return null!=t.v&&null!=t.n}return d(t)?t:d(i)?i:null}();if(s){i.value=[s.v];var l=null!=r?r:s.n;i.itemName=[l],i.seriesName=[l]}return i}function l_(t){if(!t.get("data",!0))return Tp(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Mp).models[0]}function c_(t,e){return u_(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function u_(t,e,n,i,r,o){var a,s,l;if(xs(t))return r_.Not;if(i){var c=i[o];vs(c)?(s=c.name,l=c.type):gs(c)&&(s=c)}if(null!=l)return"ordinal"===l?r_.Must:r_.Not;if(e===Kv){var u=t;if(n===i_){for(var h=u[o],d=0;d<(h||[]).length&&d<5;d++)if(null!=(a=_(h[r+d])))return a}else for(d=0;d<u.length&&d<5;d++){var p=u[r+d];if(p&&null!=(a=_(p[o])))return a}}else if(e===Jv){var f=t;if(!s)return r_.Not;for(d=0;d<f.length&&d<5;d++)if((y=f[d])&&null!=(a=_(y[s])))return a}else if(e===Qv){var g=t;if(!s)return r_.Not;if(!(h=g[s])||xs(h))return r_.Not;for(d=0;d<h.length&&d<5;d++)if(null!=(a=_(h[d])))return a}else if(e===Zv){var m=t;for(d=0;d<m.length&&d<5;d++){var y,v=hp(y=m[d]);if(!ps(v))return r_.Not;if(null!=(a=_(v[o])))return a}}function _(t){var e=gs(t);return null!=t&&Number.isFinite(Number(t))&&""!==t?e?r_.Might:r_.Not:e&&"-"!==t?r_.Must:void 0}return r_.Not}var h_,d_,p_,f_=Fs(),g_=xp(),m_=xp(),y_=function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var i=lp(this.get("color",!0)),r=this.get("colorLayer",!0);return __(this,g_,i,r,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,g_)},t}();function v_(t,e,n,i){var r=lp(t.get(["aria","decal","decals"]));return __(t,m_,r,null,e,n,i)}function __(t,e,n,i,r,o,a){var s=e(o=o||t),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(r))return c[r];var u=null!=a&&i?function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i].length>e)return t[i];return t[n-1]}(i,a):n;if((u=u||n)&&u.length){var h=u[l];return r&&(c[r]=h),s.paletteIdx=(l+1)%u.length,h}}var x_="\0_ec_inner",b_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.init=function(t,e,n,i,r,o){i=i||{},this.option=null,this._theme=new Oy(i),this._locale=new Oy(r),this._optionManager=o},e.prototype.setOption=function(t,e,n){var i=M_(e);this._optionManager.setOption(t,n,i),this._resetOption(null,i)},e.prototype.resetOption=function(t,e){return this._resetOption(t,M_(e))},e.prototype._resetOption=function(t,e){var n=!1,i=this._optionManager;if(!t||"recreate"===t){var r=i.mountOption("recreate"===t);this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(r,e)):p_(this,r),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=i.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=i.getMediaOption(this);a.length&&os(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,e){var n=this.option,i=this._componentsMap,r=this._componentsCount,o=[],a=Fs(),s=e&&e.replaceMergeMainTypeMap;o_(this).datasetMap=Fs(),os(t,function(t,e){null!=t&&(Uv.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?$a(t):Za(n[e],t,!0))}),s&&s.each(function(t,e){Uv.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))}),Uv.topologicalTravel(o,Uv.getAllClassMainTypes(),function(e){var o=function(t,e,n){var i=f_.get(e);if(!i)return n;var r=i(t);return r?n.concat(r):n}(this,e,lp(t[e])),a=i.get(e),l=pp(a,o,a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll");(function(t,e,n){os(t,function(t){var i=t.newOption;vs(i)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,i){return e.type?e.type:n?n.subType:i.determineSubType(t,e)}(e,i,t.existing,n))})})(l,e,Uv),n[e]=null,i.set(e,null),r.set(e,0);var c,u=[],h=[],d=0;os(l,function(t,n){var i=t.existing,r=t.newOption;if(r){var o="series"===e,a=Uv.getClass(e,t.keyInfo.subType,!o);if(!a)return;if("tooltip"===e){if(c)return;c=!0}if(i&&i.constructor===a)i.name=t.keyInfo.name,i.mergeOption(r,this),i.optionUpdated(r,!1);else{var s=Ja({componentIndex:n},t.keyInfo);Ja(i=new a(r,this,this,s),s),t.brandNew&&(i.__requireNewView=!0),i.init(r,this,this),i.optionUpdated(null,!0)}}else i&&(i.mergeOption({},this),i.optionUpdated({},!1));i?(u.push(i.option),h.push(i),d++):(u.push(void 0),h.push(void 0))},this),n[e]=u,i.set(e,h),r.set(e,d),"series"===e&&h_(this)},this),this._seriesIndices||h_(this)},e.prototype.getOption=function(){var t=$a(this.option);return os(t,function(e,n){if(Uv.hasClass(n)){for(var i=lp(e),r=i.length,o=!1,a=r-1;a>=0;a--)i[a]&&!vp(i[a])?o=!0:(i[a]=null,!o&&r--);i.length=r,t[n]=i}}),delete t[x_],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var i=n[e||0];if(i)return i;if(null==e)for(var r=0;r<n.length;r++)if(n[r])return n[r]}},e.prototype.queryComponents=function(t){var e=t.mainType;if(!e)return[];var n,i=t.index,r=t.id,o=t.name,a=this._componentsMap.get(e);return a&&a.length?(null!=i?(n=[],os(lp(i),function(t){a[t]&&n.push(a[t])})):n=null!=r?w_("id",r,a):null!=o?w_("name",o,a):ls(a,function(t){return!!t}),S_(n,t)):[]},e.prototype.findComponents=function(t){var e,n,i,r,o,a=t.query,s=t.mainType,l=(i=s+"Index",r=s+"Id",o=s+"Name",!(n=a)||null==n[i]&&null==n[r]&&null==n[o]?null:{mainType:s,index:n[i],id:n[r],name:n[o]});return e=S_(l?this.queryComponents(l):ls(this._componentsMap.get(s),function(t){return!!t}),t),t.filter?ls(e,t.filter):e},e.prototype.eachComponent=function(t,e,n){var i=this._componentsMap;if(fs(t)){var r=e,o=t;i.each(function(t,e){for(var n=0;t&&n<t.length;n++){var i=t[n];i&&o.call(r,e,i,i.componentIndex)}})}else for(var a=gs(t)?i.get(t):vs(t)?this.findComponents(t):null,s=0;a&&s<a.length;s++){var l=a[s];l&&e.call(n,l,l.componentIndex)}},e.prototype.getSeriesByName=function(t){var e=mp(t,null);return ls(this._componentsMap.get("series"),function(t){return!!t&&null!=e&&t.name===e})},e.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},e.prototype.getSeriesByType=function(t){return ls(this._componentsMap.get("series"),function(e){return!!e&&e.subType===t})},e.prototype.getSeries=function(){return ls(this._componentsMap.get("series"),function(t){return!!t})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(t,e){d_(this),os(this._seriesIndices,function(n){var i=this._componentsMap.get("series")[n];t.call(e,i,n)},this)},e.prototype.eachRawSeries=function(t,e){os(this._componentsMap.get("series"),function(n){n&&t.call(e,n,n.componentIndex)})},e.prototype.eachSeriesByType=function(t,e,n){d_(this),os(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];r.subType===t&&e.call(n,r,i)},this)},e.prototype.eachRawSeriesByType=function(t,e,n){return os(this.getSeriesByType(t),e,n)},e.prototype.isSeriesFiltered=function(t){return d_(this),null==this._seriesIndicesMap.get(t.componentIndex)},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(t,e){d_(this);var n=[];os(this._seriesIndices,function(i){var r=this._componentsMap.get("series")[i];t.call(e,r,i)&&n.push(i)},this),this._seriesIndices=n,this._seriesIndicesMap=Fs(n)},e.prototype.restoreData=function(t){h_(this);var e=this._componentsMap,n=[];e.each(function(t,e){Uv.hasClass(e)&&n.push(e)}),Uv.topologicalTravel(n,Uv.getAllClassMainTypes(),function(n){os(e.get(n),function(e){!e||"series"===n&&function(t,e){if(e){var n=e.seriesIndex,i=e.seriesId,r=e.seriesName;return null!=n&&t.componentIndex!==n||null!=i&&t.id!==i||null!=r&&t.name!==r}}(e,t)||e.restoreData()})})},e.internalField=(h_=function(t){var e=t._seriesIndices=[];os(t._componentsMap.get("series"),function(t){t&&e.push(t.componentIndex)}),t._seriesIndicesMap=Fs(e)},d_=function(t){},void(p_=function(t,e){t.option={},t.option[x_]=1,t._componentsMap=Fs({series:[]}),t._componentsCount=Fs();var n=e.aria;vs(n)&&null==n.enabled&&(n.enabled=!0),function(t,e){var n=t.color&&!t.colorLayer;os(e,function(e,i){"colorLayer"===i&&n||Uv.hasClass(i)||("object"==typeof e?t[i]=t[i]?Za(t[i],e,!1):$a(e):null==t[i]&&(t[i]=e))})}(e,t._theme.option),Za(e,Xv,!1),t._mergeOption(e,null)})),e}(Oy);function w_(t,e,n){if(ps(e)){var i=Fs();return os(e,function(t){null!=t&&null!=mp(t,null)&&i.set(t,!0)}),ls(n,function(e){return e&&i.get(e[t])})}var r=mp(e,null);return ls(n,function(e){return e&&null!=r&&e[t]===r})}function S_(t,e){return e.hasOwnProperty("subType")?ls(t,function(t){return t&&t.subType===e.subType}):t}function M_(t){var e=Fs();return t&&os(lp(t.replaceMerge),function(t){e.set(t,!0)}),{replaceMergeMainTypeMap:e}}is(b_,y_);const C_=b_;var T_=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"];const I_=function(t){os(T_,function(e){this[e]=hs(t[e],t)},this)};var D_={},k_=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(t,e){var n=[];os(D_,function(i,r){var o=i.create(t,e);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(t,e){os(this._coordinateSystems,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(t,e){D_[t]=e},t.get=function(t){return D_[t]},t}();const A_=k_;var E_=/^(min|max)?(.+)$/,L_=function(){function t(t){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=t}return t.prototype.setOption=function(t,e,n){t&&(os(lp(t.series),function(t){t&&t.data&&xs(t.data)&&Os(t.data)}),os(lp(t.dataset),function(t){t&&t.source&&xs(t.source)&&Os(t.source)})),t=$a(t);var i=this._optionBackup,r=function(t,e,n){var i,r,o=[],a=t.baseOption,s=t.timeline,l=t.options,c=t.media,u=!!t.media,h=!!(l||s||a&&a.timeline);function d(t){os(e,function(e){e(t,n)})}return a?(r=a).timeline||(r.timeline=s):((h||u)&&(t.options=t.media=null),r=t),u&&ps(c)&&os(c,function(t){t&&t.option&&(t.query?o.push(t):i||(i=t))}),d(r),os(l,function(t){return d(t)}),os(o,function(t){return d(t.option)}),{baseOption:r,timelineOptions:l||[],mediaDefault:i,mediaList:o}}(t,e,!i);this._newBaseOption=r.baseOption,i?(r.timelineOptions.length&&(i.timelineOptions=r.timelineOptions),r.mediaList.length&&(i.mediaList=r.mediaList),r.mediaDefault&&(i.mediaDefault=r.mediaDefault)):this._optionBackup=r},t.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],$a(t?e.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(t){var e,n=this._timelineOptions;if(n.length){var i=t.getComponent("timeline");i&&(e=$a(n[i.getCurrentIndex()]))}return e},t.prototype.getMediaOption=function(t){var e,n,i=this._api.getWidth(),r=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var c=0,u=o.length;c<u;c++)P_(o[c].query,i,r)&&s.push(c);return!s.length&&a&&(s=[-1]),s.length&&(e=s,n=this._currentMediaIndices,e.join(",")!==n.join(","))&&(l=as(s,function(t){return $a(-1===t?a.option:o[t].option)})),this._currentMediaIndices=s,l},t}();function P_(t,e,n){var i={width:e,height:n,aspectratio:e/n},r=!0;return os(t,function(t,e){var n=e.match(E_);if(n&&n[1]&&n[2]){var o=n[1],a=n[2].toLowerCase();(function(t,e,n){return"min"===n?t>=e:"max"===n?t<=e:t===e})(i[a],t,o)||(r=!1)}}),r}const O_=L_;var R_=os,B_=vs,N_=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function z_(t){var e=t&&t.itemStyle;if(e)for(var n=0,i=N_.length;n<i;n++){var r=N_[n],o=e.normal,a=e.emphasis;o&&o[r]&&(t[r]=t[r]||{},t[r].normal?Za(t[r].normal,o[r]):t[r].normal=o[r],o[r]=null),a&&a[r]&&(t[r]=t[r]||{},t[r].emphasis?Za(t[r].emphasis,a[r]):t[r].emphasis=a[r],a[r]=null)}}function F_(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,r=t[e].emphasis;i&&(n?(t[e].normal=t[e].emphasis=null,Qa(t[e],i)):t[e]=i),r&&(t.emphasis=t.emphasis||{},t.emphasis[e]=r,r.focus&&(t.emphasis.focus=r.focus),r.blurScope&&(t.emphasis.blurScope=r.blurScope))}}function V_(t){F_(t,"itemStyle"),F_(t,"lineStyle"),F_(t,"areaStyle"),F_(t,"label"),F_(t,"labelLine"),F_(t,"upperLabel"),F_(t,"edgeLabel")}function H_(t,e){var n=B_(t)&&t[e],i=B_(n)&&n.textStyle;if(i)for(var r=0,o=up.length;r<o;r++){var a=up[r];i.hasOwnProperty(a)&&(n[a]=i[a])}}function j_(t){t&&(V_(t),H_(t,"label"),t.emphasis&&H_(t.emphasis,"label"))}function W_(t){return ps(t)?t:t?[t]:[]}function G_(t){return(ps(t)?t[0]:t)||{}}function U_(t){t&&os(q_,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var q_=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Y_=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],X_=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function $_(t){var e=t&&t.itemStyle;if(e)for(var n=0;n<X_.length;n++){var i=X_[n][1],r=X_[n][0];null!=e[i]&&(e[r]=e[i])}}function Z_(t){t&&"edge"===t.alignTo&&null!=t.margin&&null==t.edgeDistance&&(t.edgeDistance=t.margin)}function K_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function J_(t,e){if(t)for(var n=0;n<t.length;n++)e(t[n]),t[n]&&J_(t[n].children,e)}function Q_(t,e){(function(t,e){R_(W_(t.series),function(t){B_(t)&&function(t){if(B_(t)){z_(t),V_(t),H_(t,"label"),H_(t,"upperLabel"),H_(t,"edgeLabel"),t.emphasis&&(H_(t.emphasis,"label"),H_(t.emphasis,"upperLabel"),H_(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(z_(e),j_(e));var n=t.markLine;n&&(z_(n),j_(n));var i=t.markArea;i&&j_(i);var r=t.data;if("graph"===t.type){r=r||t.nodes;var o=t.links||t.edges;if(o&&!xs(o))for(var a=0;a<o.length;a++)j_(o[a]);os(t.categories,function(t){V_(t)})}if(r&&!xs(r))for(a=0;a<r.length;a++)j_(r[a]);if((e=t.markPoint)&&e.data){var s=e.data;for(a=0;a<s.length;a++)j_(s[a])}if((n=t.markLine)&&n.data){var l=n.data;for(a=0;a<l.length;a++)ps(l[a])?(j_(l[a][0]),j_(l[a][1])):j_(l[a])}"gauge"===t.type?(H_(t,"axisLabel"),H_(t,"title"),H_(t,"detail")):"treemap"===t.type?(F_(t.breadcrumb,"itemStyle"),os(t.levels,function(t){V_(t)})):"tree"===t.type&&V_(t.leaves)}}(t)});var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),R_(n,function(e){R_(W_(t[e]),function(t){t&&(H_(t,"axisLabel"),H_(t.axisPointer,"label"))})}),R_(W_(t.parallel),function(t){var e=t&&t.parallelAxisDefault;H_(e,"axisLabel"),H_(e&&e.axisPointer,"label")}),R_(W_(t.calendar),function(t){F_(t,"itemStyle"),H_(t,"dayLabel"),H_(t,"monthLabel"),H_(t,"yearLabel")}),R_(W_(t.radar),function(t){H_(t,"name"),t.name&&null==t.axisName&&(t.axisName=t.name,delete t.name),null!=t.nameGap&&null==t.axisNameGap&&(t.axisNameGap=t.nameGap,delete t.nameGap)}),R_(W_(t.geo),function(t){B_(t)&&(j_(t),R_(W_(t.regions),function(t){j_(t)}))}),R_(W_(t.timeline),function(t){j_(t),F_(t,"label"),F_(t,"itemStyle"),F_(t,"controlStyle",!0);var e=t.data;ps(e)&&os(e,function(t){vs(t)&&(F_(t,"label"),F_(t,"itemStyle"))})}),R_(W_(t.toolbox),function(t){F_(t,"iconStyle"),R_(t.feature,function(t){F_(t,"iconStyle")})}),H_(G_(t.axisPointer),"label"),H_(G_(t.tooltip).axisPointer,"label")})(t,e),t.series=lp(t.series),os(t.series,function(t){if(vs(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow);else if("pie"===e||"gauge"===e){if(null!=t.clockWise&&(t.clockwise=t.clockWise),Z_(t.label),(r=t.data)&&!xs(r))for(var n=0;n<r.length;n++)Z_(r[n]);null!=t.hoverOffset&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(t.emphasis.scaleSize=t.hoverOffset))}else if("gauge"===e){var i=function(t){for(var e="pointer.color".split(","),n=t,i=0;i<e.length&&null!=(n=n&&n[e[i]]);i++);return n}(t);null!=i&&function(t,e,n){for(var i,r="itemStyle.color".split(","),o=t,a=0;a<r.length-1;a++)null==o[i=r[a]]&&(o[i]={}),o=o[i];null==o[r[a]]&&(o[r[a]]=n)}(t,0,i)}else if("bar"===e){var r;if($_(t),$_(t.backgroundStyle),$_(t.emphasis),(r=t.data)&&!xs(r))for(n=0;n<r.length;n++)"object"==typeof r[n]&&($_(r[n]),$_(r[n]&&r[n].emphasis))}else if("sunburst"===e){var o=t.highlightPolicy;o&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=o)),K_(t),J_(t.data,K_)}else"graph"===e||"sankey"===e?function(t){t&&null!=t.focusNodeAdjacency&&(t.emphasis=t.emphasis||{},null==t.emphasis.focus&&(t.emphasis.focus="adjacency"))}(t):"map"===e&&(t.mapType&&!t.map&&(t.map=t.mapType),t.mapLocation&&Qa(t,t.mapLocation));null!=t.hoverAnimation&&(t.emphasis=t.emphasis||{},t.emphasis&&null==t.emphasis.scale&&(t.emphasis.scale=t.hoverAnimation)),U_(t)}}),t.dataRange&&(t.visualMap=t.dataRange),os(Y_,function(e){var n=t[e];n&&(ps(n)||(n=[n]),os(n,function(t){U_(t)}))})}function tx(t){os(t,function(e,n){var i=[],r=[NaN,NaN],o=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(o,function(o,c,u){var h,d,p=a.get(e.stackedDimension,u);if(isNaN(p))return r;s?d=a.getRawIndex(u):h=a.get(e.stackedByDimension,u);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,h)),d>=0){var y=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&y>0||"negative"===l&&y<0||"samesign"===l&&p>=0&&y>0||"samesign"===l&&p<=0&&y<0){p=Wd(p,y),f=y;break}}}return i[0]=p,i[1]=f,i})})}var ex,nx,ix,rx,ox,ax=function(t){this.data=t.data||(t.sourceFormat===Qv?{}:[]),this.sourceFormat=t.sourceFormat||e_,this.seriesLayoutBy=t.seriesLayoutBy||n_,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;n<e.length;n++){var i=e[n];null==i.type&&c_(this,n)===r_.Must&&(i.type="ordinal")}};function sx(t){return t instanceof ax}function lx(t,e,n){n=n||ux(t);var i=e.seriesLayoutBy,r=function(t,e,n,i,r){var o,a;if(!t)return{dimensionsDefine:hx(r),startIndex:a,dimensionsDetectedCount:o};if(e===Kv){var s=t;"auto"===i||null==i?dx(function(t){null!=t&&"-"!==t&&(gs(t)?null==a&&(a=1):a=0)},n,s,10):a=ys(i)?i:i?1:0,r||1!==a||(r=[],dx(function(t,e){r[e]=null!=t?t+"":""},n,s,1/0)),o=r?r.length:n===i_?s.length:s[0]?s[0].length:null}else if(e===Jv)r||(r=function(t){for(var e,n=0;n<t.length&&!(e=t[n++]););if(e)return us(e)}(t));else if(e===Qv)r||(r=[],os(t,function(t,e){r.push(e)}));else if(e===Zv){var l=hp(t[0]);o=ps(l)&&l.length||1}return{startIndex:a,dimensionsDefine:hx(r),dimensionsDetectedCount:o}}(t,n,i,e.sourceHeader,e.dimensions);return new ax({data:t,sourceFormat:n,seriesLayoutBy:i,dimensionsDefine:r.dimensionsDefine,startIndex:r.startIndex,dimensionsDetectedCount:r.dimensionsDetectedCount,metaRawOption:$a(e)})}function cx(t){return new ax({data:t,sourceFormat:xs(t)?t_:Zv})}function ux(t){var e=e_;if(xs(t))e=t_;else if(ps(t)){0===t.length&&(e=Kv);for(var n=0,i=t.length;n<i;n++){var r=t[n];if(null!=r){if(ps(r)||xs(r)){e=Kv;break}if(vs(r)){e=Jv;break}}}}else if(vs(t))for(var o in t)if(Ws(t,o)&&rs(t[o])){e=Qv;break}return e}function hx(t){if(t){var e=Fs();return as(t,function(t,n){var i={name:(t=vs(t)?t:{name:t}).name,displayName:t.displayName,type:t.type};if(null==i.name)return i;i.name+="",null==i.displayName&&(i.displayName=i.name);var r=e.get(i.name);return r?i.name+="-"+r.count++:e.set(i.name,{count:1}),i})}}function dx(t,e,n,i){if(e===i_)for(var r=0;r<n.length&&r<i;r++)t(n[r]?n[r][0]:null,r);else{var o=n[0]||[];for(r=0;r<o.length&&r<i;r++)t(o[r],r)}}function px(t){var e=t.sourceFormat;return e===Jv||e===Qv}var fx=function(){function t(t,e){var n=sx(t)?t:cx(t);this._source=n;var i=this._data=n.data;n.sourceFormat===t_&&(this._offset=0,this._dimSize=e,this._data=i),ox(this,i,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(t,e){},t.prototype.appendData=function(t){},t.prototype.clean=function(){},t.protoInitialize=function(){var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var t;ox=function(t,r,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,c=o.dimensionsDefine;if(Ja(t,rx[Cx(a,s)]),a===t_)t.getItem=e,t.count=i,t.fillStorage=n;else{var u=yx(a,s);t.getItem=hs(u,null,r,l,c);var h=xx(a,s);t.count=hs(h,null,r,l,c)}};var e=function(t,e){t-=this._offset,e=e||[];for(var n=this._data,i=this._dimSize,r=i*t,o=0;o<i;o++)e[o]=n[r+o];return e},n=function(t,e,n,i){for(var r=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=i[a],l=null==s[0]?1/0:s[0],c=null==s[1]?-1/0:s[1],u=e-t,h=n[a],d=0;d<u;d++){var p=r[d*o+a];h[t+d]=p,p<l&&(l=p),p>c&&(c=p)}s[0]=l,s[1]=c}},i=function(){return this._data?this._data.length/this._dimSize:0};function r(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}(t={})[Kv+"_"+n_]={pure:!0,appendData:r},t[Kv+"_"+i_]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[Jv]={pure:!0,appendData:r},t[Qv]={pure:!0,appendData:function(t){var e=this._data;os(t,function(t,n){for(var i=e[n]||(e[n]=[]),r=0;r<(t||[]).length;r++)i.push(t[r])})}},t[Zv]={appendData:r},t[t_]={persistent:!1,pure:!0,appendData:function(t){this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},rx=t}(),t}(),gx=function(t,e,n,i){return t[i]},mx=((ex={})[Kv+"_"+n_]=function(t,e,n,i){return t[i+e]},ex[Kv+"_"+i_]=function(t,e,n,i,r){i+=e;for(var o=r||[],a=t,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[i]:null}return o},ex[Jv]=gx,ex[Qv]=function(t,e,n,i,r){for(var o=r||[],a=0;a<n.length;a++){var s=t[n[a].name];o[a]=s?s[i]:null}return o},ex[Zv]=gx,ex);function yx(t,e){return mx[Cx(t,e)]}var vx=function(t,e,n){return t.length},_x=((nx={})[Kv+"_"+n_]=function(t,e,n){return Math.max(0,t.length-e)},nx[Kv+"_"+i_]=function(t,e,n){var i=t[0];return i?Math.max(0,i.length-e):0},nx[Jv]=vx,nx[Qv]=function(t,e,n){var i=t[n[0].name];return i?i.length:0},nx[Zv]=vx,nx);function xx(t,e){return _x[Cx(t,e)]}var bx=function(t,e,n){return t[e]},Sx=((ix={})[Kv]=bx,ix[Jv]=function(t,e,n){return t[n]},ix[Qv]=bx,ix[Zv]=function(t,e,n){var i=hp(t);return i instanceof Array?i[e]:i},ix[t_]=bx,ix);function Mx(t){return Sx[t]}function Cx(t,e){return t===Kv?t+"_"+e:t}function Tx(t,e,n){if(t){var i=t.getRawDataItem(e);if(null!=i){var r=t.getStore(),o=r.getSource().sourceFormat;if(null!=n){var a=t.getDimensionIndex(n),s=r.getDimensionProperty(a);return Mx(o)(i,a,s)}var l=i;return o===Zv&&(l=hp(i)),l}}}var Ix=/\{@(.+?)\}/g,Dx=function(){function t(){}return t.prototype.getDataParams=function(t,e){var n=this.getData(e),i=this.getRawValue(t,e),r=n.getRawIndex(t),o=n.getName(t),a=n.getRawDataItem(t),s=n.getItemVisual(t,"style"),l=s&&s[n.getItemVisual(t,"drawType")||"fill"],c=s&&s.stroke,u=this.mainType,h="series"===u,d=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:r,data:a,dataType:e,value:i,color:l,borderColor:c,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(t,e,n,i,r,o){e=e||"normal";var a=this.getData(n),s=this.getDataParams(t,n);return o&&(s.value=o.interpolatedValue),null!=i&&ps(s.value)&&(s.value=s.value[i]),r||(r=a.getItemModel(t).get("normal"===e?["label","formatter"]:[e,"label","formatter"])),fs(r)?(s.status=e,s.dimensionIndex=i,r(s)):gs(r)?Tv(r,s).replace(Ix,function(e,n){var i=n.length,r=n;"["===r.charAt(0)&&"]"===r.charAt(i-1)&&(r=+r.slice(1,i-1));var s=Tx(a,t,r);if(o&&ps(o.interpolatedValue)){var l=a.getDimensionIndex(r);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return Tx(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function kx(t){var e,n;return vs(t)?t.type&&(n=t):e=t,{text:e,frag:n}}function Ax(t){return new Ex(t)}var Ex=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,i=t&&t.skip;if(this._dirty&&n){var r=this.context;r.data=r.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!i&&(e=this._plan(this.context));var o,a=u(this._modBy),s=this._modDataCount||0,l=u(t&&t.modBy),c=t&&t.modDataCount||0;function u(t){return!(t>=1)&&(t=1),t}a===l&&s===c||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(i)),this._modBy=l,this._modDataCount=c;var h=t&&t.step;if(this._dueEnd=n?n._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(null!=h?this._dueIndex+h:1/0,this._dueEnd);if(!i&&(o||d<p)){var f=this._progress;if(ps(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],d,p,l,c);else this._doProgress(f,d,p,l,c)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(t,e,n,i,r){Lx.reset(e,n,i,r),this._callingProgress=t,this._callingProgress({start:e,end:n,count:n-e,next:Lx.next},this.context)},t.prototype._doReset=function(t){var e,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!t&&this._reset&&((e=this._reset(this.context))&&e.progress&&(n=e.forceFirstProgress,e=e.progress),ps(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var i=this._downstream;return i&&i.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(t){(this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t},t}(),Lx=function(){var t,e,n,i,r,o={reset:function(l,c,u,h){e=l,t=c,n=u,i=h,r=Math.ceil(i/n),o.next=n>1&&i>0?s:a}};return o;function a(){return e<t?e++:null}function s(){var o=e%r*n+Math.ceil(e/r),a=e>=t?null:o<i?o:e;return e++,a}}();function Px(t){throw new Error(t)}function Ox(t,e){var n=e&&e.type;return"ordinal"===n?t:("time"!==n||ys(t)||null==t||"-"===t||(t=+Xd(t)),null==t||""===t?NaN:Number(t))}"undefined"!=typeof console&&console.warn&&console.log;var Rx=Fs({number:function(t){return parseFloat(t)},time:function(t){return+Xd(t)},trim:function(t){return gs(t)?Ls(t):t}});function Bx(t){return Rx.get(t)}var Nx={lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e}},zx=function(){function t(t,e){ys(e)||Px(""),this._opFn=Nx[t],this._rvalFloat=tp(e)}return t.prototype.evaluate=function(t){return ys(t)?this._opFn(t,this._rvalFloat):this._opFn(tp(t),this._rvalFloat)},t}(),Fx=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=ys(t)?t:tp(t),i=ys(e)?e:tp(e),r=isNaN(n),o=isNaN(i);if(r&&(n=this._incomparable),o&&(i=this._incomparable),r&&o){var a=gs(t),s=gs(e);a&&(n=s?t:0),s&&(i=a?e:0)}return n<i?this._resultLT:n>i?-this._resultLT:0},t}(),Vx=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=tp(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=tp(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function Hx(t,e){return"eq"===t||"ne"===t?new Vx("eq"===t,e):Ws(Nx,t)?new zx(t,e):null}var jx=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Ox(t,e)},t}();function Wx(t){return $x(t.sourceFormat)||Px(""),t.data}function Gx(t){var e=t.sourceFormat,n=t.data;if($x(e)||Px(""),e===Kv){for(var i=[],r=0,o=n.length;r<o;r++)i.push(n[r].slice());return i}if(e===Jv){for(i=[],r=0,o=n.length;r<o;r++)i.push(Ja({},n[r]));return i}}function Ux(t,e,n){if(null!=n)return ys(n)||!isNaN(n)&&!Ws(e,n)?t[n]:Ws(e,n)?e[n]:void 0}function qx(t){return $a(t)}var Yx=Fs();function Xx(t,e,n,i){e.length||Px(""),vs(t)||Px("");var r=t.type,o=Yx.get(r);o||Px("");var a=as(e,function(t){return function(t,e){var n=new jx,i=t.data,r=n.sourceFormat=t.sourceFormat,o=t.startIndex;t.seriesLayoutBy!==n_&&Px("");var a=[],s={},l=t.dimensionsDefine;if(l)os(l,function(t,e){var n=t.name,i={index:e,name:n,displayName:t.displayName};a.push(i),null!=n&&(Ws(s,n)&&Px(""),s[n]=i)});else for(var c=0;c<t.dimensionsDetectedCount;c++)a.push({index:c});var u=yx(r,n_);e.__isBuiltIn&&(n.getRawDataItem=function(t){return u(i,o,a,t)},n.getRawData=hs(Wx,null,t)),n.cloneRawData=hs(Gx,null,t);var h=xx(r,n_);n.count=hs(h,null,i,o,a);var d=Mx(r);n.retrieveValue=function(t,e){var n=u(i,o,a,t);return p(n,e)};var p=n.retrieveValueFromItem=function(t,e){if(null!=t){var n=a[e];return n?d(t,e,n.name):void 0}};return n.getDimensionInfo=hs(Ux,null,a,s),n.cloneAllDimensionInfo=hs(qx,null,a),n}(t,o)});return as(lp(o.transform({upstream:a[0],upstreamList:a,config:$a(t.config)})),function(t,n){var i;vs(t)||Px(""),t.data||Px(""),$x(ux(t.data))||Px("");var r=e[0];if(r&&0===n&&!t.dimensions){var o=r.startIndex;o&&(t.data=r.data.slice(0,o).concat(t.data)),i={seriesLayoutBy:n_,sourceHeader:o,dimensions:r.metaRawOption.dimensions}}else i={seriesLayoutBy:n_,sourceHeader:0,dimensions:t.dimensions};return lx(t.data,i,null)})}function $x(t){return t===Kv||t===Jv}var Zx,Kx="undefined",Jx=typeof Uint32Array===Kx?Array:Uint32Array,Qx=typeof Uint16Array===Kx?Array:Uint16Array,tb=typeof Int32Array===Kx?Array:Int32Array,eb=typeof Float64Array===Kx?Array:Float64Array,nb={float:eb,int:tb,ordinal:Array,number:Array,time:eb};function ib(t){return t>65535?Jx:Qx}function rb(){return[1/0,-1/0]}function ob(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function ab(t,e,n,i,r){var o=nb[n||"float"];if(r){var a=t[e],s=a&&a.length;if(s!==i){for(var l=new o(i),c=0;c<s;c++)l[c]=a[c];t[e]=l}}else t[e]=new o(i)}var sb=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=Fs()}return t.prototype.initData=function(t,e,n){this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var i=t.getSource(),r=this.defaultDimValueGetter=Zx[i.sourceFormat];this._dimValueGetter=n||r,this._rawExtent=[],px(i),this._dimensions=as(e,function(t){return{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,i=this._dimensions,r=n.get(t);if(null!=r){if(i[r].type===e)return r}else r=i.length;return i[r]={type:e},n.set(t,r),this._chunks[r]=new nb[e||"float"](this._rawCount),this._rawExtent[r]=[1/0,-1/0],r},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],i=this._dimensions[t],r=this._rawExtent,o=i.ordinalOffset||0,a=n.length;0===o&&(r[t]=[1/0,-1/0]);for(var s=r[t],l=o;l<a;l++){var c=n[l]=e.parseAndCollect(n[l]);isNaN(c)||(s[0]=Math.min(c,s[0]),s[1]=Math.max(c,s[1]))}i.ordinalMeta=e,i.ordinalOffset=a,i.type="ordinal"},t.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},t.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},t.prototype.appendData=function(t){var e=this._provider,n=this.count();e.appendData(t);var i=e.count();return e.persistent||(i+=n),n<i&&this._initDataFromProvider(n,i,!0),[n,i]},t.prototype.appendValues=function(t,e){for(var n=this._chunks,i=this._dimensions,r=i.length,o=this._rawExtent,a=this.count(),s=a+Math.max(t.length,e||0),l=0;l<r;l++)ab(n,l,(p=i[l]).type,s,!0);for(var c=[],u=a;u<s;u++)for(var h=u-a,d=0;d<r;d++){var p=i[d],f=Zx.arrayRows.call(this,t[h]||c,p.property,h,d);n[d][u]=f;var g=o[d];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=as(o,function(t){return t.property}),c=0;c<a;c++){var u=o[c];s[c]||(s[c]=rb()),ab(r,c,u.type,e,n)}if(i.fillStorage)i.fillStorage(t,e,r,s);else for(var h=[],d=t;d<e;d++){h=i.getItem(d,h);for(var p=0;p<a;p++){var f=r[p],g=this._dimValueGetter(h,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var n=this._chunks[t];return n?n[this.getRawIndex(e)]:NaN},t.prototype.getValues=function(t,e){var n=[],i=[];if(null==e){e=t,t=[];for(var r=0;r<this._dimensions.length;r++)i.push(r)}else i=t;r=0;for(var o=i.length;r<o;r++)n.push(this.get(i[r],e));return n},t.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var n=this._chunks[t];return n?n[e]:NaN},t.prototype.getSum=function(t){var e=0;if(this._chunks[t])for(var n=0,i=this.count();n<i;n++){var r=this.get(t,n);isNaN(r)||(e+=r)}return e},t.prototype.getMedian=function(t){var e=[];this.each([t],function(t){isNaN(t)||e.push(t)});var n=e.sort(function(t,e){return t-e}),i=this.count();return 0===i?0:i%2==1?n[(i-1)/2]:(n[i/2]+n[i/2-1])/2},t.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&n<this._count&&n===t)return t;for(var i=0,r=this._count-1;i<=r;){var o=(i+r)/2|0;if(e[o]<t)i=o+1;else{if(!(e[o]>t))return o;r=o-1}}return-1},t.prototype.indicesOfNearest=function(t,e,n){var i=this._chunks[t],r=[];if(!i)return r;null==n&&(n=1/0);for(var o=1/0,a=-1,s=0,l=0,c=this.count();l<c;l++){var u=e-i[this.getRawIndex(l)],h=Math.abs(u);h<=n&&((h<o||h===o&&u>=0&&a<0)&&(o=h,a=u,s=0),u===a&&(r[s++]=l))}return r.length=s,r},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,i=this._count;if(n===Array){t=new n(i);for(var r=0;r<i;r++)t[r]=e[r]}else t=new n(e.buffer,0,i)}else for(t=new(n=ib(this._rawCount))(this.count()),r=0;r<t.length;r++)t[r]=r;return t},t.prototype.filter=function(t,e){if(!this._count)return this;for(var n=this.clone(),i=n.count(),r=new(ib(n._rawCount))(i),o=[],a=t.length,s=0,l=t[0],c=n._chunks,u=0;u<i;u++){var h=void 0,d=n.getRawIndex(u);if(0===a)h=e(u);else if(1===a)h=e(c[l][d],u);else{for(var p=0;p<a;p++)o[p]=c[t[p]][d];o[p]=u,h=e.apply(null,o)}h&&(r[s++]=d)}return s<i&&(n._indices=r),n._count=s,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(t){var e=this.clone(),n=e._count;if(!n)return this;var i=us(t),r=i.length;if(!r)return this;var o=e.count(),a=new(ib(e._rawCount))(o),s=0,l=i[0],c=t[l][0],u=t[l][1],h=e._chunks,d=!1;if(!e._indices){var p=0;if(1===r){for(var f=h[i[0]],g=0;g<n;g++)((_=f[g])>=c&&_<=u||isNaN(_))&&(a[s++]=p),p++;d=!0}else if(2===r){f=h[i[0]];var m=h[i[1]],y=t[i[1]][0],v=t[i[1]][1];for(g=0;g<n;g++){var _=f[g],x=m[g];(_>=c&&_<=u||isNaN(_))&&(x>=y&&x<=v||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===r)for(g=0;g<o;g++){var b=e.getRawIndex(g);((_=h[i[0]][b])>=c&&_<=u||isNaN(_))&&(a[s++]=b)}else for(g=0;g<o;g++){for(var w=!0,S=(b=e.getRawIndex(g),0);S<r;S++){var M=i[S];((_=h[M][b])<t[M][0]||_>t[M][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(g))}return s<o&&(e._indices=a),e._count=s,e._extent=[],e._updateGetRawIdx(),e},t.prototype.map=function(t,e){var n=this.clone(t);return this._updateDims(n,t,e),n},t.prototype.modify=function(t,e){this._updateDims(this,t,e)},t.prototype._updateDims=function(t,e,n){for(var i=t._chunks,r=[],o=e.length,a=t.count(),s=[],l=t._rawExtent,c=0;c<e.length;c++)l[e[c]]=rb();for(var u=0;u<a;u++){for(var h=t.getRawIndex(u),d=0;d<o;d++)s[d]=i[e[d]][h];s[o]=u;var p=n&&n.apply(null,s);if(null!=p)for("object"!=typeof p&&(r[0]=p,p=r),c=0;c<p.length;c++){var f=e[c],g=p[c],m=l[f],y=i[f];y&&(y[h]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}},t.prototype.lttbDownSample=function(t,e){var n,i,r,o=this.clone([t],!0),a=o._chunks[t],s=this.count(),l=0,c=Math.floor(1/e),u=this.getRawIndex(0),h=new(ib(this._rawCount))(Math.min(2*(Math.ceil(s/c)+2),s));h[l++]=u;for(var d=1;d<s-1;d+=c){for(var p=Math.min(d+c,s-1),f=Math.min(d+2*c,s),g=(f+p)/2,m=0,y=p;y<f;y++){var v=a[C=this.getRawIndex(y)];isNaN(v)||(m+=v)}m/=f-p;var _=d,x=Math.min(d+c,s),b=d-1,w=a[u];n=-1,r=_;var S=-1,M=0;for(y=_;y<x;y++){var C;v=a[C=this.getRawIndex(y)],isNaN(v)?(M++,S<0&&(S=C)):(i=Math.abs((b-g)*(v-w)-(b-y)*(m-w)))>n&&(n=i,r=C)}M>0&&M<x-_&&(h[l++]=Math.min(S,r),r=Math.max(S,r)),h[l++]=r,u=r}return h[l++]=this.getRawIndex(s-1),o._count=l,o._indices=h,o.getRawIndex=this._getRawIdx,o},t.prototype.minmaxDownSample=function(t,e){for(var n=this.clone([t],!0),i=n._chunks,r=Math.floor(1/e),o=i[t],a=this.count(),s=new(ib(this._rawCount))(2*Math.ceil(a/r)),l=0,c=0;c<a;c+=r){var u=c,h=o[this.getRawIndex(u)],d=c,p=o[this.getRawIndex(d)],f=r;c+r>a&&(f=a-c);for(var g=0;g<f;g++){var m=o[this.getRawIndex(c+g)];m<h&&(h=m,u=c+g),m>p&&(p=m,d=c+g)}var y=this.getRawIndex(u),v=this.getRawIndex(d);u<d?(s[l++]=y,s[l++]=v):(s[l++]=v,s[l++]=y)}return n._count=l,n._indices=s,n._updateGetRawIdx(),n},t.prototype.downSample=function(t,e,n,i){for(var r=this.clone([t],!0),o=r._chunks,a=[],s=Math.floor(1/e),l=o[t],c=this.count(),u=r._rawExtent[t]=[1/0,-1/0],h=new(ib(this._rawCount))(Math.ceil(c/s)),d=0,p=0;p<c;p+=s){s>c-p&&(s=c-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),y=this.getRawIndex(Math.min(p+i(a,m)||0,c-1));l[y]=m,m<u[0]&&(u[0]=m),m>u[1]&&(u[1]=m),h[d++]=y}return r._count=d,r._indices=h,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();r<o;r++){var a=this.getRawIndex(r);switch(n){case 0:e(r);break;case 1:e(i[t[0]][a],r);break;case 2:e(i[t[0]][a],i[t[1]][a],r);break;default:for(var s=0,l=[];s<n;s++)l[s]=i[t[s]][a];l[s]=r,e.apply(null,l)}}},t.prototype.getDataExtent=function(t){var e=this._chunks[t],n=[1/0,-1/0];if(!e)return n;var i,r=this.count();if(!this._indices)return this._rawExtent[t].slice();if(i=this._extent[t])return i.slice();for(var o=(i=n)[0],a=i[1],s=0;s<r;s++){var l=e[this.getRawIndex(s)];l<o&&(o=l),l>a&&(a=l)}return i=[o,a],this._extent[t]=i,i},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],i=this._chunks,r=0;r<i.length;r++)n.push(i[r][e]);return n},t.prototype.clone=function(e,n){var i=new t,r=this._chunks,o=e&&ss(e,function(t,e){return t[e]=!0,t},{});if(o)for(var a=0;a<r.length;a++)i._chunks[a]=o[a]?ob(r[a]):r[a];else i._chunks=r;return this._copyCommonProps(i),n||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},t.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=$a(this._extent),t._rawExtent=$a(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var n=this._indices.length;e=new t(n);for(var i=0;i<n;i++)e[i]=this._indices[i]}else e=new t(this._indices);return e}return null},t.prototype._getRawIdxIdentity=function(t){return t},t.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,i){return Ox(t[i],this._dimensions[i])}Zx={arrayRows:t,objectRows:function(t,e,n,i){return Ox(t[e],this._dimensions[i])},keyedColumns:t,original:function(t,e,n,i){var r=t&&(null==t.value?t:t.value);return Ox(r instanceof Array?r[i]:r,this._dimensions[i])},typedArray:function(t,e,n,i){return t[i]}}}(),t}();const lb=sb;var cb=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var t,e,n=this._sourceHost,i=this._getUpstreamSourceManagers(),r=!!i.length;if(hb(n)){var o=n,a=void 0,s=void 0,l=void 0;if(r){var c=i[0];c.prepareSource(),a=(l=c.getSource()).data,s=l.sourceFormat,e=[c._getVersionSign()]}else s=xs(a=o.get("data",!0))?t_:Zv,e=[];var u=this._getSourceMetaRawOption()||{},h=l&&l.metaRawOption||{},d=Is(u.seriesLayoutBy,h.seriesLayoutBy)||null,p=Is(u.sourceHeader,h.sourceHeader),f=Is(u.dimensions,h.dimensions);t=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||f?[lx(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(r){var m=this._applyTransform(i);t=m.sourceList,e=m.upstreamSignList}else t=[lx(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,i=n.get("transform",!0),r=n.get("fromTransformResult",!0);null!=r&&1!==t.length&&db("");var o,a=[],s=[];return os(t,function(t){t.prepareSource();var e=t.getSource(r||0);null==r||e||db(""),a.push(e),s.push(t._getVersionSign())}),i?e=function(t,e){var n=lp(t),i=n.length;i||Px("");for(var r=0,o=i;r<o;r++)e=Xx(n[r],e),r!==o-1&&(e.length=Math.max(e.length,1));return e}(i,a,n.componentIndex):null!=r&&(e=[(o=a[0],new ax({data:o.data,sourceFormat:o.sourceFormat,seriesLayoutBy:o.seriesLayoutBy,dimensionsDefine:$a(o.dimensionsDefine),startIndex:o.startIndex,dimensionsDetectedCount:o.dimensionsDetectedCount}))]),{sourceList:e,upstreamSignList:s}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var n=t[e];if(n._isDirty()||this._upstreamSignList[e]!==n._getVersionSign())return!0}},t.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(t)}return e},t.prototype.getSharedDataStore=function(t){var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},t.prototype._innerGetDataStore=function(t,e,n){var i=this._storeList,r=i[0];r||(r=i[0]={});var o=r[n];if(!o){var a=this._getUpstreamSourceManagers()[0];hb(this._sourceHost)&&a?o=a._innerGetDataStore(t,e,n):(o=new lb).initData(new fx(e,t.length),t),r[n]=o}return o},t.prototype._getUpstreamSourceManagers=function(){var t=this._sourceHost;if(hb(t)){var e=l_(t);return e?[e.getSourceManager()]:[]}return as(function(t){return t.get("transform",!0)||t.get("fromTransformResult",!0)?Tp(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Mp).models:[]}(t),function(t){return t.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var t,e,n,i=this._sourceHost;if(hb(i))t=i.get("seriesLayoutBy",!0),e=i.get("sourceHeader",!0),n=i.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var r=i;t=r.get("seriesLayoutBy",!0),e=r.get("sourceHeader",!0),n=r.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:e,dimensions:n}},t}();function ub(t){t.option.transform&&Os(t.option.transform)}function hb(t){return"series"===t.mainType}function db(t){throw new Error(t)}function pb(t){var e=t.lineHeight;return null==e?"line-height:1":"line-height:"+El(e+"")+"px"}function fb(t,e){var n=t.color||"#6e7079",i=t.fontSize||12,r=t.fontWeight||"400",o=t.color||"#464646",a=t.fontSize||14,s=t.fontWeight||"900";return"html"===e?{nameStyle:"font-size:"+El(i+"")+"px;color:"+El(n)+";font-weight:"+El(r+""),valueStyle:"font-size:"+El(a+"")+"px;color:"+El(o)+";font-weight:"+El(s+"")}:{nameStyle:{fontSize:i,fill:n,fontWeight:r},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var gb=[0,10,20,30],mb=["","\n","\n\n","\n\n\n"];function yb(t,e){return e.type=t,e}function vb(t){return"section"===t.type}function _b(t){return vb(t)?bb:wb}function xb(t){if(vb(t)){var e=0,n=t.blocks.length,i=n>1||n>0&&!t.noHeader;return os(t.blocks,function(t){var n=xb(t);n>=e&&(e=n+ +(i&&(!n||vb(t)&&!t.noHeader)))}),e}return 0}function bb(t,e,n,i){var r,o=e.noHeader,a=(r=xb(e),{html:gb[r],richText:mb[r]}),s=[],l=e.blocks||[];Es(!l||ps(l)),l=l||[];var c=t.orderMode;if(e.sortBlocks&&c){l=l.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(Ws(u,c)){var h=new Fx(u[c],null);l.sort(function(t,e){return h.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===c&&l.reverse()}os(l,function(n,r){var o=e.valueFormatter,l=_b(n)(o?Ja(Ja({},t),{valueFormatter:o}):t,n,r>0?a.html:0,i);null!=l&&s.push(l)});var d="richText"===t.renderMode?s.join(a.richText):Mb(i,s.join(""),o?n:a.html);if(o)return d;var p=Sv(e.header,"ordinal",t.useUTC),f=fb(i,t.renderMode).nameStyle,g=pb(i);return"richText"===t.renderMode?Cb(t,p,f)+a.richText+d:Mb(i,'<div style="'+f+";"+g+';">'+El(p)+"</div>"+d,n)}function wb(t,e,n,i){var r=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(t){return as(t=ps(t)?t:[t],function(t,e){return Sv(t,ps(p)?p[e]:p,c)})};if(!o||!a){var h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",r),d=o?"":Sv(l,"ordinal",c),p=e.valueType,f=a?[]:u(e.value,e.dataIndex),g=!s||!o,m=!s&&o,y=fb(i,r),v=y.nameStyle,_=y.valueStyle;return"richText"===r?(s?"":h)+(o?"":Cb(t,d,v))+(a?"":function(t,e,n,i,r){var o=[r],a=i?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ps(e)?e.join(" "):e,o)}(t,f,g,m,_)):Mb(i,(s?"":h)+(o?"":function(t,e,n){return'<span style="'+n+";"+(e?"margin-left:2px":"")+'">'+El(t)+"</span>"}(d,!s,v))+(a?"":function(t,e,n,i){return'<span style="'+(e?"float:right;margin-left:"+(n?"10px":"20px"):"")+";"+i+'">'+as(t=ps(t)?t:[t],function(t){return El(t)}).join("&nbsp;&nbsp;")+"</span>"}(f,g,m,_)),n)}}function Sb(t,e,n,i,r,o){if(t)return _b(t)({useUTC:r,renderMode:n,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function Mb(t,e,n){return'<div style="margin: '+n+"px 0 0;"+pb(t)+';">'+e+'<div style="clear:both"></div></div>'}function Cb(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Tb(t,e){return Av(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function Ib(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var Db=function(){function t(){this.richTextStyles={},this._nextStyleNameId=np()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var i="richText"===n?this._generateStyleName():null,r=Iv({color:e,type:t,renderMode:n,markerId:i});return gs(r)?r:(this.richTextStyles[i]=r.style,r.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};ps(e)?os(e,function(t){return Ja(n,t)}):Ja(n,e);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+t+"}"},t}();function kb(t){var e,n,i,r,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),c=l.mapDimensionsAll("defaultedTooltip"),u=c.length,h=o.getRawValue(a),d=ps(h),p=Tb(o,a);if(u>1||d&&!u){var f=function(t,e,n,i,r){var o=e.getData(),a=ss(t,function(t,e,n){var i=o.getDimensionInfo(n);return t||i&&!1!==i.tooltip&&null!=i.displayName},!1),s=[],l=[],c=[];function u(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?c.push(yb("nameValue",{markerType:"subItem",markerColor:r,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return i.length?os(i,function(t){u(Tx(o,n,t),t)}):os(t,u),{inlineValues:s,inlineValueTypes:l,blocks:c}}(h,o,a,c,p);e=f.inlineValues,n=f.inlineValueTypes,i=f.blocks,r=f.inlineValues[0]}else if(u){var g=l.getDimensionInfo(c[0]);r=e=Tx(l,a,c[0]),n=g.type}else r=e=d?h[0]:h;var m=yp(o),y=m&&o.name||"",v=l.getName(a),_=s?y:v;return yb("section",{header:y,noHeader:s||!m,sortParam:r,blocks:[yb("nameValue",{markerType:"item",markerColor:p,name:_,noName:!Ls(_),value:e,valueType:n,dataIndex:a})].concat(i||[])})}var Ab=xp();function Eb(t,e){return t.getName(e)||t.getId(e)}var Lb="__universalTransitionEnabled",Pb=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return Ma(e,t),e.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Ax({count:Rb,reset:Bb}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(Ab(this).sourceManager=new cb(this)).prepareSource();var i=this.getInitialData(t,n);zb(i,this),this.dataTask.context.data=i,Ab(this).dataBeforeProcessed=i,Ob(this),this._initSelectedMapFromData(i)},e.prototype.mergeDefaultAndTheme=function(t,e){var n=Fv(this),i=n?Hv(t):{},r=this.subType;Uv.hasClass(r)&&(r+="Series"),Za(t,e.getTheme().get(this.subType)),Za(t,this.getDefaultOption()),cp(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&Vv(t,i,n)},e.prototype.mergeOption=function(t,e){t=Za(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Fv(this);n&&Vv(this.option,t,n);var i=Ab(this).sourceManager;i.dirty(),i.prepareSource();var r=this.getInitialData(t,e);zb(r,this),this.dataTask.dirty(),this.dataTask.context.data=r,Ab(this).dataBeforeProcessed=r,Ob(this),this._initSelectedMapFromData(r)},e.prototype.fillDataTextStyle=function(t){if(t&&!xs(t))for(var e=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&cp(t[n],"label",e)},e.prototype.getInitialData=function(t,e){},e.prototype.appendData=function(t){this.getRawData().appendData(t.data)},e.prototype.getData=function(t){var e=Vb(this);if(e){var n=e.context.data;return null!=t&&n.getLinkedData?n.getLinkedData(t):n}return Ab(this).data},e.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},e.prototype.setData=function(t){var e=Vb(this);if(e){var n=e.context;n.outputData=t,e!==this.dataTask&&(n.data=t)}Ab(this).data=t},e.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return Fs(t)},e.prototype.getSourceManager=function(){return Ab(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Ab(this).dataBeforeProcessed},e.prototype.getColorBy=function(){return this.get("colorBy")||"series"},e.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},e.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},e.prototype.formatTooltip=function(t,e,n){return kb({series:this,dataIndex:t,multipleSeries:e})},e.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(Ia.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,e,n){var i=this.ecModel,r=y_.prototype.getColorFromPalette.call(this,t,e,n);return r||(r=i.getColorFromPalette(t,e,n)),r},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},e.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var i=this.option.selectedMode,r=this.getData(e);if("series"===i||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<t.length;o++){var a=Eb(r,t[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},e.prototype.toggleSelect=function(t,e){for(var n=[],i=0;i<t.length;i++)n[0]=t[i],this.isSelected(t[i],e)?this.unselect(n,e):this.select(n,e)},e.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,e=us(t),n=[],i=0;i<e.length;i++){var r=t[e[i]];r>=0&&n.push(r)}return n},e.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var i=this.getData(e);return("all"===n||n[Eb(i,t)])&&!i.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[Lb])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},e.prototype._innerSelect=function(t,e){var n,i,r=this.option,o=r.selectedMode,a=e.length;if(o&&a)if("series"===o)r.selectedMap="all";else if("multiple"===o){vs(r.selectedMap)||(r.selectedMap={});for(var s=r.selectedMap,l=0;l<a;l++){var c=e[l];s[h=Eb(t,c)]=!0,this._selectedDataIndicesMap[h]=t.getRawIndex(c)}}else if("single"===o||!0===o){var u=e[a-1],h=Eb(t,u);r.selectedMap=((n={})[h]=!0,n),this._selectedDataIndicesMap=((i={})[h]=t.getRawIndex(u),i)}},e.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var e=[];t.hasItemOption&&t.each(function(n){var i=t.getRawDataItem(n);i&&i.selected&&e.push(n)}),e.length>0&&this._innerSelect(t,e)}},e.registerClass=function(t){return Uv.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Uv);function Ob(t){var e=t.name;yp(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),i=[];return os(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&i.push(n.displayName)}),i.join(" ")}(t)||e)}function Rb(t){return t.model.getRawData().count()}function Bb(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),Nb}function Nb(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function zb(t,e){os(Vs(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,ds(Fb,e))})}function Fb(t,e){var n=Vb(t);return n&&n.setOutputEnd((e||this).count()),e}function Vb(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var i=n.currentTask;if(i){var r=i.agentStubMap;r&&(i=r.get(t.uid))}return i}}is(Pb,Dx),is(Pb,y_),Op(Pb,Uv);const Hb=Pb;var jb=function(){function t(){this.group=new _d,this.uid=By("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){},t.prototype.updateLayout=function(t,e,n,i){},t.prototype.updateVisual=function(t,e,n,i){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Pp(jb),zp(jb);const Wb=jb;function Gb(){var t=xp();return function(e){var n=t(e),i=e.pipelineContext,r=!!n.large,o=!!n.progressiveRender,a=n.large=!(!i||!i.large),s=n.progressiveRender=!(!i||!i.progressiveRender);return!(r===a&&o===s)&&"reset"}}var Ub=Zf.CMD,qb=[[],[],[]],Yb=Math.sqrt,Xb=Math.atan2;function $b(t,e){if(e){var n,i,r,o,a,s,l=t.data,c=t.len(),u=Ub.M,h=Ub.C,d=Ub.L,p=Ub.R,f=Ub.A,g=Ub.Q;for(r=0,o=0;r<c;){switch(n=l[r++],o=r,i=0,n){case u:case d:i=1;break;case h:i=3;break;case g:i=2;break;case f:var m=e[4],y=e[5],v=Yb(e[0]*e[0]+e[1]*e[1]),_=Yb(e[2]*e[2]+e[3]*e[3]),x=Xb(-e[1]/_,e[0]/v);l[r]*=v,l[r++]+=m,l[r]*=_,l[r++]+=y,l[r++]*=v,l[r++]*=_,l[r++]+=x,l[r++]+=x,o=r+=2;break;case p:s[0]=l[r++],s[1]=l[r++],fl(s,s,e),l[o++]=s[0],l[o++]=s[1],s[0]+=l[r++],s[1]+=l[r++],fl(s,s,e),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<i;a++){var b=qb[a];b[0]=l[r++],b[1]=l[r++],fl(b,b,e),l[o++]=b[0],l[o++]=b[1]}}t.increaseVersion()}}var Zb=Math.sqrt,Kb=Math.sin,Jb=Math.cos,Qb=Math.PI;function tw(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ew(t,e){return(t[0]*e[0]+t[1]*e[1])/(tw(t)*tw(e))}function nw(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ew(t,e))}function iw(t,e,n,i,r,o,a,s,l,c,u){var h=l*(Qb/180),d=Jb(h)*(t-n)/2+Kb(h)*(e-i)/2,p=-1*Kb(h)*(t-n)/2+Jb(h)*(e-i)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=Zb(f),s*=Zb(f));var g=(r===o?-1:1)*Zb((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,y=g*-s*d/a,v=(t+n)/2+Jb(h)*m-Kb(h)*y,_=(e+i)/2+Kb(h)*m+Jb(h)*y,x=nw([1,0],[(d-m)/a,(p-y)/s]),b=[(d-m)/a,(p-y)/s],w=[(-1*d-m)/a,(-1*p-y)/s],S=nw(b,w);if(ew(b,w)<=-1&&(S=Qb),ew(b,w)>=1&&(S=0),S<0){var M=Math.round(S/Qb*1e6)/1e6;S=2*Qb+M%2*Qb}u.addData(c,v,_,a,s,x,S,h,o)}var rw=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,ow=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,aw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.applyTransform=function(t){},e}(vg);function sw(t){return null!=t.setData}function lw(t,e){var n=function(t){var e=new Zf;if(!t)return e;var n,i=0,r=0,o=i,a=r,s=Zf.CMD,l=t.match(rw);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],h=u.charAt(0),d=void 0,p=u.match(ow)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var y=void 0,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,M=i,C=r,T=void 0,I=void 0;switch(h){case"l":i+=p[m++],r+=p[m++],d=s.L,e.addData(d,i,r);break;case"L":i=p[m++],r=p[m++],d=s.L,e.addData(d,i,r);break;case"m":i+=p[m++],r+=p[m++],d=s.M,e.addData(d,i,r),o=i,a=r,h="l";break;case"M":i=p[m++],r=p[m++],d=s.M,e.addData(d,i,r),o=i,a=r,h="L";break;case"h":i+=p[m++],d=s.L,e.addData(d,i,r);break;case"H":i=p[m++],d=s.L,e.addData(d,i,r);break;case"v":r+=p[m++],d=s.L,e.addData(d,i,r);break;case"V":r=p[m++],d=s.L,e.addData(d,i,r);break;case"C":d=s.C,e.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),i=p[m-2],r=p[m-1];break;case"c":d=s.C,e.addData(d,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r),i+=p[m-2],r+=p[m-1];break;case"S":y=i,v=r,T=e.len(),I=e.data,n===s.C&&(y+=i-I[T-4],v+=r-I[T-3]),d=s.C,M=p[m++],C=p[m++],i=p[m++],r=p[m++],e.addData(d,y,v,M,C,i,r);break;case"s":y=i,v=r,T=e.len(),I=e.data,n===s.C&&(y+=i-I[T-4],v+=r-I[T-3]),d=s.C,M=i+p[m++],C=r+p[m++],i+=p[m++],r+=p[m++],e.addData(d,y,v,M,C,i,r);break;case"Q":M=p[m++],C=p[m++],i=p[m++],r=p[m++],d=s.Q,e.addData(d,M,C,i,r);break;case"q":M=p[m++]+i,C=p[m++]+r,i+=p[m++],r+=p[m++],d=s.Q,e.addData(d,M,C,i,r);break;case"T":y=i,v=r,T=e.len(),I=e.data,n===s.Q&&(y+=i-I[T-4],v+=r-I[T-3]),i=p[m++],r=p[m++],d=s.Q,e.addData(d,y,v,i,r);break;case"t":y=i,v=r,T=e.len(),I=e.data,n===s.Q&&(y+=i-I[T-4],v+=r-I[T-3]),i+=p[m++],r+=p[m++],d=s.Q,e.addData(d,y,v,i,r);break;case"A":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],iw(M=i,C=r,i=p[m++],r=p[m++],w,S,_,x,b,d=s.A,e);break;case"a":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],iw(M=i,C=r,i+=p[m++],r+=p[m++],w,S,_,x,b,d=s.A,e)}}"z"!==h&&"Z"!==h||(d=s.Z,e.addData(d),i=o,r=a),n=d}return e.toStatic(),e}(t),i=Ja({},e);return i.buildPath=function(t){if(sw(t))t.setData(n.data),(e=t.getContext())&&t.rebuildPath(e,1);else{var e=t;n.rebuildPath(e,1)}},i.applyTransform=function(t){$b(n,t),this.dirtyShape()},i}function cw(t,e){return new aw(lw(t,e))}function uw(t,e){e=e||{};var n=new vg;return t.shape&&n.setShape(t.shape),n.setStyle(t.style),e.bakeTransform?$b(n.path,t.getComputedTransform()):e.toLocal?n.setLocalTransform(t.getComputedTransform()):n.copyTransform(t),n.buildPath=t.buildPath,n.applyTransform=n.applyTransform,n.z=t.z,n.z2=t.z2,n.zlevel=t.zlevel,n}var hw=function(){this.cx=0,this.cy=0,this.r=0},dw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new hw},e.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(vg);dw.prototype.type="circle";const pw=dw;var fw=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},gw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new fw},e.prototype.buildPath=function(t,e){var n=.5522848,i=e.cx,r=e.cy,o=e.rx,a=e.ry,s=o*n,l=a*n;t.moveTo(i-o,r),t.bezierCurveTo(i-o,r-l,i-s,r-a,i,r-a),t.bezierCurveTo(i+s,r-a,i+o,r-l,i+o,r),t.bezierCurveTo(i+o,r+l,i+s,r+a,i,r+a),t.bezierCurveTo(i-s,r+a,i-o,r+l,i-o,r),t.closePath()},e}(vg);gw.prototype.type="ellipse";const mw=gw;var yw=Math.PI,vw=2*yw,_w=Math.sin,xw=Math.cos,bw=Math.acos,ww=Math.atan2,Sw=Math.abs,Mw=Math.sqrt,Cw=Math.max,Tw=Math.min,Iw=1e-4;function Dw(t,e,n,i,r,o,a){var s=t-n,l=e-i,c=(a?o:-o)/Mw(s*s+l*l),u=c*l,h=-c*s,d=t+u,p=e+h,f=n+u,g=i+h,m=(d+f)/2,y=(p+g)/2,v=f-d,_=g-p,x=v*v+_*_,b=r-o,w=d*g-f*p,S=(_<0?-1:1)*Mw(Cw(0,b*b*x-w*w)),M=(w*_-v*S)/x,C=(-w*v-_*S)/x,T=(w*_+v*S)/x,I=(-w*v+_*S)/x,D=M-m,k=C-y,A=T-m,E=I-y;return D*D+k*k>A*A+E*E&&(M=T,C=I),{cx:M,cy:C,x0:-u,y0:-h,x1:M*(r/b-1),y1:C*(r/b-1)}}var kw=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Aw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new kw},e.prototype.buildPath=function(t,e){!function(t,e){var n,i=Cw(e.r,0),r=Cw(e.r0||0,0),o=i>0;if(o||r>0){if(o||(i=r,r=0),r>i){var a=i;i=r,r=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var c=e.cx,u=e.cy,h=!!e.clockwise,d=Sw(l-s),p=d>vw&&d%vw;if(p>Iw&&(d=p),i>Iw)if(d>vw-Iw)t.moveTo(c+i*xw(s),u+i*_w(s)),t.arc(c,u,i,s,l,!h),r>Iw&&(t.moveTo(c+r*xw(l),u+r*_w(l)),t.arc(c,u,r,l,s,h));else{var f=void 0,g=void 0,m=void 0,y=void 0,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,M=void 0,C=void 0,T=void 0,I=void 0,D=void 0,k=void 0,A=i*xw(s),E=i*_w(s),L=r*xw(l),P=r*_w(l),O=d>Iw;if(O){var R=e.cornerRadius;R&&(n=function(t){var e;if(ps(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],y=n[3]);var B=Sw(i-r)/2;if(v=Tw(B,m),_=Tw(B,y),x=Tw(B,f),b=Tw(B,g),M=w=Cw(v,_),C=S=Cw(x,b),(w>Iw||S>Iw)&&(T=i*xw(l),I=i*_w(l),D=r*xw(s),k=r*_w(s),d<yw)){var N=function(t,e,n,i,r,o,a,s){var l=n-t,c=i-e,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<Iw))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(A,E,D,k,T,I,L,P);if(N){var z=A-N[0],F=E-N[1],V=T-N[0],H=I-N[1],j=1/_w(bw((z*V+F*H)/(Mw(z*z+F*F)*Mw(V*V+H*H)))/2),W=Mw(N[0]*N[0]+N[1]*N[1]);M=Tw(w,(i-W)/(j+1)),C=Tw(S,(r-W)/(j-1))}}}if(O)if(M>Iw){var G=Tw(m,M),U=Tw(y,M),q=Dw(D,k,A,E,i,G,h),Y=Dw(T,I,L,P,i,U,h);t.moveTo(c+q.cx+q.x0,u+q.cy+q.y0),M<w&&G===U?t.arc(c+q.cx,u+q.cy,M,ww(q.y0,q.x0),ww(Y.y0,Y.x0),!h):(G>0&&t.arc(c+q.cx,u+q.cy,G,ww(q.y0,q.x0),ww(q.y1,q.x1),!h),t.arc(c,u,i,ww(q.cy+q.y1,q.cx+q.x1),ww(Y.cy+Y.y1,Y.cx+Y.x1),!h),U>0&&t.arc(c+Y.cx,u+Y.cy,U,ww(Y.y1,Y.x1),ww(Y.y0,Y.x0),!h))}else t.moveTo(c+A,u+E),t.arc(c,u,i,s,l,!h);else t.moveTo(c+A,u+E);r>Iw&&O?C>Iw?(G=Tw(f,C),q=Dw(L,P,T,I,r,-(U=Tw(g,C)),h),Y=Dw(A,E,D,k,r,-G,h),t.lineTo(c+q.cx+q.x0,u+q.cy+q.y0),C<S&&G===U?t.arc(c+q.cx,u+q.cy,C,ww(q.y0,q.x0),ww(Y.y0,Y.x0),!h):(U>0&&t.arc(c+q.cx,u+q.cy,U,ww(q.y0,q.x0),ww(q.y1,q.x1),!h),t.arc(c,u,r,ww(q.cy+q.y1,q.cx+q.x1),ww(Y.cy+Y.y1,Y.cx+Y.x1),h),G>0&&t.arc(c+Y.cx,u+Y.cy,G,ww(Y.y1,Y.x1),ww(Y.y0,Y.x0),!h))):(t.lineTo(c+L,u+P),t.arc(c,u,r,l,s,h)):t.lineTo(c+L,u+P)}else t.moveTo(c,u);t.closePath()}}}(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(vg);Aw.prototype.type="sector";const Ew=Aw;var Lw=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},Pw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new Lw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},e}(vg);Pw.prototype.type="ring";const Ow=Pw;function Rw(t,e,n){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=function(t,e,n,i){var r,o,a,s,l=[],c=[],u=[],h=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d<p;d++)gl(a,a,t[d]),ml(s,s,t[d]);gl(a,a,i[0]),ml(s,s,i[1])}for(d=0,p=t.length;d<p;d++){var f=t[d];if(n)r=t[d?d-1:p-1],o=t[(d+1)%p];else{if(0===d||d===p-1){l.push(Xs(t[d]));continue}r=t[d-1],o=t[d+1]}Js(c,o,r),al(c,c,e);var g=ll(f,r),m=ll(f,o),y=g+m;0!==y&&(g/=y,m/=y),al(u,c,-g),al(h,c,m);var v=Zs([],f,u),_=Zs([],f,h);i&&(ml(v,v,a),gl(v,v,s),ml(_,_,a),gl(_,_,s)),l.push(v),l.push(_)}return n&&l.push(l.shift()),l}(r,i,n,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var a=r.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],c=o[2*s+1],u=r[(s+1)%a];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(r[0][0],r[0][1]),s=1;for(var h=r.length;s<h;s++)t.lineTo(r[s][0],r[s][1])}n&&t.closePath()}}var Bw=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},Nw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new Bw},e.prototype.buildPath=function(t,e){Rw(t,e,!0)},e}(vg);Nw.prototype.type="polygon";const zw=Nw;var Fw=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},Vw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Fw},e.prototype.buildPath=function(t,e){Rw(t,e,!1)},e}(vg);Vw.prototype.type="polyline";const Hw=Vw;var jw={},Ww=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},Gw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Ww},e.prototype.buildPath=function(t,e){var n,i,r,o;if(this.subPixelOptimize){var a=Ig(jw,e,this.style);n=a.x1,i=a.y1,r=a.x2,o=a.y2}else n=e.x1,i=e.y1,r=e.x2,o=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,i),s<1&&(r=n*(1-s)+r*s,o=i*(1-s)+o*s),t.lineTo(r,o))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(vg);Gw.prototype.type="line";const Uw=Gw;var qw=[],Yw=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function Xw(t,e,n){var i=t.cpx2,r=t.cpy2;return null!=i||null!=r?[(n?Zc:$c)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?Zc:$c)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?iu:nu)(t.x1,t.cpx1,t.x2,e),(n?iu:nu)(t.y1,t.cpy1,t.y2,e)]}var $w=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Yw},e.prototype.buildPath=function(t,e){var n=e.x1,i=e.y1,r=e.x2,o=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,c=e.cpy2,u=e.percent;0!==u&&(t.moveTo(n,i),null==l||null==c?(u<1&&(ou(n,a,r,u,qw),a=qw[1],r=qw[2],ou(i,s,o,u,qw),s=qw[1],o=qw[2]),t.quadraticCurveTo(a,s,r,o)):(u<1&&(Qc(n,a,l,r,u,qw),a=qw[1],l=qw[2],r=qw[3],Qc(i,s,c,o,u,qw),s=qw[1],c=qw[2],o=qw[3]),t.bezierCurveTo(a,s,l,c,r,o)))},e.prototype.pointAt=function(t){return Xw(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e=Xw(this.shape,t,!0);return sl(e,e)},e}(vg);$w.prototype.type="bezier-curve";const Zw=$w;var Kw=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Jw=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Kw},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r,0),o=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(o),c=Math.sin(o);t.moveTo(l*r+n,c*r+i),t.arc(n,i,r,o,a,!s)},e}(vg);Jw.prototype.type="arc";const Qw=Jw;var tS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return Ma(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;n<t.length;n++)e=e||t[n].shapeChanged();e&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),n=0;n<t.length;n++)t[n].path||t[n].createPathProxy(),t[n].path.setScale(e[0],e[1],t[n].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,e){for(var n=e.paths||[],i=0;i<n.length;i++)n[i].buildPath(t,n[i].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),vg.prototype.getBoundingRect.call(this)},e}(vg);const eS=tS;var nS=function(){function t(t){this.colorStops=t||[]}return t.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},t}();const iS=nS;var rS=function(t){function e(e,n,i,r,o,a){var s=t.call(this,o)||this;return s.x=null==e?0:e,s.y=null==n?0:n,s.x2=null==i?1:i,s.y2=null==r?0:r,s.type="linear",s.global=a||!1,s}return Ma(e,t),e}(iS);const oS=rS;var aS=function(t){function e(e,n,i,r,o){var a=t.call(this,r)||this;return a.x=null==e?.5:e,a.y=null==n?.5:n,a.r=null==i?.5:i,a.type="radial",a.global=o||!1,a}return Ma(e,t),e}(iS);const sS=aS;var lS=[0,0],cS=[0,0],uS=new nc,hS=new nc,dS=function(){function t(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new nc;for(n=0;n<2;n++)this._axes[n]=new nc;t&&this.fromBoundingRect(t,e)}return t.prototype.fromBoundingRect=function(t,e){var n=this._corners,i=this._axes,r=t.x,o=t.y,a=r+t.width,s=o+t.height;if(n[0].set(r,o),n[1].set(a,o),n[2].set(a,s),n[3].set(r,s),e)for(var l=0;l<4;l++)n[l].transform(e);for(nc.sub(i[0],n[1],n[0]),nc.sub(i[1],n[3],n[0]),i[0].normalize(),i[1].normalize(),l=0;l<2;l++)this._origin[l]=i[l].dot(n[0])},t.prototype.intersect=function(t,e){var n=!0,i=!e;return uS.set(1/0,1/0),hS.set(0,0),!this._intersectCheckOneSide(this,t,uS,hS,i,1)&&(n=!1,i)||!this._intersectCheckOneSide(t,this,uS,hS,i,-1)&&(n=!1,i)||i||nc.copy(e,n?uS:hS),n},t.prototype._intersectCheckOneSide=function(t,e,n,i,r,o){for(var a=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,t._corners,lS),this._getProjMinMaxOnAxis(s,e._corners,cS),lS[1]<cS[0]||lS[0]>cS[1]){if(a=!1,r)return a;var c=Math.abs(cS[0]-lS[1]),u=Math.abs(lS[0]-cS[1]);Math.min(c,u)>i.len()&&(c<u?nc.scale(i,l,-c*o):nc.scale(i,l,u*o))}else n&&(c=Math.abs(cS[0]-lS[1]),u=Math.abs(lS[0]-cS[1]),Math.min(c,u)<n.len()&&(c<u?nc.scale(n,l,c*o):nc.scale(n,l,-u*o)))}return a},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var i=this._axes[t],r=this._origin,o=e[0].dot(i)+r[t],a=o,s=o,l=1;l<e.length;l++){var c=e[l].dot(i)+r[t];a=Math.min(c,a),s=Math.max(c,s)}n[0]=a,n[1]=s},t}();const pS=dS;var fS=[],gS=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.notClear=!0,e.incremental=!0,e._displayables=[],e._temporaryDisplayables=[],e._cursor=0,e}return Ma(e,t),e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,e){e=e||!1;for(var n=0;n<t.length;n++)this.addDisplayable(t[n],e)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++)(e=this._displayables[t]).parent=this,e.update(),e.parent=null;for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new dc(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var n=this._displayables[e],i=n.getBoundingRect().clone();n.needLocalTransform()&&i.applyTransform(n.getLocalTransform(fS)),t.union(i)}this._rect=t}return this._rect},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(n[0],n[1]))for(var i=0;i<this._displayables.length;i++)if(this._displayables[i].contain(t,e))return!0;return!1},e}(gf);const mS=gS;var yS=Math.max,vS=Math.min,_S={};function xS(t){return vg.extend(t)}var bS=function(t,e){var n=lw(t,e);return function(t){function e(e){var i=t.call(this,e)||this;return i.applyTransform=n.applyTransform,i.buildPath=n.buildPath,i}return Ma(e,t),e}(aw)};function wS(t,e){return bS(t,e)}function SS(t,e){_S[t]=e}function MS(t){if(_S.hasOwnProperty(t))return _S[t]}function CS(t,e,n,i){var r=cw(t,e);return n&&("center"===i&&(n=IS(n,r.getBoundingRect())),kS(r,n)),r}function TS(t,e,n){var i=new Cg({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===n){var r={width:t.width,height:t.height};i.setStyle(IS(e,r))}}});return i}function IS(t,e){var n,i=e.width/e.height,r=t.height*i;return n=r<=t.width?t.height:(r=t.width)/i,{x:t.x+t.width/2-r/2,y:t.y+t.height/2-n/2,width:r,height:n}}var DS=function(t,e){for(var n=[],i=t.length,r=0;r<i;r++){var o=t[r];n.push(o.getUpdatedPathProxy(!0))}var a=new vg(e);return a.createPathProxy(),a.buildPath=function(t){if(sw(t)){t.appendPath(n);var e=t.getContext();e&&t.rebuildPath(e,1)}},a};function kS(t,e){if(t.applyTransform){var n=t.getBoundingRect().calculateTransform(e);t.applyTransform(n)}}function AS(t,e){return Ig(t,t,{lineWidth:e}),t}function ES(t){return Dg(t.shape,t.shape,t.style),t}var LS=kg;function PS(t,e){for(var n=Yl([]);t&&t!==e;)$l(n,t.getLocalTransform(),n),t=t.parent;return n}function OS(t,e,n){return e&&!rs(e)&&(e=Kh.getLocalTransform(e)),n&&(e=Ql([],e)),fl([],t,e)}function RS(t,e,n){var i=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),r=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),o=["left"===t?-i:"right"===t?i:0,"top"===t?-r:"bottom"===t?r:0];return o=OS(o,e,n),Math.abs(o[0])>Math.abs(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function BS(t){return!t.isGroup}function NS(t,e,n){if(t&&e){var i=function(t){var e={};return t.traverse(function(t){BS(t)&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(BS(t)&&t.anid){var e=i[t.anid];if(e){var o=r(t);t.attr(r(e)),Jm(t,o,n,Zg(t).dataIndex)}}})}function r(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=Ja({},t.shape)),e}}function zS(t,e){return as(t,function(t){var n=t[0];n=yS(n,e.x),n=vS(n,e.x+e.width);var i=t[1];return i=yS(i,e.y),[n,i=vS(i,e.y+e.height)]})}function FS(t,e){var n=yS(t.x,e.x),i=vS(t.x+t.width,e.x+e.width),r=yS(t.y,e.y),o=vS(t.y+t.height,e.y+e.height);if(i>=n&&o>=r)return{x:n,y:r,width:i-n,height:o-r}}function VS(t,e,n){var i=Ja({rectHover:!0},e),r=i.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(r.image=t.slice(8),Qa(r,n),new Cg(i)):CS(t.replace("path://",""),i,n,"center")}function HS(t,e,n,i,r){for(var o=0,a=r[r.length-1];o<r.length;o++){var s=r[o];if(jS(t,e,n,i,s[0],s[1],a[0],a[1]))return!0;a=s}}function jS(t,e,n,i,r,o,a,s){var l,c=n-t,u=i-e,h=a-r,d=s-o,p=WS(h,d,c,u);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=t-r,g=e-o,m=WS(f,g,c,u)/p;if(m<0||m>1)return!1;var y=WS(f,g,h,d)/p;return!(y<0||y>1)}function WS(t,e,n,i){return t*i-n*e}function GS(t){var e=t.itemTooltipOption,n=t.componentModel,i=t.itemName,r=gs(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:i,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&os(us(l),function(t){Ws(s,t)||(s[t]=l[t],s.$vars.push(t))});var c=Zg(t.el);c.componentMainType=o,c.componentIndex=a,c.tooltipConfig={name:i,option:Qa({content:i,encodeHTMLContent:!0,formatterParams:s},r)}}function US(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function qS(t,e){if(t)if(ps(t))for(var n=0;n<t.length;n++)US(t[n],e);else US(t,e)}SS("circle",pw),SS("ellipse",mw),SS("sector",Ew),SS("ring",Ow),SS("polygon",zw),SS("polyline",Hw),SS("rect",Pg),SS("line",Uw),SS("bezierCurve",Zw),SS("arc",Qw);var YS=xp(),XS=Gb(),$S=function(){function t(){this.group=new _d,this.uid=By("viewChart"),this.renderTask=Ax({plan:JS,reset:QS}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,i){},t.prototype.highlight=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&KS(r,i,"emphasis")},t.prototype.downplay=function(t,e,n,i){var r=t.getData(i&&i.dataType);r&&KS(r,i,"normal")},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateLayout=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.updateVisual=function(t,e,n,i){this.render(t,e,n,i)},t.prototype.eachRendered=function(t){qS(this.group,t)},t.markUpdateMethod=function(t,e){YS(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function ZS(t,e,n){t&&qm(t)&&("emphasis"===e?Tm:Im)(t,n)}function KS(t,e,n){var i=_p(t,e),r=e&&null!=e.highlightKey?function(t){var e=Qg[t];return null==e&&Jg<=32&&(e=Qg[t]=Jg++),e}(e.highlightKey):null;null!=i?os(lp(i),function(e){ZS(t.getItemGraphicEl(e),n,r)}):t.eachItemGraphicEl(function(t){ZS(t,n,r)})}function JS(t){return XS(t.model)}function QS(t){var e=t.model,n=t.ecModel,i=t.api,r=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=r&&YS(r).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,i,r),tM[l]}Pp($S),zp($S);var tM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const eM=$S;var nM="\0__throttleOriginMethod",iM="\0__throttleRate",rM="\0__throttleType";function oM(t,e,n){var i,r,o,a,s,l=0,c=0,u=null;function h(){c=(new Date).getTime(),u=null,t.apply(o,a||[])}e=e||0;var d=function(){for(var t=[],d=0;d<arguments.length;d++)t[d]=arguments[d];i=(new Date).getTime(),o=this,a=t;var p=s||e,f=s||n;s=null,r=i-(f?l:c)-p,clearTimeout(u),f?u=setTimeout(h,p):r>=0?h():u=setTimeout(h,-r),l=i};return d.clear=function(){u&&(clearTimeout(u),u=null)},d.debounceNextCall=function(t){s=t},d}function aM(t,e,n,i){var r=t[e];if(r){var o=r[nM]||r,a=r[rM];if(r[iM]!==n||a!==i){if(null==n||!i)return t[e]=o;(r=t[e]=oM(o,n,"debounce"===i))[nM]=o,r[rM]=i,r[iM]=n}return r}}function sM(t,e){var n=t[e];n&&n[nM]&&(n.clear&&n.clear(),t[e]=n[nM])}var lM=xp(),cM={itemStyle:Fp(Ay,!0),lineStyle:Fp(Iy,!0)},uM={lineStyle:"stroke",itemStyle:"fill"};function hM(t,e){return t.visualStyleMapper||cM[e]||(console.warn("Unknown style type '"+e+"'."),cM.itemStyle)}function dM(t,e){return t.visualDrawType||uM[e]||(console.warn("Unknown style type '"+e+"'."),"fill")}var pM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=t.getModel(i),o=hM(t,i)(r),a=r.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=dM(t,i),l=o[s],c=fs(l)?l:null,u="auto"===o.fill||"auto"===o.stroke;if(!o[s]||c||u){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[s]||(o[s]=h,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||fs(o.fill)?h:o.fill,o.stroke="auto"===o.stroke||fs(o.stroke)?h:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&c)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var i=t.getDataParams(n),r=Ja({},o);r[s]=c(i),e.setItemVisual(n,"style",r)}}}},fM=new Oy,gM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData&&!e.isSeriesFiltered(t)){var n=t.getData(),i=t.visualStyleAccessPath||"itemStyle",r=hM(t,i),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[i]){fM.option=n[i];var a=r(fM);Ja(t.ensureUniqueItemVisual(e,"style"),a),fM.option.decal&&(t.setItemVisual(e,"decal",fM.option.decal),fM.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},mM={performRawSeries:!0,overallReset:function(t){var e=Fs();t.eachSeries(function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,r=e.get(i);r||(r={},e.set(i,r)),lM(t).scope=r}}),t.eachSeries(function(e){if(!e.isColorBySeries()&&!t.isSeriesFiltered(e)){var n=e.getRawData(),i={},r=e.getData(),o=lM(e).scope,a=e.visualStyleAccessPath||"itemStyle",s=dM(e,a);r.each(function(t){var e=r.getRawIndex(t);i[e]=t}),n.each(function(t){var a=i[t];if(r.getItemVisual(a,"colorFromPalette")){var l=r.ensureUniqueItemVisual(a,"style"),c=n.getName(t)||t+"",u=n.count();l[s]=e.getColorFromPalette(c,o,u)}})}})}},yM=Math.PI,vM=function(){function t(t,e,n,i){this._stageTaskMap=Fs(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),i=n.context,r=!e&&n.progressiveEnabled&&(!i||i.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=i&&i.modDataCount;return{step:r,modBy:null!=o?Math.ceil(o/r):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),i=t.getData().count(),r=n.progressiveEnabled&&e.incrementalPrepareRender&&i>=n.threshold,o=t.get("large")&&i>=t.get("largeThreshold"),a="mod"===t.get("progressiveChunkMode")?i:null;t.pipelineContext=n.context={progressiveRender:r,modDataCount:a,large:o}},t.prototype.restorePipelines=function(t){var e=this,n=e._pipelineMap=Fs();t.eachSeries(function(t){var i=t.getProgressive(),r=t.uid;n.set(r,{id:r,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),e._pipe(t,t.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;os(this._allHandlers,function(i){var r=t.get(i.uid)||t.set(i.uid,{});Es(!(i.reset&&i.overallReset),""),i.reset&&this._createSeriesStageTask(i,r,e,n),i.overallReset&&this._createOverallStageTask(i,r,e,n)},this)},t.prototype.prepareView=function(t,e,n,i){var r=t.renderTask,o=r.context;o.model=e,o.ecModel=n,o.api=i,r.__block=!t.incrementalPrepareRender,this._pipe(e,r)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,i){i=i||{};var r=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}os(t,function(t,s){if(!i.visualType||i.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),c=l.seriesTaskMap,u=l.overallTask;if(u){var h,d=u.agentStubMap;d.each(function(t){a(i,t)&&(t.dirty(),h=!0)}),h&&u.dirty(),o.updatePayload(u,n);var p=o.getPerformArgs(u,i.block);d.each(function(t){t.perform(p)}),u.perform(p)&&(r=!0)}else c&&c.each(function(s,l){a(i,s)&&s.dirty();var c=o.getPerformArgs(s,i.block);c.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(c)&&(r=!0)})}}),this.unfinished=r||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,i){var r=this,o=e.seriesTaskMap,a=e.seriesTaskMap=Fs(),s=t.seriesType,l=t.getTargetSeries;function c(e){var s=e.uid,l=a.set(s,o&&o.get(s)||Ax({plan:SM,reset:MM,count:IM}));l.context={model:e,ecModel:n,api:i,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:r},r._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(c):s?n.eachRawSeriesByType(s,c):l&&l(n,i).each(c)},t.prototype._createOverallStageTask=function(t,e,n,i){var r=this,o=e.overallTask=e.overallTask||Ax({reset:_M});o.context={ecModel:n,api:i,overallReset:t.overallReset,scheduler:r};var a=o.agentStubMap,s=o.agentStubMap=Fs(),l=t.seriesType,c=t.getTargetSeries,u=!0,h=!1;function d(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(h=!0,Ax({reset:xM,onDirty:wM})));n.context={model:t,overallProgress:u},n.agent=o,n.__block=u,r._pipe(t,n)}Es(!t.createOnAllSeries,""),l?n.eachRawSeriesByType(l,d):c?c(n,i).each(d):(u=!1,os(n.getSeries(),d)),h&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=e),i.tail&&i.tail.pipe(e),i.tail=e,e.__idxInPipeline=i.count++,e.__pipeline=i},t.wrapStageHandler=function(t,e){return fs(t)&&(t={overallReset:t,seriesType:DM(t)}),t.uid=By("stageHandler"),e&&(t.visualType=e),t},t}();function _M(t){t.overallReset(t.ecModel,t.api,t.payload)}function xM(t){return t.overallProgress&&bM}function bM(){this.agent.dirty(),this.getDownstream().dirty()}function wM(){this.agent&&this.agent.dirty()}function SM(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function MM(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=lp(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?as(e,function(t,e){return TM(e)}):CM}var CM=TM(0);function TM(t){return function(e,n){var i=n.data,r=n.resetDefines[t];if(r&&r.dataEach)for(var o=e.start;o<e.end;o++)r.dataEach(i,o);else r&&r.progress&&r.progress(e,i)}}function IM(t){return t.data.count()}function DM(t){kM=null;try{t(AM,EM)}catch(t){}return kM}var kM,AM={},EM={};function LM(t,e){for(var n in e.prototype)t[n]=Gs}LM(AM,C_),LM(EM,I_),AM.eachSeriesByType=AM.eachRawSeriesByType=function(t){kM=t},AM.eachComponent=function(t){"series"===t.mainType&&t.subType&&(kM=t.subType)};const PM=vM;var OM=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const RM={color:OM,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],OM]};var BM="#B9B8CE",NM="#100C2A",zM=function(){return{axisLine:{lineStyle:{color:BM}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},FM=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],VM={darkMode:!0,color:FM,backgroundColor:NM,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:BM},pageTextStyle:{color:BM}},textStyle:{color:BM},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:BM}},dataZoom:{borderColor:"#71708A",textStyle:{color:BM},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:BM}},timeline:{lineStyle:{color:BM},label:{color:BM},controlStyle:{color:BM,borderColor:BM}},calendar:{itemStyle:{color:NM},dayLabel:{color:BM},monthLabel:{color:BM},yearLabel:{color:BM}},timeAxis:zM(),logAxis:zM(),valueAxis:zM(),categoryAxis:zM(),line:{symbol:"circle"},graph:{color:FM},gauge:{title:{color:BM},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:BM},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};VM.categoryAxis.splitLine.show=!1;const HM=VM;var jM=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},i={};if(gs(t)){var r=Lp(t);e.mainType=r.main||null,e.subType=r.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};os(t,function(t,r){for(var s=!1,l=0;l<o.length;l++){var c=o[l],u=r.lastIndexOf(c);if(u>0&&u===r.length-c.length){var h=r.slice(0,u);"data"!==h&&(e.mainType=h,e[c.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(r)&&(n[r]=t,s=!0),s||(i[r]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:i}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,r=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return c(s,o,"mainType")&&c(s,o,"subType")&&c(s,o,"index","componentIndex")&&c(s,o,"name")&&c(s,o,"id")&&c(l,r,"name")&&c(l,r,"dataIndex")&&c(l,r,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,i,r));function c(t,e,n,i){return null==t[n]||e[i||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),WM=["symbol","symbolSize","symbolRotate","symbolOffset"],GM=WM.concat(["symbolKeepAspect"]),UM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var i={},r={},o=!1,a=0;a<WM.length;a++){var s=WM[a],l=t.get(s);fs(l)?(o=!0,r[s]=l):i[s]=l}if(i.symbol=i.symbol||t.defaultSymbol,n.setVisual(Ja({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),!e.isSeriesFiltered(t)){var c=us(r);return{dataEach:o?function(e,n){for(var i=t.getRawValue(n),o=t.getDataParams(n),a=0;a<c.length;a++){var s=c[a];e.setItemVisual(n,s,r[s](i,o))}}:null}}}}},qM={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){for(var n=t.getItemModel(e),i=0;i<GM.length;i++){var r=GM[i],o=n.getShallow(r,!0);null!=o&&t.setItemVisual(e,r,o)}}:null}}};function YM(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n)}}function XM(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function $M(t,e,n,i){switch(n){case"color":t.ensureUniqueItemVisual(e,"style")[t.getVisual("drawType")]=i,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,n,i)}}function ZM(t,e){function n(e,n){var i=[];return e.eachComponent({mainType:"series",subType:t,query:n},function(t){i.push(t.seriesIndex)}),i}os([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],function(t){e(t[0],function(e,i,r){e=Ja({},e),r.dispatchAction(Ja(e,{type:t[1],seriesIndex:n(i,e)}))})})}function KM(t,e,n,i,r){var o=t+e;n.isSilent(o)||i.eachComponent({mainType:"series",subType:"pie"},function(t){for(var e=t.seriesIndex,i=t.option.selectedMap,a=r.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===e){var l=t.getData(),c=_p(l,r.fromActionPayload);n.trigger(o,{type:o,seriesId:t.id,name:ps(c)?l.getName(c[0]):l.getName(c),selected:gs(i)?i:Ja({},i)})}})}function JM(t,e,n){for(var i;t&&(!e(t)||(i=t,!n));)t=t.__hostTarget||t.parent;return i}var QM=Math.round(9*Math.random()),tC="function"==typeof Object.defineProperty,eC=function(){function t(){this._id="__ec_inner_"+QM++}return t.prototype.get=function(t){return this._guard(t)[this._id]},t.prototype.set=function(t,e){var n=this._guard(t);return tC?Object.defineProperty(n,this._id,{value:e,enumerable:!1,configurable:!0}):n[this._id]=e,this},t.prototype.delete=function(t){return!!this.has(t)&&(delete this._guard(t)[this._id],!0)},t.prototype.has=function(t){return!!this._guard(t)[this._id]},t.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},t}();const nC=eC;var iC=vg.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,o=e.height/2;t.moveTo(n,i-o),t.lineTo(n+r,i+o),t.lineTo(n-r,i+o),t.closePath()}}),rC=vg.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,i=e.cy,r=e.width/2,o=e.height/2;t.moveTo(n,i-o),t.lineTo(n+r,i),t.lineTo(n,i+o),t.lineTo(n-r,i),t.closePath()}}),oC=vg.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,i=e.y,r=e.width/5*3,o=Math.max(r,e.height),a=r/2,s=a*a/(o-a),l=i-o+a+s,c=Math.asin(s/a),u=Math.cos(c)*a,h=Math.sin(c),d=Math.cos(c),p=.6*a,f=.7*a;t.moveTo(n-u,l+s),t.arc(n,l,a,Math.PI-c,2*Math.PI+c),t.bezierCurveTo(n+u-h*p,l+s+d*p,n,i-f,n,i),t.bezierCurveTo(n,i-f,n-u+h*p,l+s+d*p,n-u,l+s),t.closePath()}}),aC=vg.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,i=e.width,r=e.x,o=e.y,a=i/3*2;t.moveTo(r,o),t.lineTo(r+a,o+n),t.lineTo(r,o+n/4*3),t.lineTo(r-a,o+n),t.lineTo(r,o),t.closePath()}}),sC={line:function(t,e,n,i,r){r.x1=t,r.y1=e+i/2,r.x2=t+n,r.y2=e+i/2},rect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i},roundRect:function(t,e,n,i,r){r.x=t,r.y=e,r.width=n,r.height=i,r.r=Math.min(n,i)/4},square:function(t,e,n,i,r){var o=Math.min(n,i);r.x=t,r.y=e,r.width=o,r.height=o},circle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.r=Math.min(n,i)/2},diamond:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i},pin:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},arrow:function(t,e,n,i,r){r.x=t+n/2,r.y=e+i/2,r.width=n,r.height=i},triangle:function(t,e,n,i,r){r.cx=t+n/2,r.cy=e+i/2,r.width=n,r.height=i}},lC={};os({line:Uw,rect:Pg,roundRect:Pg,square:Pg,circle:pw,diamond:rC,pin:oC,arrow:aC,triangle:iC},function(t,e){lC[e]=new t});var cC=vg.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,n){var i=ad(t,e,n),r=this.shape;return r&&"pin"===r.symbolType&&"inside"===e.position&&(i.y=n.y+.4*n.height),i},buildPath:function(t,e,n){var i=e.symbolType;if("none"!==i){var r=lC[i];r||(r=lC[i="rect"]),sC[i](e.x,e.y,e.width,e.height,r.shape),r.buildPath(t,r.shape,n)}}});function uC(t,e){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=t,n.fill=e||"#fff",n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=t:n.fill=t,this.markRedraw()}}function hC(t,e,n,i,r,o,a){var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?TS(t.slice(8),new dc(e,n,i,r),a?"center":"cover"):0===t.indexOf("path://")?CS(t.slice(7),{},new dc(e,n,i,r),a?"center":"cover"):new cC({shape:{symbolType:t,x:e,y:n,width:i,height:r}})).__isEmptyBrush=l,s.setColor=uC,o&&s.setColor(o),s}function dC(t){return ps(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function pC(t,e){if(null!=t)return ps(t)||(t=[t,t]),[Rd(t[0],e[0])||0,Rd(Is(t[1],t[0]),e[1])||0]}function fC(t){return isFinite(t)}function gC(t,e,n){for(var i="radial"===e.type?function(t,e,n){var i=n.width,r=n.height,o=Math.min(i,r),a=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(a=a*i+n.x,s=s*r+n.y,l*=o),a=fC(a)?a:.5,s=fC(s)?s:.5,l=l>=0&&fC(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var i=null==e.x?0:e.x,r=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*n.width+n.x,r=r*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),i=fC(i)?i:0,r=fC(r)?r:1,o=fC(o)?o:0,a=fC(a)?a:0,t.createLinearGradient(i,o,r,a)}(t,e,n),r=e.colorStops,o=0;o<r.length;o++)i.addColorStop(r[o].offset,r[o].color);return i}function mC(t){return parseInt(t,10)}function yC(t,e,n){var i=["width","height"][e],r=["clientWidth","clientHeight"][e],o=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=n[i]&&"auto"!==n[i])return parseFloat(n[i]);var s=document.defaultView.getComputedStyle(t);return(t[r]||mC(s[i])||mC(t.style[i]))-(mC(s[o])||0)-(mC(s[a])||0)|0}function vC(t){var e,n,i=t.style,r=i.lineDash&&i.lineWidth>0&&(e=i.lineDash,n=i.lineWidth,e&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:ys(e)?[e]:ps(e)?e:null:null),o=i.lineDashOffset;if(r){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(r=as(r,function(t){return t/a}),o/=a)}return[r,o]}var _C=new Zf(!0);function xC(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function bC(t){return"string"==typeof t&&"none"!==t}function wC(t){var e=t.fill;return null!=e&&"none"!==e}function SC(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function MC(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function CC(t,e,n){var i=Gp(e.image,e.__image,n);if(qp(i)){var r=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&r&&r.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*Us),o.scaleSelf(e.scaleX||1,e.scaleY||1),r.setTransform(o)}return r}}var TC=["shadowBlur","shadowOffsetX","shadowOffsetY"],IC=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function DC(t,e,n,i,r){var o=!1;if(!i&&e===(n=n||{}))return!1;if(i||e.opacity!==n.opacity){RC(t,r),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?lf.opacity:a}(i||e.blend!==n.blend)&&(o||(RC(t,r),o=!0),t.globalCompositeOperation=e.blend||lf.blend);for(var s=0;s<TC.length;s++){var l=TC[s];(i||e[l]!==n[l])&&(o||(RC(t,r),o=!0),t[l]=t.dpr*(e[l]||0))}return(i||e.shadowColor!==n.shadowColor)&&(o||(RC(t,r),o=!0),t.shadowColor=e.shadowColor||lf.shadowColor),o}function kC(t,e,n,i,r){var o=BC(e,r.inHover),a=i?null:n&&BC(n,r.inHover)||{};if(o===a)return!1;var s=DC(t,o,a,i,r);if((i||o.fill!==a.fill)&&(s||(RC(t,r),s=!0),bC(o.fill)&&(t.fillStyle=o.fill)),(i||o.stroke!==a.stroke)&&(s||(RC(t,r),s=!0),bC(o.stroke)&&(t.strokeStyle=o.stroke)),(i||o.opacity!==a.opacity)&&(s||(RC(t,r),s=!0),t.globalAlpha=null==o.opacity?1:o.opacity),e.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==l&&(s||(RC(t,r),s=!0),t.lineWidth=l)}for(var c=0;c<IC.length;c++){var u=IC[c],h=u[0];(i||o[h]!==a[h])&&(s||(RC(t,r),s=!0),t[h]=o[h]||u[1])}return s}function AC(t,e){var n=e.transform,i=t.dpr||1;n?t.setTransform(i*n[0],i*n[1],i*n[2],i*n[3],i*n[4],i*n[5]):t.setTransform(i,0,0,i,0,0)}var EC=1,LC=2,PC=3,OC=4;function RC(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function BC(t,e){return e&&t.__hoverStyle||t.style}function NC(t,e){zC(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function zC(t,e,n,i){var r=e.transform;if(!e.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return e.__dirty&=~kc,void(e.__isRendered=!1);var o=e.__clipPaths,a=n.prevElClipPaths,s=!1,l=!1;if(a&&!function(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!0;return!1}(o,a)||(a&&a.length&&(RC(t,n),t.restore(),l=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),o&&o.length&&(RC(t,n),t.save(),function(t,e,n){for(var i=!1,r=0;r<t.length;r++){var o=t[r];i=i||o.isZeroArea(),AC(e,o),e.beginPath(),o.buildPath(e,o.shape),e.clip()}n.allClipped=i}(o,t,n),s=!0),n.prevElClipPaths=o),n.allClipped)e.__isRendered=!1;else{e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=n.prevEl;c||(l=s=!0);var u,h,d=e instanceof vg&&e.autoBatch&&function(t){var e=wC(t),n=xC(t);return!(t.lineDash||!(+e^+n)||e&&"string"!=typeof t.fill||n&&"string"!=typeof t.stroke||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}(e.style);s||(u=r,h=c.transform,u&&h?u[0]!==h[0]||u[1]!==h[1]||u[2]!==h[2]||u[3]!==h[3]||u[4]!==h[4]||u[5]!==h[5]:u||h)?(RC(t,n),AC(t,e)):d||RC(t,n);var p=BC(e,n.inHover);e instanceof vg?(n.lastDrawType!==EC&&(l=!0,n.lastDrawType=EC),kC(t,e,c,l,n),d&&(n.batchFill||n.batchStroke)||t.beginPath(),function(t,e,n,i){var r,o=xC(n),a=wC(n),s=n.strokePercent,l=s<1,c=!e.path;e.silent&&!l||!c||e.createPathProxy();var u=e.path||_C,h=e.__dirty;if(!i){var d=n.fill,p=n.stroke,f=a&&!!d.colorStops,g=o&&!!p.colorStops,m=a&&!!d.image,y=o&&!!p.image,v=void 0,_=void 0,x=void 0,b=void 0,w=void 0;(f||g)&&(w=e.getBoundingRect()),f&&(v=h?gC(t,d,w):e.__canvasFillGradient,e.__canvasFillGradient=v),g&&(_=h?gC(t,p,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=_),m&&(x=h||!e.__canvasFillPattern?CC(t,d,e):e.__canvasFillPattern,e.__canvasFillPattern=x),y&&(b=h||!e.__canvasStrokePattern?CC(t,p,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),f?t.fillStyle=v:m&&(x?t.fillStyle=x:a=!1),g?t.strokeStyle=_:y&&(b?t.strokeStyle=b:o=!1)}var S,M,C=e.getGlobalScale();u.setScale(C[0],C[1],e.segmentIgnoreThreshold),t.setLineDash&&n.lineDash&&(S=(r=vC(e))[0],M=r[1]);var T=!0;(c||h&Ac)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),T=!1),u.reset(),e.buildPath(u,e.shape,i),u.toStatic(),e.pathUpdated()),T&&u.rebuildPath(t,l?s:1),S&&(t.setLineDash(S),t.lineDashOffset=M),i||(n.strokeFirst?(o&&MC(t,n),a&&SC(t,n)):(a&&SC(t,n),o&&MC(t,n))),S&&t.setLineDash([])}(t,e,p,d),d&&(n.batchFill=p.fill||"",n.batchStroke=p.stroke||"")):e instanceof bg?(n.lastDrawType!==PC&&(l=!0,n.lastDrawType=PC),kC(t,e,c,l,n),function(t,e,n){var i,r=n.text;if(null!=r&&(r+=""),r){t.font=n.font||Ea,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var o=void 0,a=void 0;t.setLineDash&&n.lineDash&&(o=(i=vC(e))[0],a=i[1]),o&&(t.setLineDash(o),t.lineDashOffset=a),n.strokeFirst?(xC(n)&&t.strokeText(r,n.x,n.y),wC(n)&&t.fillText(r,n.x,n.y)):(wC(n)&&t.fillText(r,n.x,n.y),xC(n)&&t.strokeText(r,n.x,n.y)),o&&t.setLineDash([])}}(t,e,p)):e instanceof Cg?(n.lastDrawType!==LC&&(l=!0,n.lastDrawType=LC),function(t,e,n,i,r){DC(t,BC(e,r.inHover),n&&BC(n,r.inHover),i,r)}(t,e,c,l,n),function(t,e,n){var i=e.__image=Gp(n.image,e.__image,e,e.onload);if(i&&qp(i)){var r=n.x||0,o=n.y||0,a=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=i.width,s=i.height),n.sWidth&&n.sHeight){var c=n.sx||0,u=n.sy||0;t.drawImage(i,c,u,n.sWidth,n.sHeight,r,o,a,s)}else if(n.sx&&n.sy){var h=a-(c=n.sx),d=s-(u=n.sy);t.drawImage(i,c,u,h,d,r,o,a,s)}else t.drawImage(i,r,o,a,s)}}(t,e,p)):e.getTemporalDisplayables&&(n.lastDrawType!==OC&&(l=!0,n.lastDrawType=OC),function(t,e,n){var i=e.getDisplayables(),r=e.getTemporalDisplayables();t.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover};for(o=e.getCursor(),a=i.length;o<a;o++)(u=i[o]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),zC(t,u,s,o===a-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),s.prevEl=u;for(var l=0,c=r.length;l<c;l++){var u;(u=r[l]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),zC(t,u,s,l===c-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),s.prevEl=u}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}(t,e,n)),d&&i&&RC(t,n),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),n.prevEl=e,e.__dirty=0,e.__isRendered=!0}}var FC=new nC,VC=new fu(100),HC=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function jC(t,e){if("none"===t)return null;var n=e.getDevicePixelRatio(),i=e.getZr(),r="svg"===i.painter.type;t.dirty&&FC.delete(t);var o=FC.get(t);if(o)return o;var a=Qa(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(t){for(var e,o=[n],s=!0,l=0;l<HC.length;++l){var c=a[HC[l]];if(null!=c&&!ps(c)&&!gs(c)&&!ys(c)&&"boolean"!=typeof c){s=!1;break}o.push(c)}if(s){e=o.join(",")+(r?"-svg":"");var u=VC.get(e);u&&(r?t.svgElement=u:t.image=u)}var h,d=GC(a.dashArrayX),p=function(t){if(!t||"object"==typeof t&&0===t.length)return[0,0];if(ys(t)){var e=Math.ceil(t);return[e,e]}var n=as(t,function(t){return Math.ceil(t)});return t.length%2?n.concat(n):n}(a.dashArrayY),f=WC(a.symbol),g=as(d,function(t){return UC(t)}),m=UC(p),y=!r&&Pa.createCanvas(),v=r&&{tag:"g",attrs:{},key:"dcl",children:[]},_=function(){for(var t=1,e=0,n=g.length;e<n;++e)t=rp(t,g[e]);var i=1;for(e=0,n=f.length;e<n;++e)i=rp(i,f[e].length);t*=i;var r=m*g.length*f.length;return{width:Math.max(1,Math.min(t,a.maxTileWidth)),height:Math.max(1,Math.min(r,a.maxTileHeight))}}();y&&(y.width=_.width*n,y.height=_.height*n,h=y.getContext("2d")),function(){h&&(h.clearRect(0,0,y.width,y.height),a.backgroundColor&&(h.fillStyle=a.backgroundColor,h.fillRect(0,0,y.width,y.height)));for(var t=0,e=0;e<p.length;++e)t+=p[e];if(!(t<=0))for(var o=-m,s=0,l=0,c=0;o<_.height;){if(s%2==0){for(var u=l/2%f.length,g=0,x=0,b=0;g<2*_.width;){var w=0;for(e=0;e<d[c].length;++e)w+=d[c][e];if(w<=0)break;if(x%2==0){var S=.5*(1-a.symbolSize),M=g+d[c][x]*S,C=o+p[s]*S,T=d[c][x]*a.symbolSize,I=p[s]*a.symbolSize,D=b/2%f[u].length;k(M,C,T,I,f[u][D])}g+=d[c][x],++b,++x===d[c].length&&(x=0)}++c===d.length&&(c=0)}o+=p[s],++l,++s===p.length&&(s=0)}function k(t,e,o,s,l){var c=r?1:n,u=hC(l,t*c,e*c,o*c,s*c,a.color,a.symbolKeepAspect);if(r){var d=i.painter.renderOneToVNode(u);d&&v.children.push(d)}else NC(h,u)}}(),s&&VC.put(e,y||v),t.image=y,t.svgElement=v,t.svgWidth=_.width,t.svgHeight=_.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=r?1:1/n,FC.set(t,s),t.dirty=!1,s}function WC(t){if(!t||0===t.length)return[["rect"]];if(gs(t))return[[t]];for(var e=!0,n=0;n<t.length;++n)if(!gs(t[n])){e=!1;break}if(e)return WC([t]);var i=[];for(n=0;n<t.length;++n)gs(t[n])?i.push([t[n]]):i.push(t[n]);return i}function GC(t){if(!t||0===t.length)return[[0,0]];if(ys(t))return[[r=Math.ceil(t),r]];for(var e=!0,n=0;n<t.length;++n)if(!ys(t[n])){e=!1;break}if(e)return GC([t]);var i=[];for(n=0;n<t.length;++n)if(ys(t[n])){var r=Math.ceil(t[n]);i.push([r,r])}else(r=as(t[n],function(t){return Math.ceil(t)})).length%2==1?i.push(r.concat(r)):i.push(r);return i}function UC(t){for(var e=0,n=0;n<t.length;++n)e+=t[n];return t.length%2==1?2*e:e}const qC=new bl;var YC={};function XC(t){return YC[t]}var $C="5.6.0",ZC={zrender:"5.6.1"},KC=2e3,JC=1e3,QC=2e3,tT=3e3,eT=4500,nT={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:JC,PROGRESSIVE_LAYOUT:1100,GLOBAL:QC,CHART:tT,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:eT,ARIA:6e3,DECAL:7e3}},iT="__flagInMainProcess",rT="__pendingUpdate",oT="__needsUpdateStatus",aT=/^[a-zA-Z0-9_]+$/,sT="__connectUpdateStatus";function lT(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!this.isDisposed())return uT(this,t,e);OT(this.id)}}function cT(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return uT(this,t,e)}}function uT(t,e,n){return n[0]=n[0]&&n[0].toLowerCase(),bl.prototype[e].apply(t,n)}var hT,dT,pT,fT,gT,mT,yT,vT,_T,xT,bT,wT,ST,MT,CT,TT,IT,DT,kT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e}(bl),AT=kT.prototype;AT.on=cT("on"),AT.off=cT("off");var ET=function(t){function e(e,n,i){var r=t.call(this,new jM)||this;r._chartsViews=[],r._chartsMap={},r._componentsViews=[],r._componentsMap={},r._pendingActions=[],i=i||{},gs(n)&&(n=VT[n]),r._dom=e,i.ssr&&Ad(function(t){var e=Zg(t),n=e.dataIndex;if(null!=n){var i=Fs();return i.set("series_index",e.seriesIndex),i.set("data_index",n),e.ssrType&&i.set("ssr_type",e.ssrType),i}});var o=r._zr=Md(e,{renderer:i.renderer||"canvas",devicePixelRatio:i.devicePixelRatio,width:i.width,height:i.height,ssr:i.ssr,useDirtyRect:Is(i.useDirtyRect,!1),useCoarsePointer:Is(i.useCoarsePointer,"auto"),pointerSize:i.pointerSize});r._ssr=i.ssr,r._throttledZrFlush=oM(hs(o.flush,o),17),(n=$a(n))&&Q_(n,!0),r._theme=n,r._locale=function(t){if(gs(t)){var e=Hy[t.toUpperCase()]||{};return t===zy||t===Fy?$a(e):Za($a(e),$a(Hy[Vy]),!1)}return Za($a(t),$a(Hy[Vy]),!1)}(i.locale||Wy),r._coordSysMgr=new A_;var a=r._api=CT(r);function s(t,e){return t.__prio-e.__prio}return Dc(FT,s),Dc(NT,s),r._scheduler=new PM(r,a,NT,FT),r._messageCenter=new kT,r._initEvents(),r.resize=hs(r.resize,r),o.animation.on("frame",r._onframe,r),xT(o,r),bT(o,r),Os(r),r}return Ma(e,t),e.prototype._onframe=function(){if(!this._disposed){DT(this);var t=this._scheduler;if(this[rT]){var e=this[rT].silent;this[iT]=!0;try{hT(this),fT.update.call(this,null,this[rT].updateParams)}catch(t){throw this[iT]=!1,this[rT]=null,t}this._zr.flush(),this[iT]=!1,this[rT]=null,vT.call(this,e),_T.call(this,e)}else if(t.unfinished){var n=1,i=this._model,r=this._api;t.unfinished=!1;do{var o=+new Date;t.performSeriesTasks(i),t.performDataProcessorTasks(i),mT(this,i),t.performVisualTasks(i),MT(this,this._model,r,"remain",{}),n-=+new Date-o}while(n>0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,e,n){if(!this[iT])if(this._disposed)OT(this.id);else{var i,r,o;if(vs(e)&&(n=e.lazyUpdate,i=e.silent,r=e.replaceMerge,o=e.transition,e=e.notMerge),this[iT]=!0,!this._model||e){var a=new O_(this._api),s=this._theme,l=this._model=new C_;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:r},zT);var c={seriesTransition:o,optionChanged:!0};if(n)this[rT]={silent:i,updateParams:c},this[iT]=!1,this.getZr().wakeUp();else{try{hT(this),fT.update.call(this,null,c)}catch(t){throw this[rT]=null,this[iT]=!1,t}this._ssr||this._zr.flush(),this[rT]=null,this[iT]=!1,vT.call(this,i),_T.call(this,i)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Ia.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){return t=t||{},this._zr.painter.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){return t=t||{},this._zr.painter.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(Ia.svgSupported){var t=this._zr;return os(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,i=[],r=this;os(e,function(t){n.eachComponent({mainType:t},function(t){var e=r._componentsMap[t.__viewId];e.group.ignore||(i.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return os(i,function(t){t.group.ignore=!1}),o}OT(this.id)},e.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,i=Math.min,r=Math.max,o=1/0;if(WT[n]){var a=o,s=o,l=-1/0,c=-1/0,u=[],h=t&&t.pixelRatio||this.getDevicePixelRatio();os(jT,function(o,h){if(o.group===n){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas($a(t)),p=o.getDom().getBoundingClientRect();a=i(p.left,a),s=i(p.top,s),l=r(p.right,l),c=r(p.bottom,c),u.push({dom:d,left:p.left,top:p.top})}});var d=(l*=h)-(a*=h),p=(c*=h)-(s*=h),f=Pa.createCanvas(),g=Md(f,{renderer:e?"svg":"canvas"});if(g.resize({width:d,height:p}),e){var m="";return os(u,function(t){var e=t.left-a,n=t.top-s;m+='<g transform="translate('+e+","+n+')">'+t.dom+"</g>"}),g.painter.getSvgRoot().innerHTML=m,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return t.connectedBackgroundColor&&g.add(new Pg({shape:{x:0,y:0,width:d,height:p},style:{fill:t.connectedBackgroundColor}})),os(u,function(t){var e=new Cg({style:{x:t.left*h-a,y:t.top*h-s,image:t.dom}});g.add(e)}),g.refreshImmediately(),f.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}OT(this.id)},e.prototype.convertToPixel=function(t,e){return gT(this,"convertToPixel",t,e)},e.prototype.convertFromPixel=function(t,e){return gT(this,"convertFromPixel",t,e)},e.prototype.containPixel=function(t,e){var n;if(!this._disposed)return os(wp(this._model,t),function(t,i){i.indexOf("Models")>=0&&os(t,function(t){var r=t.coordinateSystem;if(r&&r.containPoint)n=n||!!r.containPoint(e);else if("seriesModels"===i){var o=this._chartsMap[t.__viewId];o&&o.containPoint&&(n=n||o.containPoint(e,t))}},this)},this),!!n;OT(this.id)},e.prototype.getVisual=function(t,e){var n=wp(this._model,t,{defaultMainType:"series"}),i=n.seriesModel.getData(),r=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=r?YM(i,r,e):XM(i,e)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t,e,n,i=this;os(PT,function(t){var e=function(e){var n,r=i.getModel(),o=e.target;if("globalout"===t?n={}:o&&JM(o,function(t){var e=Zg(t);if(e&&null!=e.dataIndex){var i=e.dataModel||r.getSeriesByIndex(e.seriesIndex);return n=i&&i.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return n=Ja({},e.eventData),!0},!0),n){var a=n.componentType,s=n.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",s=n.seriesIndex);var l=a&&null!=s&&r.getComponent(a,s),c=l&&i["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];n.event=e,n.type=t,i._$eventProcessor.eventInfo={targetEl:o,packedEvent:n,model:l,view:c},i.trigger(t,n)}};e.zrEventfulCallAtLast=!0,i._zr.on(t,e,i)}),os(BT,function(t,e){i._messageCenter.on(e,function(t){this.trigger(e,t)},i)}),os(["selectchanged"],function(t){i._messageCenter.on(t,function(e){this.trigger(t,e)},i)}),t=this._messageCenter,e=this,n=this._api,t.on("selectchanged",function(t){var i=n.getModel();t.isFromClick?(KM("map","selectchanged",e,i,t),KM("pie","selectchanged",e,i,t)):"select"===t.fromAction?(KM("map","selected",e,i,t),KM("pie","selected",e,i,t)):"unselect"===t.fromAction&&(KM("map","unselected",e,i,t),KM("pie","unselected",e,i,t))})},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){this._disposed?OT(this.id):this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed)OT(this.id);else{this._disposed=!0,this.getDom()&&Ip(this.getDom(),qT,"");var t=this,e=t._api,n=t._model;os(t._componentsViews,function(t){t.dispose(n,e)}),os(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete jT[t.id]}},e.prototype.resize=function(t){if(!this[iT])if(this._disposed)OT(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),i=t&&t.silent;this[rT]&&(null==i&&(i=this[rT].silent),n=!0,this[rT]=null),this[iT]=!0;try{n&&hT(this),fT.update.call(this,{type:"resize",animation:Ja({duration:0},t&&t.animation)})}catch(t){throw this[iT]=!1,t}this[iT]=!1,vT.call(this,i),_T.call(this,i)}}},e.prototype.showLoading=function(t,e){if(this._disposed)OT(this.id);else if(vs(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),HT[t]){var n=HT[t](this._api,e),i=this._zr;this._loadingFX=n,i.add(n)}},e.prototype.hideLoading=function(){this._disposed?OT(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},e.prototype.makeActionFromEvent=function(t){var e=Ja({},t);return e.type=BT[t.type],e},e.prototype.dispatchAction=function(t,e){if(this._disposed)OT(this.id);else if(vs(e)||(e={silent:!!e}),RT[t.type]&&this._model)if(this[iT])this._pendingActions.push(t);else{var n=e.silent;yT.call(this,t,n);var i=e.flush;i?this._zr.flush():!1!==i&&Ia.browser.weChat&&this._throttledZrFlush(),vT.call(this,n),_T.call(this,n)}},e.prototype.updateLabelLayout=function(){qC.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed)OT(this.id);else{var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},e.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function e(t){for(var e=[],n=t.currentStates,i=0;i<n.length;i++){var r=n[i];"emphasis"!==r&&"blur"!==r&&"select"!==r&&e.push(r)}t.selected&&t.states.select&&e.push("select"),2===t.hoverState&&t.states.emphasis?e.push("emphasis"):1===t.hoverState&&t.states.blur&&e.push("blur"),t.useStates(e)}function n(t,e){if(!t.preventAutoZ){var n=t.get("z")||0,r=t.get("zlevel")||0;e.eachRendered(function(t){return i(t,n,r,-1/0),!0})}}function i(t,e,n,r){var o=t.getTextContent(),a=t.getTextGuideLine();if(t.isGroup)for(var s=t.childrenRef(),l=0;l<s.length;l++)r=Math.max(i(s[l],e,n,r),r);else t.z=e,t.zlevel=n,r=Math.max(t.z2,r);if(o&&(o.z=e,o.zlevel=n,isFinite(r)&&(o.z2=r+2)),a){var c=t.textGuideLineConfig;a.z=e,a.zlevel=n,isFinite(r)&&(a.z2=r+(c&&c.showAbove?1:-1))}return r}function r(t,e){e.eachRendered(function(t){if(!ty(t)){var e=t.getTextContent(),n=t.getTextGuideLine();t.stateTransition&&(t.stateTransition=null),e&&e.stateTransition&&(e.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),t.hasState()?(t.prevStates=t.currentStates,t.clearStates()):t.prevStates&&(t.prevStates=null)}})}function o(t,n){var i=t.getModel("stateAnimation"),r=t.isAnimationEnabled(),o=i.get("duration"),a=o>0?{duration:o,delay:i.get("delay"),easing:i.get("easing")}:null;n.eachRendered(function(t){if(t.states&&t.states.emphasis){if(ty(t))return;if(t instanceof vg&&function(t){var e=tm(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var n=t.prevStates;n&&t.useStates(n)}if(r){t.stateTransition=a;var i=t.getTextContent(),o=t.getTextGuideLine();i&&(i.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&e(t)}})}hT=function(t){var e=t._scheduler;e.restorePipelines(t._model),e.prepareStageTasks(),dT(t,!0),dT(t,!1),e.plan()},dT=function(t,e){for(var n=t._model,i=t._scheduler,r=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l<r.length;l++)r[l].__alive=!1;function c(t){var l=t.__requireNewView;t.__requireNewView=!1;var c="_ec_"+t.id+"_"+t.type,u=!l&&o[c];if(!u){var h=Lp(t.type);(u=new(e?Wb.getClass(h.main,h.sub):eM.getClass(h.sub))).init(n,s),o[c]=u,r.push(u),a.add(u.group)}t.__viewId=u.__id=c,u.__alive=!0,u.__model=t,u.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&i.prepareView(u,t,n,s)}for(e?n.eachComponent(function(t,e){"series"!==t&&c(e)}):n.eachSeries(c),l=0;l<r.length;){var u=r[l];u.__alive?l++:(!e&&u.renderTask.dispose(),a.remove(u.group),u.dispose(n,s),r.splice(l,1),o[u.__id]===u&&delete o[u.__id],u.__id=u.group.__ecComponentInfo=null)}},pT=function(t,e,n,i,r){var o=t._model;if(o.setUpdatePayload(n),i){var a={};a[i+"Id"]=n[i+"Id"],a[i+"Index"]=n[i+"Index"],a[i+"Name"]=n[i+"Name"];var s={mainType:i,query:a};r&&(s.subType=r);var l,c=n.excludeSeriesId;null!=c&&(l=Fs(),os(lp(c),function(t){var e=mp(t,null);null!=e&&l.set(e,!0)})),o&&o.eachComponent(s,function(e){if(!l||null==l.get(e.id))if(Xm(n))if(e instanceof Hb)n.type!==am||n.notBlur||e.get(["emphasis","disabled"])||function(t,e,n){var i=t.seriesIndex,r=t.getData(e.dataType);if(r){var o=_p(r,e);o=(ps(o)?o[0]:o)||0;var a=r.getItemGraphicEl(o);if(!a)for(var s=r.count(),l=0;!a&&l<s;)a=r.getItemGraphicEl(l++);if(a){var c=Zg(a);Om(i,c.focus,c.blurScope,n)}else{var u=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);null!=u&&Om(i,u,h,n)}}}(e,n,t._api);else{var i=Bm(e.mainType,e.componentIndex,n.name,t._api),r=i.focusSelf,o=i.dispatchers;n.type===am&&r&&!n.notBlur&&Rm(e.mainType,e.componentIndex,t._api),o&&os(o,function(t){n.type===am?Tm(t):Im(t)})}else Ym(n)&&e instanceof Hb&&(function(t,e){if(Ym(e)){var n=e.dataType,i=_p(t.getData(n),e);ps(i)||(i=[i]),t[e.type===um?"toggleSelect":e.type===lm?"select":"unselect"](i,n)}}(e,n,t._api),Nm(e),IT(t))},t),o&&o.eachComponent(s,function(e){l&&null!=l.get(e.id)||u(t["series"===i?"_chartsMap":"_componentsMap"][e.__viewId])},t)}else os([].concat(t._componentsViews).concat(t._chartsViews),u);function u(i){i&&i.__alive&&i[e]&&i[e](i.__model,o,t._api,n)}},fT={prepareAndUpdate:function(t){hT(this),fT.update.call(this,t,{optionChanged:null!=t.newOption})},update:function(e,n){var i=this._model,r=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(i){i.setUpdatePayload(e),s.restoreData(i,e),s.performSeriesTasks(i),a.create(i,r),s.performDataProcessorTasks(i,e),mT(this,i),a.update(i,r),t(i),s.performVisualTasks(i,e),wT(this,i,r,e,n);var l=i.get("backgroundColor")||"transparent",c=i.get("darkMode");o.setBackgroundColor(l),null!=c&&"auto"!==c&&o.setDarkMode(c),qC.trigger("afterupdate",i,r)}},updateTransform:function(e){var n=this,i=this._model,r=this._api;if(i){i.setUpdatePayload(e);var o=[];i.eachComponent(function(t,a){if("series"!==t){var s=n.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,i,r,e);l&&l.update&&o.push(s)}else o.push(s)}});var a=Fs();i.eachSeries(function(t){var o=n._chartsMap[t.__viewId];if(o.updateTransform){var s=o.updateTransform(t,i,r,e);s&&s.update&&a.set(t.uid,1)}else a.set(t.uid,1)}),t(i),this._scheduler.performVisualTasks(i,e,{setDirty:!0,dirtyMap:a}),MT(this,i,r,e,{},a),qC.trigger("afterupdate",i,r)}},updateView:function(e){var n=this._model;n&&(n.setUpdatePayload(e),eM.markUpdateMethod(e,"updateView"),t(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0}),wT(this,n,this._api,e,{}),qC.trigger("afterupdate",n,this._api))},updateVisual:function(e){var n=this,i=this._model;i&&(i.setUpdatePayload(e),i.eachSeries(function(t){t.getData().clearAllVisual()}),eM.markUpdateMethod(e,"updateVisual"),t(i),this._scheduler.performVisualTasks(i,e,{visualType:"visual",setDirty:!0}),i.eachComponent(function(t,r){if("series"!==t){var o=n.getViewOfComponentModel(r);o&&o.__alive&&o.updateVisual(r,i,n._api,e)}}),i.eachSeries(function(t){n._chartsMap[t.__viewId].updateVisual(t,i,n._api,e)}),qC.trigger("afterupdate",i,this._api))},updateLayout:function(t){fT.update.call(this,t)}},gT=function(t,e,n,i){if(t._disposed)OT(t.id);else for(var r,o=t._model,a=t._coordSysMgr.getCoordinateSystems(),s=wp(o,n),l=0;l<a.length;l++){var c=a[l];if(c[e]&&null!=(r=c[e](o,s,i)))return r}},mT=function(t,e){var n=t._chartsMap,i=t._scheduler;e.eachSeries(function(t){i.updateStreamModes(t,n[t.__viewId])})},yT=function(t,e){var n=this,i=this.getModel(),r=t.type,o=t.escapeConnect,a=RT[r],s=a.actionInfo,l=(s.update||"update").split(":"),c=l.pop(),u=null!=l[0]&&Lp(l[0]);this[iT]=!0;var h=[t],d=!1;t.batch&&(d=!0,h=as(t.batch,function(e){return(e=Qa(Ja({},e),t)).batch=null,e}));var p,f=[],g=Ym(t),m=Xm(t);if(m&&Pm(this._api),os(h,function(e){if((p=(p=a.action(e,n._model,n._api))||Ja({},e)).type=s.event||p.type,f.push(p),m){var i=Sp(t),r=i.queryOptionMap,o=i.mainTypeSpecified?r.keys()[0]:"series";pT(n,c,e,o),IT(n)}else g?(pT(n,c,e,"series"),IT(n)):u&&pT(n,c,e,u.main,u.sub)}),"none"!==c&&!m&&!g&&!u)try{this[rT]?(hT(this),fT.update.call(this,t),this[rT]=null):fT[c].call(this,t)}catch(t){throw this[iT]=!1,t}if(p=d?{type:s.event||r,escapeConnect:o,batch:f}:f[0],this[iT]=!1,!e){var y=this._messageCenter;if(y.trigger(p.type,p),g){var v={type:"selectchanged",escapeConnect:o,selected:zm(i),isFromClick:t.isFromClick||!1,fromAction:t.type,fromActionPayload:t};y.trigger(v.type,v)}}},vT=function(t){for(var e=this._pendingActions;e.length;){var n=e.shift();yT.call(this,n,t)}},_T=function(t){!t&&this.trigger("updated")},xT=function(t,e){t.on("rendered",function(n){e.trigger("rendered",n),!t.animation.isFinished()||e[rT]||e._scheduler.unfinished||e._pendingActions.length||e.trigger("finished")})},bT=function(t,e){t.on("mouseover",function(t){var n=JM(t.target,qm);n&&(function(t,e,n){var i=Zg(t),r=Bm(i.componentMainType,i.componentIndex,i.componentHighDownName,n),o=r.dispatchers,a=r.focusSelf;o?(a&&Rm(i.componentMainType,i.componentIndex,n),os(o,function(t){return Mm(t,e)})):(Om(i.seriesIndex,i.focus,i.blurScope,n),"self"===i.focus&&Rm(i.componentMainType,i.componentIndex,n),Mm(t,e))}(n,t,e._api),IT(e))}).on("mouseout",function(t){var n=JM(t.target,qm);n&&(function(t,e,n){Pm(n);var i=Zg(t),r=Bm(i.componentMainType,i.componentIndex,i.componentHighDownName,n).dispatchers;r?os(r,function(t){return Cm(t,e)}):Cm(t,e)}(n,t,e._api),IT(e))}).on("click",function(t){var n=JM(t.target,function(t){return null!=Zg(t).dataIndex},!0);if(n){var i=n.selected?"unselect":"select",r=Zg(n);e._api.dispatchAction({type:i,dataType:r.dataType,dataIndexInside:r.dataIndex,seriesIndex:r.seriesIndex,isFromClick:!0})}})},wT=function(t,e,n,i,r){!function(t){var e=[],n=[],i=!1;if(t.eachComponent(function(t,r){var o=r.get("zlevel")||0,a=r.get("z")||0,s=r.getZLevelKey();i=i||!!s,("series"===t?n:e).push({zlevel:o,z:a,idx:r.componentIndex,type:t,key:s})}),i){var r,o,a=e.concat(n);Dc(a,function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel}),os(a,function(e){var n=t.getComponent(e.type,e.idx),i=e.zlevel,a=e.key;null!=r&&(i=Math.max(r,i)),a?(i===r&&a!==o&&i++,o=a):o&&(i===r&&i++,o=""),r=i,n.setZLevel(i)})}}(e),ST(t,e,n,i,r),os(t._chartsViews,function(t){t.__alive=!1}),MT(t,e,n,i,r),os(t._chartsViews,function(t){t.__alive||t.remove(e,n)})},ST=function(t,e,i,a,s,l){os(l||t._componentsViews,function(t){var s=t.__model;r(0,t),t.render(s,e,i,a),n(s,t),o(s,t)})},MT=function(t,e,i,a,s,l){var c=t._scheduler;s=Ja(s||{},{updatedSeries:e.getSeries()}),qC.trigger("series:beforeupdate",e,i,s);var u=!1;e.eachSeries(function(e){var n=t._chartsMap[e.__viewId];n.__alive=!0;var i=n.renderTask;c.updatePayload(i,a),r(0,n),l&&l.get(e.uid)&&i.dirty(),i.perform(c.getPerformArgs(i))&&(u=!0),n.group.silent=!!e.get("silent"),function(t,e){var n=t.get("blendMode")||null;e.eachRendered(function(t){t.isGroup||(t.style.blend=n)})}(e,n),Nm(e)}),c.unfinished=u||c.unfinished,qC.trigger("series:layoutlabels",e,i,s),qC.trigger("series:transition",e,i,s),e.eachSeries(function(e){var i=t._chartsMap[e.__viewId];n(e,i),o(e,i)}),function(t,e){var n=t._zr.storage,i=0;n.traverse(function(t){t.isGroup||i++}),i>e.get("hoverLayerThreshold")&&!Ia.node&&!Ia.worker&&e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){t.states.emphasis&&(t.states.emphasis.hoverLayer=!0)})}})}(t,e),qC.trigger("series:afterupdate",e,i,s)},IT=function(t){t[oT]=!0,t.getZr().wakeUp()},DT=function(t){t[oT]&&(t.getZr().storage.traverse(function(t){ty(t)||e(t)}),t[oT]=!1)},CT=function(t){return new(function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return Ma(n,e),n.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},n.prototype.enterEmphasis=function(e,n){Tm(e,n),IT(t)},n.prototype.leaveEmphasis=function(e,n){Im(e,n),IT(t)},n.prototype.enterBlur=function(e){Dm(e),IT(t)},n.prototype.leaveBlur=function(e){km(e),IT(t)},n.prototype.enterSelect=function(e){Am(e),IT(t)},n.prototype.leaveSelect=function(e){Em(e),IT(t)},n.prototype.getModel=function(){return t.getModel()},n.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},n.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},n}(I_))(t)},TT=function(t){function e(t,e){for(var n=0;n<t.length;n++)t[n][sT]=e}os(BT,function(n,i){t._messageCenter.on(i,function(n){if(WT[t.group]&&0!==t[sT]){if(n&&n.escapeConnect)return;var i=t.makeActionFromEvent(n),r=[];os(jT,function(e){e!==t&&e.group===t.group&&r.push(e)}),e(r,0),os(r,function(t){1!==t[sT]&&t.dispatchAction(i)}),e(r,2)}})})}}(),e}(bl),LT=ET.prototype;LT.on=lT("on"),LT.off=lT("off"),LT.one=function(t,e,n){var i=this;this.on.call(this,t,function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];e&&e.apply&&e.apply(this,r),i.off(t,n)},n)};var PT=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function OT(t){}var RT={},BT={},NT=[],zT=[],FT=[],VT={},HT={},jT={},WT={},GT=+new Date-0,UT=+new Date-0,qT="_echarts_instance_";function YT(t,e,n){var i=!(n&&n.ssr);if(i){var r=JT(t);if(r)return r}var o=new ET(t,e,n);return o.id="ec_"+GT++,jT[o.id]=o,i&&Ip(t,qT,o.id),TT(o),qC.trigger("afterinit",o),o}function XT(t){if(ps(t)){var e=t;t=null,os(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+UT++,os(e,function(e){e.group=t})}return WT[t]=!0,t}function $T(t){WT[t]=!1}var ZT=$T;function KT(t){gs(t)?t=jT[t]:t instanceof ET||(t=JT(t)),t instanceof ET&&!t.isDisposed()&&t.dispose()}function JT(t){return jT[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,qT)]}function QT(t){return jT[t]}function tI(t,e){VT[t]=e}function eI(t){es(zT,t)<0&&zT.push(t)}function nI(t,e){dI(NT,t,e,KC)}function iI(t){oI("afterinit",t)}function rI(t){oI("afterupdate",t)}function oI(t,e){qC.on(t,e)}function aI(t,e,n){fs(e)&&(n=e,e="");var i=vs(t)?t.type:[t,t={event:e}][0];t.event=(t.event||i).toLowerCase(),e=t.event,BT[e]||(Es(aT.test(i)&&aT.test(e)),RT[i]||(RT[i]={action:n,actionInfo:t}),BT[e]=i)}function sI(t,e){A_.register(t,e)}function lI(t){var e=A_.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function cI(t,e){dI(FT,t,e,JC,"layout")}function uI(t,e){dI(FT,t,e,tT,"visual")}var hI=[];function dI(t,e,n,i,r){if((fs(e)||vs(e))&&(n=e,e=i),!(es(hI,n)>=0)){hI.push(n);var o=PM.wrapStageHandler(n,r);o.__prio=e,o.__raw=n,t.push(o)}}function pI(t,e){HT[t]=e}function fI(t){Oa({createCanvas:t})}function gI(t,e,n){var i=XC("registerMap");i&&i(t,e,n)}function mI(t){var e=XC("getMap");return e&&e(t)}var yI=function(t){var e=(t=$a(t)).type;e||Px("");var n=e.split(":");2!==n.length&&Px("");var i=!1;"echarts"===n[0]&&(e=n[1],i=!0),t.__isBuiltIn=i,Yx.set(e,t)};uI(QC,pM),uI(eT,gM),uI(eT,mM),uI(QC,UM),uI(eT,qM),uI(7e3,function(t,e){t.eachRawSeries(function(n){if(!t.isSeriesFiltered(n)){var i=n.getData();i.hasItemVisual()&&i.each(function(t){var n=i.getItemVisual(t,"decal");n&&(i.ensureUniqueItemVisual(t,"style").decal=jC(n,e))});var r=i.getVisual("decal");r&&(i.getVisual("style").decal=jC(r,e))}})}),eI(Q_),nI(900,function(t){var e=Fs();t.eachSeries(function(t){var n=t.get("stack");if(n){var i=e.get(n)||e.set(n,[]),r=t.getData(),o={stackResultDimension:r.getCalculationInfo("stackResultDimension"),stackedOverDimension:r.getCalculationInfo("stackedOverDimension"),stackedDimension:r.getCalculationInfo("stackedDimension"),stackedByDimension:r.getCalculationInfo("stackedByDimension"),isStackedByIndex:r.getCalculationInfo("isStackedByIndex"),data:r,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;i.length&&r.setCalculationInfo("stackedOnSeries",i[i.length-1].seriesModel),i.push(o)}}),e.each(tx)}),pI("default",function(t,e){Qa(e=e||{},{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var n=new _d,i=new Pg({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(i);var r,o=new $g({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Pg({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((r=new Qw({shape:{startAngle:-yM/2,endAngle:-yM/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*yM/2}).start("circularInOut"),r.animateShape(!0).when(1e3,{startAngle:3*yM/2}).delay(300).start("circularInOut"),n.add(r)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),c=t.getHeight()/2;e.showSpinner&&r.setShape({cx:l,cy:c}),a.setShape({x:l-s,y:c-s,width:2*s,height:2*s}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),aI({type:am,event:am,update:am},Gs),aI({type:sm,event:sm,update:sm},Gs),aI({type:lm,event:lm,update:lm},Gs),aI({type:cm,event:cm,update:cm},Gs),aI({type:um,event:um,update:um},Gs),tI("light",RM),tI("dark",HM);var vI={},_I=[],xI={registerPreprocessor:eI,registerProcessor:nI,registerPostInit:iI,registerPostUpdate:rI,registerUpdateLifecycle:oI,registerAction:aI,registerCoordinateSystem:sI,registerLayout:cI,registerVisual:uI,registerTransform:yI,registerLoading:pI,registerMap:gI,registerImpl:function(t,e){YC[t]=e},PRIORITY:nT,ComponentModel:Uv,ComponentView:Wb,SeriesModel:Hb,ChartView:eM,registerComponentModel:function(t){Uv.registerClass(t)},registerComponentView:function(t){Wb.registerClass(t)},registerSeriesModel:function(t){Hb.registerClass(t)},registerChartView:function(t){eM.registerClass(t)},registerSubTypeDefaulter:function(t,e){Uv.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Dd(t,e)}};function bI(t){ps(t)?os(t,function(t){bI(t)}):es(_I,t)>=0||(_I.push(t),fs(t)&&(t={install:t}),t.install(xI))}function wI(t){return null==t?0:t.length||1}function SI(t){return t}var MI=function(){function t(t,e,n,i,r,o){this._old=t,this._new=e,this._oldKeyGetter=n||SI,this._newKeyGetter=i||SI,this.context=r,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},i=new Array(t.length),r=new Array(e.length);this._initIndexMap(t,null,i,"_oldKeyGetter"),this._initIndexMap(e,n,r,"_newKeyGetter");for(var o=0;o<t.length;o++){var a=i[o],s=n[a],l=wI(s);if(l>1){var c=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(c,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(r,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},i={},r=[],o=[];this._initIndexMap(t,n,r,"_oldKeyGetter"),this._initIndexMap(e,i,o,"_newKeyGetter");for(var a=0;a<r.length;a++){var s=r[a],l=n[s],c=i[s],u=wI(l),h=wI(c);if(u>1&&1===h)this._updateManyToOne&&this._updateManyToOne(c,l),i[s]=null;else if(1===u&&h>1)this._updateOneToMany&&this._updateOneToMany(c,l),i[s]=null;else if(1===u&&1===h)this._update&&this._update(c,l),i[s]=null;else if(u>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,l),i[s]=null;else if(u>1)for(var d=0;d<u;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,i)},t.prototype._performRestAdd=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[i],o=wI(r);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(r[a]);else 1===o&&this._add&&this._add(r);e[i]=null}},t.prototype._initIndexMap=function(t,e,n,i){for(var r=this._diffModeMultiple,o=0;o<t.length;o++){var a="_ec_"+this[i](t[o],o);if(r||(n[o]=a),e){var s=e[a],l=wI(s);0===l?(e[a]=o,r&&n.push(a)):1===l?e[a]=[s,o]:s.push(o)}}},t}();const CI=MI;var TI=function(){function t(t,e){this._encode=t,this._schema=e}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function II(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function DI(t){return"category"===t?"ordinal":"time"===t?"time":"float"}const kI=function(t){this.otherDims={},null!=t&&Ja(this,t)};var AI=xp(),EI={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},LI=function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=RI(this.source)))},t.prototype.getSourceDimensionIndex=function(t){return Is(this._dimNameMap.get(t),-1)},t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=px(this.source),n=!BI(t),i="",r=[],o=0,a=0;o<t;o++){var s=void 0,l=void 0,c=void 0,u=this.dimensions[a];if(u&&u.storeDimIndex===o)s=e?u.name:null,l=u.type,c=u.ordinalMeta,a++;else{var h=this.getSourceDimension(o);h&&(s=e?h.name:null,l=h.type)}r.push({property:s,type:l,ordinalMeta:c}),!e||null==s||u&&u.isCalculationCoord||(i+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),i+="$",i+=EI[l]||"f",c&&(i+=c.uid),i+="$"}var d=this.source;return{dimensions:r,hash:[d.seriesLayoutBy,d.startIndex,i].join("$$")}},t.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,n=0;e<this._fullDimCount;e++){var i=void 0,r=this.dimensions[n];if(r&&r.storeDimIndex===e)r.isCalculationCoord||(i=r.name),n++;else{var o=this.getSourceDimension(e);o&&(i=o.name)}t.push(i)}return t},t.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t}();function PI(t){return t instanceof LI}function OI(t){for(var e=Fs(),n=0;n<(t||[]).length;n++){var i=t[n],r=vs(i)?i.name:i;null!=r&&null==e.get(r)&&e.set(r,n)}return e}function RI(t){var e=AI(t);return e.dimNameMap||(e.dimNameMap=OI(t.dimensionsDefine))}function BI(t){return t>30}var NI,zI,FI,VI,HI,jI,WI,GI=vs,UI=as,qI="undefined"==typeof Int32Array?Array:Int32Array,YI=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],XI=["_approximateExtent"],$I=function(){function t(t,e){var n;this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var i=!1;PI(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(i=!0,n=t),n=n||["x","y"];for(var r={},o=[],a={},s=!1,l={},c=0;c<n.length;c++){var u=n[c],h=gs(u)?new kI({name:u}):u instanceof kI?u:new kI(u),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),r[d]=h,null!=l[d]&&(s=!0),h.createInvertedIndices&&(a[d]=[]),0===p.itemName&&(this._nameDimIdx=c),0===p.itemId&&(this._idDimIdx=c),i&&(h.storeDimIndex=c)}if(this.dimensions=o,this._dimInfos=r,this._initGetDimensionInfo(s),this.hostModel=e,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=Fs();os(o,function(t){f.set(r[t].storeDimIndex,t)})}}return t.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(null==e)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];var n=this._dimIdxToName.get(e);if(null!=n)return n;var i=this._schema.getSourceDimension(e);return i?i.name:void 0},t.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(null!=e)return e;if(null==t)return-1;var n=this._getDimInfo(t);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},t.prototype._recognizeDimIndex=function(t){if(ys(t)||null!=t&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},t.prototype._getStoreDimIndex=function(t){return this.getDimensionIndex(t)},t.prototype.getDimensionInfo=function(t){return this._getDimInfo(this.getDimension(t))},t.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(t){return e.hasOwnProperty(t)?e[t]:void 0}:function(t){return e[t]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(t,e){var n=this._dimSummary;if(null==e)return n.encodeFirstDimNotExtra[t];var i=n.encode[t];return i?i[e]:null},t.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(t,e,n){var i,r=this;if(t instanceof lb&&(i=t),!i){var o=this.dimensions,a=sx(t)||rs(t)?new fx(t,o.length):t;i=new lb;var s=UI(o,function(t){return{type:r._dimInfos[t].type,property:t}});i.initData(a,s,n)}this._store=i,this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=function(t,e){var n={},i=n.encode={},r=Fs(),o=[],a=[],s={};os(t.dimensions,function(e){var n,l=t.getDimensionInfo(e),c=l.coordDim;if(c){var u=l.coordDimIndex;II(i,c)[u]=e,l.isExtraCoord||(r.set(c,1),"ordinal"!==(n=l.type)&&"time"!==n&&(o[0]=e),II(s,c)[u]=t.getDimensionIndex(l.name)),l.defaultTooltip&&a.push(e)}$v.each(function(t,e){var n=II(i,e),r=l.otherDims[e];null!=r&&!1!==r&&(n[r]=l.name)})});var l=[],c={};r.each(function(t,e){var n=i[e];c[e]=n[0],l=l.concat(n)}),n.dataDimsOnCoord=l,n.dataDimIndicesOnCoord=as(l,function(e){return t.getDimensionInfo(e).storeDimIndex}),n.encodeFirstDimNotExtra=c;var u=i.label;u&&u.length&&(o=u.slice());var h=i.tooltip;return h&&h.length?a=h.slice():a.length||(a=o.slice()),i.defaultedLabel=o,i.defaultedTooltip=a,n.userOutput=new TI(s,e),n}(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},t.prototype.appendValues=function(t,e){var n=this._store.appendValues(t,e&&e.length),i=n.start,r=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var a=i;a<r;a++){var s=a-i;this._nameList[a]=e[s],o&&WI(this,a)}},t.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,n=0;n<e.length;n++){var i=this._dimInfos[e[n]];i.ordinalMeta&&t.collectOrdinalMeta(i.storeDimIndex,i.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return null==this._idDimIdx&&t.getSource().sourceFormat!==t_&&!t.fillStorage},t.prototype._doInit=function(t,e){if(!(t>=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var i=this._nameList,r=this._idList;if(n.getSource().sourceFormat===Zv&&!n.pure)for(var o=[],a=t;a<e;a++){var s=n.getItem(a,o);if(!this.hasItemOption&&dp(s)&&(this.hasItemOption=!0),s){var l=s.name;null==i[a]&&null!=l&&(i[a]=mp(l,null));var c=s.id;null==r[a]&&null!=c&&(r[a]=mp(c,null))}}if(this._shouldMakeIdFromName())for(a=t;a<e;a++)WI(this,a);NI(this)}},t.prototype.getApproximateExtent=function(t){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t))},t.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},t.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},t.prototype.setCalculationInfo=function(t,e){GI(t)?Ja(this._calculationInfo,t):this._calculationInfo[t]=e},t.prototype.getName=function(t){var e=this.getRawIndex(t),n=this._nameList[e];return null==n&&null!=this._nameDimIdx&&(n=FI(this,this._nameDimIdx,e)),null==n&&(n=""),n},t.prototype._getCategory=function(t,e){var n=this._store.get(t,e),i=this._store.getOrdinalMeta(t);return i?i.categories[n]:n},t.prototype.getId=function(t){return zI(this,this.getRawIndex(t))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.get(i.storeDimIndex,e)},t.prototype.getByRawIndex=function(t,e){var n=this._store,i=this._dimInfos[t];if(i)return n.getByRawIndex(i.storeDimIndex,e)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t))},t.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},t.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},t.prototype.getValues=function(t,e){var n=this,i=this._store;return ps(t)?i.getValues(UI(t,function(t){return n._getStoreDimIndex(t)}),e):i.getValues(t)},t.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,n=0,i=e.length;n<i;n++)if(isNaN(this._store.get(e[n],t)))return!1;return!0},t.prototype.indexOfName=function(t){for(var e=0,n=this._store.count();e<n;e++)if(this.getName(e)===t)return e;return-1},t.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},t.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},t.prototype.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t],i=n&&n[e];return null==i||isNaN(i)?-1:i},t.prototype.indicesOfNearest=function(t,e,n){return this._store.indicesOfNearest(this._getStoreDimIndex(t),e,n)},t.prototype.each=function(t,e,n){fs(t)&&(n=e,e=t,t=[]);var i=n||this,r=UI(VI(t),this._getStoreDimIndex,this);this._store.each(r,i?hs(e,i):e)},t.prototype.filterSelf=function(t,e,n){fs(t)&&(n=e,e=t,t=[]);var i=n||this,r=UI(VI(t),this._getStoreDimIndex,this);return this._store=this._store.filter(r,i?hs(e,i):e),this},t.prototype.selectRange=function(t){var e=this,n={},i=us(t),r=[];return os(i,function(i){var o=e._getStoreDimIndex(i);n[o]=t[i],r.push(o)}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(t,e,n){fs(t)&&(n=e,e=t,t=[]),n=n||this;var i=[];return this.each(t,function(){i.push(e&&e.apply(this,arguments))},n),i},t.prototype.map=function(t,e,n,i){var r=n||i||this,o=UI(VI(t),this._getStoreDimIndex,this),a=jI(this);return a._store=this._store.map(o,r?hs(e,r):e),a},t.prototype.modify=function(t,e,n,i){var r=n||i||this,o=UI(VI(t),this._getStoreDimIndex,this);this._store.modify(o,r?hs(e,r):e)},t.prototype.downSample=function(t,e,n,i){var r=jI(this);return r._store=this._store.downSample(this._getStoreDimIndex(t),e,n,i),r},t.prototype.minmaxDownSample=function(t,e){var n=jI(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),e),n},t.prototype.lttbDownSample=function(t,e){var n=jI(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),n},t.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},t.prototype.getItemModel=function(t){var e=this.hostModel,n=this.getRawDataItem(t);return new Oy(n,e,e&&e.ecModel)},t.prototype.diff=function(t){var e=this;return new CI(t?t.getStore().getIndices():[],this.getStore().getIndices(),function(e){return zI(t,e)},function(t){return zI(e,t)})},t.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},t.prototype.setVisual=function(t,e){this._visual=this._visual||{},GI(t)?Ja(this._visual,t):this._visual[t]=e},t.prototype.getItemVisual=function(t,e){var n=this._itemVisuals[t],i=n&&n[e];return null==i?this.getVisual(e):i},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,i=n[t];i||(i=n[t]={});var r=i[e];return null==r&&(ps(r=this.getVisual(e))?r=r.slice():GI(r)&&(r=Ja({},r)),i[e]=r),r},t.prototype.setItemVisual=function(t,e,n){var i=this._itemVisuals[t]||{};this._itemVisuals[t]=i,GI(e)?Ja(i,e):i[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){GI(t)?Ja(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?Ja(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;Kg(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){os(this._graphicEls,function(n,i){n&&t&&t.call(e,n,i)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:UI(this.dimensions,this._getDimInfo,this),this.hostModel)),HI(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];fs(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(ks(arguments)))})},t.internalField=(NI=function(t){var e=t._invertedIndicesMap;os(e,function(n,i){var r=t._dimInfos[i],o=r.ordinalMeta,a=t._store;if(o){n=e[i]=new qI(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)n[a.get(r.storeDimIndex,s)]=s}})},FI=function(t,e,n){return mp(t._getCategory(e,n),null)},zI=function(t,e){var n=t._idList[e];return null==n&&null!=t._idDimIdx&&(n=FI(t,t._idDimIdx,e)),null==n&&(n="e\0\0"+e),n},VI=function(t){return ps(t)||(t=null!=t?[t]:[]),t},jI=function(e){var n=new t(e._schema?e._schema:UI(e.dimensions,e._getDimInfo,e),e.hostModel);return HI(n,e),n},HI=function(t,e){os(YI.concat(e.__wrappedMethods||[]),function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t.__wrappedMethods=e.__wrappedMethods,os(XI,function(n){t[n]=$a(e[n])}),t._calculationInfo=Ja({},e._calculationInfo)},void(WI=function(t,e){var n=t._nameList,i=t._idList,r=t._nameDimIdx,o=t._idDimIdx,a=n[e],s=i[e];if(null==a&&null!=r&&(n[e]=a=FI(t,r,e)),null==s&&null!=o&&(i[e]=s=FI(t,o,e)),null==s&&null!=a){var l=t._nameRepeatCount,c=l[a]=(l[a]||0)+1;s=a,c>1&&(s+="__ec__"+c),i[e]=s}})),t}();const ZI=$I;function KI(t,e){return JI(t,e).dimensions}function JI(t,e){sx(t)||(t=cx(t));var n=(e=e||{}).coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],r=Fs(),o=[],a=function(t,e,n,i){var r=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,i||0);return os(e,function(t){var e;vs(t)&&(e=t.dimsDef)&&(r=Math.max(r,e.length))}),r}(t,n,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&BI(a),l=i===t.dimensionsDefine,c=l?RI(t):OI(i),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,a));for(var h=Fs(u),d=new tb(a),p=0;p<d.length;p++)d[p]=-1;function f(t){var e=d[t];if(e<0){var n=i[t],r=vs(n)?n:{name:n},a=new kI,s=r.name;null!=s&&null!=c.get(s)&&(a.name=a.displayName=s),null!=r.type&&(a.type=r.type),null!=r.displayName&&(a.displayName=r.displayName);var l=o.length;return d[t]=l,a.storeDimIndex=t,o.push(a),a}return o[e]}if(!s)for(p=0;p<a;p++)f(p);h.each(function(t,e){var n=lp(t).slice();if(1===n.length&&!gs(n[0])&&n[0]<0)h.set(e,!1);else{var i=h.set(e,[]);os(n,function(t,n){var r=gs(t)?c.get(t):t;null!=r&&r<a&&(i[n]=r,m(f(r),e,n))})}});var g=0;function m(t,e,n){null!=$v.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,r.set(e,!0))}os(n,function(t){var e,n,i,r;if(gs(t))e=t,r={};else{e=(r=t).name;var o=r.ordinalMeta;r.ordinalMeta=null,(r=Ja({},r)).ordinalMeta=o,n=r.dimsDef,i=r.otherDims,r.name=r.coordDim=r.coordDimIndex=r.dimsDef=r.otherDims=null}var s=h.get(e);if(!1!==s){if(!(s=lp(s)).length)for(var c=0;c<(n&&n.length||1);c++){for(;g<a&&null!=f(g).coordDim;)g++;g<a&&s.push(g++)}os(s,function(t,o){var a=f(t);if(l&&null!=r.type&&(a.type=r.type),m(Qa(a,r),e,o),null==a.name&&n){var s=n[o];!vs(s)&&(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}i&&Qa(a.otherDims,i)})}});var y=e.generateCoord,v=e.generateCoordCount,_=null!=v;v=y?v||1:0;var x=y||"value";function b(t){null==t.name&&(t.name=t.coordDim)}if(s)os(o,function(t){b(t)}),o.sort(function(t,e){return t.storeDimIndex-e.storeDimIndex});else for(var w=0;w<a;w++){var S=f(w);null==S.coordDim&&(S.coordDim=QI(x,r,_),S.coordDimIndex=0,(!y||v<=0)&&(S.isExtraCoord=!0),v--),b(S),null!=S.type||c_(t,w)!==r_.Must&&(!S.isExtraCoord||null==S.otherDims.itemName&&null==S.otherDims.seriesName)||(S.type="ordinal")}return function(t){for(var e=Fs(),n=0;n<t.length;n++){var i=t[n],r=i.name,o=e.get(r)||0;o>0&&(i.name=r+(o-1)),o++,e.set(r,o)}}(o),new LI({source:t,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function QI(t,e,n){if(n||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var tD=function(t){this.coordSysDims=[],this.axisMap=Fs(),this.categoryAxisMap=Fs(),this.coordSysName=t},eD={cartesian2d:function(t,e,n,i){var r=t.getReferringComponents("xAxis",Mp).models[0],o=t.getReferringComponents("yAxis",Mp).models[0];e.coordSysDims=["x","y"],n.set("x",r),n.set("y",o),nD(r)&&(i.set("x",r),e.firstCategoryDimIndex=0),nD(o)&&(i.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,i){var r=t.getReferringComponents("singleAxis",Mp).models[0];e.coordSysDims=["single"],n.set("single",r),nD(r)&&(i.set("single",r),e.firstCategoryDimIndex=0)},polar:function(t,e,n,i){var r=t.getReferringComponents("polar",Mp).models[0],o=r.findAxisModel("radiusAxis"),a=r.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),nD(o)&&(i.set("radius",o),e.firstCategoryDimIndex=0),nD(a)&&(i.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,i){var r=t.ecModel,o=r.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();os(o.parallelAxisIndex,function(t,o){var s=r.getComponent("parallelAxis",t),l=a[o];n.set(l,s),nD(s)&&(i.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))})}};function nD(t){return"category"===t.get("type")}function iD(t,e,n){var i,r,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!PI(t.schema)}(e)?(r=e.schema,i=r.dimensions,o=e.store):i=e;var l,c,u,h,d=!(!t||!t.get("stack"));if(os(i,function(t,e){gs(t)&&(i[e]=t={name:t}),d&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),c||"ordinal"===t.type||"time"===t.type||s&&s!==t.coordDim||(c=t))}),!c||a||l||(a=!0),c){u="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var p=c.coordDim,f=c.type,g=0;os(i,function(t){t.coordDim===p&&g++});var m={name:u,coordDim:p,coordDimIndex:g,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},y={name:h,coordDim:h,coordDimIndex:g+1,type:f,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};r?(o&&(m.storeDimIndex=o.ensureCalculationDimension(h,f),y.storeDimIndex=o.ensureCalculationDimension(u,f)),r.appendCalculationDimension(m),r.appendCalculationDimension(y)):(i.push(m),i.push(y))}return{stackedDimension:c&&c.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:h,stackResultDimension:u}}function rD(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function oD(t,e){return rD(t,e)?t.getCalculationInfo("stackResultDimension"):e}const aD=function(t,e,n){n=n||{};var i,r=e.getSourceManager(),o=!1;t?(o=!0,i=cx(t)):o=(i=r.getSource()).sourceFormat===Zv;var a=function(t){var e=t.get("coordinateSystem"),n=new tD(e),i=eD[e];if(i)return i(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,i=t.get("coordinateSystem"),r=A_.get(i);return e&&e.coordSysDims&&(n=as(e.coordSysDims,function(t){var n={name:t},i=e.axisMap.get(t);if(i){var r=i.get("type");n.type=DI(r)}return n})),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,c=fs(l)?l:l?ds(a_,s,e):null,u=JI(i,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!o}),h=function(t,e,n){var i,r;return n&&os(t,function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==i&&(i=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(r=!0)}),r||null==i||(t[i].otherDims.itemName=0),i}(u.dimensions,n.createInvertedIndices,a),d=o?null:r.getSharedDataStore(u),p=iD(e,{schema:u,store:d}),f=new ZI(u,e);f.setCalculationInfo(p);var g=null!=h&&function(t){if(t.sourceFormat===Zv){var e=function(t){for(var e=0;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return!ps(hp(e))}}(i)?function(t,e,n,i){return i===h?n:this.defaultDimValueGetter(t,e,n,i)}:null;return f.hasItemOption=!1,f.initData(o?i:d,null,g),f};var sD=function(){function t(t){this._setting=t||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(t){return this._setting[t]},t.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1])},t.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=t),isNaN(e)||(n[1]=e)},t.prototype.isInExtentRange=function(t){return this._extent[0]<=t&&this._extent[1]>=t},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();zp(sD);const lD=sD;var cD=0,uD=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++cD}return t.createByAxisModel=function(e){var n=e.option,i=n.data,r=i&&as(i,hD);return new t({categories:r,needCollect:!r,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!gs(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=this._getOrCreateMap();return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=Fs(this.categories))},t}();function hD(t){return vs(t)&&null!=t.value?t.value:t+""}const dD=uD;function pD(t){return"interval"===t.type||"log"===t.type}function fD(t){var e=Math.pow(10,Zd(t)),n=t/e;return n?2===n?n=3:3===n?n=5:n*=2:n=1,Bd(n*e)}function gD(t){return zd(t)+2}function mD(t,e,n){t[e]=Math.max(Math.min(t[e],n[1]),n[0])}function yD(t,e){return t>=e[0]&&t<=e[1]}function vD(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function _D(t,e){return t*(e[1]-e[0])+e[0]}var xD=function(t){function e(e){var n=t.call(this,e)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new dD({})),ps(i)&&(i=new dD({categories:as(i,function(t){return vs(t)?t.value:t})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return Ma(e,t),e.prototype.parse=function(t){return null==t?NaN:gs(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return yD(t=this.parse(t),this._extent)&&null!=this._ordinalMeta.categories[t]},e.prototype.normalize=function(t){return vD(t=this._getTickNumber(this.parse(t)),this._extent)},e.prototype.scale=function(t){return t=Math.round(_D(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],e=this._extent,n=e[0];n<=e[1];)t.push({value:n}),n++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],r=0,o=this._ordinalMeta.categories.length,a=Math.min(o,e.length);r<a;++r){var s=e[r];n[r]=s,i[s]=r}for(var l=0;r<o;++r){for(;null!=i[l];)l++;n.push(l),i[l]=r}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},e.prototype._getTickNumber=function(t){var e=this._ticksByOrdinalNumber;return e&&t>=0&&t<e.length?e[t]:t},e.prototype.getRawOrdinalNumber=function(t){var e=this._ordinalNumbersByTick;return e&&t>=0&&t<e.length?e[t]:t},e.prototype.getLabel=function(t){if(!this.isBlank()){var e=this.getRawOrdinalNumber(t.value),n=this._ordinalMeta.categories[e];return null==n?"":n+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.isInExtentRange=function(t){return t=this._getTickNumber(t),this._extent[0]<=t&&this._extent[1]>=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(lD);lD.registerClass(xD);const bD=xD;var wD=Bd,SD=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="interval",e._interval=0,e._intervalPrecision=2,e}return Ma(e,t),e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return yD(t,this._extent)},e.prototype.normalize=function(t){return vD(t,this._extent)},e.prototype.scale=function(t){return _D(t,this._extent)},e.prototype.setExtent=function(t,e){var n=this._extent;isNaN(t)||(n[0]=parseFloat(t)),isNaN(e)||(n[1]=parseFloat(e))},e.prototype.unionExtent=function(t){var e=this._extent;t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]),this.setExtent(e[0],e[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=gD(t)},e.prototype.getTicks=function(t){var e=this._interval,n=this._extent,i=this._niceExtent,r=this._intervalPrecision,o=[];if(!e)return o;n[0]<i[0]&&(t?o.push({value:wD(i[0]-e,r)}):o.push({value:n[0]}));for(var a=i[0];a<=i[1]&&(o.push({value:a}),(a=wD(a+e,r))!==o[o.length-1].value);)if(o.length>1e4)return[];var s=o.length?o[o.length-1].value:i[1];return n[1]>s&&(t?o.push({value:wD(s+e,r)}):o.push({value:n[1]})),o},e.prototype.getMinorTicks=function(t){for(var e=this.getTicks(!0),n=[],i=this.getExtent(),r=1;r<e.length;r++){for(var o=e[r],a=e[r-1],s=0,l=[],c=(o.value-a.value)/t;s<t-1;){var u=wD(a.value+(s+1)*c);u>i[0]&&u<i[1]&&l.push(u),s++}n.push(l)}return n},e.prototype.getLabel=function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=zd(t.value)||0:"auto"===n&&(n=this._intervalPrecision),xv(wD(t.value,n,!0))},e.prototype.calcNiceTicks=function(t,e,n){t=t||5;var i=this._extent,r=i[1]-i[0];if(isFinite(r)){r<0&&(r=-r,i.reverse());var o=function(t,e,n,i){var r={},o=t[1]-t[0],a=r.interval=Kd(o/e,!0);null!=n&&a<n&&(a=r.interval=n),null!=i&&a>i&&(a=r.interval=i);var s=r.intervalPrecision=gD(a);return function(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),mD(t,0,e),mD(t,1,e),t[0]>t[1]&&(t[0]=t[1])}(r.niceTickExtent=[Bd(Math.ceil(t[0]/a)*a,s),Bd(Math.floor(t[1]/a)*a,s)],t),r}(i,t,e,n);this._intervalPrecision=o.intervalPrecision,this._interval=o.interval,this._niceExtent=o.niceTickExtent}},e.prototype.calcNiceExtent=function(t){var e=this._extent;if(e[0]===e[1])if(0!==e[0]){var n=Math.abs(e[0]);t.fixMax||(e[1]+=n/2),e[0]-=n/2}else e[1]=1;var i=e[1]-e[0];isFinite(i)||(e[0]=0,e[1]=1),this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval);var r=this._interval;t.fixMin||(e[0]=wD(Math.floor(e[0]/r)*r)),t.fixMax||(e[1]=wD(Math.ceil(e[1]/r)*r))},e.prototype.setNiceExtent=function(t,e){this._niceExtent=[t,e]},e.type="interval",e}(lD);lD.registerClass(SD);const MD=SD;var CD="undefined"!=typeof Float32Array,TD=CD?Float32Array:Array;function ID(t){return ps(t)?CD?new Float32Array(t):t:new TD(t)}var DD="__ec_stack_";function kD(t){return t.get("stack")||DD+t.seriesIndex}function AD(t){return t.dim+t.index}function ED(t,e){var n=[];return e.eachSeriesByType(t,function(t){BD(t)&&n.push(t)}),n}function LD(t){var e=function(t){var e={};os(t,function(t){var n=t.coordinateSystem.getBaseAxis();if("time"===n.type||"value"===n.type)for(var i=t.getData(),r=n.dim+"_"+n.index,o=i.getDimensionIndex(i.mapDimension(n.dim)),a=i.getStore(),s=0,l=a.count();s<l;++s){var c=a.get(o,s);e[r]?e[r].push(c):e[r]=[c]}});var n={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(r){r.sort(function(t,e){return t-e});for(var o=null,a=1;a<r.length;++a){var s=r[a]-r[a-1];s>0&&(o=null===o?s:Math.min(o,s))}n[i]=o}}return n}(t),n=[];return os(t,function(t){var i,r=t.coordinateSystem.getBaseAxis(),o=r.getExtent();if("category"===r.type)i=r.getBandWidth();else if("value"===r.type||"time"===r.type){var a=r.dim+"_"+r.index,s=e[a],l=Math.abs(o[1]-o[0]),c=r.scale.getExtent(),u=Math.abs(c[1]-c[0]);i=s?l/u*s:l}else{var h=t.getData();i=Math.abs(o[1]-o[0])/h.count()}var d=Rd(t.get("barWidth"),i),p=Rd(t.get("barMaxWidth"),i),f=Rd(t.get("barMinWidth")||(ND(t)?.5:1),i),g=t.get("barGap"),m=t.get("barCategoryGap");n.push({bandWidth:i,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:AD(r),stackId:kD(t)})}),PD(n)}function PD(t){var e={};os(t,function(t,n){var i=t.axisKey,r=t.bandWidth,o=e[i]||{bandWidth:r,remainedWidth:r,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},a=o.stacks;e[i]=o;var s=t.stackId;a[s]||o.autoWidthCount++,a[s]=a[s]||{width:0,maxWidth:0};var l=t.barWidth;l&&!a[s].width&&(a[s].width=l,l=Math.min(o.remainedWidth,l),o.remainedWidth-=l);var c=t.barMaxWidth;c&&(a[s].maxWidth=c);var u=t.barMinWidth;u&&(a[s].minWidth=u);var h=t.barGap;null!=h&&(o.gap=h);var d=t.barCategoryGap;null!=d&&(o.categoryGap=d)});var n={};return os(e,function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=t.categoryGap;if(null==o){var a=us(i).length;o=Math.max(35-4*a,15)+"%"}var s=Rd(o,r),l=Rd(t.gap,1),c=t.remainedWidth,u=t.autoWidthCount,h=(c-s)/(u+(u-1)*l);h=Math.max(h,0),os(i,function(t){var e=t.maxWidth,n=t.minWidth;if(t.width)i=t.width,e&&(i=Math.min(i,e)),n&&(i=Math.max(i,n)),t.width=i,c-=i+l*i,u--;else{var i=h;e&&e<i&&(i=Math.min(e,c)),n&&n>i&&(i=n),i!==h&&(t.width=i,c-=i+l*i,u--)}}),h=(c-s)/(u+(u-1)*l),h=Math.max(h,0);var d,p=0;os(i,function(t,e){t.width||(t.width=h),d=t,p+=t.width*(1+l)}),d&&(p-=d.width*l);var f=-p/2;os(i,function(t,i){n[e][i]=n[e][i]||{bandWidth:r,offset:f,width:t.width},f+=t.width*(1+l)})}),n}function OD(t,e){var n=ED(t,e),i=LD(n);os(n,function(t){var e=t.getData(),n=t.coordinateSystem.getBaseAxis(),r=kD(t),o=i[AD(n)][r],a=o.offset,s=o.width;e.setLayout({bandWidth:o.bandWidth,offset:a,size:s})})}function RD(t){return{seriesType:t,plan:Gb(),reset:function(t){if(BD(t)){var e=t.getData(),n=t.coordinateSystem,i=n.getBaseAxis(),r=n.getOtherAxis(i),o=e.getDimensionIndex(e.mapDimension(r.dim)),a=e.getDimensionIndex(e.mapDimension(i.dim)),s=t.get("showBackground",!0),l=e.mapDimension(r.dim),c=e.getCalculationInfo("stackResultDimension"),u=rD(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),h=r.isHorizontal(),d=function(t,e){var n=e.model.get("startValue");return n||(n=0),e.toGlobalCoord(e.dataToCoord("log"===e.type?n>0?n:1:n))}(0,r),p=ND(t),f=t.get("barMinHeight")||0,g=c&&e.getDimensionIndex(c),m=e.getLayout("size"),y=e.getLayout("offset");return{progress:function(t,e){for(var i,r=t.count,l=p&&ID(3*r),c=p&&s&&ID(3*r),v=p&&ID(r),_=n.master.getRect(),x=h?_.width:_.height,b=e.getStore(),w=0;null!=(i=t.next());){var S=b.get(u?g:o,i),M=b.get(a,i),C=d,T=void 0;u&&(T=+S-b.get(o,i));var I=void 0,D=void 0,k=void 0,A=void 0;if(h){var E=n.dataToPoint([S,M]);u&&(C=n.dataToPoint([T,M])[0]),I=C,D=E[1]+y,k=E[0]-C,A=m,Math.abs(k)<f&&(k=(k<0?-1:1)*f)}else E=n.dataToPoint([M,S]),u&&(C=n.dataToPoint([M,T])[1]),I=E[0]+y,D=C,k=m,A=E[1]-C,Math.abs(A)<f&&(A=(A<=0?-1:1)*f);p?(l[w]=I,l[w+1]=D,l[w+2]=h?k:A,c&&(c[w]=h?_.x:I,c[w+1]=h?D:_.y,c[w+2]=x),v[i]=i):e.setItemLayout(i,{x:I,y:D,width:k,height:A}),w+=3}p&&e.setLayout({largePoints:l,largeDataIndices:v,largeBackgroundPoints:c,valueAxisHorizontal:h})}}}}}}function BD(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}function ND(t){return t.pipelineContext&&t.pipelineContext.large}var zD=function(t){function e(e){var n=t.call(this,e)||this;return n.type="time",n}return Ma(e,t),e.prototype.getLabel=function(t){var e=this.getSetting("useUTC");return iv(t.value,Ky[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(ev(this._minLevelUnit))]||Ky.second,e,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(t,e,n){var i=this.getSetting("useUTC");return function(t,e,n,i,r){var o=null;if(gs(n))o=n;else if(fs(n))o=n(t.value,e,{level:t.level});else{var a=Ja({},$y);if(t.level>0)for(var s=0;s<Jy.length;++s)a[Jy[s]]="{primary|"+a[Jy[s]]+"}";var l=n?!1===n.inherit?n:Qa(n,a):a,c=rv(t.value,r);if(l[c])o=l[c];else if(l.inherit){for(s=Qy.indexOf(c)-1;s>=0;--s)if(l[c]){o=l[c];break}o=o||a.none}if(ps(o)){var u=null==t.level?0:t.level>=0?t.level:o.length+t.level;o=o[u=Math.min(u,o.length-1)]}}return iv(new Date(t.value),o,r,i)}(t,e,n,this.getSetting("locale"),i)},e.prototype.getTicks=function(){var t=this._interval,e=this._extent,n=[];if(!t)return n;n.push({value:e[0],level:0});var i=this.getSetting("useUTC"),r=function(t,e,n,i){var r=Qy,o=0;function a(t,e,n,r,o,a,s){for(var l=new Date(e),c=e,u=l[r]();c<n&&c<=i[1];)s.push({value:c}),u+=t,l[o](u),c=l.getTime();s.push({value:c,notAdd:!0})}function s(t,r,o){var s=[],l=!r.length;if(!function(t,e,n,i){var r=Xd(e),o=Xd(n),a=function(t){return ov(r,t,i)===ov(o,t,i)},s=function(){return a("year")},l=function(){return s()&&a("month")},c=function(){return l()&&a("day")},u=function(){return c()&&a("hour")},h=function(){return u()&&a("minute")},d=function(){return h()&&a("second")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return h();case"second":return d();case"millisecond":return d()&&a("millisecond")}}(ev(t),i[0],i[1],n)){l&&(r=[{value:UD(new Date(i[0]),t,n)},{value:i[1]}]);for(var c=0;c<r.length-1;c++){var u=r[c].value,h=r[c+1].value;if(u!==h){var d=void 0,p=void 0,f=void 0;switch(t){case"year":d=Math.max(1,Math.round(e/Yy/365)),p=av(n),f=pv(n);break;case"half-year":case"quarter":case"month":d=HD(e),p=sv(n),f=fv(n);break;case"week":case"half-week":case"day":d=VD(e),p=lv(n),f=gv(n);break;case"half-day":case"quarter-day":case"hour":d=jD(e),p=cv(n),f=mv(n);break;case"minute":d=WD(e,!0),p=uv(n),f=yv(n);break;case"second":d=WD(e,!1),p=hv(n),f=vv(n);break;case"millisecond":d=GD(e),p=dv(n),f=_v(n)}a(d,u,h,p,f,0,s),"year"===t&&o.length>1&&0===c&&o.unshift({value:o[0].value-d})}}for(c=0;c<s.length;c++)o.push(s[c]);return s}}for(var l=[],c=[],u=0,h=0,d=0;d<r.length&&o++<1e4;++d){var p=ev(r[d]);if(nv(r[d])&&(s(r[d],l[l.length-1]||[],c),p!==(r[d+1]?ev(r[d+1]):null))){if(c.length){h=u,c.sort(function(t,e){return t.value-e.value});for(var f=[],g=0;g<c.length;++g){var m=c[g].value;0!==g&&c[g-1].value===m||(f.push(c[g]),m>=i[0]&&m<=i[1]&&u++)}var y=(i[1]-i[0])/e;if(u>1.5*y&&h>y/1.5)break;if(l.push(f),u>y||t===r[d])break}c=[]}}var v=ls(as(l,function(t){return ls(t,function(t){return t.value>=i[0]&&t.value<=i[1]&&!t.notAdd})}),function(t){return t.length>0}),_=[],x=v.length-1;for(d=0;d<v.length;++d)for(var b=v[d],w=0;w<b.length;++w)_.push({value:b[w].value,level:x-d});_.sort(function(t,e){return t.value-e.value});var S=[];for(d=0;d<_.length;++d)0!==d&&_[d].value===_[d-1].value||S.push(_[d]);return S}(this._minLevelUnit,this._approxInterval,i,e);return(n=n.concat(r)).push({value:e[1],level:0}),n},e.prototype.calcNiceExtent=function(t){var e=this._extent;if(e[0]===e[1]&&(e[0]-=Yy,e[1]+=Yy),e[1]===-1/0&&e[0]===1/0){var n=new Date;e[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),e[0]=e[1]-Yy}this.calcNiceTicks(t.splitNumber,t.minInterval,t.maxInterval)},e.prototype.calcNiceTicks=function(t,e,n){t=t||10;var i=this._extent,r=i[1]-i[0];this._approxInterval=r/t,null!=e&&this._approxInterval<e&&(this._approxInterval=e),null!=n&&this._approxInterval>n&&(this._approxInterval=n);var o=FD.length,a=Math.min(function(t,e,n,i){for(;n<i;){var r=n+i>>>1;t[r][1]<e?n=r+1:i=r}return n}(FD,this._approxInterval,0,o),o-1);this._interval=FD[a][1],this._minLevelUnit=FD[Math.max(a-1,0)][0]},e.prototype.parse=function(t){return ys(t)?t:+Xd(t)},e.prototype.contain=function(t){return yD(this.parse(t),this._extent)},e.prototype.normalize=function(t){return vD(this.parse(t),this._extent)},e.prototype.scale=function(t){return _D(t,this._extent)},e.type="time",e}(MD),FD=[["second",1e3],["minute",6e4],["hour",qy],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",Xy/2],["year",Xy]];function VD(t,e){return(t/=Yy)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function HD(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function jD(t){return(t/=qy)>12?12:t>6?6:t>3.5?4:t>2?2:1}function WD(t,e){return(t/=e?6e4:1e3)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function GD(t){return Kd(t,!0)}function UD(t,e,n){var i=new Date(t);switch(ev(e)){case"year":case"month":i[fv(n)](0);case"day":i[gv(n)](1);case"hour":i[mv(n)](0);case"minute":i[yv(n)](0);case"second":i[vv(n)](0),i[_v(n)](0)}return i.getTime()}lD.registerClass(zD);const qD=zD;var YD=lD.prototype,XD=MD.prototype,$D=Bd,ZD=Math.floor,KD=Math.ceil,JD=Math.pow,QD=Math.log,tk=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e.base=10,e._originalScale=new MD,e._interval=0,e}return Ma(e,t),e.prototype.getTicks=function(t){var e=this._originalScale,n=this._extent,i=e.getExtent();return as(XD.getTicks.call(this,t),function(t){var e=t.value,r=Bd(JD(this.base,e));return r=e===n[0]&&this._fixMin?nk(r,i[0]):r,{value:r=e===n[1]&&this._fixMax?nk(r,i[1]):r}},this)},e.prototype.setExtent=function(t,e){var n=QD(this.base);t=QD(Math.max(0,t))/n,e=QD(Math.max(0,e))/n,XD.setExtent.call(this,t,e)},e.prototype.getExtent=function(){var t=this.base,e=YD.getExtent.call(this);e[0]=JD(t,e[0]),e[1]=JD(t,e[1]);var n=this._originalScale.getExtent();return this._fixMin&&(e[0]=nk(e[0],n[0])),this._fixMax&&(e[1]=nk(e[1],n[1])),e},e.prototype.unionExtent=function(t){this._originalScale.unionExtent(t);var e=this.base;t[0]=QD(t[0])/QD(e),t[1]=QD(t[1])/QD(e),YD.unionExtent.call(this,t)},e.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},e.prototype.calcNiceTicks=function(t){t=t||10;var e=this._extent,n=e[1]-e[0];if(!(n===1/0||n<=0)){var i=$d(n);for(t/n*i<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var r=[Bd(KD(e[0]/i)*i),Bd(ZD(e[1]/i)*i)];this._interval=i,this._niceExtent=r}},e.prototype.calcNiceExtent=function(t){XD.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return yD(t=QD(t)/QD(this.base),this._extent)},e.prototype.normalize=function(t){return vD(t=QD(t)/QD(this.base),this._extent)},e.prototype.scale=function(t){return t=_D(t,this._extent),JD(this.base,t)},e.type="log",e}(lD),ek=tk.prototype;function nk(t,e){return $D(t,zd(e))}ek.getMinorTicks=XD.getMinorTicks,ek.getLabel=XD.getLabel,lD.registerClass(tk);const ik=tk;var rk=function(){function t(t,e,n){this._prepareParams(t,e,n)}return t.prototype._prepareParams=function(t,e,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var i=this._isOrdinal="ordinal"===t.type;this._needCrossZero="interval"===t.type&&e.getNeedCrossZero&&e.getNeedCrossZero();var r=e.get("min",!0);null==r&&(r=e.get("startValue",!0));var o=this._modelMinRaw=r;fs(o)?this._modelMinNum=lk(t,o({min:n[0],max:n[1]})):"dataMin"!==o&&(this._modelMinNum=lk(t,o));var a=this._modelMaxRaw=e.get("max",!0);if(fs(a)?this._modelMaxNum=lk(t,a({min:n[0],max:n[1]})):"dataMax"!==a&&(this._modelMaxNum=lk(t,a)),i)this._axisDataLen=e.getCategories().length;else{var s=e.get("boundaryGap"),l=ps(s)?s:[s||0,s||0];"boolean"==typeof l[0]||"boolean"==typeof l[1]?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[od(l[0],1),od(l[1],1)]}},t.prototype.calculate=function(){var t=this._isOrdinal,e=this._dataMin,n=this._dataMax,i=this._axisDataLen,r=this._boundaryGapInner,o=t?null:n-e||Math.abs(e),a="dataMin"===this._modelMinRaw?e:this._modelMinNum,s="dataMax"===this._modelMaxRaw?n:this._modelMaxNum,l=null!=a,c=null!=s;null==a&&(a=t?i?0:NaN:e-r[0]*o),null==s&&(s=t?i?i-1:NaN:n+r[1]*o),(null==a||!isFinite(a))&&(a=NaN),(null==s||!isFinite(s))&&(s=NaN);var u=Cs(a)||Cs(s)||t&&!i;this._needCrossZero&&(a>0&&s>0&&!l&&(a=0),a<0&&s<0&&!c&&(s=0));var h=this._determinedMin,d=this._determinedMax;return null!=h&&(a=h,l=!0),null!=d&&(s=d,c=!0),{min:a,max:s,minFixed:l,maxFixed:c,isBlank:u}},t.prototype.modifyDataMinMax=function(t,e){this[ak[t]]=e},t.prototype.setDeterminedMinMax=function(t,e){this[ok[t]]=e},t.prototype.freeze=function(){this.frozen=!0},t}(),ok={min:"_determinedMin",max:"_determinedMax"},ak={min:"_dataMin",max:"_dataMax"};function sk(t,e,n){var i=t.rawExtentInfo;return i||(i=new rk(t,e,n),t.rawExtentInfo=i,i)}function lk(t,e){return null==e?null:Cs(e)?NaN:t.parse(e)}function ck(t,e){var n=t.type,i=sk(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var r=i.min,o=i.max,a=e.ecModel;if(a&&"time"===n){var s=ED("bar",a),l=!1;if(os(s,function(t){l=l||t.getBaseAxis()===e.axis}),l){var c=LD(s),u=function(t,e,n,i){var r=n.axis.getExtent(),o=Math.abs(r[1]-r[0]),a=function(t,e){if(t&&e){var n=t[AD(e)];return n}}(i,n.axis);if(void 0===a)return{min:t,max:e};var s=1/0;os(a,function(t){s=Math.min(t.offset,s)});var l=-1/0;os(a,function(t){l=Math.max(t.offset+t.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,h=u/(1-(s+l)/o)-u;return{min:t-=h*(s/c),max:e+=h*(l/c)}}(r,o,e,c);r=u.min,o=u.max}}return{extent:[r,o],fixMin:i.minFixed,fixMax:i.maxFixed}}function uk(t,e){var n=e,i=ck(t,n),r=i.extent,o=n.get("splitNumber");t instanceof ik&&(t.base=n.get("logBase"));var a=t.type,s=n.get("interval"),l="interval"===a||"time"===a;t.setExtent(r[0],r[1]),t.calcNiceExtent({splitNumber:o,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?n.get("minInterval"):null,maxInterval:l?n.get("maxInterval"):null}),null!=s&&t.setInterval&&t.setInterval(s)}function hk(t,e){if(e=e||t.get("type"))switch(e){case"category":return new bD({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new qD({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(lD.getClass(e)||MD)}}function dk(t){var e,n,i=t.getLabelModel().get("formatter"),r="category"===t.type?t.scale.getExtent()[0]:null;return"time"===t.scale.type?(n=i,function(e,i){return t.scale.getFormattedLabel(e,i,n)}):gs(i)?function(e){return function(n){var i=t.scale.getLabel(n);return e.replace("{value}",null!=i?i:"")}}(i):fs(i)?(e=i,function(n,i){return null!=r&&(i=n.value-r),e(pk(t,n),i,null!=n.level?{level:n.level}:null)}):function(e){return t.scale.getLabel(e)}}function pk(t,e){return"category"===t.type?t.scale.getLabel(e):e.value}function fk(t,e){var n=e*Math.PI/180,i=t.width,r=t.height,o=i*Math.abs(Math.cos(n))+Math.abs(r*Math.sin(n)),a=i*Math.abs(Math.sin(n))+Math.abs(r*Math.cos(n));return new dc(t.x,t.y,o,a)}function gk(t){var e=t.get("interval");return null==e?"auto":e}function mk(t){return"category"===t.type&&0===gk(t.getLabelModel())}function yk(t,e){var n={};return os(t.mapDimensionsAll(e),function(e){n[oD(t,e)]=!0}),us(n)}var vk=function(){function t(){}return t.prototype.getNeedCrossZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}();function _k(t){return aD(null,t)}var xk={isDimensionStacked:rD,enableDataStack:iD,getStackedDimension:oD};function bk(t,e){var n=e;e instanceof Oy||(n=new Oy(e));var i=hk(n);return i.setExtent(t[0],t[1]),uk(i,n),i}function wk(t){is(t,vk)}function Sk(t,e){return uy(t,null,null,"normal"!==(e=e||{}).state)}function Mk(t,e){return Math.abs(t-e)<1e-8}function Ck(t,e,n){var i=0,r=t[0];if(!r)return!1;for(var o=1;o<t.length;o++){var a=t[o];i+=rg(r[0],r[1],a[0],a[1],e,n),r=a}var s=t[0];return Mk(r[0],s[0])&&Mk(r[1],s[1])||(i+=rg(r[0],r[1],s[0],s[1],e,n)),0!==i}var Tk=[];function Ik(t,e){for(var n=0;n<t.length;n++)fl(t[n],t[n],e)}function Dk(t,e,n,i){for(var r=0;r<t.length;r++){var o=t[r];i&&(o=i.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&(gl(e,e,o),ml(n,n,o))}}var kk=function(){function t(t){this.name=t}return t.prototype.setCenter=function(t){this._center=t},t.prototype.getCenter=function(){var t=this._center;return t||(t=this._center=this.calcCenter()),t},t}(),Ak=function(t,e){this.type="polygon",this.exterior=t,this.interiors=e},Ek=function(t){this.type="linestring",this.points=t},Lk=function(t){function e(e,n,i){var r=t.call(this,e)||this;return r.type="geoJSON",r.geometries=n,r._center=i&&[i[0],i[1]],r}return Ma(e,t),e.prototype.calcCenter=function(){for(var t,e=this.geometries,n=0,i=0;i<e.length;i++){var r=e[i],o=r.exterior,a=o&&o.length;a>n&&(t=r,n=a)}if(t)return function(t){for(var e=0,n=0,i=0,r=t.length,o=t[r-1][0],a=t[r-1][1],s=0;s<r;s++){var l=t[s][0],c=t[s][1],u=o*c-l*a;e+=u,n+=(o+l)*u,i+=(a+c)*u,o=l,a=c}return e?[n/e/3,i/e/3,e]:[t[0][0]||0,t[0][1]||0]}(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},e.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var n=[1/0,1/0],i=[-1/0,-1/0];return os(this.geometries,function(e){"polygon"===e.type?Dk(e.exterior,n,i,t):os(e.points,function(e){Dk(e,n,i,t)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(i[0])&&isFinite(i[1])||(n[0]=n[1]=i[0]=i[1]=0),e=new dc(n[0],n[1],i[0]-n[0],i[1]-n[1]),t||(this._rect=e),e},e.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var i=0,r=n.length;i<r;i++){var o=n[i];if("polygon"===o.type){var a=o.exterior,s=o.interiors;if(Ck(a,t[0],t[1])){for(var l=0;l<(s?s.length:0);l++)if(Ck(s[l],t[0],t[1]))continue t;return!0}}}return!1},e.prototype.transformTo=function(t,e,n,i){var r=this.getBoundingRect(),o=r.width/r.height;n?i||(i=n/o):n=o*i;for(var a=new dc(t,e,n,i),s=r.calculateTransform(a),l=this.geometries,c=0;c<l.length;c++){var u=l[c];"polygon"===u.type?(Ik(u.exterior,s),os(u.interiors,function(t){Ik(t,s)})):os(u.points,function(t){Ik(t,s)})}(r=this._rect).copy(a),this._center=[r.x+r.width/2,r.y+r.height/2]},e.prototype.cloneShallow=function(t){null==t&&(t=this.name);var n=new e(t,this.geometries,this._center);return n._rect=this._rect,n.transformTo=null,n},e}(kk),Pk=function(t){function e(e,n){var i=t.call(this,e)||this;return i.type="geoSVG",i._elOnlyForCalculate=n,i}return Ma(e,t),e.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,e=t.getBoundingRect(),n=[e.x+e.width/2,e.y+e.height/2],i=Yl(Tk),r=t;r&&!r.isGeoSVGGraphicRoot;)$l(i,r.getLocalTransform(),i),r=r.parent;return Ql(i,i),fl(n,n,i),n},e}(kk);function Ok(t,e,n){for(var i=0;i<t.length;i++)t[i]=Rk(t[i],e[i],n)}function Rk(t,e,n){for(var i=[],r=e[0],o=e[1],a=0;a<t.length;a+=2){var s=t.charCodeAt(a)-64,l=t.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),r=s+=r,o=l+=o,i.push([s/n,l/n])}return i}function Bk(t,e){return as(ls((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;return null==n&&(n=1024),os(e.features,function(t){var e=t.geometry,i=e.encodeOffsets,r=e.coordinates;if(i)switch(e.type){case"LineString":e.coordinates=Rk(r,i,n);break;case"Polygon":case"MultiLineString":Ok(r,i,n);break;case"MultiPolygon":os(r,function(t,e){return Ok(t,i[e],n)})}}),e.UTF8Encoding=!1,e}(t)).features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var n=t.properties,i=t.geometry,r=[];switch(i.type){case"Polygon":var o=i.coordinates;r.push(new Ak(o[0],o.slice(1)));break;case"MultiPolygon":os(i.coordinates,function(t){t[0]&&r.push(new Ak(t[0],t.slice(1)))});break;case"LineString":r.push(new Ek([i.coordinates]));break;case"MultiLineString":r.push(new Ek(i.coordinates))}var a=new Lk(n[e||"name"],r,n.cp);return a.properties=n,a})}function Nk(t,e,n,i,r,o,a,s){return new $g({style:{text:t,font:e,align:n,verticalAlign:i,padding:r,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()}var zk=xp();function Fk(t,e){var n=as(e,function(e){return t.scale.parse(e)});return"time"===t.type&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function Vk(t,e){var n,i,r=Hk(t,"labels"),o=gk(e);return jk(r,o)||(fs(o)?n=Uk(t,o):(i="auto"===o?function(t){var e=zk(t).autoInterval;return null!=e?e:zk(t).autoInterval=t.calculateCategoryInterval()}(t):o,n=Gk(t,i)),Wk(r,o,{labels:n,labelCategoryInterval:i}))}function Hk(t,e){return zk(t)[e]||(zk(t)[e]=[])}function jk(t,e){for(var n=0;n<t.length;n++)if(t[n].key===e)return t[n].value}function Wk(t,e,n){return t.push({key:e,value:n}),n}function Gk(t,e,n){var i=dk(t),r=t.scale,o=r.getExtent(),a=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=o[0],u=r.count();0!==c&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var h=mk(t),d=a.get("showMinLabel")||h,p=a.get("showMaxLabel")||h;d&&c!==o[0]&&g(o[0]);for(var f=c;f<=o[1];f+=l)g(f);function g(t){var e={value:t};s.push(n?t:{formattedLabel:i(e),rawLabel:r.getLabel(e),tickValue:t})}return p&&f-l!==o[1]&&g(o[1]),s}function Uk(t,e,n){var i=t.scale,r=dk(t),o=[];return os(i.getTicks(),function(t){var a=i.getLabel(t),s=t.value;e(t.value,a)&&o.push(n?s:{formattedLabel:r(t),rawLabel:a,tickValue:s})}),o}var qk=[0,1],Yk=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return t>=n&&t<=i},t.prototype.containData=function(t){return this.scale.contain(t)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(t){return Vd(t||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this._extent,i=this.scale;return t=i.normalize(t),this.onBand&&"ordinal"===i.type&&Xk(n=n.slice(),i.count()),Od(t,qk,n,e)},t.prototype.coordToData=function(t,e){var n=this._extent,i=this.scale;this.onBand&&"ordinal"===i.type&&Xk(n=n.slice(),i.count());var r=Od(t,n,qk,e);return this.scale.scale(r)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=as(function(t,e){var n=t.getTickModel().get("customValues");if(n){var i=t.scale.getExtent();return{ticks:ls(Fk(t,n),function(t){return t>=i[0]&&t<=i[1]})}}return"category"===t.type?function(t,e){var n,i,r=Hk(t,"ticks"),o=gk(e),a=jk(r,o);if(a)return a;if(e.get("show")&&!t.scale.isBlank()||(n=[]),fs(o))n=Uk(t,o,!0);else if("auto"===o){var s=Vk(t,t.getLabelModel());i=s.labelCategoryInterval,n=as(s.labels,function(t){return t.tickValue})}else n=Gk(t,i=o,!0);return Wk(r,o,{ticks:n,tickCategoryInterval:i})}(t,e):{ticks:as(t.scale.getTicks(),function(t){return t.value})}}(this,e).ticks,function(t){return{coord:this.dataToCoord("ordinal"===this.scale.type?this.scale.getRawOrdinalNumber(t):t),tickValue:t}},this);return function(t,e,n,i){var r=e.length;if(t.onBand&&!n&&r){var o,a,s=t.getExtent();if(1===r)e[0].coord=s[0],o=e[1]={coord:s[1],tickValue:e[0].tickValue};else{var l=e[r-1].tickValue-e[0].tickValue,c=(e[r-1].coord-e[0].coord)/l;os(e,function(t){t.coord-=c/2});var u=t.scale.getExtent();a=1+u[1]-e[r-1].tickValue,o={coord:e[r-1].coord+c*a,tickValue:u[1]+1},e.push(o)}var h=s[0]>s[1];d(e[0].coord,s[0])&&(i?e[0].coord=s[0]:e.shift()),i&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]}),d(s[1],o.coord)&&(i?o.coord=s[1]:e.pop()),i&&d(o.coord,s[1])&&e.push({coord:s[1]})}function d(t,e){return t=Bd(t),e=Bd(e),h?t>e:t<e}}(this,n,e.get("alignWithLabel"),t.clamp),n},t.prototype.getMinorTicksCoords=function(){if("ordinal"===this.scale.type)return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),as(this.scale.getMinorTicks(t),function(t){return as(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(){return function(t){var e=t.getLabelModel().get("customValues");if(e){var n=dk(t),i=t.scale.getExtent();return{labels:as(ls(Fk(t,e),function(t){return t>=i[0]&&t<=i[1]}),function(e){var i={value:e};return{formattedLabel:n(i),rawLabel:t.scale.getLabel(i),tickValue:e}})}}return"category"===t.type?function(t){var e=t.getLabelModel(),n=Vk(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}(t):function(t){var e=t.scale.getTicks(),n=dk(t);return{labels:as(e,function(e,i){return{level:e.level,formattedLabel:n(e,i),rawLabel:t.scale.getLabel(e),tickValue:e.value}})}}(t)}(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var t=this._extent,e=this.scale.getExtent(),n=e[1]-e[0]+(this.onBand?1:0);0===n&&(n=1);var i=Math.abs(t[1]-t[0]);return Math.abs(i)/n},t.prototype.calculateCategoryInterval=function(){return function(t){var e=function(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}(t),n=dk(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,r=t.scale,o=r.getExtent(),a=r.count();if(o[1]-o[0]<1)return 0;var s=1;a>40&&(s=Math.max(1,Math.floor(a/40)));for(var l=o[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(i)),h=Math.abs(c*Math.sin(i)),d=0,p=0;l<=o[1];l+=s){var f,g,m=ed(n({value:l}),e.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var y=d/u,v=p/h;isNaN(y)&&(y=1/0),isNaN(v)&&(v=1/0);var _=Math.max(0,Math.floor(Math.min(y,v))),x=zk(t.model),b=t.getExtent(),w=x.lastAutoInterval,S=x.lastTickCount;return null!=w&&null!=S&&Math.abs(w-_)<=1&&Math.abs(S-a)<=1&&w>_&&x.axisExtent0===b[0]&&x.axisExtent1===b[1]?_=w:(x.lastTickCount=a,x.lastAutoInterval=_,x.axisExtent0=b[0],x.axisExtent1=b[1]),_}(this)},t}();function Xk(t,e){var n=(t[1]-t[0])/e/2;t[0]+=n,t[1]-=n}const $k=Yk;function Zk(t){var e=Uv.extend(t);return Uv.registerClass(e),e}function Kk(t){var e=Wb.extend(t);return Wb.registerClass(e),e}function Jk(t){var e=Hb.extend(t);return Hb.registerClass(e),e}function Qk(t){var e=eM.extend(t);return eM.registerClass(e),e}var tA=2*Math.PI,eA=Zf.CMD,nA=["top","right","bottom","left"];function iA(t,e,n,i,r){var o=n.width,a=n.height;switch(t){case"top":i.set(n.x+o/2,n.y-e),r.set(0,-1);break;case"bottom":i.set(n.x+o/2,n.y+a+e),r.set(0,1);break;case"left":i.set(n.x-e,n.y+a/2),r.set(-1,0);break;case"right":i.set(n.x+o+e,n.y+a/2),r.set(1,0)}}function rA(t,e,n,i,r,o,a,s,l){a-=t,s-=e;var c=Math.sqrt(a*a+s*s),u=(a/=c)*n+t,h=(s/=c)*n+e;if(Math.abs(i-r)%tA<1e-4)return l[0]=u,l[1]=h,c-n;if(o){var d=i;i=eg(r),r=eg(d)}else i=eg(i),r=eg(r);i>r&&(r+=tA);var p=Math.atan2(s,a);if(p<0&&(p+=tA),p>=i&&p<=r||p+tA>=i&&p+tA<=r)return l[0]=u,l[1]=h,c-n;var f=n*Math.cos(i)+t,g=n*Math.sin(i)+e,m=n*Math.cos(r)+t,y=n*Math.sin(r)+e,v=(f-a)*(f-a)+(g-s)*(g-s),_=(m-a)*(m-a)+(y-s)*(y-s);return v<_?(l[0]=f,l[1]=g,Math.sqrt(v)):(l[0]=m,l[1]=y,Math.sqrt(_))}function oA(t,e,n,i,r,o,a,s){var l=r-t,c=o-e,u=n-t,h=i-e,d=Math.sqrt(u*u+h*h),p=(l*(u/=d)+c*(h/=d))/d;s&&(p=Math.min(Math.max(p,0),1)),p*=d;var f=a[0]=t+p*u,g=a[1]=e+p*h;return Math.sqrt((f-r)*(f-r)+(g-o)*(g-o))}function aA(t,e,n,i,r,o,a){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var s=t+n,l=e+i,c=a[0]=Math.min(Math.max(r,t),s),u=a[1]=Math.min(Math.max(o,e),l);return Math.sqrt((c-r)*(c-r)+(u-o)*(u-o))}var sA=[];function lA(t,e,n){var i=aA(e.x,e.y,e.width,e.height,t.x,t.y,sA);return n.set(sA[0],sA[1]),i}function cA(t,e,n){for(var i,r,o=0,a=0,s=0,l=0,c=1/0,u=e.data,h=t.x,d=t.y,p=0;p<u.length;){var f=u[p++];1===p&&(s=o=u[p],l=a=u[p+1]);var g=c;switch(f){case eA.M:o=s=u[p++],a=l=u[p++];break;case eA.L:g=oA(o,a,u[p],u[p+1],h,d,sA,!0),o=u[p++],a=u[p++];break;case eA.C:g=tu(o,a,u[p++],u[p++],u[p++],u[p++],u[p],u[p+1],h,d,sA),o=u[p++],a=u[p++];break;case eA.Q:g=au(o,a,u[p++],u[p++],u[p],u[p+1],h,d,sA),o=u[p++],a=u[p++];break;case eA.A:var m=u[p++],y=u[p++],v=u[p++],_=u[p++],x=u[p++],b=u[p++];p+=1;var w=!!(1-u[p++]);i=Math.cos(x)*v+m,r=Math.sin(x)*_+y,p<=1&&(s=i,l=r),g=rA(m,y,_,x,x+b,w,(h-m)*_/v+m,d,sA),o=Math.cos(x+b)*v+m,a=Math.sin(x+b)*_+y;break;case eA.R:g=aA(s=o=u[p++],l=a=u[p++],u[p++],u[p++],h,d,sA);break;case eA.Z:g=oA(o,a,s,l,h,d,sA,!0),o=s,a=l}g<c&&(c=g,n.set(sA[0],sA[1]))}return c}var uA=new nc,hA=new nc,dA=new nc,pA=new nc,fA=new nc;function gA(t,e){if(t){var n=t.getTextGuideLine(),i=t.getTextContent();if(i&&n){var r=t.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],a=r.candidates||nA,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,c=r.anchor,u=t.getComputedTransform(),h=u&&Ql([],u),d=e.get("length2")||0;c&&dA.copy(c);for(var p=0;p<a.length;p++){iA(a[p],0,s,uA,pA),nc.scaleAndAdd(hA,uA,pA,d),hA.transform(h);var f=t.getBoundingRect(),g=c?c.distance(hA):t instanceof vg?cA(hA,t.path,dA):lA(hA,f,dA);g<l&&(l=g,hA.transform(u),dA.transform(u),dA.toArray(o[0]),hA.toArray(o[1]),uA.toArray(o[2]))}vA(o,e.get("minTurnAngle")),n.setShape({points:o})}}}var mA=[],yA=new nc;function vA(t,e){if(e<=180&&e>0){e=e/180*Math.PI,uA.fromArray(t[0]),hA.fromArray(t[1]),dA.fromArray(t[2]),nc.sub(pA,uA,hA),nc.sub(fA,dA,hA);var n=pA.len(),i=fA.len();if(!(n<.001||i<.001)){pA.scale(1/n),fA.scale(1/i);var r=pA.dot(fA);if(Math.cos(e)<r){var o=oA(hA.x,hA.y,dA.x,dA.y,uA.x,uA.y,mA,!1);yA.fromArray(mA),yA.scaleAndAdd(fA,o/Math.tan(Math.PI-e));var a=dA.x!==hA.x?(yA.x-hA.x)/(dA.x-hA.x):(yA.y-hA.y)/(dA.y-hA.y);if(isNaN(a))return;a<0?nc.copy(yA,hA):a>1&&nc.copy(yA,dA),yA.toArray(t[1])}}}}function _A(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,uA.fromArray(t[0]),hA.fromArray(t[1]),dA.fromArray(t[2]),nc.sub(pA,hA,uA),nc.sub(fA,dA,hA);var i=pA.len(),r=fA.len();if(!(i<.001||r<.001)&&(pA.scale(1/i),fA.scale(1/r),pA.dot(e)<Math.cos(n))){var o=oA(hA.x,hA.y,dA.x,dA.y,uA.x,uA.y,mA,!1);yA.fromArray(mA);var a=Math.PI/2,s=a+Math.acos(fA.dot(e))-n;if(s>=a)nc.copy(yA,dA);else{yA.scaleAndAdd(fA,o/Math.tan(Math.PI/2-s));var l=dA.x!==hA.x?(yA.x-hA.x)/(dA.x-hA.x):(yA.y-hA.y)/(dA.y-hA.y);if(isNaN(l))return;l<0?nc.copy(yA,hA):l>1&&nc.copy(yA,dA)}yA.toArray(t[1])}}}function xA(t,e,n,i){var r="normal"===n,o=r?t:t.ensureState(n);o.ignore=e;var a=i.get("smooth");a&&!0===a&&(a=.3),o.shape=o.shape||{},a>0&&(o.shape.smooth=a);var s=i.getModel("lineStyle").getLineStyle();r?t.useStyle(s):o.style=s}function bA(t,e){var n=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),n>0&&i.length>=3){var r=cl(i[0],i[1]),o=cl(i[1],i[2]);if(!r||!o)return t.lineTo(i[1][0],i[1][1]),void t.lineTo(i[2][0],i[2][1]);var a=Math.min(r,o)*n,s=pl([],i[1],i[0],a/r),l=pl([],i[1],i[2],a/o),c=pl([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],c[0],c[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var u=1;u<i.length;u++)t.lineTo(i[u][0],i[u][1])}function wA(t,e,n){var i=t.getTextGuideLine(),r=t.getTextContent();if(r){for(var o=e.normal,a=o.get("show"),s=r.ignore,l=0;l<im.length;l++){var c=im[l],u=e[c],h="normal"===c;if(u){var d=u.get("show");if((h?s:Is(r.states[c]&&r.states[c].ignore,s))||!Is(d,a)){var p=h?i:i&&i.states[c];p&&(p.ignore=!0),i&&xA(i,!0,c,u);continue}i||(i=new Hw,t.setTextGuideLine(i),h||!s&&a||xA(i,!0,"normal",e.normal),t.stateProxy&&(i.stateProxy=t.stateProxy)),xA(i,!1,c,u)}}if(i){Qa(i.style,n),i.style.fill=null;var f=o.get("showAbove");(t.textGuideLineConfig=t.textGuideLineConfig||{}).showAbove=f||!1,i.buildPath=bA}}else i&&t.removeTextGuideLine()}function SA(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},i=0;i<nm.length;i++){var r=nm[i];n[r]=t.getModel([r,e])}return n}function MA(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(!i.defaultAttr.ignore){var r=i.label,o=r.getComputedTransform(),a=r.getBoundingRect(),s=!o||o[1]<1e-5&&o[2]<1e-5,l=r.style.margin||0,c=a.clone();c.applyTransform(o),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=s?new pS(a,o):null;e.push({label:r,labelLine:i.labelLine,rect:c,localRect:a,obb:u,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:o})}}return e}function CA(t,e,n,i,r,o){var a=t.length;if(!(a<2)){t.sort(function(t,n){return t.rect[e]-n.rect[e]});for(var s,l=0,c=!1,u=[],h=0,d=0;d<a;d++){var p=t[d],f=p.rect;(s=f[e]-l)<0&&(f[e]-=s,p.label[e]-=s,c=!0);var g=Math.max(-s,0);u.push(g),h+=g,l=f[e]+f[n]}h>0&&o&&w(-h/a,0,a);var m,y,v=t[0],_=t[a-1];return x(),m<0&&S(-m,.8),y<0&&S(y,.8),x(),b(m,y,1),b(y,m,-1),x(),m<0&&M(-m),y<0&&M(y),c}function x(){m=v.rect[e]-i,y=r-_.rect[e]-_.rect[n]}function b(t,e,n){if(t<0){var i=Math.min(e,-t);if(i>0){w(i*n,0,a);var r=i+t;r<0&&S(-r*n,1)}else S(-t*n,1)}}function w(n,i,r){0!==n&&(c=!0);for(var o=i;o<r;o++){var a=t[o];a.rect[e]+=n,a.label[e]+=n}}function S(i,r){for(var o=[],s=0,l=1;l<a;l++){var c=t[l-1].rect,u=Math.max(t[l].rect[e]-c[e]-c[n],0);o.push(u),s+=u}if(s){var h=Math.min(Math.abs(i)/s,r);if(i>0)for(l=0;l<a-1;l++)w(o[l]*h,0,l+1);else for(l=a-1;l>0;l--)w(-o[l-1]*h,l,a)}}function M(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(a-1)),i=0;i<a-1;i++)if(e>0?w(n,0,i+1):w(-n,a-i-1,a),(t-=n)<=0)return}}function TA(t,e,n,i){return CA(t,"y","height",e,n,i)}function IA(t){var e=[];t.sort(function(t,e){return e.priority-t.priority});var n=new dc(0,0,0,0);function i(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}for(var r=0;r<t.length;r++){var o=t[r],a=o.axisAligned,s=o.localRect,l=o.transform,c=o.label,u=o.labelLine;n.copy(o.rect),n.width-=.1,n.height-=.1,n.x+=.05,n.y+=.05;for(var h=o.obb,d=!1,p=0;p<e.length;p++){var f=e[p];if(n.intersect(f.rect)){if(a&&f.axisAligned){d=!0;break}if(f.obb||(f.obb=new pS(f.localRect,f.transform)),h||(h=new pS(s,l)),h.intersect(f.obb)){d=!0;break}}}d?(i(c),u&&i(u)):(c.attr("ignore",o.defaultAttr.ignore),u&&u.attr("ignore",o.defaultAttr.labelGuideIgnore),e.push(o))}}function DA(t){if(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].slice());return e}}function kA(t,e){var n=t.label,i=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:DA(i&&i.shape.points)}}var AA=["align","verticalAlign","width","height","fontSize"],EA=new Kh,LA=xp(),PA=xp();function OA(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];null!=e[r]&&(t[r]=e[r])}}var RA=["x","y","rotation"],BA=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(t,e,n,i,r){var o=i.style,a=i.__hostTarget.textConfig||{},s=i.getComputedTransform(),l=i.getBoundingRect().plain();dc.applyTransform(l,l,s),s?EA.setLocalTransform(s):(EA.x=EA.y=EA.rotation=EA.originX=EA.originY=0,EA.scaleX=EA.scaleY=1),EA.rotation=eg(EA.rotation);var c,u=i.__hostTarget;if(u){c=u.getBoundingRect().plain();var h=u.getComputedTransform();dc.applyTransform(c,c,h)}var d=c&&u.getTextGuideLine();this._labelList.push({label:i,labelLine:d,seriesModel:n,dataIndex:t,dataType:e,layoutOption:r,computedLayoutOption:null,rect:l,hostRect:c,priority:c?c.width*c.height:0,defaultAttr:{ignore:i.ignore,labelGuideIgnore:d&&d.ignore,x:EA.x,y:EA.y,scaleX:EA.scaleX,scaleY:EA.scaleY,rotation:EA.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:i.cursor,attachedPos:a.position,attachedRot:a.rotation}})},t.prototype.addLabelsOfSeries=function(t){var e=this;this._chartViewList.push(t);var n=t.__model,i=n.get("labelLayout");(fs(i)||us(i).length)&&t.group.traverse(function(t){if(t.ignore)return!0;var r=t.getTextContent(),o=Zg(t);r&&!r.disableLabelLayout&&e._addLabel(o.dataIndex,o.dataType,n,r,i)})},t.prototype.updateLayoutConfig=function(t){var e=t.getWidth(),n=t.getHeight();function i(t,e){return function(){gA(t,e)}}for(var r=0;r<this._labelList.length;r++){var o=this._labelList[r],a=o.label,s=a.__hostTarget,l=o.defaultAttr,c=void 0;c=(c=fs(o.layoutOption)?o.layoutOption(kA(o,s)):o.layoutOption)||{},o.computedLayoutOption=c;var u=Math.PI/180;s&&s.setTextConfig({local:!1,position:null!=c.x||null!=c.y?null:l.attachedPos,rotation:null!=c.rotate?c.rotate*u:l.attachedRot,offset:[c.dx||0,c.dy||0]});var h=!1;if(null!=c.x?(a.x=Rd(c.x,e),a.setStyle("x",0),h=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=c.y?(a.y=Rd(c.y,n),a.setStyle("y",0),h=!0):(a.y=l.y,a.setStyle("y",l.style.y)),c.labelLinePoints){var d=s.getTextGuideLine();d&&(d.setShape({points:c.labelLinePoints}),h=!1)}LA(a).needsUpdateLabelLine=h,a.rotation=null!=c.rotate?c.rotate*u:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<AA.length;p++){var f=AA[p];a.setStyle(f,null!=c[f]?c[f]:l.style[f])}if(c.draggable){if(a.draggable=!0,a.cursor="move",s){var g=o.seriesModel;null!=o.dataIndex&&(g=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex)),a.on("drag",i(s,g.getModel("labelLine")))}}else a.off("drag"),a.cursor=l.cursor}},t.prototype.layout=function(t){var e=t.getWidth(),n=t.getHeight(),i=MA(this._labelList),r=ls(i,function(t){return"shiftX"===t.layoutOption.moveOverlap}),o=ls(i,function(t){return"shiftY"===t.layoutOption.moveOverlap});CA(r,"x","width",0,e,undefined),TA(o,0,n),IA(ls(i,function(t){return t.layoutOption.hideOverlap}))},t.prototype.processLabelsOverall=function(){var t=this;os(this._chartViewList,function(e){var n=e.__model,i=e.ignoreLabelLineUpdate,r=n.isAnimationEnabled();e.group.traverse(function(e){if(e.ignore&&!e.forceLabelAnimation)return!0;var o=!i,a=e.getTextContent();!o&&a&&(o=LA(a).needsUpdateLabelLine),o&&t._updateLabelLine(e,n),r&&t._animateLabels(e,n)})})},t.prototype._updateLabelLine=function(t,e){var n=t.getTextContent(),i=Zg(t),r=i.dataIndex;if(n&&null!=r){var o=e.getData(i.dataType),a=o.getItemModel(r),s={},l=o.getItemVisual(r,"style");if(l){var c=o.getVisual("drawType");s.stroke=l[c]}var u=a.getModel("labelLine");wA(t,SA(a),s),gA(t,u)}},t.prototype._animateLabels=function(t,e){var n=t.getTextContent(),i=t.getTextGuideLine();if(n&&(t.forceLabelAnimation||!n.ignore&&!n.invisible&&!t.disableLabelAnimation&&!ty(t))){var r=(p=LA(n)).oldLayout,o=Zg(t),a=o.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=e.getData(o.dataType);if(r){n.attr(r);var c=t.prevStates;c&&(es(c,"select")>=0&&n.attr(p.oldLayoutSelect),es(c,"emphasis")>=0&&n.attr(p.oldLayoutEmphasis)),Jm(n,s,e,a)}else if(n.attr(s),!yy(n).valueAnimation){var u=Is(n.style.opacity,1);n.style.opacity=0,Qm(n,{style:{opacity:u}},e,a)}if(p.oldLayout=s,n.states.select){var h=p.oldLayoutSelect={};OA(h,s,RA),OA(h,n.states.select,RA)}if(n.states.emphasis){var d=p.oldLayoutEmphasis={};OA(d,s,RA),OA(d,n.states.emphasis,RA)}_y(n,a,l,e,e)}if(i&&!i.ignore&&!i.invisible){r=(p=PA(i)).oldLayout;var p,f={points:i.shape.points};r?(i.attr({shape:r}),Jm(i,{shape:f},e)):(i.setShape(f),i.style.strokePercent=0,Qm(i,{style:{strokePercent:1}},e)),p.oldLayout=f}},t}();const NA=BA;var zA=xp();function FA(t){t.registerUpdateLifecycle("series:beforeupdate",function(t,e,n){var i=zA(e).labelManager;i||(i=zA(e).labelManager=new NA),i.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(t,e,n){var i=zA(e).labelManager;n.updatedSeries.forEach(function(t){i.addLabelsOfSeries(e.getViewOfSeriesModel(t))}),i.updateLayoutConfig(e),i.layout(e),i.processLabelsOverall()})}function VA(t,e,n){var i=Pa.createCanvas(),r=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=r+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",t)),i.width=r*n,i.height=o*n,i}bI(FA);var HA=function(t){function e(e,n,i){var r,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.incremental=!1,o.zlevel=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__used=!1,o.__drawIndex=0,o.__startIndex=0,o.__endIndex=0,o.__prevStartIndex=null,o.__prevEndIndex=null,i=i||Fh,"string"==typeof e?r=VA(e,n,i):vs(e)&&(e=(r=e).id),o.id=e,o.dom=r;var a=r.style;return a&&(js(r),r.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=i,o}return Ma(e,t),e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=VA("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},e.prototype.createRepaintRects=function(t,e,n,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var r,o=[],a=this.maxRepaintRectCount,s=!1,l=new dc(0,0,0,0);function c(t){if(t.isFinite()&&!t.isZero())if(0===o.length)(e=new dc(0,0,0,0)).copy(t),o.push(e);else{for(var e,n=!1,i=1/0,r=0,c=0;c<o.length;++c){var u=o[c];if(u.intersect(t)){var h=new dc(0,0,0,0);h.copy(u),h.union(t),o[c]=h,n=!0;break}if(s){l.copy(t),l.union(u);var d=t.width*t.height,p=u.width*u.height,f=l.width*l.height-d-p;f<i&&(i=f,r=c)}}s&&(o[r].union(t),n=!0),n||((e=new dc(0,0,0,0)).copy(t),o.push(e)),s||(s=o.length>=a)}}for(var u=this.__startIndex;u<this.__endIndex;++u)if(p=t[u]){var h=p.shouldBePainted(n,i,!0,!0);(f=p.__isRendered&&(p.__dirty&kc||!h)?p.getPrevPaintRect():null)&&c(f);var d=h&&(p.__dirty&kc||!p.__isRendered)?p.getPaintRect():null;d&&c(d)}for(u=this.__prevStartIndex;u<this.__prevEndIndex;++u){var p,f;h=(p=e[u])&&p.shouldBePainted(n,i,!0,!0),!p||h&&p.__zr||!p.__isRendered||(f=p.getPrevPaintRect())&&c(f)}do{for(r=!1,u=0;u<o.length;)if(o[u].isZero())o.splice(u,1);else{for(var g=u+1;g<o.length;)o[u].intersect(o[g])?(r=!0,o[u].union(o[g]),o.splice(g,1)):g++;u++}}while(r);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(t,e){var n=this.dpr,i=this.dom,r=i.style,o=this.domBack;r&&(r.width=t+"px",r.height=e+"px"),i.width=t*n,i.height=e*n,o&&(o.width=t*n,o.height=e*n,1!==n&&this.ctxBack.scale(n,n))},e.prototype.clear=function(t,e,n){var i=this.dom,r=this.ctx,o=i.width,a=i.height;e=e||this.clearColor;var s=this.motionBlur&&!t,l=this.lastFrameAlpha,c=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,o/c,a/c));var h=this.domBack;function d(t,n,i,o){if(r.clearRect(t,n,i,o),e&&"transparent"!==e){var a=void 0;ws(e)?(a=(e.global||e.__width===i&&e.__height===o)&&e.__canvasGradient||gC(r,e,{x:0,y:0,width:i,height:o}),e.__canvasGradient=a,e.__width=i,e.__height=o):Ss(e)&&(e.scaleX=e.scaleX||c,e.scaleY=e.scaleY||c,a=CC(r,e,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),r.save(),r.fillStyle=a||e,r.fillRect(t,n,i,o),r.restore()}s&&(r.save(),r.globalAlpha=l,r.drawImage(h,t,n,i,o),r.restore())}!n||s?d(0,0,o,a):n.length&&os(n,function(t){d(t.x*c,t.y*c,t.width*c,t.height*c)})},e}(bl);const jA=HA;var WA=1e5,GA=314159,UA=.01,qA=function(){function t(t,e,n,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var r=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=n=Ja({},n||{}),this.dpr=n.devicePixelRatio||Fh,this._singleCanvas=r,this.root=t,t.style&&(js(t),t.innerHTML=""),this.storage=e;var o=this._zlevelList;this._prevDisplayList=[];var a=this._layers;if(r){var s=t,l=s.width,c=s.height;null!=n.width&&(l=n.width),null!=n.height&&(c=n.height),this.dpr=n.devicePixelRatio||1,s.width=l*this.dpr,s.height=c*this.dpr,this._width=l,this._height=c;var u=new jA(s,this,this.dpr);u.__builtin__=!0,u.initContext(),a[314159]=u,u.zlevel=GA,o.push(GA),this._domRoot=t}else{this._width=yC(t,0,n),this._height=yC(t,1,n);var h=this._domRoot=function(t,e){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}(this._width,this._height);t.appendChild(h)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.refresh=function(t){var e=this.storage.getDisplayList(!0),n=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,n,t,this._redrawId);for(var r=0;r<i.length;r++){var o=i[r],a=this._layers[o];if(!a.__builtin__&&a.refresh){var s=0===r?this._backgroundColor:null;a.refresh(s)}}return this._opts.useDirtyRect&&(this._prevDisplayList=e.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(t){var e=t.length,n=this._hoverlayer;if(n&&n.clear(),e){for(var i,r={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<e;o++){var a=t[o];a.__inHover&&(n||(n=this._hoverlayer=this.getLayer(WA)),i||(i=n.ctx).save(),zC(i,a,r,o===e-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(WA)},t.prototype.paintOne=function(t,e){NC(t,e)},t.prototype._paintList=function(t,e,n,i){if(this._redrawId===i){n=n||!1,this._updateLayerStatus(t);var r=this._doPaintList(t,e,n),o=r.finished,a=r.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(t),o)this.eachLayer(function(t){t.afterBrush&&t.afterBrush()});else{var s=this;Bc(function(){s._paintList(t,e,n,i)})}}},t.prototype._compositeManually=function(){var t=this.getLayer(GA).ctx,e=this._domRoot.width,n=this._domRoot.height;t.clearRect(0,0,e,n),this.eachBuiltinLayer(function(i){i.virtual&&t.drawImage(i.dom,0,0,e,n)})},t.prototype._doPaintList=function(t,e,n){for(var i=this,r=[],o=this._opts.useDirtyRect,a=0;a<this._zlevelList.length;a++){var s=this._zlevelList[a],l=this._layers[s];l.__builtin__&&l!==this._hoverlayer&&(l.__dirty||n)&&r.push(l)}for(var c=!0,u=!1,h=function(a){var s,l=r[a],h=l.ctx,p=o&&l.createRepaintRects(t,e,d._width,d._height),f=n?l.__startIndex:l.__drawIndex,g=!n&&l.incremental&&Date.now,m=g&&Date.now(),y=l.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(l.__startIndex===l.__endIndex)l.clear(!1,y,p);else if(f===l.__startIndex){var v=t[f];v.incremental&&v.notClear&&!n||l.clear(!1,y,p)}-1===f&&(console.error("For some unknown reason. drawIndex is -1"),f=l.__startIndex);var _=function(e){var n={inHover:!1,allClipped:!1,prevEl:null,viewWidth:i._width,viewHeight:i._height};for(s=f;s<l.__endIndex;s++){var r=t[s];if(r.__inHover&&(u=!0),i._doPaintEl(r,l,o,e,n,s===l.__endIndex-1),g&&Date.now()-m>15)break}n.prevElClipPaths&&h.restore()};if(p)if(0===p.length)s=l.__endIndex;else for(var x=d.dpr,b=0;b<p.length;++b){var w=p[b];h.save(),h.beginPath(),h.rect(w.x*x,w.y*x,w.width*x,w.height*x),h.clip(),_(w),h.restore()}else h.save(),_(),h.restore();l.__drawIndex=s,l.__drawIndex<l.__endIndex&&(c=!1)},d=this,p=0;p<r.length;p++)h(p);return Ia.wxa&&os(this._layers,function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()}),{finished:c,needsRefreshHover:u}},t.prototype._doPaintEl=function(t,e,n,i,r,o){var a=e.ctx;if(n){var s=t.getPaintRect();(!i||s&&s.intersect(i))&&(zC(a,t,r,o),t.setPrevPaintRect(s))}else zC(a,t,r,o)},t.prototype.getLayer=function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=GA);var n=this._layers[t];return n||((n=new jA("zr_"+t,this,this.dpr)).zlevel=t,n.__builtin__=!0,this._layerConfig[t]?Za(n,this._layerConfig[t],!0):this._layerConfig[t-UA]&&Za(n,this._layerConfig[t-UA],!0),e&&(n.virtual=e),this.insertLayer(t,n),n.initContext()),n},t.prototype.insertLayer=function(t,e){var n=this._layers,i=this._zlevelList,r=i.length,o=this._domRoot,a=null,s=-1;if(!n[t]&&function(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}(e)){if(r>0&&t>i[0]){for(s=0;s<r-1&&!(i[s]<t&&i[s+1]>t);s++);a=n[i[s]]}if(i.splice(s+1,0,t),n[t]=e,!e.virtual)if(a){var l=a.dom;l.nextSibling?o.insertBefore(e.dom,l.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i];t.call(e,this._layers[r],r)}},t.prototype.eachBuiltinLayer=function(t,e){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__&&t.call(e,o,r)}},t.prototype.eachOtherLayer=function(t,e){for(var n=this._zlevelList,i=0;i<n.length;i++){var r=n[i],o=this._layers[r];o.__builtin__||t.call(e,o,r)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(t){function e(t){o&&(o.__endIndex!==t&&(o.__dirty=!0),o.__endIndex=t)}if(this.eachBuiltinLayer(function(t,e){t.__dirty=t.__used=!1}),this._singleCanvas)for(var n=1;n<t.length;n++)if((s=t[n]).zlevel!==t[n-1].zlevel||s.incremental){this._needsManuallyCompositing=!0;break}var i,r,o=null,a=0;for(r=0;r<t.length;r++){var s,l=(s=t[r]).zlevel,c=void 0;i!==l&&(i=l,a=0),s.incremental?((c=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,a=1):c=this.getLayer(l+(a>0?UA:0),this._needsManuallyCompositing),c.__builtin__||Xa("ZLevel "+l+" has been used by unkown layer "+c.id),c!==o&&(c.__used=!0,c.__startIndex!==r&&(c.__dirty=!0),c.__startIndex=r,c.incremental?c.__drawIndex=-1:c.__drawIndex=r,e(r),o=c),s.__dirty&kc&&!s.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=r))}e(r),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,os(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?Za(n[t],e,!0):n[t]=e;for(var i=0;i<this._zlevelList.length;i++){var r=this._zlevelList[i];r!==t&&r!==t+UA||Za(this._layers[r],n[t],!0)}}},t.prototype.delLayer=function(t){var e=this._layers,n=this._zlevelList,i=e[t];i&&(i.dom.parentNode.removeChild(i.dom),delete e[t],n.splice(es(n,t),1))},t.prototype.resize=function(t,e){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var i=this._opts,r=this.root;if(null!=t&&(i.width=t),null!=e&&(i.height=e),t=yC(r,0,i),e=yC(r,1,i),n.style.display="",this._width!==t||e!==this._height){for(var o in n.style.width=t+"px",n.style.height=e+"px",this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(t,e);this.refresh(!0)}this._width=t,this._height=e}else{if(null==t||null==e)return;this._width=t,this._height=e,this.getLayer(GA).resize(t,e)}return this},t.prototype.clearLayer=function(t){var e=this._layers[t];e&&e.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var e=new jA("image",this,t.pixelRatio||this.dpr);e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor);var n=e.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var i=e.dom.width,r=e.dom.height;this.eachLayer(function(t){t.__builtin__?n.drawImage(t.dom,0,0,i,r):t.renderToCanvas&&(n.save(),t.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++){var c=a[s];zC(n,c,o,s===l-1)}return e.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();const YA=qA;var XA=Math.sin,$A=Math.cos,ZA=Math.PI,KA=2*Math.PI,JA=180/ZA,QA=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,i,r,o){this._add("C",t,e,n,i,r,o)},t.prototype.quadraticCurveTo=function(t,e,n,i){this._add("Q",t,e,n,i)},t.prototype.arc=function(t,e,n,i,r,o){this.ellipse(t,e,n,n,0,i,r,o)},t.prototype.ellipse=function(t,e,n,i,r,o,a,s){var l,c=a-o,u=!s,h=Math.abs(c),d=Gu(h-KA)||(u?c>=KA:-c>=KA),p=c>0?c%KA:c%KA+KA;l=!!d||!Gu(h)&&p>=ZA==!!u;var f=t+n*$A(o),g=e+i*XA(o);this._start&&this._add("M",f,g);var m=Math.round(r*JA);if(d){var y=1/this._p,v=(u?1:-1)*(KA-y);this._add("A",n,i,m,1,+u,t+n*$A(o+v),e+i*XA(o+v)),y>.01&&this._add("A",n,i,m,0,+u,f,g)}else{var _=t+n*$A(a),x=e+i*XA(a);this._add("A",n,i,m,+l,+u,_,x)}},t.prototype.rect=function(t,e,n,i){this._add("M",t,e),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,i,r,o,a,s,l){for(var c=[],u=this._p,h=1;h<arguments.length;h++){var d=arguments[h];if(isNaN(d))return void(this._invalid=!0);c.push(Math.round(d*u)/u)}this._d.push(t+c.join(" ")),this._start="Z"===t},t.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},t.prototype.getStr=function(){return this._str},t}();const tE=QA;var eE="none",nE=Math.round,iE=["lineCap","miterLimit","lineJoin"],rE=as(iE,function(t){return"stroke-"+t.toLowerCase()});var oE="http://www.w3.org/2000/svg",aE="http://www.w3.org/1999/xlink",sE="ecmeta_";function lE(t){return document.createElementNS(oE,t)}function cE(t,e,n,i,r){return{tag:t,attrs:n||{},children:i,text:r,key:e}}function uE(t,e){var n=(e=e||{}).newline?"\n":"";return function t(e){var i=e.children,r=e.tag,o=e.attrs,a=e.text;return function(t,e){var n=[];if(e)for(var i in e){var r=e[i],o=i;!1!==r&&(!0!==r&&null!=r&&(o+='="'+r+'"'),n.push(o))}return"<"+t+" "+n.join(" ")+">"}(r,o)+("style"!==r?El(a):a||"")+(i?""+n+as(i,function(e){return t(e)}).join(n)+n:"")+"</"+r+">"}(t)}function hE(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function dE(t,e,n,i){return cE("svg","root",{width:t,height:e,xmlns:oE,"xmlns:xlink":aE,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},n)}var pE=0;function fE(){return pE++}var gE={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},mE="transform-origin";function yE(t,e,n){var i=Ja({},t.shape);Ja(i,e),t.buildPath(n,i);var r=new tE;return r.reset(th(t)),n.rebuildPath(r,1),r.generateStr(),r.getStr()}function vE(t,e){var n=e.originX,i=e.originY;(n||i)&&(t[mE]=n+"px "+i+"px")}var _E={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function xE(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function bE(t){return gs(t)?gE[t]?"cubic-bezier("+gE[t]+")":cu(t)?t:"":""}function wE(t,e,n,i){var r=t.animators,o=r.length,a=[];if(t instanceof eS){var s=function(t,e,n){var i,r,o=t.shape.paths,a={};if(os(o,function(t){var e=hE(n.zrId);e.animation=!0,wE(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=us(o),c=l.length;if(c){var u=o[r=l[c-1]];for(var h in u){var d=u[h];a[h]=a[h]||{d:""},a[h].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(r)>=0&&(i=f)}}}),i){e.d=!1;var s=xE(a,n);return i.replace(r,s)}}(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},c=0;c<o;c++){var u=r[c],h=[u.getMaxTime()/1e3+"s"],d=bE(u.getClip().easing),p=u.getDelay();d?h.push(d):h.push("linear"),p&&h.push(p/1e3+"s"),u.getLoop()&&h.push("infinite");var f=h.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(u)}function g(r){var o,a=r[1],s=a.length,l={},c={},u={},h="animation-timing-function";function d(t,e,n){for(var i=t.getTracks(),r=t.getMaxTime(),o=0;o<i.length;o++){var a=i[o];if(a.needsAnimate()){var s=a.keyframes,l=a.propName;if(n&&(l=n(l)),l)for(var c=0;c<s.length;c++){var u=s[c],d=Math.round(u.time/r*100)+"%",p=bE(u.easing),f=u.rawValue;(gs(f)||ys(f))&&(e[d]=e[d]||{},e[d][l]=u.rawValue,p&&(e[d][h]=p))}}}}for(var p=0;p<s;p++)(S=(w=a[p]).targetName)?"shape"===S&&d(w,c):!i&&d(w,l);for(var f in l){var g={};Zh(g,t),Ja(g,l[f]);var m=eh(g),y=l[f][h];u[f]=m?{transform:m}:{},vE(u[f],g),y&&(u[f][h]=y)}var v=!0;for(var f in c){u[f]=u[f]||{};var _=!o;y=c[f][h],_&&(o=new Zf);var x=o.len();o.reset(),u[f].d=yE(t,c[f],o);var b=o.len();if(!_&&x!==b){v=!1;break}y&&(u[f][h]=y)}if(!v)for(var f in u)delete u[f].d;if(!i)for(p=0;p<s;p++){var w,S;"style"===(S=(w=a[p]).targetName)&&d(w,u,function(t){return _E[t]})}var M,C=us(u),T=!0;for(p=1;p<C.length;p++){var I=C[p-1],D=C[p];if(u[I][mE]!==u[D][mE]){T=!1;break}M=u[I][mE]}if(T&&M){for(var f in u)u[f][mE]&&delete u[f][mE];e[mE]=M}if(ls(C,function(t){return us(u[t]).length>0}).length)return xE(u,n)+" "+r[0]+" both"}for(var m in l)(s=g(l[m]))&&a.push(s);if(a.length){var y=n.zrId+"-cls-"+fE();n.cssNodes["."+y]={animation:a.join(",")},e.class=y}}function SE(t,e,n,i){var r=JSON.stringify(t),o=n.cssStyleCache[r];o||(o=n.zrId+"-cls-"+fE(),n.cssStyleCache[r]=o,n.cssNodes["."+o+(i?":hover":"")]=t),e.class=e.class?e.class+" "+o:o}var ME=Math.round;function CE(t){return t&&gs(t.src)}function TE(t){return t&&fs(t.toDataURL)}function IE(t,e,n,i){(function(t,e,n,i){var r=null==e.opacity?1:e.opacity;if(n instanceof Cg)t("opacity",r);else{if(function(t){var e=t.fill;return null!=e&&e!==eE}(e)){var o=Wu(e.fill);t("fill",o.color);var a=null!=e.fillOpacity?e.fillOpacity*o.opacity*r:o.opacity*r;(i||a<1)&&t("fill-opacity",a)}else t("fill",eE);if(function(t){var e=t.stroke;return null!=e&&e!==eE}(e)){var s=Wu(e.stroke);t("stroke",s.color);var l=e.strokeNoScale?n.getLineScale():1,c=l?(e.lineWidth||0)/l:0,u=null!=e.strokeOpacity?e.strokeOpacity*s.opacity*r:s.opacity*r,h=e.strokeFirst;if((i||1!==c)&&t("stroke-width",c),(i||h)&&t("paint-order",h?"stroke":"fill"),(i||u<1)&&t("stroke-opacity",u),e.lineDash){var d=vC(n),p=d[0],f=d[1];p&&(f=nE(f||0),t("stroke-dasharray",p.join(",")),(f||i)&&t("stroke-dashoffset",f))}else i&&t("stroke-dasharray",eE);for(var g=0;g<iE.length;g++){var m=iE[g];if(i||e[m]!==fg[m]){var y=e[m]||fg[m];y&&t(rE[g],y)}}}else i&&t("stroke",eE)}})(function(r,o){var a="fill"===r||"stroke"===r;a&&Ju(o)?zE(e,t,r,i):a&&$u(o)?FE(n,t,r,i):t[r]=o,a&&i.ssr&&"none"===o&&(t["pointer-events"]="visible")},e,n,!1),function(t,e,n){var i=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(i)){var r=function(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(t),o=n.shadowCache,a=o[r];if(!a){var s=t.getGlobalScale(),l=s[0],c=s[1];if(!l||!c)return;var u=i.shadowOffsetX||0,h=i.shadowOffsetY||0,d=i.shadowBlur,p=Wu(i.shadowColor),f=p.opacity,g=p.color,m=d/2/l+" "+d/2/c;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=cE("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[cE("feDropShadow","",{dx:u/l,dy:h/c,stdDeviation:m,"flood-color":g,"flood-opacity":f})]),o[r]=a}e.filter=Qu(a)}}(n,t,i)}function DE(t,e){var n=kd(e);n&&(n.each(function(e,n){null!=e&&(t[(sE+n).toLowerCase()]=e+"")}),e.isSilent()&&(t[sE+"silent"]="true"))}function kE(t){return Gu(t[0]-1)&&Gu(t[1])&&Gu(t[2])&&Gu(t[3]-1)}function AE(t,e,n){if(e&&(!function(t){return Gu(t[4])&&Gu(t[5])}(e)||!kE(e))){var i=n?10:1e4;t.transform=kE(e)?"translate("+ME(e[4]*i)/i+" "+ME(e[5]*i)/i+")":function(t){return"matrix("+Uu(t[0])+","+Uu(t[1])+","+Uu(t[2])+","+Uu(t[3])+","+qu(t[4])+","+qu(t[5])+")"}(e)}}function EE(t,e,n){for(var i=t.points,r=[],o=0;o<i.length;o++)r.push(ME(i[o][0]*n)/n),r.push(ME(i[o][1]*n)/n);e.points=r.join(" ")}function LE(t){return!t.smooth}var PE,OE,RE={circle:[(PE=["cx","cy","r"],OE=as(PE,function(t){return"string"==typeof t?[t,t]:t}),function(t,e,n){for(var i=0;i<OE.length;i++){var r=OE[i],o=t[r[0]];null!=o&&(e[r[1]]=ME(o*n)/n)}})],polyline:[EE,LE],polygon:[EE,LE]};function BE(t,e){var n=t.style,i=t.shape,r=RE[t.type],o={},a=e.animation,s="path",l=t.style.strokePercent,c=e.compress&&th(t)||4;if(!r||e.willUpdate||r[1]&&!r[1](i)||a&&function(t){for(var e=t.animators,n=0;n<e.length;n++)if("shape"===e[n].targetName)return!0;return!1}(t)||l<1){var u=!t.path||t.shapeChanged();t.path||t.createPathProxy();var h=t.path;u&&(h.beginPath(),t.buildPath(h,t.shape),t.pathUpdated());var d=h.getVersion(),p=t,f=p.__svgPathBuilder;p.__svgPathVersion===d&&f&&l===p.__svgPathStrokePercent||(f||(f=p.__svgPathBuilder=new tE),f.reset(c),h.rebuildPath(f,l),f.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),o.d=f.getStr()}else{s=t.type;var g=Math.pow(10,c);r[0](i,o,g)}return AE(o,t.transform),IE(o,n,t,e),DE(o,t),e.animation&&wE(t,o,e),e.emphasis&&function(t,e,n){if(!t.ignore)if(t.isSilent())SE(c={"pointer-events":"none"},e,n,!0);else{var i=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},r=i.fill;if(!r){var o=t.style&&t.style.fill,a=t.states.select&&t.states.select.style&&t.states.select.style.fill,s=t.currentStates.indexOf("select")>=0&&a||o;s&&(r=Hu(s))}var l=i.lineWidth;l&&(l/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var c={cursor:"pointer"};r&&(c.fill=r),i.stroke&&(c.stroke=i.stroke),l&&(c["stroke-width"]=l),SE(c,e,n,!0)}}(t,o,e),cE(s,t.id+"",o)}function NE(t,e){return t instanceof vg?BE(t,e):t instanceof Cg?function(t,e){var n=t.style,i=n.image;if(i&&!gs(i)&&(CE(i)?i=i.src:TE(i)&&(i=i.toDataURL())),i){var r=n.x||0,o=n.y||0,a={href:i,width:n.width,height:n.height};return r&&(a.x=r),o&&(a.y=o),AE(a,t.transform),IE(a,n,t,e),DE(a,t),e.animation&&wE(t,a,e),cE("image",t.id+"",a)}}(t,e):t instanceof bg?function(t,e){var n=t.style,i=n.text;if(null!=i&&(i+=""),i&&!isNaN(n.x)&&!isNaN(n.y)){var r=n.font||Ea,o=n.x||0,a=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,rd(r),n.textBaseline),s={"dominant-baseline":"central","text-anchor":Yu[n.textAlign]||n.textAlign};if(jg(n)){var l="",c=n.fontStyle,u=Vg(n.fontSize);if(!parseFloat(u))return;var h=n.fontFamily||Aa,d=n.fontWeight;l+="font-size:"+u+";font-family:"+h+";",c&&"normal"!==c&&(l+="font-style:"+c+";"),d&&"normal"!==d&&(l+="font-weight:"+d+";"),s.style=l}else s.style="font: "+r;return i.match(/\s/)&&(s["xml:space"]="preserve"),o&&(s.x=o),a&&(s.y=a),AE(s,t.transform),IE(s,n,t,e),DE(s,t),e.animation&&wE(t,s,e),cE("text",t.id+"",s,void 0,i)}}(t,e):void 0}function zE(t,e,n,i){var r,o=t[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(Zu(o))r="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!Ku(o))return;r="radialGradient",a.cx=Is(o.x,.5),a.cy=Is(o.y,.5),a.r=Is(o.r,.5)}for(var s=o.colorStops,l=[],c=0,u=s.length;c<u;++c){var h=100*qu(s[c].offset)+"%",d=Wu(s[c].color),p=d.color,f=d.opacity,g={offset:h};g["stop-color"]=p,f<1&&(g["stop-opacity"]=f),l.push(cE("stop",c+"",g))}var m=uE(cE(r,"",a,l)),y=i.gradientCache,v=y[m];v||(v=i.zrId+"-g"+i.gradientIdx++,y[m]=v,a.id=v,i.defs[v]=cE(r,v,a,l)),e[n]=Qu(v)}function FE(t,e,n,i){var r,o=t.style[n],a=t.getBoundingRect(),s={},l=o.repeat,c="no-repeat"===l,u="repeat-x"===l,h="repeat-y"===l;if(Xu(o)){var d=o.imageWidth,p=o.imageHeight,f=void 0,g=o.image;if(gs(g)?f=g:CE(g)?f=g.src:TE(g)&&(f=g.toDataURL()),"undefined"==typeof Image){var m="Image width/height must been given explictly in svg-ssr renderer.";Es(d,m),Es(p,m)}else if(null==d||null==p){var y=function(t,e){if(t){var n=t.elm,i=d||e.width,r=p||e.height;"pattern"===t.tag&&(u?(r=1,i/=a.width):h&&(i=1,r/=a.height)),t.attrs.width=i,t.attrs.height=r,n&&(n.setAttribute("width",i),n.setAttribute("height",r))}},v=Gp(f,null,t,function(t){c||y(w,t),y(r,t)});v&&v.width&&v.height&&(d=d||v.width,p=p||v.height)}r=cE("image","img",{href:f,width:d,height:p}),s.width=d,s.height=p}else o.svgElement&&(r=$a(o.svgElement),s.width=o.svgWidth,s.height=o.svgHeight);if(r){var _,x;c?_=x=1:u?(x=1,_=s.width/a.width):h?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(s.width=_),null==x||isNaN(x)||(s.height=x);var b=eh(o);b&&(s.patternTransform=b);var w=cE("pattern","",s,[r]),S=uE(w),M=i.patternCache,C=M[S];C||(C=i.zrId+"-p"+i.patternIdx++,M[S]=C,s.id=C,w=i.defs[C]=cE("pattern",C,s,[r])),e[n]=Qu(C)}}function VE(t,e,n){var i=n.clipPathCache,r=n.defs,o=i[t.id];if(!o){var a={id:o=n.zrId+"-c"+n.clipPathIdx++};i[t.id]=o,r[o]=cE("clipPath",o,a,[BE(t,n)])}e["clip-path"]=Qu(o)}function HE(t){return document.createTextNode(t)}function jE(t,e,n){t.insertBefore(e,n)}function WE(t,e){t.removeChild(e)}function GE(t,e){t.appendChild(e)}function UE(t){return t.parentNode}function qE(t){return t.nextSibling}function YE(t,e){t.textContent=e}var XE=cE("","");function $E(t){return void 0===t}function ZE(t){return void 0!==t}function KE(t,e,n){for(var i={},r=e;r<=n;++r){var o=t[r].key;void 0!==o&&(i[o]=r)}return i}function JE(t,e){var n=t.key===e.key;return t.tag===e.tag&&n}function QE(t){var e,n=t.children,i=t.tag;if(ZE(i)){var r=t.elm=lE(i);if(nL(XE,t),ps(n))for(e=0;e<n.length;++e){var o=n[e];null!=o&&GE(r,QE(o))}else ZE(t.text)&&!vs(t.text)&&GE(r,HE(t.text))}else t.elm=HE(t.text);return t.elm}function tL(t,e,n,i,r){for(;i<=r;++i){var o=n[i];null!=o&&jE(t,QE(o),e)}}function eL(t,e,n,i){for(;n<=i;++n){var r=e[n];null!=r&&(ZE(r.tag)?WE(UE(r.elm),r.elm):WE(t,r.elm))}}function nL(t,e){var n,i=e.elm,r=t&&t.attrs||{},o=e.attrs||{};if(r!==o){for(n in o){var a=o[n];r[n]!==a&&(!0===a?i.setAttribute(n,""):!1===a?i.removeAttribute(n):"style"===n?i.style.cssText=a:120!==n.charCodeAt(0)?i.setAttribute(n,a):"xmlns:xlink"===n||"xmlns"===n?i.setAttributeNS("http://www.w3.org/2000/xmlns/",n,a):58===n.charCodeAt(3)?i.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,a):58===n.charCodeAt(5)?i.setAttributeNS(aE,n,a):i.setAttribute(n,a))}for(n in r)n in o||i.removeAttribute(n)}}function iL(t,e){var n=e.elm=t.elm,i=t.children,r=e.children;t!==e&&(nL(t,e),$E(e.text)?ZE(i)&&ZE(r)?i!==r&&function(t,e,n){for(var i,r,o,a=0,s=0,l=e.length-1,c=e[0],u=e[l],h=n.length-1,d=n[0],p=n[h];a<=l&&s<=h;)null==c?c=e[++a]:null==u?u=e[--l]:null==d?d=n[++s]:null==p?p=n[--h]:JE(c,d)?(iL(c,d),c=e[++a],d=n[++s]):JE(u,p)?(iL(u,p),u=e[--l],p=n[--h]):JE(c,p)?(iL(c,p),jE(t,c.elm,qE(u.elm)),c=e[++a],p=n[--h]):JE(u,d)?(iL(u,d),jE(t,u.elm,c.elm),u=e[--l],d=n[++s]):($E(i)&&(i=KE(e,a,l)),$E(r=i[d.key])||(o=e[r]).tag!==d.tag?jE(t,QE(d),c.elm):(iL(o,d),e[r]=void 0,jE(t,o.elm,c.elm)),d=n[++s]);(a<=l||s<=h)&&(a>l?tL(t,null==n[h+1]?null:n[h+1].elm,n,s,h):eL(t,e,a,l))}(n,i,r):ZE(r)?(ZE(t.text)&&YE(n,""),tL(n,null,r,0,r.length-1)):ZE(i)?eL(n,i,0,i.length-1):ZE(t.text)&&YE(n,""):t.text!==e.text&&(ZE(i)&&eL(n,i,0,i.length-1),YE(n,e.text)))}var rL=0,oL=function(){function t(t,e,n){if(this.type="svg",this.refreshHover=function(){},this.configLayer=function(){},this.storage=e,this._opts=n=Ja({},n),this.root=t,this._id="zr"+rL++,this._oldVNode=dE(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var r=this._svgDom=this._oldVNode.elm=lE("svg");nL(null,this._oldVNode),i.appendChild(r),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(JE(t,e))iL(t,e);else{var n=t.elm,i=UE(n);QE(e),null!==i&&(jE(i,e.elm,qE(n)),eL(i,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return NE(t,hE(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,i=this._height,r=hE(this._id);r.animation=t.animation,r.willUpdate=t.willUpdate,r.compress=t.compress,r.emphasis=t.emphasis,r.ssr=this._opts.ssr;var o=[],a=this._bgVNode=function(t,e,n,i){var r;if(n&&"none"!==n)if(r=cE("rect","bg",{width:t,height:e,x:"0",y:"0"}),Ju(n))zE({fill:n},r.attrs,"fill",i);else if($u(n))FE({style:{fill:n},dirty:Gs,getBoundingRect:function(){return{width:t,height:e}}},r.attrs,"fill",i);else{var o=Wu(n),a=o.color,s=o.opacity;r.attrs.fill=a,s<1&&(r.attrs["fill-opacity"]=s)}return r}(n,i,this._backgroundColor,r);a&&o.push(a);var s=t.compress?null:this._mainVNode=cE("g","main",{},[]);this._paintList(e,r,s?s.children:o),s&&o.push(s);var l=as(us(r.defs),function(t){return r.defs[t]});if(l.length&&o.push(cE("defs","defs",{},l)),t.animation){var c=function(t,e,n){var i=(n=n||{}).newline?"\n":"",r=" {"+i,o=i+"}",a=as(us(t),function(e){return e+r+as(us(t[e]),function(n){return n+":"+t[e][n]+";"}).join(i)+o}).join(i),s=as(us(e),function(t){return"@keyframes "+t+r+as(us(e[t]),function(n){return n+r+as(us(e[t][n]),function(i){var r=e[t][n][i];return"d"===i&&(r='path("'+r+'")'),i+":"+r+";"}).join(i)+o}).join(i)+o}).join(i);return a||s?["<![CDATA[",a,s,"]]>"].join(i):""}(r.cssNodes,r.cssAnims,{newline:!0});if(c){var u=cE("style","stl",{},[],c);o.push(u)}}return dE(n,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},uE(this.renderToVNode({animation:Is(t.cssAnimation,!0),emphasis:Is(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Is(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var i,r,o=t.length,a=[],s=0,l=0,c=0;c<o;c++){var u=t[c];if(!u.invisible){var h=u.__clipPaths,d=h&&h.length||0,p=r&&r.length||0,f=void 0;for(f=Math.max(d-1,p-1);f>=0&&(!h||!r||h[f]!==r[f]);f--);for(var g=p-1;g>f;g--)i=a[--s-1];for(var m=f+1;m<d;m++){var y={};VE(h[m],y,e);var v=cE("g","clip-g-"+l++,y,[]);(i?i.children:n).push(v),a[s++]=v,i=v}r=h;var _=NE(u,e);_&&(i?i.children:n).push(_)}}},t.prototype.resize=function(t,e){var n=this._opts,i=this.root,r=this._viewport;if(null!=t&&(n.width=t),null!=e&&(n.height=e),i&&r&&(r.style.display="none",t=yC(i,0,n),e=yC(i,1,n),r.style.display=""),this._width!==t||this._height!==e){if(this._width=t,this._height=e,r){var o=r.style;o.width=t+"px",o.height=e+"px"}if($u(this._backgroundColor))this.refresh();else{var a=this._svgDom;a&&(a.setAttribute("width",t),a.setAttribute("height",e));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute("width",t),s.setAttribute("height",e))}}},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},t.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},t.prototype.toDataURL=function(t){var e=this.renderToString(),n="data:image/svg+xml;";return t?(e=nh(e))&&n+"base64,"+e:n+"charset=UTF-8,"+encodeURIComponent(e)},t}();const aL=oL,sL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ma(e,t),e.prototype.getInitialData=function(t){return aD(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(t){var e=new _d,n=hC("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var i=this.getData().getVisual("symbol"),r=this.getData().getVisual("symbolRotate"),o="none"===i?"circle":i,a=.8*t.itemHeight,s=hC(o,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?r:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill="#fff",s.style.lineWidth=2),e},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(Hb);function lL(t,e){var n=t.mapDimensionsAll("defaultedLabel"),i=n.length;if(1===i){var r=Tx(t,e,n[0]);return null!=r?r+"":null}if(i){for(var o=[],a=0;a<n.length;a++)o.push(Tx(t,e,n[a]));return o.join(" ")}}function cL(t,e){var n=t.mapDimensionsAll("defaultedLabel");if(!ps(e))return e+"";for(var i=[],r=0;r<n.length;r++){var o=t.getDimensionIndex(n[r]);o>=0&&i.push(e[o])}return i.join(" ")}var uL=function(t){function e(e,n,i,r){var o=t.call(this)||this;return o.updateData(e,n,i,r),o}return Ma(e,t),e.prototype._createSymbol=function(t,e,n,i,r){this.removeAll();var o=hC(t,-1,-1,2,2,null,r);o.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),o.drift=hL,this._symbolType=t,this.add(o)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Tm(this.childAt(0))},e.prototype.downplay=function(){Im(this.childAt(0))},e.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},e.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},e.prototype.updateData=function(t,n,i,r){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",a=t.hostModel,s=e.getSymbolSize(t,n),l=o!==this._symbolType,c=r&&r.disableAnimation;if(l){var u=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,s,u)}else{(d=this.childAt(0)).silent=!1;var h={scaleX:s[0]/2,scaleY:s[1]/2};c?d.attr(h):Jm(d,h,a,n),ry(d)}if(this._updateCommon(t,n,s,i,r),l){var d=this.childAt(0);c||(h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}},d.scaleX=d.scaleY=0,d.style.opacity=0,Qm(d,h,a,n))}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,e,n,i,r){var o,a,s,l,c,u,h,d,p,f=this.childAt(0),g=t.hostModel;if(i&&(o=i.emphasisItemStyle,a=i.blurItemStyle,s=i.selectItemStyle,l=i.focus,c=i.blurScope,h=i.labelStatesModels,d=i.hoverScale,p=i.cursorStyle,u=i.emphasisDisabled),!i||t.hasItemOption){var m=i&&i.itemModel?i.itemModel:t.getItemModel(e),y=m.getModel("emphasis");o=y.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=y.get("focus"),c=y.get("blurScope"),u=y.get("disabled"),h=cy(m),d=y.getShallow("scale"),p=m.getShallow("cursor")}var v=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(v||0)*Math.PI/180||0);var _=pC(t.getItemVisual(e,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=t.getItemVisual(e,"style"),b=x.fill;if(f instanceof Cg){var w=f.style;f.useStyle(Ja({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(Ja({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,r&&r.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),M=this._z2;null!=S?null==M&&(this._z2=f.z2,f.z2+=S):null!=M&&(f.z2=M,this._z2=null);var C=r&&r.useNameLabel;ly(f,h,{labelFetcher:g,labelDataIndex:e,defaultText:function(e){return C?t.getName(e):lL(t,e)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var T=f.ensureState("emphasis");T.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var I=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;T.scaleX=this._sizeX*I,T.scaleY=this._sizeY*I,this.setSymbolScale(1),Vm(this,l,c,u)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,e,n){var i=this.childAt(0),r=Zg(this).dataIndex,o=n&&n.animation;if(this.silent=i.silent=!0,n&&n.fadeLabel){var a=i.getTextContent();a&&ey(a,{style:{opacity:0}},e,{dataIndex:r,removeOpt:o,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ey(i,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:r,cb:t,removeOpt:o})},e.getSymbolSize=function(t,e){return dC(t.getItemVisual(e,"symbolSize"))},e}(_d);function hL(t,e){this.parent.drift(t,e)}const dL=uL;function pL(t,e,n,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(n))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function fL(t){return null==t||vs(t)||(t={isIgnore:t}),t||{}}function gL(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:cy(e),cursorStyle:e.get("cursor")}}var mL=function(){function t(t){this.group=new _d,this._SymbolCtor=t||dL}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=fL(e);var n=this.group,i=t.hostModel,r=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=gL(t),l={disableAnimation:a},c=e.getSymbolPoint||function(e){return t.getItemLayout(e)};r||n.removeAll(),t.diff(r).add(function(i){var r=c(i);if(pL(t,r,i,e)){var a=new o(t,i,s,l);a.setPosition(r),t.setItemGraphicEl(i,a),n.add(a)}}).update(function(u,h){var d=r.getItemGraphicEl(h),p=c(u);if(pL(t,p,u,e)){var f=t.getItemVisual(u,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(t,u,s,l)).setPosition(p);else{d.updateData(t,u,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Jm(d,m,i)}n.add(d),t.setItemGraphicEl(u,d)}else n.remove(d)}).remove(function(t){var e=r.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},i)}).execute(),this._getSymbolPoint=c,this._data=t},t.prototype.updateLayout=function(){var t=this,e=this._data;e&&e.eachItemGraphicEl(function(e,n){var i=t._getSymbolPoint(n);e.setPosition(i),e.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=gL(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function i(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[],n=fL(n);for(var r=t.start;r<t.end;r++){var o=e.getItemLayout(r);if(pL(e,o,r,n)){var a=new this._SymbolCtor(e,r,this._seriesScope);a.traverse(i),a.setPosition(o),this.group.add(a),e.setItemGraphicEl(r,a),this._progressiveEls.push(a)}}},t.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},t.prototype.remove=function(t){var e=this.group,n=this._data;n&&t?n.eachItemGraphicEl(function(t){t.fadeOut(function(){e.remove(t)},n.hostModel)}):e.removeAll()},t}();const yL=mL;function vL(t,e,n){var i=t.getBaseAxis(),r=t.getOtherAxis(i),o=function(t,e){var n=0,i=t.scale.getExtent();return"start"===e?n=i[0]:"end"===e?n=i[1]:ys(e)&&!isNaN(e)?n=e:i[0]>0?n=i[0]:i[1]<0&&(n=i[1]),n}(r,n),a=i.dim,s=r.dim,l=e.mapDimension(s),c=e.mapDimension(a),u="x"===s||"radius"===s?1:0,h=as(t.dimensions,function(t){return e.mapDimension(t)}),d=!1,p=e.getCalculationInfo("stackResultDimension");return rD(e,h[0])&&(d=!0,h[0]=p),rD(e,h[1])&&(d=!0,h[1]=p),{dataDimsForPoint:h,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function _L(t,e,n,i){var r=NaN;t.stacked&&(r=n.get(n.getCalculationInfo("stackedOverDimension"),i)),isNaN(r)&&(r=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,i),a[1-o]=r,e.dataToPoint(a)}var xL=Math.min,bL=Math.max;function wL(t,e){return isNaN(t)||isNaN(e)}function SL(t,e,n,i,r,o,a,s,l){for(var c,u,h,d,p,f,g=n,m=0;m<i;m++){var y=e[2*g],v=e[2*g+1];if(g>=r||g<0)break;if(wL(y,v)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](y,v),h=y,d=v;else{var _=y-c,x=v-u;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var b=g+o,w=e[2*b],S=e[2*b+1];w===y&&S===v&&m<i;)m++,g+=o,w=e[2*(b+=o)],S=e[2*b+1],_=(y=e[2*g])-c,x=(v=e[2*g+1])-u;var M=m+1;if(l)for(;wL(w,S)&&M<i;)M++,w=e[2*(b+=o)],S=e[2*b+1];var C=.5,T=0,I=0,D=void 0,k=void 0;if(M>=i||wL(w,S))p=y,f=v;else{T=w-c,I=S-u;var A=y-c,E=w-y,L=v-u,P=S-v,O=void 0,R=void 0;if("x"===s){var B=T>0?1:-1;p=y-B*(O=Math.abs(A))*a,f=v,D=y+B*(R=Math.abs(E))*a,k=v}else if("y"===s){var N=I>0?1:-1;p=y,f=v-N*(O=Math.abs(L))*a,D=y,k=v+N*(R=Math.abs(P))*a}else O=Math.sqrt(A*A+L*L),p=y-T*a*(1-(C=(R=Math.sqrt(E*E+P*P))/(R+O))),f=v-I*a*(1-C),k=v+I*a*C,D=xL(D=y+T*a*C,bL(w,y)),k=xL(k,bL(S,v)),D=bL(D,xL(w,y)),f=v-(I=(k=bL(k,xL(S,v)))-v)*O/R,p=xL(p=y-(T=D-y)*O/R,bL(c,y)),f=xL(f,bL(u,v)),D=y+(T=y-(p=bL(p,xL(c,y))))*R/O,k=v+(I=v-(f=bL(f,xL(u,v))))*R/O}t.bezierCurveTo(h,d,p,f,y,v),h=D,d=k}else t.lineTo(y,v)}c=y,u=v,g+=o}return m}var ML=function(){this.smooth=0,this.smoothConstraint=!0},CL=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ML},e.prototype.buildPath=function(t,e){var n=e.points,i=0,r=n.length/2;if(e.connectNulls){for(;r>0&&wL(n[2*r-2],n[2*r-1]);r--);for(;i<r&&wL(n[2*i],n[2*i+1]);i++);}for(;i<r;)i+=SL(t,n,i,r,r,1,e.smooth,e.smoothMonotone,e.connectNulls)+1},e.prototype.getPointOn=function(t,e){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,i,r=this.path.data,o=Zf.CMD,a="x"===e,s=[],l=0;l<r.length;){var c=void 0,u=void 0,h=void 0,d=void 0,p=void 0,f=void 0,g=void 0;switch(r[l++]){case o.M:n=r[l++],i=r[l++];break;case o.L:if(c=r[l++],u=r[l++],(g=a?(t-n)/(c-n):(t-i)/(u-i))<=1&&g>=0){var m=a?(u-i)*g+i:(c-n)*g+n;return a?[t,m]:[m,t]}n=c,i=u;break;case o.C:c=r[l++],u=r[l++],h=r[l++],d=r[l++],p=r[l++],f=r[l++];var y=a?Kc(n,c,h,p,t,s):Kc(i,u,d,f,t,s);if(y>0)for(var v=0;v<y;v++){var _=s[v];if(_<=1&&_>=0)return m=a?$c(i,u,d,f,_):$c(n,c,h,p,_),a?[t,m]:[m,t]}n=p,i=f}}},e}(vg),TL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e}(ML),IL=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new TL},e.prototype.buildPath=function(t,e){var n=e.points,i=e.stackedOnPoints,r=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0&&wL(n[2*o-2],n[2*o-1]);o--);for(;r<o&&wL(n[2*r],n[2*r+1]);r++);}for(;r<o;){var s=SL(t,n,r,o,o,1,e.smooth,a,e.connectNulls);SL(t,i,r+s-1,s,o,-1,e.stackedOnSmooth,a,e.connectNulls),r+=s+1,t.closePath()}},e}(vg);function DL(t,e,n,i,r){var o=t.getArea(),a=o.x,s=o.y,l=o.width,c=o.height,u=n.get(["lineStyle","width"])||0;a-=u/2,s-=u/2,l+=u,c+=u,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var h=new Pg({shape:{x:a,y:s,width:l,height:c}});if(e){var d=t.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(h.shape.x+=l),h.shape.width=0):(f||(h.shape.y+=c),h.shape.height=0);var g=fs(r)?function(t){r(t,h)}:null;Qm(h,{shape:{width:l,height:c,x:a,y:s}},n,null,i,g)}return h}function kL(t,e,n){var i=t.getArea(),r=Bd(i.r0,1),o=Bd(i.r,1),a=new Ew({shape:{cx:Bd(t.cx,1),cy:Bd(t.cy,1),r0:r,r:o,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});return e&&("angle"===t.getBaseAxis().dim?a.shape.endAngle=i.startAngle:a.shape.r=r,Qm(a,{shape:{endAngle:i.endAngle,r:o}},n)),a}function AL(t,e,n,i,r){return t?"polar"===t.type?kL(t,e,n):"cartesian2d"===t.type?DL(t,e,n,i,r):null:null}function EL(t,e){return t.type===e}function LL(t,e){if(t.length===e.length){for(var n=0;n<t.length;n++)if(t[n]!==e[n])return;return!0}}function PL(t){for(var e=1/0,n=1/0,i=-1/0,r=-1/0,o=0;o<t.length;){var a=t[o++],s=t[o++];isNaN(a)||(e=Math.min(a,e),i=Math.max(a,i)),isNaN(s)||(n=Math.min(s,n),r=Math.max(s,r))}return[[e,n],[i,r]]}function OL(t,e){var n=PL(t),i=n[0],r=n[1],o=PL(e),a=o[0],s=o[1];return Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(r[0]-s[0]),Math.abs(r[1]-s[1]))}function RL(t){return ys(t)?t:t?.5:0}function BL(t,e,n,i,r){var o=n.getBaseAxis(),a="x"===o.dim||"radius"===o.dim?0:1,s=[],l=0,c=[],u=[],h=[],d=[];if(r){for(l=0;l<t.length;l+=2){var p=e||t;isNaN(p[l])||isNaN(p[l+1])||d.push(t[l],t[l+1])}t=d}for(l=0;l<t.length-2;l+=2)switch(h[0]=t[l+2],h[1]=t[l+3],u[0]=t[l],u[1]=t[l+1],s.push(u[0],u[1]),i){case"end":c[a]=h[a],c[1-a]=u[1-a],s.push(c[0],c[1]);break;case"middle":var f=(u[a]+h[a])/2,g=[];c[a]=g[a]=f,c[1-a]=u[1-a],g[1-a]=h[1-a],s.push(c[0],c[1]),s.push(g[0],g[1]);break;default:c[a]=u[a],c[1-a]=h[1-a],s.push(c[0],c[1])}return s.push(t[l++],t[l++]),s}function NL(t,e){return isNaN(t)||isNaN(e)}function zL(t,e){return[t[2*e],t[2*e+1]]}function FL(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<nm.length;e++)if(t.get([nm[e],"endLabel","show"]))return!0;return!1}function VL(t,e,n,i){if(EL(e,"cartesian2d")){var r=i.getModel("endLabel"),o=r.get("valueAnimation"),a=i.getData(),s={lastFrameIndex:0},l=FL(i)?function(n,i){t._endLabelOnDuring(n,i,a,s,o,r,e)}:null,c=e.getBaseAxis().isHorizontal(),u=DL(e,n,i,function(){var e=t._endLabel;e&&n&&null!=s.originalX&&e.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=u.shape,d=Math.max(h.width,h.height);c?(h.y-=d,h.height+=2*d):(h.x-=d,h.width+=2*d)}return l&&l(1,u),u}return kL(e,n,i)}var HL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.init=function(){var t=new _d,e=new yL;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t,this._changePolyState=hs(this._changePolyState,this)},e.prototype.render=function(t,e,n){var i=t.coordinateSystem,r=this.group,o=t.getData(),a=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=o.getLayout("points")||[],c="polar"===i.type,u=this._coordSys,h=this._symbolDraw,d=this._polyline,p=this._polygon,f=this._lineGroup,g=!e.ssr&&t.get("animation"),m=!s.isEmpty(),y=s.get("origin"),v=vL(i,o,y),_=m&&function(t,e,n){if(!n.valueDim)return[];for(var i=e.count(),r=ID(2*i),o=0;o<i;o++){var a=_L(n,t,e,o);r[2*o]=a[0],r[2*o+1]=a[1]}return r}(i,o,v),x=t.get("showSymbol"),b=t.get("connectNulls"),w=x&&!c&&function(t,e,n){var i=t.get("showAllSymbol"),r="auto"===i;if(!i||r){var o=n.getAxesByScale("ordinal")[0];if(o&&(!r||!function(t,e){var n=t.getExtent(),i=Math.abs(n[1]-n[0])/t.scale.count();isNaN(i)&&(i=0);for(var r=e.count(),o=Math.max(1,Math.round(r/5)),a=0;a<r;a+=o)if(1.5*dL.getSymbolSize(e,a)[t.isHorizontal()?1:0]>i)return!1;return!0}(o,e))){var a=e.mapDimension(o.dim),s={};return os(o.getViewLabels(),function(t){var e=o.scale.getRawOrdinalNumber(t.tickValue);s[e]=1}),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}(t,o,i),S=this._data;S&&S.eachItemGraphicEl(function(t,e){t.__temp&&(r.remove(t),S.setItemGraphicEl(e,null))}),x||h.remove(),r.add(f);var M,C=!c&&t.get("step");i&&i.getArea&&t.get("clip",!0)&&(null!=(M=i.getArea()).width?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var T=function(t,e,n){var i=t.getVisual("visualMeta");if(i&&i.length&&t.count()&&"cartesian2d"===e.type){for(var r,o,a=i.length-1;a>=0;a--){var s=t.getDimensionInfo(i[a].dimension);if("x"===(r=s&&s.coordDim)||"y"===r){o=i[a];break}}if(o){var l=e.getAxis(r),c=as(o.stops,function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}}),u=c.length,h=o.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),h.reverse());var d=function(t,e){var n,i,r=[],o=t.length;function a(t,e,n){var i=t.coord;return{coord:n,color:Pu((n-i)/(e.coord-i),[t.color,e.color])}}for(var s=0;s<o;s++){var l=t[s],c=l.coord;if(c<0)n=l;else{if(c>e){i?r.push(a(i,l,e)):n&&r.push(a(n,l,0),a(n,l,e));break}n&&(r.push(a(n,l,0)),n=null),r.push(l),i=l}}return r}(c,"x"===r?n.getWidth():n.getHeight()),p=d.length;if(!p&&u)return c[0].coord<0?h[1]?h[1]:c[u-1].color:h[0]?h[0]:c[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";os(d,function(t){t.offset=(t.coord-f)/m}),d.push({offset:p?d[p-1].offset:.5,color:h[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:h[0]||"transparent"});var y=new oS(0,0,0,0,d,!0);return y[r]=f,y[r+"2"]=g,y}}}(o,i,n)||o.getVisual("style")[o.getVisual("drawType")];if(d&&u.type===i.type&&C===this._step){m&&!p?p=this._newPolygon(l,_):p&&!m&&(f.remove(p),p=this._polygon=null),c||this._initOrUpdateEndLabel(t,i,Av(T));var I=f.getClipPath();I?Qm(I,{shape:VL(this,i,!1,t).shape},t):f.setClipPath(VL(this,i,!0,t)),x&&h.updateData(o,{isIgnore:w,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),LL(this._stackedOnPoints,_)&&LL(this._points,l)||(g?this._doUpdateAnimation(o,_,i,n,C,y,b):(C&&(_&&(_=BL(_,l,i,C,b)),l=BL(l,null,i,C,b)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:_})))}else x&&h.updateData(o,{isIgnore:w,clipShape:M,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),g&&this._initSymbolLabelAnimation(o,i,M),C&&(_&&(_=BL(_,l,i,C,b)),l=BL(l,null,i,C,b)),d=this._newPolyline(l),m?p=this._newPolygon(l,_):p&&(f.remove(p),p=this._polygon=null),c||this._initOrUpdateEndLabel(t,i,Av(T)),f.setClipPath(VL(this,i,!0,t));var D=t.getModel("emphasis"),k=D.get("focus"),A=D.get("blurScope"),E=D.get("disabled");d.useStyle(Qa(a.getLineStyle(),{fill:"none",stroke:T,lineJoin:"bevel"})),Gm(d,t,"lineStyle"),d.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"])&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1),Zg(d).seriesIndex=t.seriesIndex,Vm(d,k,A,E);var L=RL(t.get("smooth")),P=t.get("smoothMonotone");if(d.setShape({smooth:L,smoothMonotone:P,connectNulls:b}),p){var O=o.getCalculationInfo("stackedOnSeries"),R=0;p.useStyle(Qa(s.getAreaStyle(),{fill:T,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),O&&(R=RL(O.get("smooth"))),p.setShape({smooth:L,stackedOnSmooth:R,smoothMonotone:P,connectNulls:b}),Gm(p,t,"areaStyle"),Zg(p).seriesIndex=t.seriesIndex,Vm(p,k,A,E)}var B=this._changePolyState;o.eachItemGraphicEl(function(t){t&&(t.onHoverStateChange=B)}),this._polyline.onHoverStateChange=B,this._data=o,this._coordSys=i,this._stackedOnPoints=_,this._points=l,this._step=C,this._valueOrigin=y,t.get("triggerLineEvent")&&(this.packEventData(t,d),p&&this.packEventData(t,p))},e.prototype.packEventData=function(t,e){Zg(e).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,e,n,i){var r=t.getData(),o=_p(r,i);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=r.getLayout("points"),s=r.getItemGraphicEl(o);if(!s){var l=a[2*o],c=a[2*o+1];if(isNaN(l)||isNaN(c))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,c))return;var u=t.get("zlevel")||0,h=t.get("z")||0;(s=new dL(r,o)).x=l,s.y=c,s.setZ(u,h);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=u,d.z=h,d.z2=this._polyline.z2+1),s.__temp=!0,r.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else eM.prototype.highlight.call(this,t,e,n,i)},e.prototype.downplay=function(t,e,n,i){var r=t.getData(),o=_p(r,i);if(this._changePolyState("normal"),null!=o&&o>=0){var a=r.getItemGraphicEl(o);a&&(a.__temp?(r.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else eM.prototype.downplay.call(this,t,e,n,i)},e.prototype._changePolyState=function(t){var e=this._polygon;bm(this._polyline,t),e&&bm(e,t)},e.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new CL({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},e.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new IL({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(t,e,n){var i,r,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(i=o.isHorizontal(),r=!1):"polar"===e.type&&(i="angle"===o.dim,r=!0);var s=t.hostModel,l=s.get("animationDuration");fs(l)&&(l=l(null));var c=s.get("animationDelay")||0,u=fs(c)?c(null):c;t.eachItemGraphicEl(function(t,o){var s=t;if(s){var h=[t.x,t.y],d=void 0,p=void 0,f=void 0;if(n)if(r){var g=n,m=e.pointToCoord(h);i?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var y=n;i?(d=y.x,p=y.x+y.width,f=t.x):(d=y.y+y.height,p=y.y,f=t.y)}var v=p===d?0:(f-d)/(p-d);a&&(v=1-v);var _=fs(c)?c(o):l*v+u,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,e,n){var i=t.getModel("endLabel");if(FL(t)){var r=t.getData(),o=this._polyline,a=r.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new $g({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e=t.length/2;e>0&&NL(t[2*e-2],t[2*e-1]);e--);return e-1}(a);l>=0&&(ly(o,cy(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?cL(r,n):lL(r,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),i=n.isHorizontal(),r=n.inverse,o=i?r?"right":"left":"center",a=i?"middle":r?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||a}}}(i,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,e,n,i,r,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==i.originalX&&(i.originalX=s.x,i.originalY=s.y);var c=n.getLayout("points"),u=n.hostModel,h=u.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,y=e.shape,v=m?g?y.x:y.y+y.height:g?y.x+y.width:y.y,_=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),b=g?"x":"y",w=function(t,e,n){for(var i,r,o=t.length/2,a="x"===n?0:1,s=0,l=-1,c=0;c<o;c++)if(r=t[2*c+a],!isNaN(r)&&!isNaN(t[2*c+1-a]))if(0!==c){if(i<=e&&r>=e||i>=e&&r<=e){l=c;break}s=c,i=r}else i=r;return{range:[s,l],t:(e-i)/(r-i)}}(c,v,b),S=w.range,M=S[1]-S[0],C=void 0;if(M>=1){if(M>1&&!h){var T=zL(c,S[0]);s.attr({x:T[0]+_,y:T[1]+x}),r&&(C=u.getRawValue(S[0]))}else{(T=l.getPointOn(v,b))&&s.attr({x:T[0]+_,y:T[1]+x});var I=u.getRawValue(S[0]),D=u.getRawValue(S[1]);r&&(C=kp(n,d,I,D,w.t))}i.lastFrameIndex=S[0]}else{var k=1===t||i.lastFrameIndex>0?S[0]:0;T=zL(c,k),r&&(C=u.getRawValue(k)),s.attr({x:T[0]+_,y:T[1]+x})}if(r){var A=yy(s);"function"==typeof A.setLabelText&&A.setLabelText(C)}}},e.prototype._doUpdateAnimation=function(t,e,n,i,r,o,a){var s=this._polyline,l=this._polygon,c=t.hostModel,u=function(t,e,n,i,r,o,a){for(var s=function(t,e){var n=[];return e.diff(t).add(function(t){n.push({cmd:"+",idx:t})}).update(function(t,e){n.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){n.push({cmd:"-",idx:t})}).execute(),n}(t,e),l=[],c=[],u=[],h=[],d=[],p=[],f=[],g=vL(r,e,a),m=t.getLayout("points")||[],y=e.getLayout("points")||[],v=0;v<s.length;v++){var _=s[v],x=!0,b=void 0,w=void 0;switch(_.cmd){case"=":b=2*_.idx,w=2*_.idx1;var S=m[b],M=m[b+1],C=y[w],T=y[w+1];(isNaN(S)||isNaN(M))&&(S=C,M=T),l.push(S,M),c.push(C,T),u.push(n[b],n[b+1]),h.push(i[w],i[w+1]),f.push(e.getRawIndex(_.idx1));break;case"+":var I=_.idx,D=g.dataDimsForPoint,k=r.dataToPoint([e.get(D[0],I),e.get(D[1],I)]);w=2*I,l.push(k[0],k[1]),c.push(y[w],y[w+1]);var A=_L(g,r,e,I);u.push(A[0],A[1]),h.push(i[w],i[w+1]),f.push(e.getRawIndex(I));break;case"-":x=!1}x&&(d.push(_),p.push(p.length))}p.sort(function(t,e){return f[t]-f[e]});var E=l.length,L=ID(E),P=ID(E),O=ID(E),R=ID(E),B=[];for(v=0;v<p.length;v++){var N=p[v],z=2*v,F=2*N;L[z]=l[F],L[z+1]=l[F+1],P[z]=c[F],P[z+1]=c[F+1],O[z]=u[F],O[z+1]=u[F+1],R[z]=h[F],R[z+1]=h[F+1],B[v]=d[N]}return{current:L,next:P,stackedOnCurrent:O,stackedOnNext:R,status:B}}(this._data,t,this._stackedOnPoints,e,this._coordSys,0,this._valueOrigin),h=u.current,d=u.stackedOnCurrent,p=u.next,f=u.stackedOnNext;if(r&&(d=BL(u.stackedOnCurrent,u.current,n,r,a),h=BL(u.current,null,n,r,a),f=BL(u.stackedOnNext,u.next,n,r,a),p=BL(u.next,null,n,r,a)),OL(h,p)>3e3||l&&OL(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=u.current,s.shape.points=h;var g={shape:{points:p}};u.current!==h&&(g.shape.__points=u.next),s.stopAnimation(),Jm(s,g,c),l&&(l.setShape({points:h,stackedOnPoints:d}),l.stopAnimation(),Jm(l,{shape:{stackedOnPoints:f}},c),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],y=u.status,v=0;v<y.length;v++)if("="===y[v].cmd){var _=t.getItemGraphicEl(y[v].idx1);_&&m.push({el:_,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){l&&l.dirtyShape();for(var t=s.shape.__points,e=0;e<m.length;e++){var n=m[e].el,i=2*m[e].ptIdx;n.x=t[i],n.y=t[i+1],n.markRedraw()}})},e.prototype.remove=function(t){var e=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(t,i){t.__temp&&(e.remove(t),n.setItemGraphicEl(i,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(eM);const jL=HL;function WL(t,e){return{seriesType:t,plan:Gb(),reset:function(t){var n=t.getData(),i=t.coordinateSystem,r=t.pipelineContext,o=e||r.large;if(i){var a=as(i.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");rD(n,a[0])&&(a[0]=l),rD(n,a[1])&&(a[1]=l);var c=n.getStore(),u=n.getDimensionIndex(a[0]),h=n.getDimensionIndex(a[1]);return s&&{progress:function(t,e){for(var n=t.end-t.start,r=o&&ID(n*s),a=[],l=[],d=t.start,p=0;d<t.end;d++){var f=void 0;if(1===s){var g=c.get(u,d);f=i.dataToPoint(g,null,l)}else a[0]=c.get(u,d),a[1]=c.get(h,d),f=i.dataToPoint(a,null,l);o?(r[p++]=f[0],r[p++]=f[1]):e.setItemLayout(d,f.slice())}o&&e.setLayout("points",r)}}}}}}var GL={average:function(t){for(var e=0,n=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],n++);return 0===n?NaN:e/n},sum:function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n]||0;return e},max:function(t){for(var e=-1/0,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n<t.length;n++)t[n]<e&&(e=t[n]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},UL=function(t){return Math.round(t.length/2)};function qL(t){return{seriesType:t,reset:function(t,e,n){var i=t.getData(),r=t.get("sampling"),o=t.coordinateSystem,a=i.count();if(a>10&&"cartesian2d"===o.type&&r){var s=o.getBaseAxis(),l=o.getOtherAxis(s),c=s.getExtent(),u=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(u||1),d=Math.round(a/h);if(isFinite(d)&&d>1){"lttb"===r?t.setData(i.lttbDownSample(i.mapDimension(l.dim),1/d)):"minmax"===r&&t.setData(i.minmaxDownSample(i.mapDimension(l.dim),1/d));var p=void 0;gs(r)?p=GL[r]:fs(r)&&(p=r),p&&t.setData(i.downSample(i.mapDimension(l.dim),1/d,p,UL))}}}}}var YL=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return aD(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,e,n){var i=this.coordinateSystem;if(i&&i.clampData){var r=i.clampData(t),o=i.dataToPoint(r);if(n)os(i.getAxes(),function(t,n){if("category"===t.type&&null!=e){var i=t.getTicksCoords(),a=t.getTickModel().get("alignWithLabel"),s=r[n],l="x1"===e[n]||"y1"===e[n];if(l&&!a&&(s+=1),i.length<2)return;if(2===i.length)return void(o[n]=t.toGlobalCoord(t.getExtent()[l?1:0]));for(var c=void 0,u=void 0,h=1,d=0;d<i.length;d++){var p=i[d].coord,f=d===i.length-1?i[d-1].tickValue+h:i[d].tickValue;if(f===s){u=p;break}if(f<s)c=p;else if(null!=c&&f>s){u=(p+c)/2;break}1===d&&(h=f-i[0].tickValue)}null==u&&(c?c&&(u=i[i.length-1].coord):u=i[0].coord),o[n]=t.toGlobalCoord(u)}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),c=i.getBaseAxis().isHorizontal()?0:1;o[c]+=s+l/2}return o}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(Hb);Hb.registerClass(YL);const XL=YL,$L=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.getInitialData=function(){return aD(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),e=this.get("largeThreshold");return e>t&&(t=e),t},e.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Ny(XL.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(XL);var ZL=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},KL=function(t){function e(e){var n=t.call(this,e)||this;return n.type="sausage",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new ZL},e.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-r),s=r+a,l=e.startAngle,c=e.endAngle,u=e.clockwise,h=2*Math.PI,d=u?c-l<h:l-c<h;d||(l=c-(u?h:-h));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(c),m=Math.sin(c);d?(t.moveTo(p*r+n,f*r+i),t.arc(p*s+n,f*s+i,a,-Math.PI+l,l,!u)):t.moveTo(p*o+n,f*o+i),t.arc(n,i,o,l,c,!u),t.arc(g*s+n,m*s+i,a,c-2*Math.PI,c-Math.PI,!u),0!==r&&t.arc(n,i,r,c,l,u)},e}(vg);const JL=KL;function QL(t,e,n){return e*Math.sin(t)*(n?-1:1)}function tP(t,e,n){return e*Math.cos(t)*(n?1:-1)}function eP(t,e,n){var i=t.get("borderRadius");if(null==i)return n?{cornerRadius:0}:null;ps(i)||(i=[i,i,i,i]);var r=Math.abs(e.r||0-e.r0||0);return{cornerRadius:as(i,function(t){return od(t,r)})}}var nP=Math.max,iP=Math.min,rP=function(t){function e(){var n=t.call(this)||this;return n.type=e.type,n._isFirstFrame=!0,n}return Ma(e,t),e.prototype.render=function(t,e,n,i){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var r=t.get("coordinateSystem");("cartesian2d"===r||"polar"===r)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,i))},e.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},e.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},e.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t,e,n,i){var r,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,c=l.getBaseAxis();"cartesian2d"===l.type?r=c.isHorizontal():"polar"===l.type&&(r="angle"===c.dim);var u=t.isAnimationEnabled()?t:null,h=function(t,e){var n=t.get("realtimeSort",!0),i=e.getBaseAxis();if(n&&"category"===i.type&&"cartesian2d"===e.type)return{baseAxis:i,otherAxis:e.getOtherAxis(i)}}(t,l);h&&this._enableRealtimeSort(h,a,n);var d=t.get("clip",!0)||h,p=function(t,e){var n=t.getArea&&t.getArea();if(EL(t,"cartesian2d")){var i=t.getBaseAxis();if("category"!==i.type||!i.onBand){var r=e.getLayout("bandWidth");i.isHorizontal()?(n.x-=r,n.width+=2*r):(n.y-=r,n.height+=2*r)}}return n}(l,a);o.removeClipPath();var f=t.get("roundCap",!0),g=t.get("showBackground",!0),m=t.getModel("backgroundStyle"),y=m.get("borderRadius")||0,v=[],_=this._backgroundEls,x=i&&i.isInitSort,b=i&&"changeAxisOrder"===i.type;function w(t){var e=dP[l.type](a,t),n=function(t,e,n){return new("polar"===t.type?Ew:Pg)({shape:_P(e,n,t),silent:!0,z2:0})}(l,r,e);return n.useStyle(m.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",y):n.setShape("cornerRadius",y),v[t]=n,n}a.diff(s).add(function(e){var n=a.getItemModel(e),i=dP[l.type](a,e,n);if(g&&w(e),a.hasValue(e)&&hP[l.type](i)){var s=!1;d&&(s=oP[l.type](p,i));var m=aP[l.type](t,a,e,i,r,u,c.model,!1,f);h&&(m.forceLabelAnimation=!0),fP(m,a,e,n,i,t,r,"polar"===l.type),x?m.attr({shape:i}):h?sP(h,u,m,i,e,r,!1,!1):Qm(m,{shape:i},t,e),a.setItemGraphicEl(e,m),o.add(m),m.ignore=s}}).update(function(e,n){var i=a.getItemModel(e),S=dP[l.type](a,e,i);if(g){var M=void 0;0===_.length?M=w(n):((M=_[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?M.setShape("r",y):M.setShape("cornerRadius",y),v[e]=M);var C=dP[l.type](a,e);Jm(M,{shape:_P(r,C,l)},u,e)}var T=s.getItemGraphicEl(n);if(a.hasValue(e)&&hP[l.type](S)){var I=!1;if(d&&(I=oP[l.type](p,S))&&o.remove(T),T?ry(T):T=aP[l.type](t,a,e,S,r,u,c.model,!!T,f),h&&(T.forceLabelAnimation=!0),b){var D=T.getTextContent();if(D){var k=yy(D);null!=k.prevValue&&(k.prevValue=k.value)}}else fP(T,a,e,i,S,t,r,"polar"===l.type);x?T.attr({shape:S}):h?sP(h,u,T,S,e,r,!0,b):Jm(T,{shape:S},t,e,null),a.setItemGraphicEl(e,T),T.ignore=I,o.add(T)}else o.remove(T)}).remove(function(e){var n=s.getItemGraphicEl(e);n&&iy(n,t,e)}).execute();var S=this._backgroundGroup||(this._backgroundGroup=new _d);S.removeAll();for(var M=0;M<v.length;++M)S.add(v[M]);o.add(S),this._backgroundEls=v,this._data=a},e.prototype._renderLarge=function(t,e,n){this._clear(),yP(t,this.group),this._updateLargeClip(t)},e.prototype._incrementalRenderLarge=function(t,e){this._removeBackground(),yP(e,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(t){var e=t.get("clip",!0)&&AL(t.coordinateSystem,!1,t),n=this.group;e?n.setClipPath(e):n.removeClipPath()},e.prototype._enableRealtimeSort=function(t,e,n){var i=this;if(e.count()){var r=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(e,t,n),this._isFirstFrame=!1;else{var o=function(t){var n=e.getItemGraphicEl(t),i=n&&n.shape;return i&&Math.abs(r.isHorizontal()?i.height:i.width)||0};this._onRendered=function(){i._updateSortWithinSameData(e,o,r,n)},n.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(t,e,n){var i=[];return t.each(t.mapDimension(e.dim),function(t,e){var r=n(e);r=null==r?NaN:r,i.push({dataIndex:e,mappedValue:r,ordinalNumber:t})}),i.sort(function(t,e){return e.mappedValue-t.mappedValue}),{ordinalNumbers:as(i,function(t){return t.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(t,e,n){for(var i=n.scale,r=t.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=i.getOrdinalMeta().categories.length;a<s;++a){var l=t.rawIndexOf(r,i.getRawOrdinalNumber(a)),c=l<0?Number.MIN_VALUE:e(t.indexOfRawIndex(l));if(c>o)return!0;o=c}return!1},e.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,i=n.getExtent(),r=Math.max(0,i[0]),o=Math.min(i[1],n.getOrdinalMeta().categories.length-1);r<=o;++r)if(t.ordinalNumbers[r]!==n.getRawOrdinalNumber(r))return!0},e.prototype._updateSortWithinSameData=function(t,e,n,i){if(this._isOrderChangedWithinSameData(t,e,n)){var r=this._dataSort(t,n,e);this._isOrderDifferentInView(r,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:r}))}},e.prototype._dispatchInitSort=function(t,e,n){var i=e.baseAxis,r=this._dataSort(t,i,function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:r})},e.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},e.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(e){iy(e,t,Zg(e).dataIndex)})):e.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(eM),oP={cartesian2d:function(t,e){var n=e.width<0?-1:1,i=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height);var r=t.x+t.width,o=t.y+t.height,a=nP(e.x,t.x),s=iP(e.x+e.width,r),l=nP(e.y,t.y),c=iP(e.y+e.height,o),u=s<a,h=c<l;return e.x=u&&a>r?s:a,e.y=h&&l>o?c:l,e.width=u?0:s-a,e.height=h?0:c-l,n<0&&(e.x+=e.width,e.width=-e.width),i<0&&(e.y+=e.height,e.height=-e.height),u||h},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var i=e.r;e.r=e.r0,e.r0=i}var r=iP(e.r,t.r),o=nP(e.r0,t.r0);e.r=r,e.r0=o;var a=r-o<0;return n<0&&(i=e.r,e.r=e.r0,e.r0=i),a}},aP={cartesian2d:function(t,e,n,i,r,o,a,s,l){var c=new Pg({shape:Ja({},i),z2:1});return c.__dataIndex=n,c.name="item",o&&(c.shape[r?"height":"width"]=0),c},polar:function(t,e,n,i,r,o,a,s,l){var c=!r&&l?JL:Ew,u=new c({shape:i,z2:1});u.name="item";var h,d,p=pP(r);if(u.calculateTextPosition=(h=p,d=({isRoundCap:c===JL}||{}).isRoundCap,function(t,e,n){var i=e.position;if(!i||i instanceof Array)return ad(t,e,n);var r=h(i),o=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,c=a.r,u=a.r0,p=(c+u)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,y=d?Math.abs(c-u)/2:0,v=Math.cos,_=Math.sin,x=s+c*v(f),b=l+c*_(f),w="left",S="top";switch(r){case"startArc":x=s+(u-o)*v(m),b=l+(u-o)*_(m),w="center",S="top";break;case"insideStartArc":x=s+(u+o)*v(m),b=l+(u+o)*_(m),w="center",S="bottom";break;case"startAngle":x=s+p*v(f)+QL(f,o+y,!1),b=l+p*_(f)+tP(f,o+y,!1),w="right",S="middle";break;case"insideStartAngle":x=s+p*v(f)+QL(f,-o+y,!1),b=l+p*_(f)+tP(f,-o+y,!1),w="left",S="middle";break;case"middle":x=s+p*v(m),b=l+p*_(m),w="center",S="middle";break;case"endArc":x=s+(c+o)*v(m),b=l+(c+o)*_(m),w="center",S="bottom";break;case"insideEndArc":x=s+(c-o)*v(m),b=l+(c-o)*_(m),w="center",S="top";break;case"endAngle":x=s+p*v(g)+QL(g,o+y,!0),b=l+p*_(g)+tP(g,o+y,!0),w="left",S="middle";break;case"insideEndAngle":x=s+p*v(g)+QL(g,-o+y,!0),b=l+p*_(g)+tP(g,-o+y,!0),w="right",S="middle";break;default:return ad(t,e,n)}return(t=t||{}).x=x,t.y=b,t.align=w,t.verticalAlign=S,t}),o){var f=r?"r":"endAngle",g={};u.shape[f]=r?i.r0:i.startAngle,g[f]=i[f],(s?Jm:Qm)(u,{shape:g},o)}return u}};function sP(t,e,n,i,r,o,a,s){var l,c;o?(c={x:i.x,width:i.width},l={y:i.y,height:i.height}):(c={y:i.y,height:i.height},l={x:i.x,width:i.width}),s||(a?Jm:Qm)(n,{shape:l},e,r,null),(a?Jm:Qm)(n,{shape:c},e?t.baseAxis.model:null,r)}function lP(t,e){for(var n=0;n<e.length;n++)if(!isFinite(t[e[n]]))return!0;return!1}var cP=["x","y","width","height"],uP=["cx","cy","r","startAngle","endAngle"],hP={cartesian2d:function(t){return!lP(t,cP)},polar:function(t){return!lP(t,uP)}},dP={cartesian2d:function(t,e,n){var i=t.getItemLayout(e),r=n?function(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var i=t.get(["itemStyle","borderWidth"])||0,r=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(i,r,o)}(n,i):0,o=i.width>0?1:-1,a=i.height>0?1:-1;return{x:i.x+o*r/2,y:i.y+a*r/2,width:i.width-o*r,height:i.height-a*r}},polar:function(t,e,n){var i=t.getItemLayout(e);return{cx:i.cx,cy:i.cy,r0:i.r0,r:i.r,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}}};function pP(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function fP(t,e,n,i,r,o,a,s){var l=e.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var c=t.shape;Ja(c,eP(i.getModel("itemStyle"),c,!0)),t.setShape(c)}}else{var u=i.get(["itemStyle","borderRadius"])||0;t.setShape("r",u)}t.useStyle(l);var h=i.getShallow("cursor");h&&t.attr("cursor",h);var d=s?a?r.r>=r.r0?"endArc":"startArc":r.endAngle>=r.startAngle?"endAngle":"startAngle":a?r.height>=0?"bottom":"top":r.width>=0?"right":"left",p=cy(i);ly(t,p,{labelFetcher:o,labelDataIndex:n,defaultText:lL(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=t.getTextContent();if(s&&f){var g=i.get(["label","position"]);t.textConfig.inside="middle"===g||null,function(t,e,n,i){if(ys(i))t.setTextConfig({rotation:i});else if(ps(e))t.setTextConfig({rotation:0});else{var r,o=t.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,c=n(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":r=l;break;case"startAngle":case"insideStartAngle":r=a;break;case"endAngle":case"insideEndAngle":r=s;break;default:return void t.setTextConfig({rotation:0})}var u=1.5*Math.PI-r;"middle"===c&&u>Math.PI/2&&u<1.5*Math.PI&&(u-=Math.PI),t.setTextConfig({rotation:u})}}(t,"outside"===g?d:g,pP(a),i.get(["label","rotate"]))}vy(f,p,o.getRawValue(n),function(t){return cL(e,t)});var m=i.getModel(["emphasis"]);Vm(t,m.get("focus"),m.get("blurScope"),m.get("disabled")),Gm(t,i),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(r)&&(t.style.fill="none",t.style.stroke="none",os(t.states,function(t){t.style&&(t.style.fill=t.style.stroke="none")}))}var gP=function(){},mP=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new gP},e.prototype.buildPath=function(t,e){for(var n=e.points,i=this.baseDimIdx,r=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[i]=s,a[r]=n[l+2],o[i]=n[l+i],o[r]=n[l+r],t.rect(o[0],o[1],a[0],a[1])},e}(vg);function yP(t,e,n,i){var r=t.getData(),o=r.getLayout("valueAxisHorizontal")?1:0,a=r.getLayout("largeDataIndices"),s=r.getLayout("size"),l=t.getModel("backgroundStyle"),c=r.getLayout("largeBackgroundPoints");if(c){var u=new mP({shape:{points:c},incremental:!!i,silent:!0,z2:0});u.baseDimIdx=o,u.largeDataIndices=a,u.barWidth=s,u.useStyle(l.getItemStyle()),e.add(u),n&&n.push(u)}var h=new mP({shape:{points:r.getLayout("largePoints")},incremental:!!i,ignoreCoarsePointer:!0,z2:1});h.baseDimIdx=o,h.largeDataIndices=a,h.barWidth=s,e.add(h),h.useStyle(r.getVisual("style")),h.style.stroke=null,Zg(h).seriesIndex=t.seriesIndex,t.get("silent")||(h.on("mousedown",vP),h.on("mousemove",vP)),n&&n.push(h)}var vP=oM(function(t){var e=function(t,e,n){for(var i=t.baseDimIdx,r=1-i,o=t.shape.points,a=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,h=o.length/3;u<h;u++){var d=3*u;if(l[i]=c,l[r]=o[d+2],s[i]=o[d+i],s[r]=o[d+r],l[r]<0&&(s[r]+=l[r],l[r]=-l[r]),e>=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[u]}return-1}(this,t.offsetX,t.offsetY);Zg(this).dataIndex=e>=0?e:null},30,!1);function _P(t,e,n){if(EL(n,"cartesian2d")){var i=e,r=n.getArea();return{x:t?i.x:r.x,y:t?r.y:i.y,width:t?i.width:r.width,height:t?r.height:i.height}}var o=e;return{cx:(r=n.getArea()).cx,cy:r.cy,r0:t?r.r0:o.r0,r:t?r.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}const xP=rP;var bP=2*Math.PI,wP=Math.PI/180;function SP(t,e){return Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function MP(t,e){var n=SP(t,e),i=t.get("center"),r=t.get("radius");ps(r)||(r=[0,r]);var o,a,s=Rd(n.width,e.getWidth()),l=Rd(n.height,e.getHeight()),c=Math.min(s,l),u=Rd(r[0],c/2),h=Rd(r[1],c/2),d=t.coordinateSystem;if(d){var p=d.dataToPoint(i);o=p[0]||0,a=p[1]||0}else ps(i)||(i=[i,i]),o=Rd(i[0],s)+n.x,a=Rd(i[1],l)+n.y;return{cx:o,cy:a,r0:u,r:h}}function CP(t,e,n){e.eachSeriesByType(t,function(t){var e=t.getData(),i=e.mapDimension("value"),r=SP(t,n),o=MP(t,n),a=o.cx,s=o.cy,l=o.r,c=o.r0,u=-t.get("startAngle")*wP,h=t.get("endAngle"),d=t.get("padAngle")*wP;h="auto"===h?u-bP:-h*wP;var p=t.get("minAngle")*wP+d,f=0;e.each(i,function(t){!isNaN(t)&&f++});var g=e.getSum(i),m=Math.PI/(g||f)*2,y=t.get("clockwise"),v=t.get("roseType"),_=t.get("stillShowZeroSum"),x=e.getDataExtent(i);x[0]=0;var b=y?1:-1,w=[u,h],S=b*d/2;Xf(w,!y),u=w[0],h=w[1];var M=TP(t);M.startAngle=u,M.endAngle=h,M.clockwise=y;var C=Math.abs(h-u),T=C,I=0,D=u;if(e.setLayout({viewRect:r,r:l}),e.each(i,function(t,n){var i;if(isNaN(t))e.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:y,cx:a,cy:s,r0:c,r:v?NaN:l});else{(i="area"!==v?0===g&&_?m:t*m:C/f)<p?(i=p,T-=p):I+=t;var r=D+b*i,o=0,u=0;d>i?u=o=D+b*i/2:(o=D+S,u=r-S),e.setItemLayout(n,{angle:i,startAngle:o,endAngle:u,clockwise:y,cx:a,cy:s,r0:c,r:v?Od(t,x,[c,l]):l}),D=r}}),T<bP&&f)if(T<=.001){var k=C/f;e.each(i,function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n);i.angle=k;var r=0,o=0;k<d?o=r=u+b*(n+.5)*k:(r=u+b*n*k+S,o=u+b*(n+1)*k-S),i.startAngle=r,i.endAngle=o}})}else m=T/I,D=u,e.each(i,function(t,n){if(!isNaN(t)){var i=e.getItemLayout(n),r=i.angle===p?p:t*m,o=0,a=0;r<d?a=o=D+b*r/2:(o=D+S,a=D+b*r-S),i.startAngle=o,i.endAngle=a,D+=b*r}})})}var TP=xp();function IP(t){return{seriesType:t,reset:function(t,e){var n=e.findComponents({mainType:"legend"});if(n&&n.length){var i=t.getData();i.filterSelf(function(t){for(var e=i.getName(t),r=0;r<n.length;r++)if(!n[r].isSelected(e))return!1;return!0})}}}}var DP=Math.PI/180;function kP(t,e,n,i,r,o,a,s,l,c){if(!(t.length<2)){for(var u=t.length,h=0;h<u;h++)if("outer"===t[h].position&&"labelLine"===t[h].labelAlignTo){var d=t[h].label.x-c;t[h].linePoints[1][0]+=d,t[h].label.x=c}TA(t,l,l+a)&&function(t){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],c=l.label.y>n?a:o,u=Math.abs(l.label.y-n);if(u>=c.maxY){var h=l.label.x-e-l.len2*r,d=i+l.len,f=Math.abs(h)<d?Math.sqrt(u*u/(1-h*h/d/d)):d;c.rB=f,c.maxY=u}c.list.push(l)}p(o),p(a)}(t)}function p(t){for(var o=t.rB,a=o*o,s=0;s<t.list.length;s++){var l=t.list[s],c=Math.abs(l.label.y-n),u=i+l.len,h=u*u,d=Math.sqrt(Math.abs((1-c*c/a)*h)),p=e+(d+l.len2)*r,f=p-l.label.x;AP(l,l.targetTextWidth-f*r,!0),l.label.x=p}}}function AP(t,e,n){if(void 0===n&&(n=!1),null==t.labelStyleWidth){var i=t.label,r=i.style,o=t.rect,a=r.backgroundColor,s=r.padding,l=s?s[1]+s[3]:0,c=r.overflow,u=o.width+(a?0:l);if(e<u||n){var h=o.height;if(c&&c.match("break")){i.setStyle("backgroundColor",null),i.setStyle("width",e-l);var d=i.getBoundingRect();i.setStyle("width",Math.ceil(d.width)),i.setStyle("backgroundColor",a)}else{var p=e-l,f=e<u?p:n?p>t.unconstrainedWidth?null:p:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var m=(i.style.margin||0)+2.1;o.height=g.height+m,o.y-=(o.height-h)/2}}}function EP(t){return"center"===t.position}var LP=function(t){function e(e,n,i){var r=t.call(this)||this;r.z2=2;var o=new $g;return r.setTextContent(o),r.updateData(e,n,i,!0),r}return Ma(e,t),e.prototype.updateData=function(t,e,n,i){var r=this,o=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),c=Ja(eP(a.getModel("itemStyle"),l,!0),l);if(isNaN(c.startAngle))r.setShape(c);else{if(i){r.setShape(c);var u=o.getShallow("animationType");o.ecModel.ssr?(Qm(r,{scaleX:0,scaleY:0},o,{dataIndex:e,isFrom:!0}),r.originX=c.cx,r.originY=c.cy):"scale"===u?(r.shape.r=l.r0,Qm(r,{shape:{r:l.r}},o,e)):null!=n?(r.setShape({startAngle:n,endAngle:n}),Qm(r,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,e)):(r.shape.endAngle=l.startAngle,Jm(r,{shape:{endAngle:l.endAngle}},o,e))}else ry(r),Jm(r,{shape:c},o,e);r.useStyle(t.getItemVisual(e,"style")),Gm(r,a);var h=(l.startAngle+l.endAngle)/2,d=o.get("selectedOffset"),p=Math.cos(h)*d,f=Math.sin(h)*d,g=a.getShallow("cursor");g&&r.attr("cursor",g),this._updateLabel(o,t,e),r.ensureState("emphasis").shape=Ja({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},eP(s.getModel("itemStyle"),l)),Ja(r.ensureState("select"),{x:p,y:f,shape:eP(a.getModel(["select","itemStyle"]),l)}),Ja(r.ensureState("blur"),{shape:eP(a.getModel(["blur","itemStyle"]),l)});var m=r.getTextGuideLine(),y=r.getTextContent();m&&Ja(m.ensureState("select"),{x:p,y:f}),Ja(y.ensureState("select"),{x:p,y:f}),Vm(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},e.prototype._updateLabel=function(t,e,n){var i=this,r=e.getItemModel(n),o=r.getModel("labelLine"),a=e.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;ly(i,cy(r),{labelFetcher:e.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(n,"normal")||e.getName(n)});var c=i.getTextContent();i.setTextConfig({position:null,rotation:null}),c.attr({z2:10});var u=t.get(["label","position"]);if("outside"!==u&&"outer"!==u)i.removeTextGuideLine();else{var h=this.getTextGuideLine();h||(h=new Hw,this.setTextGuideLine(h)),wA(this,SA(r),{stroke:s,opacity:Ds(o.get(["lineStyle","opacity"]),l,1)})}},e}(Ew),PP=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return Ma(e,t),e.prototype.render=function(t,e,n,i){var r,o=t.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),c=1;isNaN(l&&l.startAngle)&&c<o.count();++c)l=o.getItemLayout(c);l&&(r=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&t.get("showEmptyCircle")){var u=TP(t),h=new Ew({shape:Ja(MP(t,n),u)});h.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=h,s.add(h)}o.diff(a).add(function(t){var e=new LP(o,t,r);o.setItemGraphicEl(t,e),s.add(e)}).update(function(t,e){var n=a.getItemGraphicEl(e);n.updateData(o,t,r),n.off("click"),s.add(n),o.setItemGraphicEl(t,n)}).remove(function(e){iy(a.getItemGraphicEl(e),t,e)}).execute(),function(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*DP,s=i.getLayout("viewRect"),l=i.getLayout("r"),c=s.width,u=s.x,h=s.y,d=s.height;function p(t){t.ignore=!0}i.each(function(t){var s=i.getItemGraphicEl(t),h=s.shape,d=s.getTextContent(),f=s.getTextGuideLine(),g=i.getItemModel(t),m=g.getModel("label"),y=m.get("position")||g.get(["emphasis","label","position"]),v=m.get("distanceToLabelLine"),_=m.get("alignTo"),x=Rd(m.get("edgeDistance"),c),b=m.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=Rd(S,c);var M=w.get("length2");if(M=Rd(M,c),Math.abs(h.endAngle-h.startAngle)<a)return os(d.states,p),d.ignore=!0,void(f&&(os(f.states,p),f.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(d)){var C,T,I,D,k=(h.startAngle+h.endAngle)/2,A=Math.cos(k),E=Math.sin(k);e=h.cx,n=h.cy;var L="inside"===y||"inner"===y;if("center"===y)C=h.cx,T=h.cy,D="center";else{var P=(L?(h.r+h.r0)/2*A:h.r*A)+e,O=(L?(h.r+h.r0)/2*E:h.r*E)+n;if(C=P+3*A,T=O+3*E,!L){var R=P+A*(S+l-h.r),B=O+E*(S+l-h.r),N=R+(A<0?-1:1)*M;C="edge"===_?A<0?u+x:u+c-x:N+(A<0?-v:v),T=B,I=[[P,O],[R,B],[N,B]]}D=L?"center":"edge"===_?A>0?"right":"left":A>0?"left":"right"}var z=Math.PI,F=0,V=m.get("rotate");if(ys(V))F=V*(z/180);else if("center"===y)F=0;else if("radial"===V||!0===V)F=A<0?-k+z:-k;else if("tangential"===V&&"outside"!==y&&"outer"!==y){var H=Math.atan2(A,E);H<0&&(H=2*z+H),E>0&&(H=z+H),F=H-z}if(o=!!F,d.x=C,d.y=T,d.rotation=F,d.setStyle({verticalAlign:"middle"}),L){d.setStyle({align:D});var j=d.states.select;j&&(j.x+=d.x,j.y+=d.y)}else{var W=d.getBoundingRect().clone();W.applyTransform(d.getComputedTransform());var G=(d.style.margin||0)+2.1;W.y-=G/2,W.height+=G,r.push({label:d,labelLine:f,position:y,len:S,len2:M,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new nc(A,E),linePoints:I,textAlign:D,labelDistance:v,labelAlignTo:_,edgeDistance:x,bleedMargin:b,rect:W,unconstrainedWidth:W.width,labelStyleWidth:d.style.width})}s.setTextConfig({inside:L})}}),!o&&t.get("avoidLabelOverlap")&&function(t,e,n,i,r,o,a,s){for(var l=[],c=[],u=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0;d<t.length;d++){var p=t[d].label;EP(t[d])||(p.x<e?(u=Math.min(u,p.x),l.push(t[d])):(h=Math.max(h,p.x),c.push(t[d])))}for(d=0;d<t.length;d++)if(!EP(m=t[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;p=m.label;var f,g=m.linePoints;f="edge"===m.labelAlignTo?p.x<e?g[2][0]-m.labelDistance-a-m.edgeDistance:a+r-m.edgeDistance-g[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?p.x<e?u-a-m.bleedMargin:a+r-h-m.bleedMargin:p.x<e?p.x-a-m.bleedMargin:a+r-p.x-m.bleedMargin,m.targetTextWidth=f,AP(m,f)}for(kP(c,e,n,i,1,0,o,0,s,h),kP(l,e,n,i,-1,0,o,0,s,u),d=0;d<t.length;d++){var m;if(!EP(m=t[d])&&m.linePoints){p=m.label,g=m.linePoints;var y="edge"===m.labelAlignTo,v=p.style.padding,_=v?v[1]+v[3]:0,x=p.style.backgroundColor?0:_,b=m.rect.width+x,w=g[1][0]-g[2][0];y?p.x<e?g[2][0]=a+m.edgeDistance+b+m.labelDistance:g[2][0]=a+r-m.edgeDistance-b-m.labelDistance:(p.x<e?g[2][0]=p.x+m.labelDistance:g[2][0]=p.x-m.labelDistance,g[1][0]=g[2][0]+w),g[1][1]=g[2][1]=p.y}}}(r,e,n,l,c,d,u,h);for(var f=0;f<r.length;f++){var g=r[f],m=g.label,y=g.labelLine,v=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),v&&(os(m.states,p),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(y){var x=g.linePoints;v||!x?(os(y.states,p),y.ignore=!0):(vA(x,g.minTurnAngle),_A(x,g.surfaceNormal,g.maxSurfaceAngle),y.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new nc(x[0][0],x[0][1])})}}}(t),"expansion"!==t.get("animationTypeUpdate")&&(this._data=o)},e.prototype.dispose=function(){},e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,r=t[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}},e.type="pie",e}(eM);const OP=PP;function RP(t,e,n){e=ps(e)&&{coordDimensions:e}||Ja({encodeDefine:t.getEncode()},e);var i=t.getSource(),r=JI(i,e).dimensions,o=new ZI(r,t);return o.initData(i,n),o}var BP=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}();const NP=BP;var zP=xp();const FP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new NP(hs(this.getData,this),hs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return RP(this,{coordDimensions:["value"],encodeDefaulter:ds(s_,this)})},e.prototype.getDataParams=function(e){var n=this.getData(),i=zP(n),r=i.seats;if(!r){var o=[];n.each(n.mapDimension("value"),function(t){o.push(t)}),r=i.seats=jd(o,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=r[e]||0,a.$vars.push("percent"),a},e.prototype._defaultLabelLine=function(t){cp(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(Hb),VP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return aD(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(Hb);var HP=function(){},jP=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new HP},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,e){var n,i=e.points,r=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&r[0]<4,c=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<i.length;){var u=i[n++],h=i[n++];isNaN(u)||isNaN(h)||c&&!c.contain(u,h)||(a.x=u-r[0]/2,a.y=h-r[1]/2,a.width=r[0],a.height=r[1],o.buildPath(t,a,!0))}this.incremental&&(this._off=n,this.notClear=!0)}},e.prototype.afterBrush=function(){var t,e=this.shape,n=e.points,i=e.size,r=this._ctx,o=this.softClipShape;if(r){for(t=this._off;t<n.length;){var a=n[t++],s=n[t++];isNaN(a)||isNaN(s)||o&&!o.contain(a,s)||r.fillRect(a-i[0]/2,s-i[1]/2,i[0],i[1])}this.incremental&&(this._off=t,this.notClear=!0)}},e.prototype.findDataIndex=function(t,e){for(var n=this.shape,i=n.points,r=n.size,o=Math.max(r[0],4),a=Math.max(r[1],4),s=i.length/2-1;s>=0;s--){var l=2*s,c=i[l]-o/2,u=i[l+1]-a/2;if(t>=c&&e>=u&&t<=c+o&&e<=u+a)return s}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,i=e.size,r=i[0],o=i[1],a=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<n.length;){var h=n[u++],d=n[u++];a=Math.min(h,a),l=Math.max(h,l),s=Math.min(d,s),c=Math.max(d,c)}t=this._rect=new dc(a-r/2,s-o/2,l-a+r,c-s+o)}return t},e}(vg),WP=function(){function t(){this.group=new _d}return t.prototype.updateData=function(t,e){this._clear();var n=this._create();n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,e)},t.prototype.updateLayout=function(t){var e=t.getLayout("points");this.group.eachChild(function(t){if(null!=t.startIndex){var n=2*(t.endIndex-t.startIndex),i=4*t.startIndex*2;e=new Float32Array(e.buffer,i,n)}t.setShape("points",e),t.reset()})},t.prototype.incrementalPrepareUpdate=function(t){this._clear()},t.prototype.incrementalUpdate=function(t,e,n){var i=this._newAdded[0],r=e.getLayout("points"),o=i&&i.shape.points;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+r.length);s.set(o),s.set(r,a),i.endIndex=t.end,i.setShape({points:s})}else{this._newAdded=[];var l=this._create();l.startIndex=t.start,l.endIndex=t.end,l.incremental=!0,l.setShape({points:r}),this._setCommon(l,e,n)}},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new jP({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;n=n||{};var r=e.getVisual("symbolSize");t.setShape("size",r instanceof Array?r:[r,r]),t.softClipShape=n.clipShape||null,t.symbolProxy=hC(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var o=t.shape.size[0]<4;t.useStyle(i.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=e.getVisual("style"),s=a&&a.fill;s&&t.setColor(s);var l=Zg(t);l.seriesIndex=i.seriesIndex,t.on("mousemove",function(e){l.dataIndex=null;var n=t.hoverDataIdx;n>=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();const GP=WP,UP=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).updateData(i,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateSymbolDraw(i,t).incrementalPrepareUpdate(i),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),{clipShape:this._getClipShape(e)}),this._finished=t.end===e.getData().count()},e.prototype.updateTransform=function(t,e,n){var i=t.getData();if(this.group.dirty(),!this._finished||i.count()>1e4)return{update:!0};var r=WL("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout(i)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var e=t.coordinateSystem;return e&&e.getArea&&e.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,i=e.pipelineContext.large;return n&&i===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=i?new GP:new yL,this._isLargeDraw=i,this.group.removeAll()),this.group.add(n.group),n},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(eM),qP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Uv);var YP=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Mp).models[0]},e.type="cartesian2dAxis",e}(Uv);is(YP,vk);var XP={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},$P=Za({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},XP),ZP=Za({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},XP);const KP={category:$P,value:ZP,time:Za({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},ZP),log:Qa({logBase:10},ZP)};var JP={value:1,category:1,time:1,log:1};function QP(t,e,n,i){os(JP,function(r,o){var a=Za(Za({},KP[o],!0),i,!0),s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e+"Axis."+o,n}return Ma(n,t),n.prototype.mergeDefaultAndTheme=function(t,e){var n=Fv(this),i=n?Hv(t):{};Za(t,e.getTheme().get(o+"Axis")),Za(t,this.getDefaultOption()),t.type=tO(t),n&&Vv(t,i,n)},n.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=dD.createByAxisModel(this))},n.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=e+"Axis."+o,n.defaultOption=a,n}(n);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",tO)}function tO(t){return t.type||(t.data?"category":"value")}var eO=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return as(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),ls(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),nO=["x","y"];function iO(t){return"interval"===t.type||"time"===t.type}var rO=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cartesian2d",e.dimensions=nO,e}return Ma(e,t),e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(iO(t)&&iO(e)){var n=t.getExtent(),i=e.getExtent(),r=this.dataToPoint([n[0],i[0]]),o=this.dataToPoint([n[1],i[1]]),a=n[1]-n[0],s=i[1]-i[0];if(a&&s){var l=(o[0]-r[0])/a,c=(o[1]-r[1])/s,u=r[0]-n[0]*l,h=r[1]-i[0]*c,d=this._transform=[l,0,0,c,u,h];this._invTransform=Ql([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,e){var n=this.dataToPoint(t),i=this.dataToPoint(e),r=this.getArea(),o=new dc(n[0],n[1],i[0]-n[0],i[1]-n[1]);return r.intersect(o)},e.prototype.dataToPoint=function(t,e,n){n=n||[];var i=t[0],r=t[1];if(this._transform&&null!=i&&isFinite(i)&&null!=r&&isFinite(r))return fl(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(i,e)),n[1]=a.toGlobalCoord(a.dataToCoord(r,e)),n},e.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,i=this.getAxis("y").scale,r=n.getExtent(),o=i.getExtent(),a=n.parse(t[0]),s=i.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(r[0],r[1]),a),Math.max(r[0],r[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},e.prototype.pointToData=function(t,e){var n=[];if(this._invTransform)return fl(n,t,this._invTransform);var i=this.getAxis("x"),r=this.getAxis("y");return n[0]=i.coordToData(i.toLocalCoord(t[0]),e),n[1]=r.coordToData(r.toLocalCoord(t[1]),e),n},e.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},e.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1])-t,r=Math.min(n[0],n[1])-t,o=Math.max(e[0],e[1])-i+t,a=Math.max(n[0],n[1])-r+t;return new dc(i,r,o,a)},e}(eO);const oO=rO;var aO=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.index=0,a.type=r||"value",a.position=o||"bottom",a}return Ma(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},e.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},e.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}($k);const sO=aO;function lO(t,e,n){n=n||{};var i=t.coordinateSystem,r=e.axis,o={},a=r.getAxesOnZeroOf()[0],s=r.position,l=a?"onZero":s,c=r.dim,u=i.getRect(),h=[u.x,u.x+u.width,u.y,u.y+u.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=e.get("offset")||0,f="x"===c?[h[2]-p,h[3]+p]:[h[0]-p,h[1]+p];if(a){var g=a.toGlobalCoord(a.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}o.position=["y"===c?f[d[l]]:h[0],"x"===c?f[d[l]]:h[3]],o.rotation=Math.PI/2*("x"===c?0:1),o.labelDirection=o.tickDirection=o.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],o.labelOffset=a?f[d[s]]-f[d.onZero]:0,e.get(["axisTick","inside"])&&(o.tickDirection=-o.tickDirection),Ts(n.labelInside,e.get(["axisLabel","inside"]))&&(o.labelDirection=-o.labelDirection);var m=e.get(["axisLabel","rotate"]);return o.labelRotate="top"===l?-m:m,o.z2=1,o}function cO(t){return"cartesian2d"===t.get("coordinateSystem")}function uO(t){var e={xAxisModel:null,yAxisModel:null};return os(e,function(n,i){var r=i.replace(/Model$/,""),o=t.getReferringComponents(r,Mp).models[0];e[i]=o}),e}var hO=Math.log;function dO(t,e,n){var i=MD.prototype,r=i.getTicks.call(n),o=i.getTicks.call(n,!0),a=r.length-1,s=i.getInterval.call(n),l=ck(t,e),c=l.extent,u=l.fixMin,h=l.fixMax;if("log"===t.type){var d=hO(t.base);c=[hO(c[0])/d,hO(c[1])/d]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:a,fixMin:u,fixMax:h});var p=i.getExtent.call(t);u&&(c[0]=p[0]),h&&(c[1]=p[1]);var f=i.getInterval.call(t),g=c[0],m=c[1];if(u&&h)f=(m-g)/a;else if(u)for(m=c[0]+f*a;m<c[1]&&isFinite(m)&&isFinite(c[1]);)f=fD(f),m=c[0]+f*a;else if(h)for(g=c[1]-f*a;g>c[0]&&isFinite(g)&&isFinite(c[0]);)f=fD(f),g=c[1]-f*a;else{t.getTicks().length-1>a&&(f=fD(f));var y=f*a;(g=Bd((m=Math.ceil(c[1]/f)*f)-y))<0&&c[0]>=0?(g=0,m=Bd(y)):m>0&&c[1]<=0&&(m=0,g=-Bd(y))}var v=(r[0].value-o[0].value)/s,_=(r[a].value-o[a].value)/s;i.setExtent.call(t,g+f*v,m+f*_),i.setInterval.call(t,f),(v||_)&&i.setNiceExtent.call(t,g+f,m-f)}var pO=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=nO,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function i(t){var e,n=us(t),i=n.length;if(i){for(var r=[],o=i-1;o>=0;o--){var a=t[+n[o]],s=a.model,l=a.scale;pD(l)&&s.get("alignTicks")&&null==s.get("interval")?r.push(a):(uk(l,s),pD(l)&&(e=a))}r.length&&(e||uk((e=r.pop()).scale,e.model),os(r,function(t){dO(t.scale,t.model,e.scale)}))}}this._updateScale(t,this.model),i(n.x),i(n.y);var r={};os(n.x,function(t){gO(n,"y",t,r)}),os(n.y,function(t){gO(n,"x",t,r)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var i=t.getBoxLayoutParams(),r=!n&&t.get("containLabel"),o=Nv(i,{width:e.getWidth(),height:e.getHeight()});this._rect=o;var a=this._axesList;function s(){os(a,function(t){var e=t.isHorizontal(),n=e?[0,o.width]:[0,o.height],i=t.inverse?1:0;t.setExtent(n[i],n[1-i]),function(t,e){var n=t.getExtent(),i=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return i-t+e}}(t,e?o.x:o.y)})}s(),r&&(os(a,function(t){if(!t.model.get(["axisLabel","inside"])){var e=function(t){var e=t.model,n=t.scale;if(e.get(["axisLabel","show"])&&!n.isBlank()){var i,r,o=n.getExtent();r=n instanceof bD?n.count():(i=n.getTicks()).length;var a,s=t.getLabelModel(),l=dk(t),c=1;r>40&&(c=Math.ceil(r/40));for(var u=0;u<r;u+=c){var h=l(i?i[u]:{value:o[0]+u},u),d=fk(s.getTextRect(h),s.get("rotate")||0);a?a.union(d):a=d}return a}}(t);if(e){var n=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);o[n]-=e[n]+i,"top"===t.position?o.y+=e.height+i:"left"===t.position&&(o.x+=e.width+i)}}}),s()),os(this._coordsList,function(t){t.calcAffineTransform()})},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}vs(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var i=0,r=this._coordsList;i<r.length;i++)if(r[i].getAxis("x").index===t||r[i].getAxis("y").index===e)return r[i]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.dataToPoint(n):i.axis?i.axis.toGlobalCoord(i.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(t,e,n){var i=this._findConvertTarget(e);return i.cartesian?i.cartesian.pointToData(n):i.axis?i.axis.coordToData(i.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(t){var e,n,i=t.seriesModel,r=t.xAxisModel||i&&i.getReferringComponents("xAxis",Mp).models[0],o=t.yAxisModel||i&&i.getReferringComponents("yAxis",Mp).models[0],a=t.gridModel,s=this._coordsList;return i?es(s,e=i.coordinateSystem)<0&&(e=null):r&&o?e=this.getCartesian(r.componentIndex,o.componentIndex):r?n=this.getAxis("x",r.componentIndex):o?n=this.getAxis("y",o.componentIndex):a&&a.coordinateSystem===this&&(e=this._coordsList[0]),{cartesian:e,axis:n}},t.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},t.prototype._initCartesian=function(t,e,n){var i=this,r=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(e.eachComponent("xAxis",l("x"),this),e.eachComponent("yAxis",l("y"),this),!s.x||!s.y)return this._axesMap={},void(this._axesList=[]);function l(e){return function(n,i){if(fO(n,t)){var l=n.get("position");"x"===e?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var c=new sO(e,hk(n),[0,0],n.get("type"),l),u="category"===c.type;c.onBand=u&&n.get("boundaryGap"),c.inverse=n.get("inverse"),n.axis=c,c.model=n,c.grid=r,c.index=i,r._axesList.push(c),a[e][i]=c,s[e]++}}}this._axesMap=a,os(a.x,function(e,n){os(a.y,function(r,o){var a="x"+n+"y"+o,s=new oO(a);s.master=i,s.model=t,i._coordsMap[a]=s,i._coordsList.push(s),s.addAxis(e),s.addAxis(r)})})},t.prototype._updateScale=function(t,e){function n(t,e){os(yk(t,e.dim),function(n){e.scale.unionExtentFromData(t,n)})}os(this._axesList,function(t){if(t.scale.setExtent(1/0,-1/0),"category"===t.type){var e=t.model.get("categorySortInfo");t.scale.setSortInfo(e)}}),t.eachSeries(function(t){if(cO(t)){var i=uO(t),r=i.xAxisModel,o=i.yAxisModel;if(!fO(r,e)||!fO(o,e))return;var a=this.getCartesian(r.componentIndex,o.componentIndex),s=t.getData(),l=a.getAxis("x"),c=a.getAxis("y");n(s,l),n(s,c)}},this)},t.prototype.getTooltipAxes=function(t){var e=[],n=[];return os(this.getCartesians(),function(i){var r=null!=t&&"auto"!==t?i.getAxis(t):i.getBaseAxis(),o=i.getOtherAxis(r);es(e,r)<0&&e.push(r),es(n,o)<0&&n.push(o)}),{baseAxes:e,otherAxes:n}},t.create=function(e,n){var i=[];return e.eachComponent("grid",function(r,o){var a=new t(r,e,n);a.name="grid_"+o,a.resize(r,n,!0),r.coordinateSystem=a,i.push(a)}),e.eachSeries(function(t){if(cO(t)){var e=uO(t),n=e.xAxisModel,i=e.yAxisModel,r=n.getCoordSysModel().coordinateSystem;t.coordinateSystem=r.getCartesian(n.componentIndex,i.componentIndex)}}),i},t.dimensions=nO,t}();function fO(t,e){return t.getCoordSysModel()===e}function gO(t,e,n,i){n.getAxesOnZeroOf=function(){return r?[r]:[]};var r,o=t[e],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)mO(o[l])&&(r=o[l]);else for(var c in o)if(o.hasOwnProperty(c)&&mO(o[c])&&!i[u(o[c])]){r=o[c];break}r&&(i[u(r)]=!0)}function u(t){return t.dim+"_"+t.index}}function mO(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),n=e[0],i=e[1];return!(n>0&&i>0||n<0&&i<0)}(t)}const yO=pO;var vO=Math.PI,_O=function(){function t(t,e){this.group=new _d,this.opt=e,this.axisModel=t,Qa(e,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new _d({x:e.position[0],y:e.position[1],rotation:e.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(t){return!!xO[t]},t.prototype.add=function(t){xO[t](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(t,e,n){var i,r,o=Ud(e-t);return qd(o)?(r=n>0?"top":"bottom",i="center"):qd(o-vO)?(r=n>0?"bottom":"top",i="center"):(r="middle",i=o>0&&o<vO?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:i,textVerticalAlign:r}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),xO={axisLine:function(t,e,n,i){var r=e.get(["axisLine","show"]);if("auto"===r&&t.handleAutoShown&&(r=t.handleAutoShown("axisLine")),r){var o=e.axis.getExtent(),a=i.transform,s=[o[0],0],l=[o[1],0],c=s[0]>l[0];a&&(fl(s,s,a),fl(l,l,a));var u=Ja({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new Uw({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});AS(h.shape,h.style.lineWidth),h.anid="line",n.add(h);var d=e.get(["axisLine","symbol"]);if(null!=d){var p=e.get(["axisLine","symbolSize"]);gs(d)&&(d=[d,d]),(gs(p)||ys(p))&&(p=[p,p]);var f=pC(e.get(["axisLine","symbolOffset"])||0,p),g=p[0],m=p[1];os([{rotate:t.rotation+Math.PI/2,offset:f[0],r:0},{rotate:t.rotation-Math.PI/2,offset:f[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(e,i){if("none"!==d[i]&&null!=d[i]){var r=hC(d[i],-g/2,-m/2,g,m,u.stroke,!0),o=e.r+e.offset,a=c?l:s;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),n.add(r)}})}}},axisTickLabel:function(t,e,n,i){var r=function(t,e,n,i){var r=n.axis,o=n.getModel("axisTick"),a=o.get("show");if("auto"===a&&i.handleAutoShown&&(a=i.handleAutoShown("axisTick")),a&&!r.scale.isBlank()){for(var s=o.getModel("lineStyle"),l=i.tickDirection*o.get("length"),c=MO(r.getTicksCoords(),e.transform,l,Qa(s.getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])}),"ticks"),u=0;u<c.length;u++)t.add(c[u]);return c}}(n,i,e,t),o=function(t,e,n,i){var r=n.axis;if(Ts(i.axisLabelShow,n.get(["axisLabel","show"]))&&!r.scale.isBlank()){var o=n.getModel("axisLabel"),a=o.get("margin"),s=r.getViewLabels(),l=(Ts(i.labelRotate,o.get("rotate"))||0)*vO/180,c=_O.innerTextLayout(i.rotation,l,i.labelDirection),u=n.getCategories&&n.getCategories(!0),h=[],d=_O.isLabelSilent(n),p=n.get("triggerEvent");return os(s,function(l,f){var g="ordinal"===r.scale.type?r.scale.getRawOrdinalNumber(l.tickValue):l.tickValue,m=l.formattedLabel,y=l.rawLabel,v=o;if(u&&u[g]){var _=u[g];vs(_)&&_.textStyle&&(v=new Oy(_.textStyle,o,n.ecModel))}var x=v.getTextColor()||n.get(["axisLine","lineStyle","color"]),b=r.dataToCoord(g),w=v.getShallow("align",!0)||c.textAlign,S=Is(v.getShallow("alignMinLabel",!0),w),M=Is(v.getShallow("alignMaxLabel",!0),w),C=v.getShallow("verticalAlign",!0)||v.getShallow("baseline",!0)||c.textVerticalAlign,T=Is(v.getShallow("verticalAlignMinLabel",!0),C),I=Is(v.getShallow("verticalAlignMaxLabel",!0),C),D=new $g({x:b,y:i.labelOffset+i.labelDirection*a,rotation:c.rotation,silent:d,z2:10+(l.level||0),style:uy(v,{text:m,align:0===f?S:f===s.length-1?M:w,verticalAlign:0===f?T:f===s.length-1?I:C,fill:fs(x)?x("category"===r.type?y:"value"===r.type?g+"":g,f):x})});if(D.anid="label_"+g,GS({el:D,componentModel:n,itemName:m,formatterParamsExtra:{isTruncated:function(){return D.isTruncated},value:y,tickIndex:f}}),p){var k=_O.makeAxisEventDataBase(n);k.targetType="axisLabel",k.value=y,k.tickIndex=f,"category"===r.type&&(k.dataIndex=g),Zg(D).eventData=k}e.add(D),D.updateTransform(),h.push(D),t.add(D),D.decomposeTransform()}),h}}(n,i,e,t);(function(t,e,n){if(!mk(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),r=t.get(["axisLabel","showMaxLabel"]);n=n||[];var o=(e=e||[])[0],a=e[1],s=e[e.length-1],l=e[e.length-2],c=n[0],u=n[1],h=n[n.length-1],d=n[n.length-2];!1===i?(bO(o),bO(c)):wO(o,a)&&(i?(bO(a),bO(u)):(bO(o),bO(c))),!1===r?(bO(s),bO(h)):wO(l,s)&&(r?(bO(l),bO(d)):(bO(s),bO(h)))}})(e,o,r),function(t,e,n,i){var r=n.axis,o=n.getModel("minorTick");if(o.get("show")&&!r.scale.isBlank()){var a=r.getMinorTicksCoords();if(a.length)for(var s=o.getModel("lineStyle"),l=i*o.get("length"),c=Qa(s.getLineStyle(),Qa(n.getModel("axisTick").getLineStyle(),{stroke:n.get(["axisLine","lineStyle","color"])})),u=0;u<a.length;u++)for(var h=MO(a[u],e.transform,l,c,"minorticks_"+u),d=0;d<h.length;d++)t.add(h[d])}}(n,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])&&IA(MA(as(o,function(t){return{label:t,priority:t.z2,defaultAttr:{ignore:t.ignore}}})))},axisName:function(t,e,n,i){var r=Ts(t.axisName,e.get("name"));if(r){var o,a,s=e.get("nameLocation"),l=t.nameDirection,c=e.getModel("nameTextStyle"),u=e.get("nameGap")||0,h=e.axis.getExtent(),d=h[0]>h[1]?-1:1,p=["start"===s?h[0]-d*u:"end"===s?h[1]+d*u:(h[0]+h[1])/2,SO(s)?t.labelOffset+l*u:0],f=e.get("nameRotate");null!=f&&(f=f*vO/180),SO(s)?o=_O.innerTextLayout(t.rotation,null!=f?f:t.rotation,l):(o=function(t,e,n,i){var r,o,a=Ud(n-t),s=i[0]>i[1],l="start"===e&&!s||"start"!==e&&s;return qd(a-vO/2)?(o=l?"bottom":"top",r="center"):qd(a-1.5*vO)?(o=l?"top":"bottom",r="center"):(o="middle",r=a<1.5*vO&&a>vO/2?l?"left":"right":l?"right":"left"),{rotation:a,textAlign:r,textVerticalAlign:o}}(t.rotation,s,f||0,h),null!=(a=t.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(o.rotation)),!isFinite(a)&&(a=null)));var g=c.getFont(),m=e.get("nameTruncate",!0)||{},y=m.ellipsis,v=Ts(t.nameTruncateMaxWidth,m.maxWidth,a),_=new $g({x:p[0],y:p[1],rotation:o.rotation,silent:_O.isLabelSilent(e),style:uy(c,{text:r,font:g,overflow:"truncate",width:v,ellipsis:y,fill:c.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:c.get("align")||o.textAlign,verticalAlign:c.get("verticalAlign")||o.textVerticalAlign}),z2:1});if(GS({el:_,componentModel:e,itemName:r}),_.__fullText=r,_.anid="name",e.get("triggerEvent")){var x=_O.makeAxisEventDataBase(e);x.targetType="axisName",x.name=r,Zg(_).eventData=x}i.add(_),_.updateTransform(),n.add(_),_.decomposeTransform()}}};function bO(t){t&&(t.ignore=!0)}function wO(t,e){var n=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(n&&i){var r=Yl([]);return Kl(r,r,-t.rotation),n.applyTransform($l([],r,t.getLocalTransform())),i.applyTransform($l([],r,e.getLocalTransform())),n.intersect(i)}}function SO(t){return"middle"===t||"center"===t}function MO(t,e,n,i,r){for(var o=[],a=[],s=[],l=0;l<t.length;l++){var c=t[l].coord;a[0]=c,a[1]=0,s[0]=c,s[1]=n,e&&(fl(a,a,e),fl(s,s,e));var u=new Uw({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});AS(u.shape,u.style.lineWidth),u.anid=r+"_"+t[l].tickValue,o.push(u)}return o}const CO=_O;function TO(t,e){return"all"===t||ps(t)&&es(t,e)>=0||t===e}function IO(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[kO(t)]}function DO(t){return!!t.get(["handle","show"])}function kO(t){return t.type+"||"+t.id}var AO={},EO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(e,n,i,r){this.axisPointerClass&&function(t){var e=IO(t);if(e){var n=e.axisPointerModel,i=e.axis.scale,r=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=i.parse(a));var s=DO(n);null==o&&(r.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),r.value=a,s&&(r.status=e.axis.scale.isBlank()?"hide":"show")}}(e),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,i,!0)},e.prototype.updateAxisPointer=function(t,e,n,i){this._doUpdateAxisPointerClass(t,n,!1)},e.prototype.remove=function(t,e){var n=this._axisPointer;n&&n.remove(e)},e.prototype.dispose=function(e,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(t,n,i){var r=e.getAxisPointerClass(this.axisPointerClass);if(r){var o=function(t){var e=IO(t);return e&&e.axisPointerModel}(t);o?(this._axisPointer||(this._axisPointer=new r)).render(t,o,n,i):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},e.registerAxisPointerClass=function(t,e){AO[t]=e},e.getAxisPointerClass=function(t){return t&&AO[t]},e.type="axis",e}(Wb);const LO=EO;var PO=xp();function OO(t,e,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=i.coordinateSystem.getRect(),c=r.getTicksCoords({tickModel:o,clamp:!0});if(c.length){var u=s.length,h=PO(t).splitAreaColors,d=Fs(),p=0;if(h)for(var f=0;f<c.length;f++){var g=h.get(c[f].tickValue);if(null!=g){p=(g+(u-1)*f)%u;break}}var m=r.toGlobalCoord(c[0].coord),y=a.getAreaStyle();for(s=ps(s)?s:[s],f=1;f<c.length;f++){var v=r.toGlobalCoord(c[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;r.isHorizontal()?(_=m,x=l.y,b=v-_,w=l.height,m=_+b):(_=l.x,x=m,b=l.width,m=x+(w=v-x));var S=c[f-1].tickValue;null!=S&&d.set(S,p),e.add(new Pg({anid:null!=S?"area_"+S:null,shape:{x:_,y:x,width:b,height:w},style:Qa({fill:s[p]},y),autoBatch:!0,silent:!0})),p=(p+1)%u}PO(t).splitAreaColors=d}}}function RO(t){PO(t).splitAreaColors=null}var BO=["axisLine","axisTickLabel","axisName"],NO=["splitArea","splitLine","minorSplitLine"],zO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="CartesianAxisPointer",n}return Ma(e,t),e.prototype.render=function(e,n,i,r){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new _d,this.group.add(this._axisGroup),e.get("show")){var a=e.getCoordSysModel(),s=lO(a,e),l=new CO(e,Ja({handleAutoShown:function(t){for(var n=a.coordinateSystem.getCartesians(),i=0;i<n.length;i++)if(pD(n[i].getOtherAxis(e.axis).scale))return!0;return!1}},s));os(BO,l.add,l),this._axisGroup.add(l.getGroup()),os(NO,function(t){e.get([t,"show"])&&FO[t](this,this._axisGroup,e,a)},this),r&&"changeAxisOrder"===r.type&&r.isInitSort||NS(o,this._axisGroup,e),t.prototype.render.call(this,e,n,i,r)}},e.prototype.remove=function(){RO(this)},e.type="cartesianAxis",e}(LO),FO={splitLine:function(t,e,n,i){var r=n.axis;if(!r.scale.isBlank()){var o=n.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color"),l=!1!==o.get("showMinLine"),c=!1!==o.get("showMaxLine");s=ps(s)?s:[s];for(var u=i.coordinateSystem.getRect(),h=r.isHorizontal(),d=0,p=r.getTicksCoords({tickModel:o}),f=[],g=[],m=a.getLineStyle(),y=0;y<p.length;y++){var v=r.toGlobalCoord(p[y].coord);if((0!==y||l)&&(y!==p.length-1||c)){var _=p[y].tickValue;h?(f[0]=v,f[1]=u.y,g[0]=v,g[1]=u.y+u.height):(f[0]=u.x,f[1]=v,g[0]=u.x+u.width,g[1]=v);var x=d++%s.length,b=new Uw({anid:null!=_?"line_"+_:null,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},style:Qa({stroke:s[x]},m),silent:!0});AS(b.shape,m.lineWidth),e.add(b)}}}},minorSplitLine:function(t,e,n,i){var r=n.axis,o=n.getModel("minorSplitLine").getModel("lineStyle"),a=i.coordinateSystem.getRect(),s=r.isHorizontal(),l=r.getMinorTicksCoords();if(l.length)for(var c=[],u=[],h=o.getLineStyle(),d=0;d<l.length;d++)for(var p=0;p<l[d].length;p++){var f=r.toGlobalCoord(l[d][p].coord);s?(c[0]=f,c[1]=a.y,u[0]=f,u[1]=a.y+a.height):(c[0]=a.x,c[1]=f,u[0]=a.x+a.width,u[1]=f);var g=new Uw({anid:"minor_line_"+l[d][p].tickValue,autoBatch:!0,shape:{x1:c[0],y1:c[1],x2:u[0],y2:u[1]},style:h,silent:!0});AS(g.shape,h.lineWidth),e.add(g)}},splitArea:function(t,e,n,i){OO(t,e,n,i)}},VO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="xAxis",e}(zO),HO=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=VO.type,e}return Ma(e,t),e.type="yAxis",e}(zO),jO=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="grid",e}return Ma(e,t),e.prototype.render=function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new Pg({shape:t.coordinateSystem.getRect(),style:Qa({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(Wb),WO={offset:0};function GO(t){t.registerComponentView(jO),t.registerComponentModel(qP),t.registerCoordinateSystem("cartesian2d",yO),QP(t,"x",YP,WO),QP(t,"y",YP,WO),t.registerComponentView(VO),t.registerComponentView(HO),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}function UO(t){t.eachSeriesByType("radar",function(t){var e=t.getData(),n=[],i=t.coordinateSystem;if(i){var r=i.getIndicatorAxes();os(r,function(t,o){e.each(e.mapDimension(r[o].dim),function(t,e){n[e]=n[e]||[];var r=i.dataToPoint(t,o);n[e][o]=qO(r)?r:YO(i)})}),e.each(function(t){var r=cs(n[t],function(t){return qO(t)})||YO(i);n[t].push(r.slice()),e.setItemLayout(t,n[t])})}})}function qO(t){return!isNaN(t[0])&&!isNaN(t[1])}function YO(t){return[t.cx,t.cy]}function XO(t){var e=t.polar;if(e){ps(e)||(e=[e]);var n=[];os(e,function(e,i){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],ps(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):n.push(e)}),t.polar=n}os(t.series,function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)})}var $O=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.coordinateSystem,r=this.group,o=t.getData(),s=this._data;function l(t,e){var n=t.getItemVisual(e,"symbol")||"circle";if("none"!==n){var i=dC(t.getItemVisual(e,"symbolSize")),r=hC(n,-1,-1,2,2),o=t.getItemVisual(e,"symbolRotate")||0;return r.attr({style:{strokeNoScale:!0},z2:100,scaleX:i[0]/2,scaleY:i[1]/2,rotation:o*Math.PI/180||0}),r}}function c(e,n,i,r,o,s){i.removeAll();for(var c=0;c<n.length-1;c++){var u=l(r,o);u&&(u.__dimIdx=c,e[c]?(u.setPosition(e[c]),a[s?"initProps":"updateProps"](u,{x:n[c][0],y:n[c][1]},t,o)):u.setPosition(n[c]),i.add(u))}}function u(t){return as(t,function(t){return[i.cx,i.cy]})}o.diff(s).add(function(e){var n=o.getItemLayout(e);if(n){var i=new zw,r=new Hw,a={shape:{points:n}};i.shape.points=u(n),r.shape.points=u(n),Qm(i,a,t,e),Qm(r,a,t,e);var s=new _d,l=new _d;s.add(r),s.add(i),s.add(l),c(r.shape.points,n,l,o,e,!0),o.setItemGraphicEl(e,s)}}).update(function(e,n){var i=s.getItemGraphicEl(n),r=i.childAt(0),a=i.childAt(1),l=i.childAt(2),u={shape:{points:o.getItemLayout(e)}};u.shape.points&&(c(r.shape.points,u.shape.points,l,o,e,!1),ry(a),ry(r),Jm(r,u,t),Jm(a,u,t),o.setItemGraphicEl(e,i))}).remove(function(t){r.remove(s.getItemGraphicEl(t))}).execute(),o.eachItemGraphicEl(function(t,e){var n=o.getItemModel(e),i=t.childAt(0),a=t.childAt(1),s=t.childAt(2),l=o.getItemVisual(e,"style"),c=l.fill;r.add(t),i.useStyle(Qa(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:c})),Gm(i,n,"lineStyle"),Gm(a,n,"areaStyle");var u=n.getModel("areaStyle"),h=u.isEmpty()&&u.parentModel.isEmpty();a.ignore=h,os(["emphasis","select","blur"],function(t){var e=n.getModel([t,"areaStyle"]),i=e.isEmpty()&&e.parentModel.isEmpty();a.ensureState(t).ignore=i&&h}),a.useStyle(Qa(u.getAreaStyle(),{fill:c,opacity:.7,decal:l.decal}));var d=n.getModel("emphasis"),p=d.getModel("itemStyle").getItemStyle();s.eachChild(function(t){if(t instanceof Cg){var i=t.style;t.useStyle(Ja({image:i.image,x:i.x,y:i.y,width:i.width,height:i.height},l))}else t.useStyle(l),t.setColor(c),t.style.strokeNoScale=!0;t.ensureState("emphasis").style=$a(p);var r=o.getStore().get(o.getDimensionIndex(t.__dimIdx),e);(null==r||isNaN(r))&&(r=""),ly(t,cy(n),{labelFetcher:o.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:r,inheritColor:c,defaultOpacity:l.opacity})}),Vm(t,d.get("focus"),d.get("blurScope"),d.get("disabled"))}),this._data=o},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.type="radar",e}(eM);const ZO=$O;var KO=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ma(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new NP(hs(this.getData,this),hs(this.getRawData,this))},e.prototype.getInitialData=function(t,e){return RP(this,{generateCoord:"indicator_",generateCoordCount:1/0})},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(t),a=""===o?this.name:o,s=Tb(this,t);return yb("section",{header:a,sortBlocks:!0,blocks:as(r,function(e){var n=i.get(i.mapDimension(e.dim),t);return yb("nameValue",{markerType:"subItem",markerColor:s,name:e.name,value:n,sortParam:n})})})},e.prototype.getTooltipPosition=function(t){if(null!=t)for(var e=this.getData(),n=this.coordinateSystem,i=e.getValues(as(n.dimensions,function(t){return e.mapDimension(t)}),t),r=0,o=i.length;r<o;r++)if(!isNaN(i[r])){var a=n.getIndicatorAxes();return n.coordToPoint(a[r].dataToCoord(i[r]),r)}},e.type="series.radar",e.dependencies=["radar"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},e}(Hb);const JO=KO;var QO=KP.value;function tR(t,e){return Qa({show:e},t)}var eR=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),n=this.get("scale"),i=this.get("axisLine"),r=this.get("axisTick"),o=this.get("axisLabel"),a=this.get("axisName"),s=this.get(["axisName","show"]),l=this.get(["axisName","formatter"]),c=this.get("axisNameGap"),u=this.get("triggerEvent"),h=as(this.get("indicator")||[],function(h){null!=h.max&&h.max>0&&!h.min?h.min=0:null!=h.min&&h.min<0&&!h.max&&(h.max=0);var d=a;null!=h.color&&(d=Qa({color:h.color},a));var p=Za($a(h),{boundaryGap:t,splitNumber:e,scale:n,axisLine:i,axisTick:r,axisLabel:o,name:h.text,showName:s,nameLocation:"end",nameGap:c,nameTextStyle:d,triggerEvent:u},!1);if(gs(l)){var f=p.name;p.name=l.replace("{value}",null!=f?f:"")}else fs(l)&&(p.name=l(p.name,p));var g=new Oy(p,null,this.ecModel);return is(g,vk.prototype),g.mainType="radar",g.componentIndex=this.componentIndex,g},this);this._indicatorModels=h},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Za({lineStyle:{color:"#bbb"}},QO.axisLine),axisLabel:tR(QO.axisLabel,!1),axisTick:tR(QO.axisTick,!1),splitLine:tR(QO.splitLine,!0),splitArea:tR(QO.splitArea,!0),indicator:[]},e}(Uv);const nR=eR;var iR=["axisLine","axisTickLabel","axisName"],rR=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){this.group.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var e=t.coordinateSystem;os(as(e.getIndicatorAxes(),function(t){var n=t.model.get("showName")?t.name:"";return new CO(t.model,{axisName:n,position:[e.cx,e.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){os(iR,t.add,t),this.group.add(t.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var i=t.get("shape"),r=t.getModel("splitLine"),o=t.getModel("splitArea"),a=r.getModel("lineStyle"),s=o.getModel("areaStyle"),l=r.get("show"),c=o.get("show"),u=a.get("color"),h=s.get("color"),d=ps(u)?u:[u],p=ps(h)?h:[h],f=[],g=[];if("circle"===i)for(var m=n[0].getTicksCoords(),y=e.cx,v=e.cy,_=0;_<m.length;_++)l&&f[I(f,d,_)].push(new pw({shape:{cx:y,cy:v,r:m[_].coord}})),c&&_<m.length-1&&g[I(g,p,_)].push(new Ow({shape:{cx:y,cy:v,r0:m[_].coord,r:m[_+1].coord}}));else{var x,b=as(n,function(t,n){var i=t.getTicksCoords();return x=null==x?i.length-1:Math.min(i.length-1,x),as(i,function(t){return e.coordToPoint(t.coord,n)})}),w=[];for(_=0;_<=x;_++){for(var S=[],M=0;M<n.length;M++)S.push(b[M][_]);S[0]&&S.push(S[0].slice()),l&&f[I(f,d,_)].push(new Hw({shape:{points:S}})),c&&w&&g[I(g,p,_-1)].push(new zw({shape:{points:S.concat(w)}})),w=S.slice().reverse()}}var C=a.getLineStyle(),T=s.getAreaStyle();os(g,function(t,e){this.group.add(DS(t,{style:Qa({stroke:"none",fill:p[e%p.length]},T),silent:!0}))},this),os(f,function(t,e){this.group.add(DS(t,{style:Qa({fill:"none",stroke:d[e%d.length]},C),silent:!0}))},this)}function I(t,e,n){var i=n%e.length;return t[i]=t[i]||[],i}},e.type="radar",e}(Wb);const oR=rR;var aR=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.type="value",r.angle=0,r.name="",r}return Ma(e,t),e}($k);const sR=aR;var lR=function(){function t(t,e,n){this.dimensions=[],this._model=t,this._indicatorAxes=as(t.getIndicatorModels(),function(t,e){var n="indicator_"+e,i=new sR(n,new MD);return i.name=t.get("name"),i.model=t,t.axis=i,this.dimensions.push(n),i},this),this.resize(t,n)}return t.prototype.getIndicatorAxes=function(){return this._indicatorAxes},t.prototype.dataToPoint=function(t,e){var n=this._indicatorAxes[e];return this.coordToPoint(n.dataToCoord(t),e)},t.prototype.coordToPoint=function(t,e){var n=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(n),this.cy-t*Math.sin(n)]},t.prototype.pointToData=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=Math.sqrt(e*e+n*n);e/=i,n/=i;for(var r,o=Math.atan2(-n,e),a=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var c=this._indicatorAxes[l],u=Math.abs(o-c.angle);u<a&&(r=c,s=l,a=u)}return[s,+(r&&r.coordToData(i))]},t.prototype.resize=function(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r)/2;this.cx=Rd(n[0],i),this.cy=Rd(n[1],r),this.startAngle=t.get("startAngle")*Math.PI/180;var a=t.get("radius");(gs(a)||ys(a))&&(a=[0,a]),this.r0=Rd(a[0],o),this.r=Rd(a[1],o),os(this._indicatorAxes,function(t,e){t.setExtent(this.r0,this.r);var n=this.startAngle+e*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),t.angle=n},this)},t.prototype.update=function(t,e){var n=this._indicatorAxes,i=this._model;os(n,function(t){t.scale.setExtent(1/0,-1/0)}),t.eachSeriesByType("radar",function(e,r){if("radar"===e.get("coordinateSystem")&&t.getComponent("radar",e.get("radarIndex"))===i){var o=e.getData();os(n,function(t){t.scale.unionExtentFromData(o,o.mapDimension(t.dim))})}},this);var r=i.get("splitNumber"),o=new MD;o.setExtent(0,r),o.setInterval(1),os(n,function(t,e){dO(t.scale,t.model,o)})},t.prototype.convertToPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.create=function(e,n){var i=[];return e.eachComponent("radar",function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o}),e.eachSeriesByType("radar",function(t){"radar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("radarIndex")||0])}),i},t.dimensions=[],t}();const cR=lR;function uR(t){t.registerCoordinateSystem("radar",cR),t.registerComponentModel(nR),t.registerComponentView(oR),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();e.each(function(t){e.setItemVisual(t,"legendIcon","roundRect")}),e.setVisual("legendIcon","roundRect")}})}var hR="\0_ec_interaction_mutex";function dR(t,e){return!!pR(t)[e]}function pR(t){return t[hR]||(t[hR]={})}aI({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Gs);var fR=function(t){function e(e){var n=t.call(this)||this;n._zr=e;var i=hs(n._mousedownHandler,n),r=hs(n._mousemoveHandler,n),o=hs(n._mouseupHandler,n),a=hs(n._mousewheelHandler,n),s=hs(n._pinchHandler,n);return n.enable=function(t,n){this.disable(),this._opt=Qa($a(n)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",r),e.on("mouseup",o)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",a),e.on("pinch",s))},n.disable=function(){e.off("mousedown",i),e.off("mousemove",r),e.off("mouseup",o),e.off("mousewheel",a),e.off("pinch",s)},n}return Ma(e,t),e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(t){this.pointerChecker=t},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(t){if(!jl(t)){for(var e=t.target;e;){if(e.draggable)return;e=e.__hostTarget||e.parent}var n=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,n,i)&&(this._x=n,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(t){if(this._dragging&&yR("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!dR(this._zr,"globalPan")){var e=t.offsetX,n=t.offsetY,i=this._x,r=this._y,o=e-i,a=n-r;this._x=e,this._y=n,this._opt.preventDefaultMouseMove&&Hl(t.event),mR(this,"pan","moveOnMouseMove",t,{dx:o,dy:a,oldX:i,oldY:r,newX:e,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(t){jl(t)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(t){var e=yR("zoomOnMouseWheel",t,this._opt),n=yR("moveOnMouseWheel",t,this._opt),i=t.wheelDelta,r=Math.abs(i),o=t.offsetX,a=t.offsetY;if(0!==i&&(e||n)){if(e){var s=r>3?1.4:r>1?1.2:1.1;gR(this,"zoom","zoomOnMouseWheel",t,{scale:i>0?s:1/s,originX:o,originY:a,isAvailableBehavior:null})}if(n){var l=Math.abs(i);gR(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:(i>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:o,originY:a,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){dR(this._zr,"globalPan")||gR(this,"zoom",null,t,{scale:t.pinchScale>1?1.1:1/1.1,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})},e}(bl);function gR(t,e,n,i,r){t.pointerChecker&&t.pointerChecker(i,r.originX,r.originY)&&(Hl(i.event),mR(t,e,n,i,r))}function mR(t,e,n,i,r){r.isAvailableBehavior=hs(yR,null,n,i),t.trigger(e,r)}function yR(t,e,n){var i=n[t];return!t||i&&(!gs(i)||e.event[i+"Key"])}const vR=fR;function _R(t,e,n){var i=t.target;i.x+=e,i.y+=n,i.dirty()}function xR(t,e,n,i){var r=t.target,o=t.zoomLimit,a=t.zoom=t.zoom||1;if(a*=e,o){var s=o.min||0,l=o.max||1/0;a=Math.max(Math.min(l,a),s)}var c=a/t.zoom;t.zoom=a,r.x-=(n-r.x)*(c-1),r.y-=(i-r.y)*(c-1),r.scaleX*=c,r.scaleY*=c,r.dirty()}var bR,wR={axisPointer:1,tooltip:1,brush:1};function SR(t,e,n){var i=e.getComponentByElement(t.topTarget),r=i&&i.coordinateSystem;return i&&i!==n&&!wR.hasOwnProperty(i.mainType)&&r&&r.model!==n}function MR(t){gs(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));var e=t;for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}var CR={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},TR=us(CR),IR={"alignment-baseline":"textBaseline","stop-color":"stopColor"},DR=us(IR),kR=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var n=MR(t);this._defsUsePending=[];var i=new _d;this._root=i;var r=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),s=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),RR(n,i,null,!0,!1);for(var l,c,u=n.firstChild;u;)this._parseNode(u,i,r,null,!1,!1),u=u.nextSibling;if(function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i[0].style[i[1]]=t[i[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var h=FR(o);h.length>=4&&(l={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(l&&null!=a&&null!=s&&(c=GR(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var d=i;(i=new _d).add(d),d.scaleX=d.scaleY=c.scale,d.x=c.x,d.y=c.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new Pg({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:l,viewBoxTransform:c,named:r}},t.prototype._parseNode=function(t,e,n,i,r,o){var a,s=t.nodeName.toLowerCase(),l=i;if("defs"===s&&(r=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!r){var c=bR[s];if(c&&Ws(bR,s)){a=c.call(this,t,e);var u=t.getAttribute("name");if(u){var h={name:u,namedFrom:null,svgNodeTagLower:s,el:a};n.push(h),"g"===s&&(l=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var d=AR[s];if(d&&Ws(AR,s)){var p=d.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup)for(var g=t.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,r,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},t.prototype._parseText=function(t,e){var n=new bg({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});PR(e,n),RR(t,n,this._defsUsePending,!1,!1),function(t,e){var n=e.__selfStyle;if(n){var i=n.textBaseline,r=i;i&&"auto"!==i?"baseline"===i?r="alphabetic":"before-edge"===i||"text-before-edge"===i?r="top":"after-edge"===i||"text-after-edge"===i?r="bottom":"central"!==i&&"mathematical"!==i||(r="middle"):r="alphabetic",t.style.textBaseline=r}var o=e.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),t.style.textAlign=s)}}(n,e);var i=n.style,r=i.fontSize;r&&r<9&&(i.fontSize=9,n.scaleX*=r/9,n.scaleY*=r/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=void(bR={g:function(t,e){var n=new _d;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new Pg;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new pw;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new Uw;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new mw;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,i=t.getAttribute("points");i&&(n=OR(i));var r=new zw({shape:{points:n||[]},silent:!0});return PR(e,r),RR(t,r,this._defsUsePending,!1,!1),r},polyline:function(t,e){var n,i=t.getAttribute("points");i&&(n=OR(i));var r=new Hw({shape:{points:n||[]},silent:!0});return PR(e,r),RR(t,r,this._defsUsePending,!1,!1),r},image:function(t,e){var n=new Cg;return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(r),this._textY=parseFloat(i)+parseFloat(o);var a=new _d;return PR(e,a),RR(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),i=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=i&&(this._textY=parseFloat(i));var r=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new _d;return PR(e,a),RR(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(r),this._textY+=parseFloat(o),a},path:function(t,e){var n=cw(t.getAttribute("d")||"");return PR(e,n),RR(t,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),t}(),AR={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),r=parseInt(t.getAttribute("y2")||"0",10),o=new oS(e,n,i,r);return ER(t,o),LR(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),r=new sS(e,n,i);return ER(t,r),LR(t,r),r}};function ER(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function LR(t,e){for(var n=t.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var i,r=n.getAttribute("offset");i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};WR(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function PR(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Qa(e.__inheritedStyle,t.__inheritedStyle))}function OR(t){for(var e=FR(t),n=[],i=0;i<e.length;i+=2){var r=parseFloat(e[i]),o=parseFloat(e[i+1]);n.push([r,o])}return n}function RR(t,e,n,i,r){var o=e,a=o.__inheritedStyle=o.__inheritedStyle||{},s={};1===t.nodeType&&(function(t,e){var n=t.getAttribute("transform");if(n){n=n.replace(/,/g," ");var i=[],r=null;n.replace(VR,function(t,e,n){return i.push(e,n),""});for(var o=i.length-1;o>0;o-=2){var a=i[o],s=i[o-1],l=FR(a);switch(r=r||ql(),s){case"translate":Zl(r,r,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Jl(r,r,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Kl(r,r,-parseFloat(l[0])*HR,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":$l(r,[1,0,Math.tan(parseFloat(l[0])*HR),1,0,0],r);break;case"skewY":$l(r,[1,Math.tan(parseFloat(l[0])*HR),0,1,0,0],r);break;case"matrix":r[0]=parseFloat(l[0]),r[1]=parseFloat(l[1]),r[2]=parseFloat(l[2]),r[3]=parseFloat(l[3]),r[4]=parseFloat(l[4]),r[5]=parseFloat(l[5])}}e.setLocalTransform(r)}}(t,e),WR(t,a,s),i||function(t,e,n){for(var i=0;i<TR.length;i++){var r=TR[i];null!=(o=t.getAttribute(r))&&(e[CR[r]]=o)}for(i=0;i<DR.length;i++){var o;r=DR[i],null!=(o=t.getAttribute(r))&&(n[IR[r]]=o)}}(t,a,s)),o.style=o.style||{},null!=a.fill&&(o.style.fill=NR(o,"fill",a.fill,n)),null!=a.stroke&&(o.style.stroke=NR(o,"stroke",a.stroke,n)),os(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(t){null!=a[t]&&(o.style[t]=parseFloat(a[t]))}),os(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],function(t){null!=a[t]&&(o.style[t]=a[t])}),r&&(o.__selfStyle=s),a.lineDash&&(o.style.lineDash=as(FR(a.lineDash),function(t){return parseFloat(t)})),"hidden"!==a.visibility&&"collapse"!==a.visibility||(o.invisible=!0),"none"===a.display&&(o.ignore=!0)}var BR=/^url\(\s*#(.*?)\)/;function NR(t,e,n,i){var r=n&&n.match(BR);if(!r)return"none"===n&&(n=null),n;var o=Ls(r[1]);i.push([t,e,o])}var zR=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function FR(t){return t.match(zR)||[]}var VR=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,HR=Math.PI/180,jR=/([^\s:;]+)\s*:\s*([^:;]+)/g;function WR(t,e,n){var i,r=t.getAttribute("style");if(r)for(jR.lastIndex=0;null!=(i=jR.exec(r));){var o=i[1],a=Ws(CR,o)?CR[o]:null;a&&(e[a]=i[2]);var s=Ws(IR,o)?IR[o]:null;s&&(n[s]=i[2])}}function GR(t,e){var n=e.width/t.width,i=e.height/t.height,r=Math.min(n,i);return{scale:r,x:-(t.x+t.width/2)*r+(e.x+e.width/2),y:-(t.y+t.height/2)*r+(e.y+e.height/2)}}for(var UR=Fs(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),qR=function(){function t(t,e){this.type="geoSVG",this._usedGraphicMap=Fs(),this._freedGraphics=[],this._mapName=t,this._parsedXML=MR(e)}return t.prototype.load=function(){var t=this._firstGraphic;if(!t){t=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(t),this._boundingRect=this._firstGraphic.boundingRect.clone();var e=function(t){var e=[],n=Fs();return os(t,function(t){if(null==t.namedFrom){var i=new Pk(t.name,t.el);e.push(i),n.set(t.name,i)}}),{regions:e,regionsMap:n}}(t.named),n=e.regions,i=e.regionsMap;this._regions=n,this._regionsMap=i}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},t.prototype._buildGraphic=function(t){var e,n,i,r;try{Es(null!=(n=(e=t&&(i=t,r={ignoreViewBox:!0,ignoreRootClip:!0},(new kR).parse(i,r))||{}).root))}catch(t){throw new Error("Invalid svg format\n"+t.message)}var o=new _d;o.add(n),o.isGeoSVGGraphicRoot=!0;var a=e.width,s=e.height,l=e.viewBoxRect,c=this._boundingRect;if(!c){var u=void 0,h=void 0,d=void 0,p=void 0;if(null!=a?(u=0,d=a):l&&(u=l.x,d=l.width),null!=s?(h=0,p=s):l&&(h=l.y,p=l.height),null==u||null==h){var f=n.getBoundingRect();null==u&&(u=f.x,d=f.width),null==h&&(h=f.y,p=f.height)}c=this._boundingRect=new dc(u,h,d,p)}if(l){var g=GR(l,c);n.scaleX=n.scaleY=g.scale,n.x=g.x,n.y=g.y}o.setClipPath(new Pg({shape:c.plain()}));var m=[];return os(e.named,function(t){var e;null!=UR.get(t.svgNodeTagLower)&&(m.push(t),(e=t.el).silent=!1,e.isGroup&&e.traverse(function(t){t.silent=!1}))}),{root:o,boundingRect:c,named:m}},t.prototype.useGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),e.set(t,n),n)},t.prototype.freeGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);n&&(e.removeKey(t),this._freedGraphics.push(n))},t}(),YR=[126,25],XR="南海诸岛",$R=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],ZR=0;ZR<$R.length;ZR++)for(var KR=0;KR<$R[ZR].length;KR++)$R[ZR][KR][0]/=10.5,$R[ZR][KR][1]/=-14,$R[ZR][KR][0]+=YR[0],$R[ZR][KR][1]+=YR[1];var JR={南海诸岛:[32,80],广东:[0,-10],香港:[10,5],澳门:[-10,10],天津:[5,5]},QR=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]],tB=function(){function t(t,e,n){var i;this.type="geoJSON",this._parsedMap=Fs(),this._mapName=t,this._specialAreas=n,this._geoJSON=gs(i=e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(i):new Function("return ("+i+");")():i}return t.prototype.load=function(t,e){e=e||"name";var n=this._parsedMap.get(e);if(!n){var i=this._parseToRegions(e);n=this._parsedMap.set(e,{regions:i,boundingRect:eB(i)})}var r=Fs(),o=[];return os(n.regions,function(e){var n=e.name;t&&Ws(t,n)&&(e=e.cloneShallow(n=t[n])),o.push(e),r.set(n,e)}),{regions:o,boundingRect:n.boundingRect||new dc(0,0,0,0),regionsMap:r}},t.prototype._parseToRegions=function(t){var e,n=this._mapName,i=this._geoJSON;try{e=i?Bk(i,t):[]}catch(t){throw new Error("Invalid geoJson format\n"+t.message)}return function(t,e){if("china"===t){for(var n=0;n<e.length;n++)if(e[n].name===XR)return;e.push(new Lk(XR,as($R,function(t){return{type:"polygon",exterior:t}}),YR))}}(n,e),os(e,function(t){var e=t.name;!function(t,e){if("china"===t){var n=JR[e.name];if(n){var i=e.getCenter();i[0]+=n[0]/10.5,i[1]+=-n[1]/14,e.setCenter(i)}}}(n,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:QR[0]})}(n,t);var i=this._specialAreas&&this._specialAreas[e];i&&t.transformTo(i.left,i.top,i.width,i.height)},this),e},t.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},t}();function eB(t){for(var e,n=0;n<t.length;n++){var i=t[n].getBoundingRect();(e=e||i.clone()).union(i)}return e}var nB=Fs();const iB=function(t){return nB.get(t)},rB=function(t,e,n){var i=nB.get(t);if(i)return i.load(e,n)};var oB=["rect","circle","line","ellipse","polygon","polyline","path"],aB=Fs(oB),sB=Fs(oB.concat(["g"])),lB=Fs(oB.concat(["g"])),cB=xp();function uB(t){var e=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(e.fill=n),e}function hB(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var dB=function(){function t(t){var e=new _d;this.uid=By("ec_map_draw"),this._controller=new vR(t.getZr()),this._controllerHost={target:e},this.group=e,e.add(this._regionsGroup=new _d),e.add(this._svgGroup=new _d)}return t.prototype.draw=function(t,e,n,i,r){var o="geo"===t.mainType,a=t.getData&&t.getData();o&&e.eachComponent({mainType:"series",subType:"map"},function(e){a||e.getHostGeoModel()!==t||(a=e.getData())});var s=t.coordinateSystem,l=this._regionsGroup,c=this.group,u=s.getTransformInfo(),h=u.raw,d=u.roam;!l.childAt(0)||r?(c.x=d.x,c.y=d.y,c.scaleX=d.scaleX,c.scaleY=d.scaleY,c.dirty()):Jm(c,d,t);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0,f={api:n,geo:s,mapOrGeoModel:t,data:a,isVisualEncodedByVisualMap:p,isGeo:o,transformInfoRaw:h};"geoJSON"===s.resourceType?this._buildGeoJSON(f):"geoSVG"===s.resourceType&&this._buildSVG(f),this._updateController(t,e,n),this._updateMapSelectHandler(t,l,n,i)},t.prototype._buildGeoJSON=function(t){var e=this._regionsGroupByName=Fs(),n=Fs(),i=this._regionsGroup,r=t.transformInfoRaw,o=t.mapOrGeoModel,a=t.data,s=t.geo.projection,l=s&&s.stream;function c(t,e){return e&&(t=e(t)),t&&[t[0]*r.scaleX+r.x,t[1]*r.scaleY+r.y]}function u(t){for(var e=[],n=!l&&s&&s.project,i=0;i<t.length;++i){var r=c(t[i],n);r&&e.push(r)}return e}function h(t){return{shape:{points:u(t)}}}i.removeAll(),os(t.geo.regions,function(r){var u=r.name,d=e.get(u),p=n.get(u)||{},f=p.dataIdx,g=p.regionModel;if(!d){d=e.set(u,new _d),i.add(d),f=a?a.indexOfName(u):null;var m=(g=t.isGeo?o.getRegionModel(u):a?a.getItemModel(f):null).get("silent",!0);null!=m&&(d.silent=m),n.set(u,{dataIdx:f,regionModel:g})}var y=[],v=[];os(r.geometries,function(t){if("polygon"===t.type){var e=[t.exterior].concat(t.interiors||[]);l&&(e=vB(e,l)),os(e,function(t){y.push(new zw(h(t)))})}else{var n=t.points;l&&(n=vB(n,l,!0)),os(n,function(t){v.push(new Hw(h(t)))})}});var _=c(r.getCenter(),s&&s.project);function x(e,n){if(e.length){var i=new eS({culling:!0,segmentIgnoreThreshold:1,shape:{paths:e}});d.add(i),pB(t,i,f,g),fB(t,i,u,g,o,f,_),n&&(hB(i),os(i.states,hB))}}x(y),x(v,!0)}),e.each(function(e,i){var r=n.get(i),a=r.dataIdx,s=r.regionModel;gB(t,e,i,s,o,a),mB(t,e,i,s,o),yB(t,e,i,s,o)},this)},t.prototype._buildSVG=function(t){var e=t.geo.map,n=t.transformInfoRaw;this._svgGroup.x=n.x,this._svgGroup.y=n.y,this._svgGroup.scaleX=n.scaleX,this._svgGroup.scaleY=n.scaleY,this._svgResourceChanged(e)&&(this._freeSVG(),this._useSVG(e));var i=this._svgDispatcherMap=Fs(),r=!1;os(this._svgGraphicRecord.named,function(e){var n=e.name,o=t.mapOrGeoModel,a=t.data,s=e.svgNodeTagLower,l=e.el,c=a?a.indexOfName(n):null,u=o.getRegionModel(n);null!=aB.get(s)&&l instanceof gf&&pB(t,l,c,u),l instanceof gf&&(l.culling=!0);var h=u.get("silent",!0);null!=h&&(l.silent=h),l.z2EmphasisLift=0,e.namedFrom||(null!=lB.get(s)&&fB(t,l,n,u,o,c,null),gB(t,l,n,u,o,c),mB(t,l,n,u,o),null!=sB.get(s)&&("self"===yB(t,l,n,u,o)&&(r=!0),(i.get(n)||i.set(n,[])).push(l)))},this),this._enableBlurEntireSVG(r,t)},t.prototype._enableBlurEntireSVG=function(t,e){if(t&&e.isGeo){var n=e.mapOrGeoModel.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse(function(t){if(!t.isGroup){Sm(t);var e=t.ensureState("blur").style||{};null==e.opacity&&null!=n&&(e.opacity=n),t.ensureState("emphasis")}})}},t.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.dispose(),this._controllerHost=null},t.prototype.findHighDownDispatchers=function(t,e){if(null==t)return[];var n=e.coordinateSystem;if("geoJSON"===n.resourceType){var i=this._regionsGroupByName;if(i){var r=i.get(t);return r?[r]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(t)||[]},t.prototype._svgResourceChanged=function(t){return this._svgMapName!==t},t.prototype._useSVG=function(t){var e=iB(t);if(e&&"geoSVG"===e.type){var n=e.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=t}},t.prototype._freeSVG=function(){var t=this._svgMapName;if(null!=t){var e=iB(t);e&&"geoSVG"===e.type&&e.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},t.prototype._updateController=function(t,e,n){var i=t.coordinateSystem,r=this._controller,o=this._controllerHost;o.zoomLimit=t.get("scaleLimit"),o.zoom=i.getZoom(),r.enable(t.get("roam")||!1);var a=t.mainType;function s(){var e={type:"geoRoam",componentType:a};return e[a+"Id"]=t.id,e}r.off("pan").on("pan",function(t){this._mouseDownFlag=!1,_R(o,t.dx,t.dy),n.dispatchAction(Ja(s(),{dx:t.dx,dy:t.dy,animation:{duration:0}}))},this),r.off("zoom").on("zoom",function(t){this._mouseDownFlag=!1,xR(o,t.scale,t.originX,t.originY),n.dispatchAction(Ja(s(),{totalZoom:o.zoom,zoom:t.scale,originX:t.originX,originY:t.originY,animation:{duration:0}}))},this),r.setPointerChecker(function(e,r,o){return i.containPoint([r,o])&&!SR(e,n,t)})},t.prototype.resetForLabelLayout=function(){this.group.traverse(function(t){var e=t.getTextContent();e&&(e.ignore=cB(e).ignore)})},t.prototype._updateMapSelectHandler=function(t,e,n,i){var r=this;e.off("mousedown"),e.off("click"),t.get("selectedMode")&&(e.on("mousedown",function(){r._mouseDownFlag=!0}),e.on("click",function(t){r._mouseDownFlag&&(r._mouseDownFlag=!1)}))},t}();function pB(t,e,n,i){var r=i.getModel("itemStyle"),o=i.getModel(["emphasis","itemStyle"]),a=i.getModel(["blur","itemStyle"]),s=i.getModel(["select","itemStyle"]),l=uB(r),c=uB(o),u=uB(s),h=uB(a),d=t.data;if(d){var p=d.getItemVisual(n,"style"),f=d.getItemVisual(n,"decal");t.isVisualEncodedByVisualMap&&p.fill&&(l.fill=p.fill),f&&(l.decal=jC(f,t.api))}e.setStyle(l),e.style.strokeNoScale=!0,e.ensureState("emphasis").style=c,e.ensureState("select").style=u,e.ensureState("blur").style=h,Sm(e)}function fB(t,e,n,i,r,o,a){var s=t.data,l=t.isGeo,c=s&&isNaN(s.get(s.mapDimension("value"),o)),u=s&&s.getItemLayout(o);if(l||c||u&&u.showLabel){var h=l?n:o,d=void 0;(!s||o>=0)&&(d=r);var p=a?{normal:{align:"center",verticalAlign:"middle"}}:null;ly(e,cy(i),{labelFetcher:d,labelDataIndex:h,defaultText:n},p);var f=e.getTextContent();if(f&&(cB(f).ignore=f.ignore,e.textConfig&&a)){var g=e.getBoundingRect().clone();e.textConfig.layoutRect=g,e.textConfig.position=[(a[0]-g.x)/g.width*100+"%",(a[1]-g.y)/g.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function gB(t,e,n,i,r,o){t.data?t.data.setItemGraphicEl(o,e):Zg(e).eventData={componentType:"geo",componentIndex:r.componentIndex,geoIndex:r.componentIndex,name:n,region:i&&i.option||{}}}function mB(t,e,n,i,r){t.data||GS({el:e,componentModel:r,itemName:n,itemTooltipOption:i.get("tooltip")})}function yB(t,e,n,i,r){e.highDownSilentOnTouch=!!r.get("selectedMode");var o=i.getModel("emphasis"),a=o.get("focus");return Vm(e,a,o.get("blurScope"),o.get("disabled")),t.isGeo&&function(t,e,n){var i=Zg(t);i.componentMainType=e.mainType,i.componentIndex=e.componentIndex,i.componentHighDownName=n}(e,r,n),a}function vB(t,e,n){var i,r=[];function o(){i=[]}function a(){i.length&&(r.push(i),i=[])}var s=e({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(t,e){isFinite(t)&&isFinite(e)&&i.push([t,e])},sphere:function(){}});return!n&&s.polygonStart(),os(t,function(t){s.lineStart();for(var e=0;e<t.length;e++)s.point(t[e][0],t[e][1]);s.lineEnd()}),!n&&s.polygonEnd(),r}const _B=dB;var xB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n,i){if(!i||"mapToggleSelect"!==i.type||i.from!==this.uid){var r=this.group;if(r.removeAll(),!t.getHostGeoModel()){if(this._mapDraw&&i&&"geoRoam"===i.type&&this._mapDraw.resetForLabelLayout(),i&&"geoRoam"===i.type&&"series"===i.componentType&&i.seriesId===t.id)(o=this._mapDraw)&&r.add(o.group);else if(t.needsDrawMap){var o=this._mapDraw||new _B(n);r.add(o.group),o.draw(t,e,n,this,i),this._mapDraw=o}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t,e,n)}}},e.prototype.remove=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},e.prototype._renderSymbols=function(t,e,n){var i=t.originalData,r=this.group;i.each(i.mapDimension("value"),function(e,n){if(!isNaN(e)){var o=i.getItemLayout(n);if(o&&o.point){var a=o.point,s=o.offset,l=new pw({style:{fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:rm+1)});if(!s){var c=t.mainSeries.getData(),u=i.getName(n),h=c.indexOfName(u),d=i.getItemModel(n),p=d.getModel("label"),f=c.getItemGraphicEl(h);ly(l,cy(d),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(h,n)}},defaultText:u}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){bm(l,t)}}r.add(l)}}})},e.type="map",e}(eM);const bB=xB;var wB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.needsDrawMap=!1,n.seriesGroup=[],n.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,i=n.getRegion(e);return i&&n.dataToPoint(i.getCenter())}},n}return Ma(e,t),e.prototype.getInitialData=function(t){for(var e=RP(this,{coordDimensions:["value"],encodeDefaulter:ds(s_,this)}),n=Fs(),i=[],r=0,o=e.count();r<o;r++){var a=e.getName(r);n.set(a,r)}return os(rB(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,function(t){var r,o=t.name,a=n.get(o),s=t.properties&&t.properties.echartsStyle;null==a?(r={name:o},i.push(r)):r=e.getRawDataItem(a),s&&Za(r,s)}),e.appendData(i),e},e.prototype.getHostGeoModel=function(){var t=this.option.geoIndex;return null!=t?this.ecModel.getComponent("geo",t):null},e.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},e.prototype.getRawValue=function(t){var e=this.getData();return e.get(e.mapDimension("value"),t)},e.prototype.getRegionModel=function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},e.prototype.formatTooltip=function(t,e,n){for(var i=this.getData(),r=this.getRawValue(t),o=i.getName(t),a=this.seriesGroup,s=[],l=0;l<a.length;l++){var c=a[l].originalData.indexOfName(o),u=i.mapDimension("value");isNaN(a[l].originalData.get(u,c))||s.push(a[l].name)}return yb("section",{header:s.join(", "),noHeader:!s.length,blocks:[yb("nameValue",{name:o,value:r})]})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.getLegendIcon=function(t){var e=t.icon||"roundRect",n=hC(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return n.setStyle(t.itemStyle),n.style.stroke="none",e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill="#fff",n.style.lineWidth=2),n},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(Hb);const SB=wB;function MB(t){var e={};t.eachSeriesByType("map",function(t){var n=t.getHostGeoModel(),i=n?"o"+n.id:"i"+t.getMapType();(e[i]=e[i]||[]).push(t)}),os(e,function(t,e){for(var n,i,r,o=(n=as(t,function(t){return t.getData()}),i=t[0].get("mapValueCalculation"),r={},os(n,function(t){t.each(t.mapDimension("value"),function(e,n){var i="ec-"+t.getName(n);r[i]=r[i]||[],isNaN(e)||r[i].push(e)})}),n[0].map(n[0].mapDimension("value"),function(t,e){for(var o="ec-"+n[0].getName(e),a=0,s=1/0,l=-1/0,c=r[o].length,u=0;u<c;u++)s=Math.min(s,r[o][u]),l=Math.max(l,r[o][u]),a+=r[o][u];return 0===c?NaN:"min"===i?s:"max"===i?l:"average"===i?a/c:a})),a=0;a<t.length;a++)t[a].originalData=t[a].getData();for(a=0;a<t.length;a++)t[a].seriesGroup=t,t[a].needsDrawMap=0===a&&!t[a].getHostGeoModel(),t[a].setData(o.cloneShallow()),t[a].mainSeries=t[0]})}function CB(t){var e={};t.eachSeriesByType("map",function(n){var i=n.getMapType();if(!n.getHostGeoModel()&&!e[i]){var r={};os(n.seriesGroup,function(e){var n=e.coordinateSystem,i=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&i.each(i.mapDimension("value"),function(t,e){var o=i.getName(e),a=n.getRegion(o);if(a&&!isNaN(t)){var s=r[o]||0,l=n.dataToPoint(a.getCenter());r[o]=s+1,i.setItemLayout(e,{point:l,offset:s})}})});var o=n.getData();o.each(function(t){var e=o.getName(t),n=o.getItemLayout(t)||{};n.showLabel=!r[e],o.setItemLayout(t,n)}),e[i]=!0}})}var TB=fl,IB=function(t){function e(e){var n=t.call(this)||this;return n.type="view",n.dimensions=["x","y"],n._roamTransformable=new Kh,n._rawTransformable=new Kh,n.name=e,n}return Ma(e,t),e.prototype.setBoundingRect=function(t,e,n,i){return this._rect=new dc(t,e,n,i),this._rect},e.prototype.getBoundingRect=function(){return this._rect},e.prototype.setViewRect=function(t,e,n,i){this._transformTo(t,e,n,i),this._viewRect=new dc(t,e,n,i)},e.prototype._transformTo=function(t,e,n,i){var r=this.getBoundingRect(),o=this._rawTransformable;o.transform=r.calculateTransform(new dc(t,e,n,i));var a=o.parent;o.parent=null,o.decomposeTransform(),o.parent=a,this._updateTransform()},e.prototype.setCenter=function(t,e){t&&(this._center=[Rd(t[0],e.getWidth()),Rd(t[1],e.getHeight())],this._updateCenterAndZoom())},e.prototype.setZoom=function(t){t=t||1;var e=this.zoomLimit;e&&(null!=e.max&&(t=Math.min(e.max,t)),null!=e.min&&(t=Math.max(e.min,t))),this._zoom=t,this._updateCenterAndZoom()},e.prototype.getDefaultCenter=function(){var t=this.getBoundingRect();return[t.x+t.width/2,t.y+t.height/2]},e.prototype.getCenter=function(){return this._center||this.getDefaultCenter()},e.prototype.getZoom=function(){return this._zoom||1},e.prototype.getRoamTransform=function(){return this._roamTransformable.getLocalTransform()},e.prototype._updateCenterAndZoom=function(){var t=this._rawTransformable.getLocalTransform(),e=this._roamTransformable,n=this.getDefaultCenter(),i=this.getCenter(),r=this.getZoom();i=fl([],i,t),n=fl([],n,t),e.originX=i[0],e.originY=i[1],e.x=n[0]-i[0],e.y=n[1]-i[1],e.scaleX=e.scaleY=r,this._updateTransform()},e.prototype._updateTransform=function(){var t=this._roamTransformable,e=this._rawTransformable;e.parent=t,t.updateTransform(),e.updateTransform(),Xl(this.transform||(this.transform=[]),e.transform||[1,0,0,1,0,0]),this._rawTransform=e.getLocalTransform(),this.invTransform=this.invTransform||[],Ql(this.invTransform,this.transform),this.decomposeTransform()},e.prototype.getTransformInfo=function(){var t=this._rawTransformable,e=this._roamTransformable,n=new Kh;return n.transform=e.transform,n.decomposeTransform(),{roam:{x:n.x,y:n.y,scaleX:n.scaleX,scaleY:n.scaleY},raw:{x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY}}},e.prototype.getViewRect=function(){return this._viewRect},e.prototype.getViewRectAfterRoam=function(){var t=this.getBoundingRect().clone();return t.applyTransform(this.transform),t},e.prototype.dataToPoint=function(t,e,n){var i=e?this._rawTransform:this.transform;return n=n||[],i?TB(n,t,i):Ys(n,t)},e.prototype.pointToData=function(t){var e=this.invTransform;return e?TB([],t,e):[t[0],t[1]]},e.prototype.convertToPixel=function(t,e,n){var i=DB(e);return i===this?i.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,e,n){var i=DB(e);return i===this?i.pointToData(n):null},e.prototype.containPoint=function(t){return this.getViewRectAfterRoam().contain(t[0],t[1])},e.dimensions=["x","y"],e}(Kh);function DB(t){var e=t.seriesModel;return e?e.coordinateSystem:null}const kB=IB;var AB={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},EB=["lng","lat"],LB=function(t){function e(e,n,i){var r=t.call(this,e)||this;r.dimensions=EB,r.type="geo",r._nameCoordMap=Fs(),r.map=n;var o,a=i.projection,s=rB(n,i.nameMap,i.nameProperty),l=iB(n),c=(r.resourceType=l?l.type:null,r.regions=s.regions),u=AB[l.type];if(r._regionsMap=s.regionsMap,r.regions=s.regions,r.projection=a,a)for(var h=0;h<c.length;h++){var d=c[h].getBoundingRect(a);(o=o||d.clone()).union(d)}else o=s.boundingRect;return r.setBoundingRect(o.x,o.y,o.width,o.height),r.aspectScale=a?1:Is(i.aspectScale,u.aspectScale),r._invertLongitute=!a&&u.invertLongitute,r}return Ma(e,t),e.prototype._transformTo=function(t,e,n,i){var r=this.getBoundingRect(),o=this._invertLongitute;r=r.clone(),o&&(r.y=-r.y-r.height);var a=this._rawTransformable;a.transform=r.calculateTransform(new dc(t,e,n,i));var s=a.parent;a.parent=null,a.decomposeTransform(),a.parent=s,o&&(a.scaleY=-a.scaleY),this._updateTransform()},e.prototype.getRegion=function(t){return this._regionsMap.get(t)},e.prototype.getRegionByCoord=function(t){for(var e=this.regions,n=0;n<e.length;n++){var i=e[n];if("geoJSON"===i.type&&i.contain(t))return e[n]}},e.prototype.addGeoCoord=function(t,e){this._nameCoordMap.set(t,e)},e.prototype.getGeoCoord=function(t){var e=this._regionsMap.get(t);return this._nameCoordMap.get(t)||e&&e.getCenter()},e.prototype.dataToPoint=function(t,e,n){if(gs(t)&&(t=this.getGeoCoord(t)),t){var i=this.projection;return i&&(t=i.project(t)),t&&this.projectedToPoint(t,e,n)}},e.prototype.pointToData=function(t){var e=this.projection;return e&&(t=e.unproject(t)),t&&this.pointToProjected(t)},e.prototype.pointToProjected=function(e){return t.prototype.pointToData.call(this,e)},e.prototype.projectedToPoint=function(e,n,i){return t.prototype.dataToPoint.call(this,e,n,i)},e.prototype.convertToPixel=function(t,e,n){var i=PB(e);return i===this?i.dataToPoint(n):null},e.prototype.convertFromPixel=function(t,e,n){var i=PB(e);return i===this?i.pointToData(n):null},e}(kB);function PB(t){var e=t.geoModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",Mp).models[0]||{}).coordinateSystem:null}is(LB,kB);const OB=LB;function RB(t,e){var n=t.get("boundingCoords");if(null!=n){var i=n[0],r=n[1];if(isFinite(i[0])&&isFinite(i[1])&&isFinite(r[0])&&isFinite(r[1])){var o=this.projection;if(o){var a=i[0],s=i[1],l=r[0],c=r[1];i=[1/0,1/0],r=[-1/0,-1/0];var u=function(t,e,n,a){for(var s=n-t,l=a-e,c=0;c<=100;c++){var u=c/100,h=o.project([t+s*u,e+l*u]);gl(i,i,h),ml(r,r,h)}};u(a,s,l,s),u(l,s,l,c),u(l,c,a,c),u(a,c,l,s)}this.setBoundingRect(i[0],i[1],r[0]-i[0],r[1]-i[1])}}var h,d,p,f=this.getBoundingRect(),g=t.get("layoutCenter"),m=t.get("layoutSize"),y=e.getWidth(),v=e.getHeight(),_=f.width/f.height*this.aspectScale,x=!1;if(g&&m&&(h=[Rd(g[0],y),Rd(g[1],v)],d=Rd(m,Math.min(y,v)),isNaN(h[0])||isNaN(h[1])||isNaN(d)||(x=!0)),x)p={},_>1?(p.width=d,p.height=d/_):(p.height=d,p.width=d*_),p.y=h[1]-p.height/2,p.x=h[0]-p.width/2;else{var b=t.getBoxLayoutParams();b.aspect=_,p=Nv(b,{width:y,height:v})}this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(t.get("center"),e),this.setZoom(t.get("zoom"))}var BB=function(){function t(){this.dimensions=EB}return t.prototype.create=function(t,e){var n=[];function i(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection")}}t.eachComponent("geo",function(t,r){var o=t.get("map"),a=new OB(o+r,o,Ja({nameMap:t.get("nameMap")},i(t)));a.zoomLimit=t.get("scaleLimit"),n.push(a),t.coordinateSystem=a,a.model=t,a.resize=RB,a.resize(t,e)}),t.eachSeries(function(t){if("geo"===t.get("coordinateSystem")){var e=t.get("geoIndex")||0;t.coordinateSystem=n[e]}});var r={};return t.eachSeriesByType("map",function(t){if(!t.getHostGeoModel()){var e=t.getMapType();r[e]=r[e]||[],r[e].push(t)}}),os(r,function(t,r){var o=as(t,function(t){return t.get("nameMap")}),a=new OB(r,r,Ja({nameMap:Ka(o)},i(t[0])));a.zoomLimit=Ts.apply(null,as(t,function(t){return t.get("scaleLimit")})),n.push(a),a.resize=RB,a.resize(t[0],e),os(t,function(t){t.coordinateSystem=a,function(t,e){os(e.get("geoCoord"),function(e,n){t.addGeoCoord(n,e)})}(a,t)})}),n},t.prototype.getFilledRegions=function(t,e,n,i){for(var r=(t||[]).slice(),o=Fs(),a=0;a<r.length;a++)o.set(r[a].name,r[a]);return os(rB(e,n,i).regions,function(t){var e=t.name,n=o.get(e),i=t.properties&&t.properties.echartsStyle;n||(n={name:e},r.push(n)),i&&Za(n,i)}),r},t}();const NB=new BB;var zB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(t,e,n){var i=iB(t.map);if(i&&"geoJSON"===i.type){var r=t.itemStyle=t.itemStyle||{};"color"in r||(r.color="#eee")}this.mergeDefaultAndTheme(t,n),cp(t,"label",["show"])},e.prototype.optionUpdated=function(){var t=this,e=this.option;e.regions=NB.getFilledRegions(e.regions,e.map,e.nameMap,e.nameProperty);var n={};this._optionModelMap=ss(e.regions||[],function(e,i){var r=i.name;return r&&(e.set(r,new Oy(i,t,t.ecModel)),i.selected&&(n[r]=!0)),e},Fs()),e.selectedMap||(e.selectedMap=n)},e.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new Oy(null,this,this.ecModel)},e.prototype.getFormattedLabel=function(t,e){var n=this.getRegionModel(t),i="normal"===e?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),r={name:t};return fs(i)?(r.status=e,i(r)):gs(i)?i.replace("{a}",null!=t?t:""):void 0},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.select=function(t){var e=this.option,n=e.selectedMode;n&&("multiple"!==n&&(e.selectedMap=null),(e.selectedMap||(e.selectedMap={}))[t]=!0)},e.prototype.unSelect=function(t){var e=this.option.selectedMap;e&&(e[t]=!1)},e.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},e.prototype.isSelected=function(t){var e=this.option.selectedMap;return!(!e||!e[t])},e.type="geo",e.layoutMode="box",e.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},e}(Uv);const FB=zB;function VB(t,e){return t.pointToProjected?t.pointToProjected(e):t.pointToData(e)}function HB(t,e,n,i){var r=t.getZoom(),o=t.getCenter(),a=e.zoom,s=t.projectedToPoint?t.projectedToPoint(o):t.dataToPoint(o);if(null!=e.dx&&null!=e.dy&&(s[0]-=e.dx,s[1]-=e.dy,t.setCenter(VB(t,s),i)),null!=a){if(n){var l=n.min||0,c=n.max||1/0;a=Math.max(Math.min(r*a,c),l)/r}t.scaleX*=a,t.scaleY*=a;var u=(e.originX-t.x)*(a-1),h=(e.originY-t.y)*(a-1);t.x-=u,t.y-=h,t.updateTransform(),t.setCenter(VB(t,s),i),t.setZoom(a*r)}return{center:t.getCenter(),zoom:t.getZoom()}}var jB=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.focusBlurEnabled=!0,n}return Ma(e,t),e.prototype.init=function(t,e){this._api=e},e.prototype.render=function(t,e,n,i){if(this._model=t,!t.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new _B(n));var r=this._mapDraw;r.draw(t,e,n,this,i),r.group.on("click",this._handleRegionClick,this),r.group.silent=t.get("silent"),this.group.add(r.group),this.updateSelectStatus(t,e,n)},e.prototype._handleRegionClick=function(t){var e;JM(t.target,function(t){return null!=(e=Zg(t).eventData)},!0),e&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:e.name})},e.prototype.updateSelectStatus=function(t,e,n){var i=this;this._mapDraw.group.traverse(function(t){var e=Zg(t).eventData;if(e)return i._model.isSelected(e.name)?n.enterSelect(t):n.leaveSelect(t),!0})},e.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},e.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},e.type="geo",e}(Wb);const WB=jB;function GB(t,e,n){!function(t,e,n){if(e.svg){var i=new qR(t,e.svg);nB.set(t,i)}else{var r=e.geoJson||e.geoJSON;r&&!e.features?n=e.specialAreas:r=e,i=new tB(t,r,n),nB.set(t,i)}}(t,e,n)}function UB(t){function e(e,n){n.update="geo:updateSelectStatus",t.registerAction(n,function(t,n){var i={},r=[];return n.eachComponent({mainType:"geo",query:t},function(n){n[e](t.name),os(n.coordinateSystem.regions,function(t){i[t.name]=n.isSelected(t.name)||!1});var o=[];os(i,function(t,e){i[e]&&o.push(e)}),r.push({geoIndex:n.componentIndex,name:o})}),{selected:i,allSelected:r,name:t.name}})}t.registerCoordinateSystem("geo",NB),t.registerComponentModel(FB),t.registerComponentView(WB),t.registerImpl("registerMap",GB),t.registerImpl("getMap",function(t){return function(t){var e=nB.get(t);return e&&"geoJSON"===e.type&&e.getMapForUser()}(t)}),e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),t.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e,n){var i=t.componentType||"series";e.eachComponent({mainType:i,query:t},function(e){var r=e.coordinateSystem;if("geo"===r.type){var o=HB(r,t,e.get("scaleLimit"),n);e.setCenter&&e.setCenter(o.center),e.setZoom&&e.setZoom(o.zoom),"series"===i&&os(e.seriesGroup,function(t){t.setCenter(o.center),t.setZoom(o.zoom)})}})})}function qB(t,e){var n=t.isExpand?t.children:[],i=t.parentNode.children,r=t.hierNode.i?i[t.hierNode.i-1]:null;if(n.length){!function(t){for(var e=t.children,n=e.length,i=0,r=0;--n>=0;){var o=e[n];o.hierNode.prelim+=i,o.hierNode.modifier+=i,r+=o.hierNode.change,i+=o.hierNode.shift+r}}(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;r?(t.hierNode.prelim=r.hierNode.prelim+e(t,r),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else r&&(t.hierNode.prelim=r.hierNode.prelim+e(t,r));t.parentNode.hierNode.defaultAncestor=function(t,e,n,i){if(e){for(var r=t,o=t,a=o.parentNode.children[0],s=e,l=r.hierNode.modifier,c=o.hierNode.modifier,u=a.hierNode.modifier,h=s.hierNode.modifier;s=ZB(s),o=KB(o),s&&o;){r=ZB(r),a=KB(a),r.hierNode.ancestor=t;var d=s.hierNode.prelim+h-o.hierNode.prelim-c+i(s,o);d>0&&(QB(JB(s,t,n),t,d),c+=d,l+=d),h+=s.hierNode.modifier,c+=o.hierNode.modifier,l+=r.hierNode.modifier,u+=a.hierNode.modifier}s&&!ZB(r)&&(r.hierNode.thread=s,r.hierNode.modifier+=h-l),o&&!KB(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=c-u,n=t)}return n}(t,r,t.parentNode.hierNode.defaultAncestor||i[0],e)}function YB(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function XB(t){return arguments.length?t:tN}function $B(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function ZB(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function KB(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function JB(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function QB(t,e,n){var i=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=i,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=i}function tN(t,e){return t.parentNode===e.parentNode?1:2}var eN=function(){this.parentPoint=[],this.childPoints=[]},nN=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new eN},e.prototype.buildPath=function(t,e){var n=e.childPoints,i=n.length,r=e.parentPoint,o=n[0],a=n[i-1];if(1===i)return t.moveTo(r[0],r[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,c=1-l,u=Rd(e.forkPosition,1),h=[];h[l]=r[l],h[c]=r[c]+(a[c]-r[c])*u,t.moveTo(r[0],r[1]),t.lineTo(h[0],h[1]),t.moveTo(o[0],o[1]),h[l]=o[l],t.lineTo(h[0],h[1]),h[l]=a[l],t.lineTo(h[0],h[1]),t.lineTo(a[0],a[1]);for(var d=1;d<i-1;d++){var p=n[d];t.moveTo(p[0],p[1]),h[l]=p[l],t.lineTo(h[0],h[1])}},e}(vg),iN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._mainGroup=new _d,n}return Ma(e,t),e.prototype.init=function(t,e){this._controller=new vR(e.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},e.prototype.render=function(t,e,n){var i=t.getData(),r=t.layoutInfo,o=this._mainGroup;"radial"===t.get("layout")?(o.x=r.x+r.width/2,o.y=r.y+r.height/2):(o.x=r.x,o.y=r.y),this._updateViewCoordSys(t,n),this._updateController(t,e,n);var a=this._data;i.diff(a).add(function(e){rN(i,e)&&oN(i,e,null,o,t)}).update(function(e,n){var r=a.getItemGraphicEl(n);rN(i,e)?oN(i,e,r,o,t):r&&lN(a,n,r,o,t)}).remove(function(e){var n=a.getItemGraphicEl(e);n&&lN(a,e,n,o,t)}).execute(),this._nodeScaleRatio=t.get("nodeScaleRatio"),this._updateNodeAndLinkScale(t),!0===t.get("expandAndCollapse")&&i.eachItemGraphicEl(function(e,i){e.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:i})})}),this._data=i},e.prototype._updateViewCoordSys=function(t,e){var n=t.getData(),i=[];n.each(function(t){var e=n.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||i.push([+e.x,+e.y])});var r=[],o=[];Mf(i,r,o);var a=this._min,s=this._max;o[0]-r[0]===0&&(r[0]=a?a[0]:r[0]-1,o[0]=s?s[0]:o[0]+1),o[1]-r[1]===0&&(r[1]=a?a[1]:r[1]-1,o[1]=s?s[1]:o[1]+1);var l=t.coordinateSystem=new kB;l.zoomLimit=t.get("scaleLimit"),l.setBoundingRect(r[0],r[1],o[0]-r[0],o[1]-r[1]),l.setCenter(t.get("center"),e),l.setZoom(t.get("zoom")),this.group.attr({x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY}),this._min=r,this._max=o},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker(function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!SR(e,n,t)}),r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",function(e){_R(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"treeRoam",dx:e.dx,dy:e.dy})}).on("zoom",function(e){xR(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"treeRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(t),n.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(t){var e=t.getData(),n=this._getNodeGlobalScale(t);e.eachItemGraphicEl(function(t,e){t.setSymbolScale(n)})},e.prototype._getNodeGlobalScale=function(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=this._nodeScaleRatio,i=e.scaleX||1;return((e.getZoom()-1)*n+1)/i},e.prototype.dispose=function(){this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},e.type="tree",e}(eM);function rN(t,e){var n=t.getItemLayout(e);return n&&!isNaN(n.x)&&!isNaN(n.y)}function oN(t,e,n,i,r){var o=!n,a=t.tree.getNodeByDataIndex(e),s=a.getModel(),l=a.getVisual("style").fill,c=!1===a.isExpand&&0!==a.children.length?l:"#fff",u=t.tree.root,h=a.parentNode===u?a:a.parentNode||a,d=t.getItemGraphicEl(h.dataIndex),p=h.getLayout(),f=d?{x:d.__oldX,y:d.__oldY,rawX:d.__radialOldRawX,rawY:d.__radialOldRawY}:p,g=a.getLayout();o?((n=new dL(t,e,null,{symbolInnerColor:c,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(t,e,null,{symbolInnerColor:c,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,i.add(n),t.setItemGraphicEl(e,n),n.__oldX=n.x,n.__oldY=n.y,Jm(n,{x:g.x,y:g.y},r);var m=n.getSymbolPath();if("radial"===r.get("layout")){var y=u.children[0],v=y.getLayout(),_=y.children.length,x=void 0,b=void 0;if(g.x===v.x&&!0===a.isExpand&&y.children.length){var w={x:(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,y:(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-v.y,w.x-v.x))<0&&(x=2*Math.PI+x),(b=w.x<v.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-v.y,g.x-v.x))<0&&(x=2*Math.PI+x),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<v.x)&&(x-=Math.PI):(b=g.x>v.x)||(x-=Math.PI);var S=b?"left":"right",M=s.getModel("label"),C=M.get("rotate"),T=C*(Math.PI/180),I=m.getTextContent();I&&(m.setTextConfig({position:M.get("position")||S,rotation:null==C?-x:T,origin:"center"}),I.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),k="relative"===D?Vs(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===D?a.getAncestorsIndices():"descendant"===D?a.getDescendantIndices():null;k&&(Zg(n).focus=k),function(t,e,n,i,r,o,a,s){var l=e.getModel(),c=t.get("edgeShape"),u=t.get("layout"),h=t.getOrient(),d=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=i.__edge;if("curve"===c)e.parentNode&&e.parentNode!==n&&(g||(g=i.__edge=new Zw({shape:cN(u,h,d,r,r)})),Jm(g,{shape:cN(u,h,d,o,a)},t));else if("polyline"===c&&"orthogonal"===u&&e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var m=e.children,y=[],v=0;v<m.length;v++){var _=m[v].getLayout();y.push([_.x,_.y])}g||(g=i.__edge=new nN({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:h,forkPosition:p}})),Jm(g,{shape:{parentPoint:[a.x,a.y],childPoints:y}},t)}g&&("polyline"!==c||e.isExpand)&&(g.useStyle(Qa({strokeNoScale:!0,fill:null},f)),Gm(g,l,"lineStyle"),Sm(g),s.add(g))}(r,a,u,n,f,p,g,i),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var i=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);i&&1===i.hoverState||bm(n.__edge,e)}})}function aN(t,e,n,i,r){var o=sN(e.tree.root,t),a=o.source,s=o.sourceLayout,l=e.getItemGraphicEl(t.dataIndex);if(l){var c=e.getItemGraphicEl(a.dataIndex).__edge,u=l.__edge||(!1===a.isExpand||1===a.children.length?c:void 0),h=i.get("edgeShape"),d=i.get("layout"),p=i.get("orient"),f=i.get(["lineStyle","curveness"]);u&&("curve"===h?ey(u,{shape:cN(d,p,f,s,s),style:{opacity:0}},i,{cb:function(){n.remove(u)},removeOpt:r}):"polyline"===h&&"orthogonal"===i.get("layout")&&ey(u,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},i,{cb:function(){n.remove(u)},removeOpt:r}))}}function sN(t,e){for(var n,i=e.parentNode===t?e:e.parentNode||e;null==(n=i.getLayout());)i=i.parentNode===t?i:i.parentNode||i;return{source:i,sourceLayout:n}}function lN(t,e,n,i,r){var o=t.tree.getNodeByDataIndex(e),a=sN(t.tree.root,o).sourceLayout,s={duration:r.get("animationDurationUpdate"),easing:r.get("animationEasingUpdate")};ey(n,{x:a.x+1,y:a.y+1},r,{cb:function(){i.remove(n),t.setItemGraphicEl(e,null)},removeOpt:s}),n.fadeOut(null,t.hostModel,{fadeLabel:!0,animation:s}),o.children.forEach(function(e){aN(e,t,i,r,s)}),aN(o,t,i,r,s)}function cN(t,e,n,i,r){var o,a,s,l,c,u,h,d;if("radial"===t){c=i.rawX,h=i.rawY,u=r.rawX,d=r.rawY;var p=$B(c,h),f=$B(c,h+(d-h)*n),g=$B(u,d+(h-d)*n),m=$B(u,d);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return c=i.x,h=i.y,u=r.x,d=r.y,"LR"!==e&&"RL"!==e||(o=c+(u-c)*n,a=h,s=u+(c-u)*n,l=d),"TB"!==e&&"BT"!==e||(o=c,a=h+(d-h)*n,s=u,l=d+(h-d)*n),{x1:c,y1:h,x2:u,y2:d,cpx1:o,cpy1:a,cpx2:s,cpy2:l}}const uN=iN;var hN=xp();function dN(t,e){if(hN(this).mainData===this){var n=Ja({},hN(this).datas);n[this.dataType]=e,yN(e,n,t)}else vN(e,this.dataType,hN(this).mainData,t);return e}function pN(t,e){return t.struct&&t.struct.update(),e}function fN(t,e){return os(hN(e).datas,function(n,i){n!==e&&vN(n.cloneShallow(),i,e,t)}),e}function gN(t){var e=hN(this).mainData;return null==t||null==e?e:hN(e).datas[t]}function mN(){var t=hN(this).mainData;return null==t?[{data:t}]:as(us(hN(t).datas),function(e){return{type:e,data:hN(t).datas[e]}})}function yN(t,e,n){hN(t).datas={},os(e,function(e,i){vN(e,i,t,n)})}function vN(t,e,n,i){hN(n).datas[e]=t,hN(t).mainData=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=gN,t.getLinkedDataAll=mN}const _N=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,yN(e,n,t),os(n,function(n){os(e.TRANSFERABLE_METHODS,function(e){n.wrapMethod(e,ds(dN,t))})}),e.wrapMethod("cloneShallow",ds(fN,t)),os(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,ds(pN,t))}),Es(n[e.dataType]===e)};var xN=function(){function t(t,e){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}return t.prototype.isRemoved=function(){return this.dataIndex<0},t.prototype.eachNode=function(t,e,n){fs(t)&&(n=e,e=t,t=null),gs(t=t||{})&&(t={order:t});var i,r=t.order||"preorder",o=this[t.attr||"children"];"preorder"===r&&(i=e.call(n,this));for(var a=0;!i&&a<o.length;a++)o[a].eachNode(t,e,n);"postorder"===r&&e.call(n,this)},t.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var n=0;n<this.children.length;n++){var i=this.children[n];i.updateDepthAndHeight(t+1),i.height>e&&(e=i.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,i=n.length;e<i;e++){var r=n[e].getNodeById(t);if(r)return r}},t.prototype.contains=function(t){if(t===this)return!0;for(var e=0,n=this.children,i=n.length;e<i;e++){var r=n[e].contains(t);if(r)return r}},t.prototype.getAncestors=function(t){for(var e=[],n=t?this:this.parentNode;n;)e.push(n),n=n.parentNode;return e.reverse(),e},t.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},t.prototype.getDescendantIndices=function(){var t=[];return this.eachNode(function(e){t.push(e.dataIndex)}),t},t.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},t.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},t.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},t.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},t}(),bN=function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,n){this.root.eachNode(t,e,n)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},t.prototype.update=function(){for(var t=this.data,e=this._nodes,n=0,i=e.length;n<i;n++)e[n].dataIndex=-1;for(n=0,i=t.count();n<i;n++)e[t.getRawIndex(n)].dataIndex=n},t.prototype.clearLayouts=function(){this.data.clearItemLayouts()},t.createTree=function(e,n,i){var r=new t(n),o=[],a=1;!function t(e,n){var i=e.value;a=Math.max(a,ps(i)?i.length:1),o.push(e);var s=new xN(mp(e.name,""),r);n?function(t,e){var n=e.children;t.parentNode!==e&&(n.push(t),t.parentNode=e)}(s,n):r.root=s,r._nodes.push(s);var l=e.children;if(l)for(var c=0;c<l.length;c++)t(l[c],s)}(e),r.root.updateDepthAndHeight(0);var s=JI(o,{coordDimensions:["value"],dimensionsCount:a}).dimensions,l=new ZI(s,n);return l.initData(o),i&&i(l),_N({mainData:l,struct:r,structAttr:"tree"}),r.update(),r},t}();const wN=bN;function SN(t,e,n){if(t&&es(e,t.type)>=0){var i=n.getData().tree.root,r=t.targetNode;if(gs(r)&&(r=i.getNodeById(r)),r&&i.contains(r))return{node:r};var o=t.targetNodeId;if(null!=o&&(r=i.getNodeById(o)))return{node:r}}}function MN(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function CN(t,e){return es(MN(t),e)>=0}function TN(t,e){for(var n=[];t;){var i=t.dataIndex;n.push({name:t.name,dataIndex:i,value:e.getRawValue(i)}),t=t.parentNode}return n.reverse(),n}var IN=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return Ma(e,t),e.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},i=new Oy(n,this,this.ecModel),r=wN.createTree(e,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=r.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=i),t})}),o=0;r.eachNode("preorder",function(t){t.depth>o&&(o=t.depth)});var a=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:o;return r.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),r.data},e.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,e,n){for(var i=this.getData().tree,r=i.root.children[0],o=i.getNodeByDataIndex(t),a=o.getValue(),s=o.name;o&&o!==r;)s=o.parentNode.name+"."+s,o=o.parentNode;return yb("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=TN(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(Hb);const DN=IN;function kN(t,e){for(var n,i=[t];n=i.pop();)if(e(n),n.isExpand){var r=n.children;if(r.length)for(var o=r.length-1;o>=0;o--)i.push(r[o])}}function AN(t,e){t.eachSeriesByType("tree",function(t){!function(t,e){var n=function(t,e){return Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=n;var i=t.get("layout"),r=0,o=0,a=null;"radial"===i?(r=2*Math.PI,o=Math.min(n.height,n.width)/2,a=XB(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(r=n.width,o=n.height,a=XB());var s=t.getData().tree.root,l=s.children[0];if(l){!function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,i,r=[e];n=r.pop();)if(i=n.children,n.isExpand&&i.length)for(var o=i.length-1;o>=0;o--){var a=i[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},r.push(a)}}(s),function(t,e,n){for(var i,r=[t],o=[];i=r.pop();)if(o.push(i),i.isExpand){var a=i.children;if(a.length)for(var s=0;s<a.length;s++)r.push(a[s])}for(;i=o.pop();)e(i,n)}(l,qB,a),s.hierNode.modifier=-l.hierNode.prelim,kN(l,YB);var c=l,u=l,h=l;kN(l,function(t){var e=t.getLayout().x;e<c.getLayout().x&&(c=t),e>u.getLayout().x&&(u=t),t.depth>h.depth&&(h=t)});var d=c===u?1:a(c,u)/2,p=d-c.getLayout().x,f=0,g=0,m=0,y=0;if("radial"===i)f=r/(u.getLayout().x+d+p),g=o/(h.depth-1||1),kN(l,function(t){m=(t.getLayout().x+p)*f,y=(t.depth-1)*g;var e=$B(m,y);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:y},!0)});else{var v=t.getOrient();"RL"===v||"LR"===v?(g=o/(u.getLayout().x+d+p),f=r/(h.depth-1||1),kN(l,function(t){y=(t.getLayout().x+p)*g,m="LR"===v?(t.depth-1)*f:r-(t.depth-1)*f,t.setLayout({x:m,y},!0)})):"TB"!==v&&"BT"!==v||(f=r/(u.getLayout().x+d+p),g=o/(h.depth-1||1),kN(l,function(t){m=(t.getLayout().x+p)*f,y="TB"===v?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:m,y},!0)}))}}}(t,e)})}function EN(t){t.eachSeriesByType("tree",function(t){var e=t.getData();e.tree.eachNode(function(t){var n=t.getModel().getModel("itemStyle").getItemStyle();Ja(e.ensureUniqueItemVisual(t.dataIndex,"style"),n)})})}var LN=["treemapZoomToNode","treemapRender","treemapMove"];function PN(t){var e=t.getData().tree,n={};e.eachNode(function(e){for(var i=e;i&&i.depth>1;)i=i.parentNode;var r=v_(t.ecModel,i.name||i.dataIndex+"",n);e.setVisual("decal",r)})}var ON=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventUsingHoverLayer=!0,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};RN(n);var i=t.levels||[],r=this.designatedVisualItemStyle={},o=new Oy({itemStyle:r},this,e);i=t.levels=function(t,e){var n,i,r=lp(e.get("color")),o=lp(e.get(["aria","decal","decals"]));if(r){os(t=t||[],function(t){var e=new Oy(t),r=e.get("color"),o=e.get("decal");(e.get(["itemStyle","color"])||r&&"none"!==r)&&(n=!0),(e.get(["itemStyle","decal"])||o&&"none"!==o)&&(i=!0)});var a=t[0]||(t[0]={});return n||(a.color=r.slice()),!i&&o&&(a.decal=o.slice()),t}}(i,e);var a=as(i||[],function(t){return new Oy(t,o,e)},this),s=wN.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=s.getNodeByDataIndex(e),i=n?a[n.depth]:null;return t.parentModel=i||o,t})});return s.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t);return yb("nameValue",{name:i.getName(t),value:r})},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=TN(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Ja(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Fs(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){PN(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(Hb);function RN(t){var e=0;os(t.children,function(t){RN(t);var n=t.value;ps(n)&&(n=n[0]),e+=n});var n=t.value;ps(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),ps(t.value)?t.value[0]=n:t.value=n}const BN=ON;var NN=function(){function t(t){this.group=new _d,t.add(this.group)}return t.prototype.render=function(t,e,n,i){var r=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),r.get("show")&&n){var a=r.getModel("itemStyle"),s=r.getModel("emphasis"),l=a.getModel("textStyle"),c=s.getModel(["itemStyle","textStyle"]),u={pos:{left:r.get("left"),right:r.get("right"),top:r.get("top"),bottom:r.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:r.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,u,l),this._renderContent(t,u,a,s,l,c,i),zv(o,u.pos,u.box)}},t.prototype._prepare=function(t,e,n){for(var i=t;i;i=i.parentNode){var r=mp(i.getModel().get("name"),""),o=n.getTextRect(r),a=Math.max(o.width+16,e.emptyItemWidth);e.totalWidth+=a+8,e.renderList.push({node:i,text:r,width:a})}},t.prototype._renderContent=function(t,e,n,i,r,o,a){for(var s=0,l=e.emptyItemWidth,c=t.get(["breadcrumb","height"]),u=function(t,e,n){var i=e.width,r=e.height,o=Rd(t.left,i),a=Rd(t.top,r),s=Rd(t.right,i),l=Rd(t.bottom,r);return(isNaN(o)||isNaN(parseFloat(t.left)))&&(o=0),(isNaN(s)||isNaN(parseFloat(t.right)))&&(s=i),(isNaN(a)||isNaN(parseFloat(t.top)))&&(a=0),(isNaN(l)||isNaN(parseFloat(t.bottom)))&&(l=r),n=wv(n||0),{width:Math.max(s-o-n[1]-n[3],0),height:Math.max(l-a-n[0]-n[2],0)}}(e.pos,e.box),h=e.totalWidth,d=e.renderList,p=i.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],m=g.node,y=g.width,v=g.text;h>u.width&&(h-=y-l,y=l,v=null);var _=new zw({shape:{points:zN(s,0,y,c,f===d.length-1,0===f)},style:Qa(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new $g({style:uy(r,{text:v})}),textConfig:{position:"inside"},z2:1e4*rm,onclick:ds(a,m)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=uy(o,{text:v}),_.ensureState("emphasis").style=p,Vm(_,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(_),FN(_,t,m),s+=y+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function zN(t,e,n,i,r,o){var a=[[r?t:t-5,e],[t+n,e],[t+n,e+i],[r?t:t-5,e+i]];return!o&&a.splice(2,0,[t+n+5,e+i/2]),!r&&a.push([t,e+i/2]),a}function FN(t,e,n){Zg(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&TN(n,e)}}const VN=NN;var HN=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,i,r){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:i,easing:r}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){--e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},i=0,r=this._storage.length;i<r;i++){var o=this._storage[i];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:n,aborted:n})}return this},t}(),jN=_d,WN=Pg,GN="label",UN="upperLabel",qN=10*rm,YN=2*rm,XN=3*rm,$N=Fp([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),ZN=function(t){var e=$N(t);return e.stroke=e.fill=e.lineWidth=null,e},KN=xp(),JN=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._state="ready",n._storage={nodeGroup:[],background:[],content:[]},n}return Ma(e,t),e.prototype.render=function(t,e,n,i){if(!(es(e.findComponents({mainType:"series",subType:"treemap",query:i}),t)<0)){this.seriesModel=t,this.api=n,this.ecModel=e;var r=SN(i,["treemapZoomToNode","treemapRootToNode"],t),o=i&&i.type,a=t.layoutInfo,s=!this._oldTree,l=this._storage,c="treemapRootToNode"===o&&r&&l?{rootNodeGroup:l.nodeGroup[r.node.getRawIndex()],direction:i.direction}:null,u=this._giveContainerGroup(a),h=t.get("animation"),d=this._doRender(u,t,c);!h||s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(u,d,t,c),this._resetController(n),this._renderBreadcrumb(t,n,r)}},e.prototype._giveContainerGroup=function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new jN,this._initEvents(e),this.group.add(e)),e.x=t.x,e.y=t.y,e},e.prototype._doRender=function(t,e,n){var i=e.getData().tree,r=this._oldTree,o={nodeGroup:[],background:[],content:[]},a={nodeGroup:[],background:[],content:[]},s=this._storage,l=[];function c(t,i,r,c){return function(t,e,n,i,r,o,a,s,l,c){if(a){var u=a.getLayout(),h=t.getData(),d=a.getModel();if(h.setItemGraphicEl(a.dataIndex,null),u&&u.isInView){var p=u.width,f=u.height,g=u.borderWidth,m=u.invisible,y=a.getRawIndex(),v=s&&s.getRawIndex(),_=a.viewChildren,x=u.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),M=d.getModel(["blur","itemStyle"]),C=d.getModel(["select","itemStyle"]),T=w.get("borderRadius")||0,I=F("nodeGroup",jN);if(I){if(l.add(I),I.x=u.x||0,I.y=u.y||0,I.markRedraw(),KN(I).nodeWidth=p,KN(I).nodeHeight=f,u.isAboveViewRoot)return I;var D=F("background",WN,c,YN);D&&function(e,n,i){var r=Zg(n);if(r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:T}),m)B(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=ZN(w);l.fill=s;var c=$N(S);c.fill=S.get("borderColor");var u=$N(M);u.fill=M.get("borderColor");var h=$N(C);if(h.fill=C.get("borderColor"),i){var d=p-2*g;N(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=c,n.ensureState("blur").style=u,n.ensureState("select").style=h,Sm(n)}e.add(n)}(I,D,b&&u.upperLabelHeight);var k=d.getModel("emphasis"),A=k.get("focus"),E=k.get("blurScope"),L=k.get("disabled"),P="ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():A;if(b)qm(I)&&Um(I,!1),D&&(Um(D,!L),h.setItemGraphicEl(a.dataIndex,D),Hm(D,P,E));else{var O=F("content",WN,c,XN);O&&function(e,n){var i=Zg(n);i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex;var r=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:r,height:o,r:T}),m)B(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,c=ZN(w);c.fill=l,c.decal=s.decal;var u=$N(S),h=$N(M),d=$N(C);N(n,l,s.opacity,null),n.setStyle(c),n.ensureState("emphasis").style=u,n.ensureState("blur").style=h,n.ensureState("select").style=d,Sm(n)}e.add(n)}(I,O),D.disableMorphing=!0,D&&qm(D)&&Um(D,!1),Um(I,!L),h.setItemGraphicEl(a.dataIndex,I);var R=d.getShallow("cursor");R&&O.attr("cursor",R),Hm(I,P,E)}return I}}}function B(t){!t.invisible&&o.push(t)}function N(e,n,i,r){var o=d.getModel(r?UN:GN),s=mp(d.get("name"),null),l=o.getShallow("show");ly(e,cy(d,r?UN:GN),{defaultText:l?s:null,inheritColor:n,defaultOpacity:i,labelFetcher:t,labelDataIndex:a.dataIndex});var c=e.getTextContent();if(c){var h=c.style,p=As(h.padding||0);r&&(e.setTextConfig({layoutRect:r}),c.disableLabelLayout=!0),c.beforeUpdate=function(){var t=Math.max((r?r.width:e.shape.width)-p[1]-p[3],0),n=Math.max((r?r.height:e.shape.height)-p[0]-p[2],0);h.width===t&&h.height===n||c.setStyle({width:t,height:n})},h.truncateMinChar=2,h.lineOverflow="truncate",z(h,r,u);var f=c.getState("emphasis");z(f?f.style:null,r,u)}}function z(e,n,i){var r=e?e.text:null;if(!n&&i.isLeafRoot&&null!=r){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+r:r}}function F(t,o,s,l){var c=null!=v&&n[t][v],u=r[t];return c?(n[t][v]=null,function(t,e){var n=t[y]={};e instanceof jN?(n.oldX=e.x,n.oldY=e.y):n.oldShape=Ja({},e.shape)}(u,c)):m||((c=new o)instanceof gf&&(c.z2=function(t,e){return t*qN+e}(s,l)),function(t,e){var n=t[y]={},o=a.parentNode,s=e instanceof _d;if(o&&(!i||"drillDown"===i.direction)){var l=0,c=0,u=r.background[o.getRawIndex()];!i&&u&&u.oldShape&&(l=u.oldShape.width,c=u.oldShape.height),s?(n.oldX=0,n.oldY=c):n.oldShape={x:l,y:c,width:0,height:0}}n.fadein=!s}(u,c)),e[t][y]=c}}(e,a,s,n,o,l,t,i,r,c)}!function t(e,n,i,r,o){function a(t){return t.getId()}function s(a,s){var l=null!=a?e[a]:null,u=null!=s?n[s]:null,h=c(l,u,i,o);h&&t(l&&l.viewChildren||[],u&&u.viewChildren||[],h,r,o+1)}r?(n=e,os(e,function(t,e){!t.isRemoved()&&s(e,e)})):new CI(n,e,a,a).add(s).update(s).remove(ds(s,null)).execute()}(i.root?[i.root]:[],r&&r.root?[r.root]:[],t,i===r||!r,0);var u=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&os(t,function(t,n){var i=e[n];os(t,function(t){t&&(i.push(t),KN(t).willDelete=!0)})}),e}(s);if(this._oldTree=i,this._storage=a,this._controllerHost){var h=this.seriesModel.layoutInfo,d=i.root.getLayout();d.width===h.width&&d.height===h.height&&(this._controllerHost.zoom=1)}return{lastsForAnimation:o,willDeleteEls:u,renderFinally:function(){os(u,function(t){os(t,function(t){t.parent&&t.parent.remove(t)})}),os(l,function(t){t.invisible=!0,t.dirty()})}}},e.prototype._doAnimation=function(t,e,n,i){var r=n.get("animationDurationUpdate"),o=n.get("animationEasing"),a=(fs(r)?0:r)||0,s=(fs(o)?null:o)||"cubicOut",l=new HN;os(e.willDeleteEls,function(t,e){os(t,function(t,n){if(!t.invisible){var r,o=t.parent,c=KN(o);if(i&&"drillDown"===i.direction)r=o===i.rootNodeGroup?{shape:{x:0,y:0,width:c.nodeWidth,height:c.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;c.willDelete||(u=c.nodeWidth/2,h=c.nodeHeight/2),r="nodeGroup"===e?{x:u,y:h,style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}r&&l.add(t,r,a,0,s)}})}),os(this._storage,function(t,n){os(t,function(t,i){var r=e.lastsForAnimation[n][i],o={};r&&(t instanceof _d?null!=r.oldX&&(o.x=t.x,o.y=t.y,t.x=r.oldX,t.y=r.oldY):(r.oldShape&&(o.shape=Ja({},t.shape),t.setShape(r.oldShape)),r.fadein?(t.setStyle("opacity",0),o.style={opacity:1}):1!==t.style.opacity&&(o.style={opacity:1})),l.add(t,o,a,0,s))})},this),this._state="animating",l.finished(hs(function(){this._state="ready",e.renderFinally()},this)).start()},e.prototype._resetController=function(t){var e=this._controller,n=this._controllerHost;n||(this._controllerHost={target:this.group},n=this._controllerHost),e||((e=this._controller=new vR(t.getZr())).enable(this.seriesModel.get("roam")),n.zoomLimit=this.seriesModel.get("scaleLimit"),n.zoom=this.seriesModel.get("zoom"),e.on("pan",hs(this._onPan,this)),e.on("zoom",hs(this._onZoom,this)));var i=new dc(0,0,t.getWidth(),t.getHeight());e.setPointerChecker(function(t,e,n){return i.contain(e,n)})},e.prototype._clearController=function(){var t=this._controller;this._controllerHost=null,t&&(t.dispose(),t=null)},e.prototype._onPan=function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},e.prototype._onZoom=function(t){var e=t.originX,n=t.originY,i=t.scale;if("animating"!==this._state){var r=this.seriesModel.getData().tree.root;if(!r)return;var o=r.getLayout();if(!o)return;var a,s=new dc(o.x,o.y,o.width,o.height),l=this._controllerHost;a=l.zoomLimit;var c=l.zoom=l.zoom||1;if(c*=i,a){var u=a.min||0,h=a.max||1/0;c=Math.max(Math.min(h,c),u)}var d=c/l.zoom;l.zoom=c;var p=this.seriesModel.layoutInfo,f=[1,0,0,1,0,0];Zl(f,f,[-(e-=p.x),-(n-=p.y)]),Jl(f,f,[d,d]),Zl(f,f,[e,n]),s.applyTransform(f),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},e.prototype._initEvents=function(t){var e=this;t.on("click",function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var i=e.findTarget(t.offsetX,t.offsetY);if(i){var r=i.node;if(r.getLayout().isLeafRoot)e._rootToNode(i);else if("zoomToNode"===n)e._zoomToNode(i);else if("link"===n){var o=r.hostTree.data.getItemModel(r.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Ev(a,s)}}}}},this)},e.prototype._renderBreadcrumb=function(t,e,n){var i=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(n={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new VN(this.group))).render(t,e,n.node,function(e){"animating"!==i._state&&(CN(t.getViewRoot(),e)?i._rootToNode({node:e}):i._zoomToNode({node:e}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,e){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(i){var r=this._storage.background[i.getRawIndex()];if(r){var o=r.transformCoordToLocal(t,e),a=r.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:i,offsetX:o[0],offsetY:o[1]}}},this),n},e.type="treemap",e}(eM);const QN=JN;var tz=os,ez=vs,nz=function(){function t(e){var n=e.mappingMethod,i=e.type,r=this.option=$a(e);this.type=i,this.mappingMethod=n,this._normalizeData=dz[n];var o=t.visualHandlers[i];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(iz(r),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,os(e,function(e,n){e.originIndex=n,null!=e.visual&&(t.hasSpecialVisual=!0)})}(r)):"category"===n?r.categories?function(t){var e=t.categories,n=t.categoryMap={},i=t.visual;if(tz(e,function(t,e){n[t]=e}),!ps(i)){var r=[];vs(i)?tz(i,function(t,e){var i=n[e];r[null!=i?i:-1]=t}):r[-1]=i,i=hz(t,r)}for(var o=e.length-1;o>=0;o--)null==i[o]&&(delete n[e[o]],e.pop())}(r):iz(r,!0):(Es("linear"!==n||r.dataExtent),iz(r))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return hs(this._normalizeData,this)},t.listVisualTypes=function(){return us(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){vs(t)?os(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,i){var r,o=ps(e)?[]:vs(e)?{}:(r=!0,null);return t.eachVisual(e,function(t,e){var a=n.call(i,t,e);r?o=a:o[e]=a}),o},t.retrieveVisuals=function(e){var n,i={};return e&&tz(t.visualHandlers,function(t,r){e.hasOwnProperty(r)&&(i[r]=e[r],n=!0)}),n?i:null},t.prepareVisualTypes=function(t){if(ps(t))t=t.slice();else{if(!ez(t))return[];var e=[];tz(t,function(t,n){e.push(n)}),t=e}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var i,r=1/0,o=0,a=e.length;o<a;o++){var s=e[o].value;if(null!=s){if(s===t||gs(s)&&s===t+"")return o;n&&h(s,o)}}for(o=0,a=e.length;o<a;o++){var l=e[o],c=l.interval,u=l.close;if(c){if(c[0]===-1/0){if(pz(u[1],t,c[1]))return o}else if(c[1]===1/0){if(pz(u[0],c[0],t))return o}else if(pz(u[0],c[0],t)&&pz(u[1],t,c[1]))return o;n&&h(c[0],o),n&&h(c[1],o)}}if(n)return t===1/0?e.length-1:t===-1/0?0:i;function h(e,n){var o=Math.abs(e-t);o<r&&(r=o,i=n)}},t.visualHandlers={color:{applyVisual:az("color"),getColorMapper:function(){var t=this.option;return hs("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),sz.call(this,t)}:function(e,n,i){var r=!!i;return!n&&(e=this._normalizeData(e)),i=Eu(e,t.parsedVisual,i),r?i:Nu(i,"rgba")},this)},_normalizedToVisual:{linear:function(t){return Nu(Eu(t,this.option.parsedVisual),"rgba")},category:sz,piecewise:function(t,e){var n=uz.call(this,e);return null==n&&(n=Nu(Eu(t,this.option.parsedVisual),"rgba")),n},fixed:lz}},colorHue:rz(function(t,e){return Ru(t,e)}),colorSaturation:rz(function(t,e){return Ru(t,null,e)}),colorLightness:rz(function(t,e){return Ru(t,null,null,e)}),colorAlpha:rz(function(t,e){return Bu(t,e)}),decal:{applyVisual:az("decal"),_normalizedToVisual:{linear:null,category:sz,piecewise:null,fixed:null}},opacity:{applyVisual:az("opacity"),_normalizedToVisual:cz([0,1])},liftZ:{applyVisual:az("liftZ"),_normalizedToVisual:{linear:lz,category:lz,piecewise:lz,fixed:lz}},symbol:{applyVisual:function(t,e,n){n("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:oz,category:sz,piecewise:function(t,e){var n=uz.call(this,e);return null==n&&(n=oz.call(this,t)),n},fixed:lz}},symbolSize:{applyVisual:az("symbolSize"),_normalizedToVisual:cz([0,1])}},t}();function iz(t,e){var n=t.visual,i=[];vs(n)?tz(n,function(t){i.push(t)}):null!=n&&i.push(n),e||1!==i.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(i[1]=i[0]),hz(t,i)}function rz(t){return{applyVisual:function(e,n,i){var r=this.mapValueToVisual(e);i("color",t(n("color"),r))},_normalizedToVisual:cz([0,1])}}function oz(t){var e=this.option.visual;return e[Math.round(Od(t,[0,1],[0,e.length-1],!0))]||{}}function az(t){return function(e,n,i){i(t,this.mapValueToVisual(e))}}function sz(t){var e=this.option.visual;return e[this.option.loop&&-1!==t?t%e.length:t]}function lz(){return this.option.visual[0]}function cz(t){return{linear:function(e){return Od(e,t,this.option.visual,!0)},category:sz,piecewise:function(e,n){var i=uz.call(this,n);return null==i&&(i=Od(e,t,this.option.visual,!0)),i},fixed:lz}}function uz(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var i=n[nz.findPieceIndex(t,n)];if(i&&i.visual)return i.visual[this.type]}}function hz(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=as(e,function(t){return Iu(t)||[0,0,0,1]})),e}var dz={linear:function(t){return Od(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=nz.findPieceIndex(t,e,!0);if(null!=n)return Od(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?-1:e},fixed:Gs};function pz(t,e,n){return t?e<=n:e<n}const fz=nz;var gz=xp();const mz={seriesType:"treemap",reset:function(t){var e=t.getData().tree.root;e.isRemoved()||yz(e,{},t.getViewRoot().getAncestors(),t)}};function yz(t,e,n,i){var r=t.getModel(),o=t.getLayout(),a=t.hostTree.data;if(o&&!o.invisible&&o.isInView){var s,l=r.getModel("itemStyle"),c=function(t,e,n){var i=Ja({},e),r=n.designatedVisualItemStyle;return os(["color","colorAlpha","colorSaturation"],function(n){r[n]=e[n];var o=t.get(n);r[n]=null,null!=o&&(i[n]=o)}),i}(l,e,i),u=a.ensureUniqueItemVisual(t.dataIndex,"style"),h=l.get("borderColor"),d=l.get("borderColorSaturation");null!=d&&(h=function(t,e){return null!=e?Ru(e,null,null,t):null}(d,s=vz(c))),u.stroke=h;var p=t.viewChildren;if(p&&p.length){var f=function(t,e,n,i,r,o){if(o&&o.length){var a=xz(e,"color")||null!=r.color&&"none"!==r.color&&(xz(e,"colorAlpha")||xz(e,"colorSaturation"));if(a){var s=e.get("visualMin"),l=e.get("visualMax"),c=n.dataExtent.slice();null!=s&&s<c[0]&&(c[0]=s),null!=l&&l>c[1]&&(c[1]=l);var u=e.get("colorMappingBy"),h={type:a.name,dataExtent:c,visual:a.range};"color"!==h.type||"index"!==u&&"id"!==u?h.mappingMethod="linear":(h.mappingMethod="category",h.loop=!0);var d=new fz(h);return gz(d).drColorMappingBy=u,d}}}(0,r,o,0,c,p);os(p,function(t,e){if(t.depth>=n.length||t===n[t.depth]){var o=function(t,e,n,i,r,o){var a=Ja({},e);if(r){var s=r.type,l="color"===s&&gz(r).drColorMappingBy,c="index"===l?i:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=r.mapValueToVisual(c)}return a}(r,c,t,e,f,i);yz(t,o,n,i)}})}else s=vz(c),u.fill=s}}function vz(t){var e=_z(t,"color");if(e){var n=_z(t,"colorAlpha"),i=_z(t,"colorSaturation");return i&&(e=Ru(e,null,null,i)),n&&(e=Bu(e,n)),e}}function _z(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function xz(t,e){var n=t.get(e);return ps(n)&&n.length?{name:e,range:n}:null}var bz=Math.max,wz=Math.min,Sz=Ts,Mz=os,Cz=["itemStyle","borderWidth"],Tz=["itemStyle","gapWidth"],Iz=["upperLabel","show"],Dz=["upperLabel","height"];const kz={seriesType:"treemap",reset:function(t,e,n,i){var r=n.getWidth(),o=n.getHeight(),a=t.option,s=Nv(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),l=a.size||[],c=Rd(Sz(s.width,l[0]),r),u=Rd(Sz(s.height,l[1]),o),h=i&&i.type,d=SN(i,["treemapZoomToNode","treemapRootToNode"],t),p="treemapRender"===h||"treemapMove"===h?i.rootRect:null,f=t.getViewRoot(),g=MN(f);if("treemapMove"!==h){var m="treemapZoomToNode"===h?function(t,e,n,i,r){var o,a=(e||{}).node,s=[i,r];if(!a||a===n)return s;for(var l=i*r,c=l*t.option.zoomToNodeRatio;o=a.parentNode;){for(var u=0,h=o.children,d=0,p=h.length;d<p;d++)u+=h[d].getValue();var f=a.getValue();if(0===f)return s;c*=u/f;var g=o.getModel(),m=g.get(Cz);(c+=4*m*m+(3*m+Math.max(m,Oz(g)))*Math.pow(c,.5))>Gd&&(c=Gd),a=o}c<l&&(c=l);var y=Math.pow(c/l,.5);return[i*y,r*y]}(t,d,f,c,u):p?[p.width,p.height]:[c,u],y=a.sort;y&&"asc"!==y&&"desc"!==y&&(y="desc");var v={squareRatio:a.squareRatio,sort:y,leafDepth:a.leafDepth};f.hostTree.clearLayouts();var _={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(_),Az(f,v,!1,0),_=f.getLayout(),Mz(g,function(t,e){var n=(g[e+1]||f).getValue();t.setLayout(Ja({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))})}var x=t.getData().tree.root;x.setLayout(function(t,e,n){if(e)return{x:e.x,y:e.y};var i={x:0,y:0};if(!n)return i;var r=n.node,o=r.getLayout();if(!o)return i;for(var a=[o.width/2,o.height/2],s=r;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:t.width/2-a[0],y:t.height/2-a[1]}}(s,p,d),!0),t.setLayoutInfo(s),Pz(x,new dc(-s.x,-s.y,r,o),g,f,0)}};function Az(t,e,n,i){var r,o;if(!t.isRemoved()){var a=t.getLayout();r=a.width,o=a.height;var s=t.getModel(),l=s.get(Cz),c=s.get(Tz)/2,u=Oz(s),h=Math.max(l,u),d=l-c,p=h-c;t.setLayout({borderWidth:l,upperHeight:h,upperLabelHeight:u},!0);var f=(r=bz(r-2*d,0))*(o=bz(o-d-p,0)),g=function(t,e,n,i,r,o){var a=t.children||[],s=i.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=i.leafDepth&&i.leafDepth<=o;if(r&&!l)return t.viewChildren=[];a=ls(a,function(t){return!t.isRemoved()}),function(t,e){e&&t.sort(function(t,n){var i="asc"===e?t.getValue()-n.getValue():n.getValue()-t.getValue();return 0===i?"asc"===e?t.dataIndex-n.dataIndex:n.dataIndex-t.dataIndex:i})}(a,s);var c=function(t,e,n){for(var i=0,r=0,o=e.length;r<o;r++)i+=e[r].getValue();var a,s=t.get("visualDimension");return e&&e.length?"value"===s&&n?(a=[e[e.length-1].getValue(),e[0].getValue()],"asc"===n&&a.reverse()):(a=[1/0,-1/0],Mz(e,function(t){var e=t.getValue(s);e<a[0]&&(a[0]=e),e>a[1]&&(a[1]=e)})):a=[NaN,NaN],{sum:i,dataExtent:a}}(e,a,s);if(0===c.sum)return t.viewChildren=[];if(c.sum=function(t,e,n,i,r){if(!i)return n;for(var o=t.get("visibleMin"),a=r.length,s=a,l=a-1;l>=0;l--){var c=r["asc"===i?a-l-1:l].getValue();c/n*e<o&&(s=l,n-=c)}return"asc"===i?r.splice(0,a-s):r.splice(s,a-s),n}(e,n,c.sum,s,a),0===c.sum)return t.viewChildren=[];for(var u=0,h=a.length;u<h;u++){var d=a[u].getValue()/c.sum*n;a[u].setLayout({area:d})}return l&&(a.length&&t.setLayout({isLeafRoot:!0},!0),a.length=0),t.viewChildren=a,t.setLayout({dataExtent:c.dataExtent},!0),a}(t,s,f,e,n,i);if(g.length){var m={x:d,y:p,width:r,height:o},y=wz(r,o),v=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var S=Ez(_,y,e.squareRatio);S<=v?(x++,v=S):(_.area-=_.pop().getLayout().area,Lz(_,y,m,c,!1),y=wz(m.width,m.height),_.length=_.area=0,v=1/0)}if(_.length&&Lz(_,y,m,c,!0),!n){var M=s.get("childrenVisibleMin");null!=M&&f<M&&(n=!0)}for(x=0,b=g.length;x<b;x++)Az(g[x],e,n,i+1)}}}function Ez(t,e,n){for(var i=0,r=1/0,o=0,a=void 0,s=t.length;o<s;o++)(a=t[o].getLayout().area)&&(a<r&&(r=a),a>i&&(i=a));var l=t.area*t.area,c=e*e*n;return l?bz(c*i/l,l/(c*r)):1/0}function Lz(t,e,n,i,r){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],c=n[s[o]],u=e?t.area/e:0;(r||u>n[l[a]])&&(u=n[l[a]]);for(var h=0,d=t.length;h<d;h++){var p=t[h],f={},g=u?p.getLayout().area/u:0,m=f[l[a]]=bz(u-2*i,0),y=n[s[o]]+n[l[o]]-c,v=h===d-1||y<g?y:g,_=f[l[o]]=bz(v-2*i,0);f[s[a]]=n[s[a]]+wz(i,m/2),f[s[o]]=c+wz(i,_/2),c+=v,p.setLayout(f,!0)}n[s[a]]+=u,n[l[a]]-=u}function Pz(t,e,n,i,r){var o=t.getLayout(),a=n[r],s=a&&a===t;if(!(a&&!s||r===n.length&&t!==i)){t.setLayout({isInView:!0,invisible:!s&&!e.intersect(o),isAboveViewRoot:s},!0);var l=new dc(e.x-o.x,e.y-o.y,e.width,e.height);Mz(t.viewChildren||[],function(t){Pz(t,l,n,i,r+1)})}}function Oz(t){return t.get(Iz)?t.get(Dz):0}function Rz(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.eachSeriesByType("graph",function(t){var n=t.getCategoriesData(),i=t.getGraph().data,r=n.mapArray(n.getName);i.filterSelf(function(t){var n=i.getItemModel(t).getShallow("category");if(null!=n){ys(n)&&(n=r[n]);for(var o=0;o<e.length;o++)if(!e[o].isSelected(n))return!1}return!0})})}function Bz(t){var e={};t.eachSeriesByType("graph",function(t){var n=t.getCategoriesData(),i=t.getData(),r={};n.each(function(i){var o=n.getName(i);r["ec-"+o]=i;var a=n.getItemModel(i),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=t.getColorFromPalette(o,e)),n.setItemVisual(i,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],c=0;c<l.length;c++){var u=a.getShallow(l[c],!0);null!=u&&n.setItemVisual(i,l[c],u)}}),n.count()&&i.each(function(t){var e=i.getItemModel(t).getShallow("category");if(null!=e){gs(e)&&(e=r["ec-"+e]);var o=n.getItemVisual(e,"style");Ja(i.ensureUniqueItemVisual(t,"style"),o);for(var a=["symbol","symbolSize","symbolKeepAspect"],s=0;s<a.length;s++)i.setItemVisual(t,a[s],n.getItemVisual(e,a[s]))}})})}function Nz(t){return t instanceof Array||(t=[t,t]),t}function zz(t){t.eachSeriesByType("graph",function(t){var e=t.getGraph(),n=t.getEdgeData(),i=Nz(t.get("edgeSymbol")),r=Nz(t.get("edgeSymbolSize"));n.setVisual("fromSymbol",i&&i[0]),n.setVisual("toSymbol",i&&i[1]),n.setVisual("fromSymbolSize",r&&r[0]),n.setVisual("toSymbolSize",r&&r[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each(function(t){var i=n.getItemModel(t),r=e.getEdgeByIndex(t),o=Nz(i.getShallow("symbol",!0)),a=Nz(i.getShallow("symbolSize",!0)),s=i.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(t,"style");switch(Ja(l,s),l.stroke){case"source":var c=r.node1.getVisual("style");l.stroke=c&&c.fill;break;case"target":c=r.node2.getVisual("style"),l.stroke=c&&c.fill}o[0]&&r.setVisual("fromSymbol",o[0]),o[1]&&r.setVisual("toSymbol",o[1]),a[0]&&r.setVisual("fromSymbolSize",a[0]),a[1]&&r.setVisual("toSymbolSize",a[1])})})}var Fz="--\x3e",Vz=function(t){return t.get("autoCurveness")||null},Hz=function(t,e){var n=Vz(t),i=20,r=[];if(ys(n))i=n;else if(ps(n))return void(t.__curvenessList=n);e>i&&(i=e);var o=i%2?i+2:i+3;r=[];for(var a=0;a<o;a++)r.push((a%2?a+1:a)/10*(a%2?-1:1));t.__curvenessList=r},jz=function(t,e,n){var i=[t.id,t.dataIndex].join("."),r=[e.id,e.dataIndex].join(".");return[n.uid,i,r].join(Fz)},Wz=function(t){var e=t.split(Fz);return[e[0],e[2],e[1]].join(Fz)},Gz=function(t,e){var n=e.__edgeMap;return n[t]?n[t].length:0};function Uz(t,e,n,i){var r=Vz(e),o=ps(r);if(!r)return null;var a=function(t,e){var n=jz(t.node1,t.node2,e);return e.__edgeMap[n]}(t,e);if(!a)return null;for(var s=-1,l=0;l<a.length;l++)if(a[l]===n){s=l;break}var c=function(t,e){return Gz(jz(t.node1,t.node2,e),e)+Gz(jz(t.node2,t.node1,e),e)}(t,e);Hz(e,c),t.lineStyle=t.lineStyle||{};var u=jz(t.node1,t.node2,e),h=e.__curvenessList,d=o||c%2?0:1;if(a.isForward)return h[d+s];var p=Wz(u),f=Gz(p,e),g=h[s+f+d];return i?o?r&&0===r[0]?(f+d)%2?g:-g:((f%2?0:1)+d)%2?g:-g:(f+d)%2?g:-g:h[s+f+d]}function qz(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=t.getGraph();n.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),Yz(n,t)}}function Yz(t,e){t.eachEdge(function(t,n){var i=Ds(t.getModel().get(["lineStyle","curveness"]),-Uz(t,e,n,!0),0),r=Xs(t.node1.getLayout()),o=Xs(t.node2.getLayout()),a=[r,o];+i&&a.push([(r[0]+o[0])/2-(r[1]-o[1])*i,(r[1]+o[1])/2-(o[0]-r[0])*i]),t.setLayout(a)})}function Xz(t,e){t.eachSeriesByType("graph",function(t){var e=t.get("layout"),n=t.coordinateSystem;if(n&&"view"!==n.type){var i=t.getData(),r=[];os(n.dimensions,function(t){r=r.concat(i.mapDimensionsAll(t))});for(var o=0;o<i.count();o++){for(var a=[],s=!1,l=0;l<r.length;l++){var c=i.get(r[l],o);isNaN(c)||(s=!0),a.push(c)}s?i.setItemLayout(o,n.dataToPoint(a)):i.setItemLayout(o,[NaN,NaN])}Yz(i.graph,t)}else e&&"none"!==e||qz(t)})}function $z(t){var e=t.coordinateSystem;if("view"!==e.type)return 1;var n=t.option.nodeScaleRatio,i=e.scaleX;return((e.getZoom()-1)*n+1)/i}function Zz(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var Kz=Math.PI,Jz=[];function Qz(t,e,n,i){var r=t.coordinateSystem;if(!r||"view"===r.type){var o=r.getBoundingRect(),a=t.getData(),s=a.graph,l=o.width/2+o.x,c=o.height/2+o.y,u=Math.min(o.width,o.height)/2,h=a.count();if(a.setLayout({cx:l,cy:c}),h){if(n){var d=r.pointToData(i),p=d[0],f=d[1],g=[p-l,f-c];sl(g,g),al(g,g,u),n.setLayout([l+g[0],c+g[1]],!0),eF(n,t.get(["circular","rotateLabel"]),l,c)}tF[e](t,s,a,u,l,c,h),s.eachEdge(function(e,n){var i,r=Ds(e.getModel().get(["lineStyle","curveness"]),Uz(e,t,n),0),o=Xs(e.node1.getLayout()),a=Xs(e.node2.getLayout()),s=(o[0]+a[0])/2,u=(o[1]+a[1])/2;+r&&(i=[l*(r*=3)+s*(1-r),c*r+u*(1-r)]),e.setLayout([o,a,i])})}}}var tF={value:function(t,e,n,i,r,o,a){var s=0,l=n.getSum("value"),c=2*Math.PI/(l||a);e.eachNode(function(t){var e=t.getValue("value"),n=c*(l?e:1)/2;s+=n,t.setLayout([i*Math.cos(s)+r,i*Math.sin(s)+o]),s+=n})},symbolSize:function(t,e,n,i,r,o,a){var s=0;Jz.length=a;var l=$z(t);e.eachNode(function(t){var e=Zz(t);isNaN(e)&&(e=2),e<0&&(e=0),e*=l;var n=Math.asin(e/2/i);isNaN(n)&&(n=Kz/2),Jz[t.dataIndex]=n,s+=2*n});var c=(2*Kz-s)/a/2,u=0;e.eachNode(function(t){var e=c+Jz[t.dataIndex];u+=e,(!t.getLayout()||!t.getLayout().fixed)&&t.setLayout([i*Math.cos(u)+r,i*Math.sin(u)+o]),u+=e})}};function eF(t,e,n,i){var r=t.getGraphicEl();if(r){var o=t.getModel().get(["label","rotate"])||0,a=r.getSymbolPath();if(e){var s=t.getLayout(),l=Math.atan2(s[1]-i,s[0]-n);l<0&&(l=2*Math.PI+l);var c=s[0]<n;c&&(l-=Math.PI);var u=c?"left":"right";a.setTextConfig({rotation:-l,position:u,origin:"center"});var h=a.ensureState("emphasis");Ja(h.textConfig||(h.textConfig={}),{position:u})}else a.setTextConfig({rotation:o*=Math.PI/180})}}function nF(t){t.eachSeriesByType("graph",function(t){"circular"===t.get("layout")&&Qz(t,"symbolSize")})}var iF=Ks;function rF(t){t.eachSeriesByType("graph",function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var n=t.preservedPoints||{},i=t.getGraph(),r=i.data,o=i.edgeData,a=t.getModel("force"),s=a.get("initLayout");t.preservedPoints?r.each(function(t){var e=r.getId(t);r.setItemLayout(t,n[e]||[NaN,NaN])}):s&&"none"!==s?"circular"===s&&Qz(t,"value"):qz(t);var l=r.getDataExtent("value"),c=o.getDataExtent("value"),u=a.get("repulsion"),h=a.get("edgeLength"),d=ps(u)?u:[u,u],p=ps(h)?h:[h,h];p=[p[1],p[0]];var f=r.mapArray("value",function(t,e){var n=r.getItemLayout(e),i=Od(t,l,d);return isNaN(i)&&(i=(d[0]+d[1])/2),{w:i,rep:i,fixed:r.getItemModel(e).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}}),g=o.mapArray("value",function(e,n){var r=i.getEdgeByIndex(n),o=Od(e,c,p);isNaN(o)&&(o=(p[0]+p[1])/2);var a=r.getModel(),s=Ds(r.getModel().get(["lineStyle","curveness"]),-Uz(r,t,n,!0),0);return{n1:f[r.node1.dataIndex],n2:f[r.node2.dataIndex],d:o,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}}),m=e.getBoundingRect(),y=function(t,e,n){for(var i=t,r=e,o=n.rect,a=o.width,s=o.height,l=[o.x+a/2,o.y+s/2],c=null==n.gravity?.1:n.gravity,u=0;u<i.length;u++){var h=i[u];h.p||(h.p=qs(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),h.pp=Xs(h.p),h.edges=null}var d,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(t){i[t].fixed=!0},setUnfixed:function(t){i[t].fixed=!1},beforeStep:function(t){d=t},afterStep:function(t){p=t},step:function(t){d&&d(i,r);for(var e=[],n=i.length,o=0;o<r.length;o++){var a=r[o];if(!a.ignoreForceLayout){var s=a.n1;Js(e,(m=a.n2).p,s.p);var u=Qs(e)-a.d,h=m.w/(s.w+m.w);isNaN(h)&&(h=0),sl(e,e),!s.fixed&&iF(s.p,s.p,e,h*u*g),!m.fixed&&iF(m.p,m.p,e,-(1-h)*u*g)}}for(o=0;o<n;o++)(_=i[o]).fixed||(Js(e,l,_.p),iF(_.p,_.p,e,c*g));for(o=0;o<n;o++){s=i[o];for(var f=o+1;f<n;f++){var m;Js(e,(m=i[f]).p,s.p),0===(u=Qs(e))&&($s(e,Math.random()-.5,Math.random()-.5),u=1);var y=(s.rep+m.rep)/u/u;!s.fixed&&iF(s.pp,s.pp,e,y),!m.fixed&&iF(m.pp,m.pp,e,-y)}}var v=[];for(o=0;o<n;o++){var _;(_=i[o]).fixed||(Js(v,_.p,_.pp),iF(_.p,_.p,v,g),Ys(_.pp,_.p))}var x=(g*=.992)<.01;p&&p(i,r,x),t&&t(x)}}}(f,g,{rect:m,gravity:a.get("gravity"),friction:a.get("friction")});y.beforeStep(function(t,e){for(var n=0,r=t.length;n<r;n++)t[n].fixed&&Ys(t[n].p,i.getNodeByIndex(n).getLayout())}),y.afterStep(function(t,e,o){for(var a=0,s=t.length;a<s;a++)t[a].fixed||i.getNodeByIndex(a).setLayout(t[a].p),n[r.getId(a)]=t[a].p;for(a=0,s=e.length;a<s;a++){var l=e[a],c=i.getEdgeByIndex(a),u=l.n1.p,h=l.n2.p,d=c.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],Ys(d[0],u),Ys(d[1],h),+l.curveness&&(d[2]=[(u[0]+h[0])/2-(u[1]-h[1])*l.curveness,(u[1]+h[1])/2-(h[0]-u[0])*l.curveness]),c.setLayout(d)}}),t.forceLayout=y,t.preservedPoints=n,y.step()}else t.forceLayout=null})}function oF(t,e){var n=[];return t.eachSeriesByType("graph",function(t){var i=t.get("coordinateSystem");if(!i||"view"===i){var r=t.getData(),o=[],a=[];Mf(r.mapArray(function(t){var e=r.getItemModel(t);return[+e.get("x"),+e.get("y")]}),o,a),a[0]-o[0]===0&&(a[0]+=1,o[0]-=1),a[1]-o[1]===0&&(a[1]+=1,o[1]-=1);var s=(a[0]-o[0])/(a[1]-o[1]),l=function(t,e,n){return Nv(Ja(t.getBoxLayoutParams(),{aspect:n}),{width:e.getWidth(),height:e.getHeight()})}(t,e,s);isNaN(s)&&(o=[l.x,l.y],a=[l.x+l.width,l.y+l.height]);var c=a[0]-o[0],u=a[1]-o[1],h=l.width,d=l.height,p=t.coordinateSystem=new kB;p.zoomLimit=t.get("scaleLimit"),p.setBoundingRect(o[0],o[1],c,u),p.setViewRect(l.x,l.y,h,d),p.setCenter(t.get("center"),e),p.setZoom(t.get("zoom")),n.push(p)}}),n}var aF,sF=Uw.prototype,lF=Zw.prototype,cF=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function uF(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}Ma(function(){return null!==aF&&aF.apply(this,arguments)||this},aF=cF);var hF=function(t){function e(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return Ma(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new cF},e.prototype.buildPath=function(t,e){uF(e)?sF.buildPath.call(this,t,e):lF.buildPath.call(this,t,e)},e.prototype.pointAt=function(t){return uF(this.shape)?sF.pointAt.call(this,t):lF.pointAt.call(this,t)},e.prototype.tangentAt=function(t){var e=this.shape,n=uF(e)?[e.x2-e.x1,e.y2-e.y1]:lF.tangentAt.call(this,t);return sl(n,n)},e}(vg);const dF=hF;var pF=["fromSymbol","toSymbol"];function fF(t){return"_"+t+"Type"}function gF(t,e,n){var i=e.getItemVisual(n,t);if(!i||"none"===i)return i;var r=e.getItemVisual(n,t+"Size"),o=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=dC(r);return i+l+pC(a||0,l)+(o||"")+(s||"")}function mF(t,e,n){var i=e.getItemVisual(n,t);if(i&&"none"!==i){var r=e.getItemVisual(n,t+"Size"),o=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=dC(r),c=pC(a||0,l),u=hC(i,-l[0]/2+c[0],-l[1]/2+c[1],l[0],l[1],null,s);return u.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,u.name=t,u}}function yF(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}var vF=function(t){function e(e,n,i){var r=t.call(this)||this;return r._createLine(e,n,i),r}return Ma(e,t),e.prototype._createLine=function(t,e,n){var i=t.hostModel,r=function(t){var e=new dF({name:"line",subPixelOptimize:!0});return yF(e.shape,t),e}(t.getItemLayout(e));r.shape.percent=0,Qm(r,{shape:{percent:1}},i,e),this.add(r),os(pF,function(n){var i=mF(n,t,e);this.add(i),this[fF(n)]=gF(n,t,e)},this),this._updateCommonStl(t,e,n)},e.prototype.updateData=function(t,e,n){var i=t.hostModel,r=this.childOfName("line"),o=t.getItemLayout(e),a={shape:{}};yF(a.shape,o),Jm(r,a,i,e),os(pF,function(n){var i=gF(n,t,e),r=fF(n);if(this[r]!==i){this.remove(this.childOfName(n));var o=mF(n,t,e);this.add(o)}this[r]=i},this),this._updateCommonStl(t,e,n)},e.prototype.getLinePath=function(){return this.childAt(0)},e.prototype._updateCommonStl=function(t,e,n){var i=t.hostModel,r=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,c=n&&n.emphasisDisabled,u=n&&n.focus,h=n&&n.blurScope;if(!n||t.hasItemOption){var d=t.getItemModel(e),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),c=p.get("disabled"),u=p.get("focus"),h=p.get("blurScope"),l=cy(d)}var f=t.getItemVisual(e,"style"),g=f.stroke;r.useStyle(f),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,r.ensureState("blur").style=a,r.ensureState("select").style=s,os(pF,function(t){var e=this.childOfName(t);if(e){e.setColor(g),e.style.opacity=f.opacity;for(var n=0;n<nm.length;n++){var i=nm[n],o=r.getState(i);if(o){var a=o.style||{},s=e.ensureState(i),l=s.style||(s.style={});null!=a.stroke&&(l[e.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}e.markRedraw()}},this);var m=i.getRawValue(e);ly(this,l,{labelDataIndex:e,labelFetcher:{getFormattedLabel:function(e,n){return i.getFormattedLabel(e,n,t.dataType)}},inheritColor:g||"#000",defaultOpacity:f.opacity,defaultText:(null==m?t.getName(e):isFinite(m)?Bd(m):m)+""});var y=this.getTextContent();if(y){var v=l.normal;y.__align=y.style.align,y.__verticalAlign=y.style.verticalAlign,y.__position=v.get("position")||"middle";var _=v.get("distance");ps(_)||(_=[_,_]),y.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),Vm(this,u,h,c)},e.prototype.highlight=function(){Tm(this)},e.prototype.downplay=function(){Im(this)},e.prototype.updateLayout=function(t,e){this.setLinePoints(t.getItemLayout(e))},e.prototype.setLinePoints=function(t){var e=this.childOfName("line");yF(e.shape,t),e.dirty()},e.prototype.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),i=t.getTextContent();if(e||n||i&&!i.ignore){for(var r=1,o=this.parent;o;)o.scaleX&&(r/=o.scaleX),o=o.parent;var a=t.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),c=a.pointAt(s),u=Js([],c,l);if(sl(u,u),e&&(e.setPosition(l),S(e,0),e.scaleX=e.scaleY=r*s,e.markRedraw()),n&&(n.setPosition(c),S(n,1),n.scaleX=n.scaleY=r*s,n.markRedraw()),i&&!i.ignore){i.x=i.y=0,i.originX=i.originY=0;var h=void 0,d=void 0,p=i.__labelDistance,f=p[0]*r,g=p[1]*r,m=s/2,y=a.tangentAt(m),v=[y[1],-y[0]],_=a.pointAt(m);v[1]>0&&(v[0]=-v[0],v[1]=-v[1]);var x=y[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var b=-Math.atan2(y[1],y[0]);c[0]<l[0]&&(b=Math.PI+b),i.rotation=b}var w=void 0;switch(i.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-g,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=g,d="top";break;default:w=0,d="middle"}switch(i.__position){case"end":i.x=u[0]*f+c[0],i.y=u[1]*g+c[1],h=u[0]>.8?"left":u[0]<-.8?"right":"center",d=u[1]>.8?"top":u[1]<-.8?"bottom":"middle";break;case"start":i.x=-u[0]*f+l[0],i.y=-u[1]*g+l[1],h=u[0]>.8?"right":u[0]<-.8?"left":"center",d=u[1]>.8?"bottom":u[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":i.x=f*x+l[0],i.y=l[1]+w,h=y[0]<0?"right":"left",i.originX=-f*x,i.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":i.x=_[0],i.y=_[1]+w,h="center",i.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":i.x=-f*x+c[0],i.y=c[1]+w,h=y[0]>=0?"right":"left",i.originX=f*x,i.originY=-w}i.scaleX=i.scaleY=r,i.setStyle({verticalAlign:i.__verticalAlign||d,align:i.__align||h})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var i=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(i[1],i[0]))}else t.attr("rotation",n)}},e}(_d);const _F=vF;function xF(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:cy(e)}}function bF(t){return isNaN(t[0])||isNaN(t[1])}function wF(t){return t&&!bF(t[0])&&!bF(t[1])}const SF=function(){function t(t){this.group=new _d,this._LineCtor=t||_F}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,i=n.group,r=n._lineData;n._lineData=t,r||i.removeAll();var o=xF(t);t.diff(r).add(function(n){e._doAdd(t,n,o)}).update(function(n,i){e._doUpdate(r,t,i,n,o)}).remove(function(t){i.remove(r.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=xF(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e){function n(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}this._progressiveEls=[];for(var i=t.start;i<t.end;i++)if(wF(e.getItemLayout(i))){var r=new this._LineCtor(e,i,this._seriesScope);r.traverse(n),this.group.add(r),e.setItemGraphicEl(i,r),this._progressiveEls.push(r)}},t.prototype.remove=function(){this.group.removeAll()},t.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},t.prototype._doAdd=function(t,e,n){if(wF(t.getItemLayout(e))){var i=new this._LineCtor(t,e,n);t.setItemGraphicEl(e,i),this.group.add(i)}},t.prototype._doUpdate=function(t,e,n,i,r){var o=t.getItemGraphicEl(n);wF(e.getItemLayout(i))?(o?o.updateData(e,i,r):o=new this._LineCtor(e,i,r),e.setItemGraphicEl(i,o),this.group.add(o)):this.group.remove(o)},t}();var MF=[],CF=[],TF=[],IF=nu,DF=hl,kF=Math.abs;function AF(t,e,n){for(var i,r=t[0],o=t[1],a=t[2],s=1/0,l=n*n,c=.1,u=.1;u<=.9;u+=.1)MF[0]=IF(r[0],o[0],a[0],u),MF[1]=IF(r[1],o[1],a[1],u),(p=kF(DF(MF,e)-l))<s&&(s=p,i=u);for(var h=0;h<32;h++){var d=i+c;CF[0]=IF(r[0],o[0],a[0],i),CF[1]=IF(r[1],o[1],a[1],i),TF[0]=IF(r[0],o[0],a[0],d),TF[1]=IF(r[1],o[1],a[1],d);var p=DF(CF,e)-l;if(kF(p)<.01)break;var f=DF(TF,e)-l;c/=2,p<0?f>=0?i+=c:i-=c:f>=0?i-=c:i+=c}return i}function EF(t,e){var n=[],i=ou,r=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),c=t.getVisual("fromSymbol"),u=t.getVisual("toSymbol");l.__original||(l.__original=[Xs(l[0]),Xs(l[1])],l[2]&&l.__original.push(Xs(l[2])));var h=l.__original;if(null!=l[2]){if(Ys(r[0],h[0]),Ys(r[1],h[2]),Ys(r[2],h[1]),c&&"none"!==c){var d=Zz(t.node1),p=AF(r,h[0],d*e);i(r[0][0],r[1][0],r[2][0],p,n),r[0][0]=n[3],r[1][0]=n[4],i(r[0][1],r[1][1],r[2][1],p,n),r[0][1]=n[3],r[1][1]=n[4]}u&&"none"!==u&&(d=Zz(t.node2),p=AF(r,h[1],d*e),i(r[0][0],r[1][0],r[2][0],p,n),r[1][0]=n[1],r[2][0]=n[2],i(r[0][1],r[1][1],r[2][1],p,n),r[1][1]=n[1],r[2][1]=n[2]),Ys(l[0],r[0]),Ys(l[1],r[2]),Ys(l[2],r[1])}else Ys(o[0],h[0]),Ys(o[1],h[1]),Js(a,o[1],o[0]),sl(a,a),c&&"none"!==c&&(d=Zz(t.node1),Ks(o[0],o[0],a,d*e)),u&&"none"!==u&&(d=Zz(t.node2),Ks(o[1],o[1],a,-d*e)),Ys(l[0],o[0]),Ys(l[1],o[1])})}function LF(t){return"view"===t.type}var PF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(t,e){var n=new yL,i=new SF,r=this.group;this._controller=new vR(e.getZr()),this._controllerHost={target:r},r.add(n.group),r.add(i.group),this._symbolDraw=n,this._lineDraw=i,this._firstRender=!0},e.prototype.render=function(t,e,n){var i=this,r=t.coordinateSystem;this._model=t;var o=this._symbolDraw,a=this._lineDraw,s=this.group;if(LF(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):Jm(s,l,t)}EF(t.getGraph(),$z(t));var c=t.getData();o.updateData(c);var u=t.getEdgeData();a.updateData(u),this._updateNodeAndLinkScale(),this._updateController(t,e,n),clearTimeout(this._layoutTimeout);var h=t.forceLayout,d=t.get(["force","layoutAnimation"]);h&&this._startForceLayoutIteration(h,d);var p=t.get("layout");c.graph.eachNode(function(e){var n=e.dataIndex,r=e.getGraphicEl(),o=e.getModel();if(r){r.off("drag").off("dragend");var a=o.get("draggable");a&&r.on("drag",function(o){switch(p){case"force":h.warmUp(),!i._layouting&&i._startForceLayoutIteration(h,d),h.setFixed(n),c.setItemLayout(n,[r.x,r.y]);break;case"circular":c.setItemLayout(n,[r.x,r.y]),e.setLayout({fixed:!0},!0),Qz(t,"symbolSize",e,[o.offsetX,o.offsetY]),i.updateLayout(t);break;default:c.setItemLayout(n,[r.x,r.y]),Yz(t.getGraph(),t),i.updateLayout(t)}}).on("dragend",function(){h&&h.setUnfixed(n)}),r.setDraggable(a,!!o.get("cursor")),"adjacency"===o.get(["emphasis","focus"])&&(Zg(r).focus=e.getAdjacentDataIndices())}}),c.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&(Zg(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var f="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),g=c.getLayout("cx"),m=c.getLayout("cy");c.graph.eachNode(function(t){eF(t,f,g,m)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,e){var n=this;!function i(){t.step(function(t){n.updateLayout(n._model),(n._layouting=!t)&&(e?n._layoutTimeout=setTimeout(i,16):i())})}()},e.prototype._updateController=function(t,e,n){var i=this,r=this._controller,o=this._controllerHost,a=this.group;r.setPointerChecker(function(e,i,r){var o=a.getBoundingRect();return o.applyTransform(a.transform),o.contain(i,r)&&!SR(e,n,t)}),LF(t.coordinateSystem)?(r.enable(t.get("roam")),o.zoomLimit=t.get("scaleLimit"),o.zoom=t.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",function(e){_R(o,e.dx,e.dy),n.dispatchAction({seriesId:t.id,type:"graphRoam",dx:e.dx,dy:e.dy})}).on("zoom",function(e){xR(o,e.scale,e.originX,e.originY),n.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:e.scale,originX:e.originX,originY:e.originY}),i._updateNodeAndLinkScale(),EF(t.getGraph(),$z(t)),i._lineDraw.updateLayout(),n.updateLabelLayout()})):r.disable()},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=$z(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},e.prototype.updateLayout=function(t){EF(t.getGraph(),$z(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(eM);const OF=PF;function RF(t){return"_EC_"+t}var BF=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[RF(t)]){var i=new NF(t,e);return i.hostGraph=this,this.nodes.push(i),n[RF(t)]=i,i}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[RF(t)]},t.prototype.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if(ys(t)&&(t=this.nodes[t]),ys(e)&&(e=this.nodes[e]),t instanceof NF||(t=i[RF(t)]),e instanceof NF||(e=i[RF(e)]),t&&e){var o=t.id+"-"+e.id,a=new zF(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),r[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof NF&&(t=t.id),e instanceof NF&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&t.call(e,n[r],r)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},t.prototype.breadthFirstTraverse=function(t,e,n,i){if(e instanceof NF||(e=this._nodesMap[RF(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(i,e,null))for(var a=[e];a.length;){var s=a.shift(),l=s[r];for(o=0;o<l.length;o++){var c=l[o],u=c.node1===s?c.node2:c.node1;if(!u.__visited){if(t.call(i,u,s))return;a.push(u),u.__visited=!0}}}}},t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,i=this.edges,r=0,o=n.length;r<o;r++)n[r].dataIndex=-1;for(r=0,o=t.count();r<o;r++)n[t.getRawIndex(r)].dataIndex=r;for(e.filterSelf(function(t){var n=i[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0}),r=0,o=i.length;r<o;r++)i[r].dataIndex=-1;for(r=0,o=e.count();r<o;r++)i[e.getRawIndex(r)].dataIndex=r},t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,i=this.edges,r=0;r<n.length;r++)e.addNode(n[r].id,n[r].dataIndex);for(r=0;r<i.length;r++){var o=i[r];e.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return e},t}(),NF=function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}return t.prototype.degree=function(){return this.edges.length},t.prototype.inDegree=function(){return this.inEdges.length},t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=Fs(),e=Fs(),n=0;n<this.edges.length;n++){var i=this.edges[n];if(!(i.dataIndex<0)){t.set(i.dataIndex,!0);for(var r=[i.node1],o=[i.node2],a=0;a<r.length;){var s=r[a];a++,e.set(s.dataIndex,!0);for(var l=0;l<s.inEdges.length;l++)t.set(s.inEdges[l].dataIndex,!0),r.push(s.inEdges[l].node1)}for(a=0;a<o.length;){var c=o[a];for(a++,e.set(c.dataIndex,!0),l=0;l<c.outEdges.length;l++)t.set(c.outEdges[l].dataIndex,!0),o.push(c.outEdges[l].node2)}}}return{edge:t.keys(),node:e.keys()}},t}(),zF=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=Fs(),e=Fs();t.set(this.dataIndex,!0);for(var n=[this.node1],i=[this.node2],r=0;r<n.length;){var o=n[r];r++,e.set(o.dataIndex,!0);for(var a=0;a<o.inEdges.length;a++)t.set(o.inEdges[a].dataIndex,!0),n.push(o.inEdges[a].node1)}for(r=0;r<i.length;){var s=i[r];for(r++,e.set(s.dataIndex,!0),a=0;a<s.outEdges.length;a++)t.set(s.outEdges[a].dataIndex,!0),i.push(s.outEdges[a].node2)}return{edge:t.keys(),node:e.keys()}},t}();function FF(t,e){return{getValue:function(n){var i=this[t][e];return i.getStore().get(i.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}is(NF,FF("hostGraph","data")),is(zF,FF("hostGraph","edgeData"));const VF=BF;function HF(t,e,n,i,r){for(var o=new VF(i),a=0;a<t.length;a++)o.addNode(Ts(t[a].id,t[a].name,a),a);var s=[],l=[],c=0;for(a=0;a<e.length;a++){var u=e[a],h=u.source,d=u.target;o.addEdge(h,d,c)&&(l.push(u),s.push(Ts(mp(u.id,null),h+" > "+d)),c++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=aD(t,n);else{var g=A_.get(f),m=g&&g.dimensions||[];es(m,"value")<0&&m.concat(["value"]);var y=JI(t,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(p=new ZI(y,n)).initData(t)}var v=new ZI(["value"],n);return v.initData(l,s),r&&r(p,v),_N({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:v},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var jF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ma(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new NP(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),cp(e,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,e){var n,i=t.edges||t.links||[],r=t.data||t.nodes||[],o=this;if(r&&i){Vz(n=this)&&(n.__curvenessList=[],n.__edgeMap={},Hz(n));var a=HF(r,i,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var n=Oy.prototype.getModel;function i(t,e){var i=n.call(this,t,e);return i.resolveParentPath=r,i}function r(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=r,t.getModel=i,t})});return os(a.edges,function(t){!function(t,e,n,i){if(Vz(n)){var r=jz(t,e,n),o=n.__edgeMap,a=o[Wz(r)];o[r]&&!a?o[r].isForward=!0:a&&o[r]&&(a.isForward=!0,o[r].isForward=!1),o[r]=o[r]||[],o[r].push(i)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,e,n){if("edge"===n){var i=this.getData(),r=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),yb("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return kb({series:this,dataIndex:t,multipleSeries:e})},e.prototype._updateCategoriesData=function(){var t=as(this.option.categories||[],function(t){return null!=t.value?t:Ja({value:0},t)}),e=new ZI(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Hb);const WF=jF;var GF={type:"graphRoam",event:"graphRoam",update:"none"},UF=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},qF=function(t){function e(e){var n=t.call(this,e)||this;return n.type="pointer",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new UF},e.prototype.buildPath=function(t,e){var n=Math.cos,i=Math.sin,r=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=r/3?1:2),l=e.y-i(a)*o*(o>=r/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+i(a)*o),t.lineTo(e.x+n(e.angle)*r,e.y+i(e.angle)*r),t.lineTo(e.x-n(a)*o,e.y-i(a)*o),t.lineTo(s,l)},e}(vg);const YF=qF;function XF(t,e){var n=null==t?"":t+"";return e&&(gs(e)?n=e.replace("{value}",n):fs(e)&&(n=e(t))),n}var $F=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){this.group.removeAll();var i=t.get(["axisLine","lineStyle","color"]),r=function(t,e){var n=t.get("center"),i=e.getWidth(),r=e.getHeight(),o=Math.min(i,r);return{cx:Rd(n[0],e.getWidth()),cy:Rd(n[1],e.getHeight()),r:Rd(t.get("radius"),o/2)}}(t,n);this._renderMain(t,e,n,i,r),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,e,n,i,r){var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,c=t.getModel("axisLine"),u=c.get("roundCap")?JL:Ew,h=c.get("show"),d=c.getModel("lineStyle"),p=d.get("width"),f=[s,l];Xf(f,!a);for(var g=(l=f[1])-(s=f[0]),m=s,y=[],v=0;h&&v<i.length;v++){var _=new u({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(i[v][0],0),1),cx:r.cx,cy:r.cy,clockwise:a,r0:r.r-p,r:r.r},silent:!0});_.setStyle({fill:i[v][1]}),_.setStyle(d.getLineStyle(["color","width"])),y.push(_),m=l}y.reverse(),os(y,function(t){return o.add(t)});var x=function(t){if(t<=0)return i[0][1];var e;for(e=0;e<i.length;e++)if(i[e][0]>=t&&(0===e?0:i[e-1][0])<t)return i[e][1];return i[e-1][1]};this._renderTicks(t,e,n,x,r,s,l,a,p),this._renderTitleAndDetail(t,e,n,x,r),this._renderAnchor(t,r),this._renderPointer(t,e,n,x,r,s,l,a,p)},e.prototype._renderTicks=function(t,e,n,i,r,o,a,s,l){for(var c,u,h=this.group,d=r.cx,p=r.cy,f=r.r,g=+t.get("min"),m=+t.get("max"),y=t.getModel("splitLine"),v=t.getModel("axisTick"),_=t.getModel("axisLabel"),x=t.get("splitNumber"),b=v.get("splitNumber"),w=Rd(y.get("length"),f),S=Rd(v.get("length"),f),M=o,C=(a-o)/x,T=C/b,I=y.getModel("lineStyle").getLineStyle(),D=v.getModel("lineStyle").getLineStyle(),k=y.get("distance"),A=0;A<=x;A++){if(c=Math.cos(M),u=Math.sin(M),y.get("show")){var E=new Uw({shape:{x1:c*(f-(L=k?k+l:l))+d,y1:u*(f-L)+p,x2:c*(f-w-L)+d,y2:u*(f-w-L)+p},style:I,silent:!0});"auto"===I.stroke&&E.setStyle({stroke:i(A/x)}),h.add(E)}if(_.get("show")){var L=_.get("distance")+k,P=XF(Bd(A/x*(m-g)+g),_.get("formatter")),O=i(A/x),R=c*(f-w-L)+d,B=u*(f-w-L)+p,N=_.get("rotate"),z=0;"radial"===N?(z=-M+2*Math.PI)>Math.PI/2&&(z+=Math.PI):"tangential"===N?z=-M-Math.PI/2:ys(N)&&(z=N*Math.PI/180),0===z?h.add(new $g({style:uy(_,{text:P,x:R,y:B,verticalAlign:u<-.8?"top":u>.8?"bottom":"middle",align:c<-.4?"left":c>.4?"right":"center"},{inheritColor:O}),silent:!0})):h.add(new $g({style:uy(_,{text:P,x:R,y:B,verticalAlign:"middle",align:"center"},{inheritColor:O}),silent:!0,originX:R,originY:B,rotation:z}))}if(v.get("show")&&A!==x){L=(L=v.get("distance"))?L+l:l;for(var F=0;F<=b;F++){c=Math.cos(M),u=Math.sin(M);var V=new Uw({shape:{x1:c*(f-L)+d,y1:u*(f-L)+p,x2:c*(f-S-L)+d,y2:u*(f-S-L)+p},silent:!0,style:D});"auto"===D.stroke&&V.setStyle({stroke:i((A+F/b)/x)}),h.add(V),M+=T}M-=T}else M+=C}},e.prototype._renderPointer=function(t,e,n,i,r,o,a,s,l){var c=this.group,u=this._data,h=this._progressEls,d=[],p=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),m=t.getData(),y=m.mapDimension("value"),v=+t.get("min"),_=+t.get("max"),x=[v,_],b=[o,a];function w(e,n){var i,o=m.getItemModel(e).getModel("pointer"),a=Rd(o.get("width"),r.r),s=Rd(o.get("length"),r.r),l=t.get(["pointer","icon"]),c=o.get("offsetCenter"),u=Rd(c[0],r.r),h=Rd(c[1],r.r),d=o.get("keepAspect");return(i=l?hC(l,u-a/2,h-s,a,s,null,d):new YF({shape:{angle:-Math.PI/2,width:a,r:s,x:u,y:h}})).rotation=-(n+Math.PI/2),i.x=r.cx,i.y=r.cy,i}function S(t,e){var n=f.get("roundCap")?JL:Ew,i=f.get("overlap"),a=i?f.get("width"):l/m.count(),c=i?r.r-a:r.r-(t+1)*a,u=i?r.r:r.r-t*a,h=new n({shape:{startAngle:o,endAngle:e,cx:r.cx,cy:r.cy,clockwise:s,r0:c,r:u}});return i&&(h.z2=Od(m.get(y,t),[v,_],[100,0],!0)),h}(g||p)&&(m.diff(u).add(function(e){var n=m.get(y,e);if(p){var i=w(e,o);Qm(i,{rotation:-((isNaN(+n)?b[0]:Od(n,x,b,!0))+Math.PI/2)},t),c.add(i),m.setItemGraphicEl(e,i)}if(g){var r=S(e,o),a=f.get("clip");Qm(r,{shape:{endAngle:Od(n,x,b,a)}},t),c.add(r),Kg(t.seriesIndex,m.dataType,e,r),d[e]=r}}).update(function(e,n){var i=m.get(y,e);if(p){var r=u.getItemGraphicEl(n),a=r?r.rotation:o,s=w(e,a);s.rotation=a,Jm(s,{rotation:-((isNaN(+i)?b[0]:Od(i,x,b,!0))+Math.PI/2)},t),c.add(s),m.setItemGraphicEl(e,s)}if(g){var l=h[n],v=S(e,l?l.shape.endAngle:o),_=f.get("clip");Jm(v,{shape:{endAngle:Od(i,x,b,_)}},t),c.add(v),Kg(t.seriesIndex,m.dataType,e,v),d[e]=v}}).execute(),m.each(function(t){var e=m.getItemModel(t),n=e.getModel("emphasis"),r=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled");if(p){var s=m.getItemGraphicEl(t),l=m.getItemVisual(t,"style"),c=l.fill;if(s instanceof Cg){var u=s.style;s.useStyle(Ja({image:u.image,x:u.x,y:u.y,width:u.width,height:u.height},l))}else s.useStyle(l),"pointer"!==s.type&&s.setColor(c);s.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===s.style.fill&&s.setStyle("fill",i(Od(m.get(y,t),x,[0,1],!0))),s.z2EmphasisLift=0,Gm(s,e),Vm(s,r,o,a)}if(g){var h=d[t];h.useStyle(m.getItemVisual(t,"style")),h.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),h.z2EmphasisLift=0,Gm(h,e),Vm(h,r,o,a)}}),this._progressEls=d)},e.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor");if(n.get("show")){var i=n.get("size"),r=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=hC(r,e.cx-i/2+Rd(o[0],e.r),e.cy-i/2+Rd(o[1],e.r),i,i,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},e.prototype._renderTitleAndDetail=function(t,e,n,i,r){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),c=+t.get("max"),u=new _d,h=[],d=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add(function(t){h[t]=new $g({silent:!0}),d[t]=new $g({silent:!0})}).update(function(t,e){h[t]=o._titleEls[e],d[t]=o._detailEls[e]}).execute(),a.each(function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new _d,m=i(Od(o,[l,c],[0,1],!0)),y=n.getModel("title");if(y.get("show")){var v=y.get("offsetCenter"),_=r.cx+Rd(v[0],r.r),x=r.cy+Rd(v[1],r.r);(D=h[e]).attr({z2:f?0:2,style:uy(y,{x:_,y:x,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(D)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=r.cx+Rd(w[0],r.r),M=r.cy+Rd(w[1],r.r),C=Rd(b.get("width"),r.r),T=Rd(b.get("height"),r.r),I=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:m,D=d[e],k=b.get("formatter");D.attr({z2:f?0:2,style:uy(b,{x:S,y:M,text:XF(o,k),width:isNaN(C)?null:C,height:isNaN(T)?null:T,align:"center",verticalAlign:"middle"},{inheritColor:I})}),vy(D,{normal:b},o,function(t){return XF(t,k)}),p&&_y(D,e,a,t,{getFormattedLabel:function(t,e,n,i,r,a){return XF(a?a.interpolatedValue:o,k)}}),g.add(D)}u.add(g)}),this.group.add(u),this._titleEls=h,this._detailEls=d},e.type="gauge",e}(eM);const ZF=$F,KF=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="itemStyle",n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return RP(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(Hb);var JF=["itemStyle","opacity"],QF=function(t){function e(e,n){var i=t.call(this)||this,r=i,o=new Hw,a=new $g;return r.setTextContent(a),i.setTextGuideLine(o),i.updateData(e,n,!0),i}return Ma(e,t),e.prototype.updateData=function(t,e,n){var i=this,r=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(JF);l=null==l?1:l,n||ry(i),i.useStyle(t.getItemVisual(e,"style")),i.style.lineJoin="round",n?(i.setShape({points:a.points}),i.style.opacity=0,Qm(i,{style:{opacity:l}},r,e)):Jm(i,{style:{opacity:l},shape:{points:a.points}},r,e),Gm(i,o),this._updateLabel(t,e),Vm(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t,e){var n=this,i=this.getTextGuideLine(),r=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),c=l.fill;ly(r,cy(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:c,outsideFill:c});var u=s.linePoints;i.setShape({points:u}),n.textGuideLineConfig={anchor:u?new nc(u[0][0],u[0][1]):null},Jm(r,{style:{x:s.x,y:s.y}},o,e),r.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),wA(n,SA(a),{stroke:c})},e}(zw);const tV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreLabelLineUpdate=!0,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._data,o=this.group;i.diff(r).add(function(t){var e=new QF(i,t);i.setItemGraphicEl(t,e),o.add(e)}).update(function(t,e){var n=r.getItemGraphicEl(e);n.updateData(i,t),o.add(n),i.setItemGraphicEl(t,n)}).remove(function(e){iy(r.getItemGraphicEl(e),t,e)}).execute(),this._data=i},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(eM);var eV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new NP(hs(this.getData,this),hs(this.getRawData,this)),this._defaultLabelLine(e)},e.prototype.getInitialData=function(t,e){return RP(this,{coordDimensions:["value"],encodeDefaulter:ds(s_,this)})},e.prototype._defaultLabelLine=function(t){cp(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},e.prototype.getDataParams=function(e){var n=this.getData(),i=t.prototype.getDataParams.call(this,e),r=n.mapDimension("value"),o=n.getSum(r);return i.percent=o?+(n.get(r,e)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(Hb);const nV=eV;function iV(t,e){t.eachSeriesByType("funnel",function(t){var n=t.getData(),i=n.mapDimension("value"),r=t.get("sort"),o=function(t,e){return Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e),a=t.get("orient"),s=o.width,l=o.height,c=function(t,e){for(var n=t.mapDimension("value"),i=t.mapArray(n,function(t){return t}),r=[],o="ascending"===e,a=0,s=t.count();a<s;a++)r[a]=a;return fs(e)?r.sort(e):"none"!==e&&r.sort(function(t,e){return o?i[t]-i[e]:i[e]-i[t]}),r}(n,r),u=o.x,h=o.y,d="horizontal"===a?[Rd(t.get("minSize"),l),Rd(t.get("maxSize"),l)]:[Rd(t.get("minSize"),s),Rd(t.get("maxSize"),s)],p=n.getDataExtent(i),f=t.get("min"),g=t.get("max");null==f&&(f=Math.min(p[0],0)),null==g&&(g=p[1]);var m=t.get("funnelAlign"),y=t.get("gap"),v=(("horizontal"===a?s:l)-y*(n.count()-1))/n.count(),_=function(t,e){if("horizontal"===a){var r=Od(n.get(i,t)||0,[f,g],d,!0),o=void 0;switch(m){case"top":o=h;break;case"center":o=h+(l-r)/2;break;case"bottom":o=h+(l-r)}return[[e,o],[e,o+r]]}var c,p=Od(n.get(i,t)||0,[f,g],d,!0);switch(m){case"left":c=u;break;case"center":c=u+(s-p)/2;break;case"right":c=u+s-p}return[[c,e],[c+p,e]]};"ascending"===r&&(v=-v,y=-y,"horizontal"===a?u+=s:h+=l,c=c.reverse());for(var x=0;x<c.length;x++){var b=c[x],w=c[x+1],S=n.getItemModel(b);if("horizontal"===a){var M=S.get(["itemStyle","width"]);null==M?M=v:(M=Rd(M,s),"ascending"===r&&(M=-M));var C=_(b,u),T=_(w,u+M);u+=M+y,n.setItemLayout(b,{points:C.concat(T.slice().reverse())})}else{var I=S.get(["itemStyle","height"]);null==I?I=v:(I=Rd(I,l),"ascending"===r&&(I=-I)),C=_(b,h),T=_(w,h+I),h+=I+y,n.setItemLayout(b,{points:C.concat(T.slice().reverse())})}}!function(t){var e=t.hostModel.get("orient");t.each(function(n){var i,r,o,a,s=t.getItemModel(n),l=s.getModel("label").get("position"),c=s.getModel("labelLine"),u=t.getItemLayout(n),h=u.points,d="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(d)"insideLeft"===l?(r=(h[0][0]+h[3][0])/2+5,o=(h[0][1]+h[3][1])/2,i="left"):"insideRight"===l?(r=(h[1][0]+h[2][0])/2-5,o=(h[1][1]+h[2][1])/2,i="right"):(r=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,o=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,i="center"),a=[[r,o],[r,o]];else{var p=void 0,f=void 0,g=void 0,m=void 0,y=c.get("length");"left"===l?(p=(h[3][0]+h[0][0])/2,f=(h[3][1]+h[0][1])/2,r=(g=p-y)-5,i="right"):"right"===l?(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,r=(g=p+y)+5,i="left"):"top"===l?(p=(h[3][0]+h[0][0])/2,o=(m=(f=(h[3][1]+h[0][1])/2)-y)-5,i="center"):"bottom"===l?(p=(h[1][0]+h[2][0])/2,o=(m=(f=(h[1][1]+h[2][1])/2)+y)+5,i="center"):"rightTop"===l?(p="horizontal"===e?h[3][0]:h[1][0],f="horizontal"===e?h[3][1]:h[1][1],"horizontal"===e?(o=(m=f-y)-5,i="center"):(r=(g=p+y)+5,i="top")):"rightBottom"===l?(p=h[2][0],f=h[2][1],"horizontal"===e?(o=(m=f+y)+5,i="center"):(r=(g=p+y)+5,i="bottom")):"leftTop"===l?(p=h[0][0],f="horizontal"===e?h[0][1]:h[1][1],"horizontal"===e?(o=(m=f-y)-5,i="center"):(r=(g=p-y)-5,i="right")):"leftBottom"===l?(p="horizontal"===e?h[1][0]:h[3][0],f="horizontal"===e?h[1][1]:h[2][1],"horizontal"===e?(o=(m=f+y)+5,i="center"):(r=(g=p-y)-5,i="right")):(p=(h[1][0]+h[2][0])/2,f=(h[1][1]+h[2][1])/2,"horizontal"===e?(o=(m=f+y)+5,i="center"):(r=(g=p+y)+5,i="left")),"horizontal"===e?r=g=p:o=m=f,a=[[p,f],[g,m]]}u.label={linePoints:a,x:r,y:o,verticalAlign:"middle",textAlign:i,inside:d}})}(n)})}var rV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._dataGroup=new _d,n._initialized=!1,n}return Ma(e,t),e.prototype.init=function(){this.group.add(this._dataGroup)},e.prototype.render=function(t,e,n,i){this._progressiveEls=null;var r=this._dataGroup,o=t.getData(),a=this._data,s=t.coordinateSystem,l=s.dimensions,c=sV(t);if(o.diff(a).add(function(t){lV(aV(o,r,t,l,s),o,t,c)}).update(function(e,n){var i=a.getItemGraphicEl(n),r=oV(o,e,l,s);o.setItemGraphicEl(e,i),Jm(i,{shape:{points:r}},t,e),ry(i),lV(i,o,e,c)}).remove(function(t){var e=a.getItemGraphicEl(t);r.remove(e)}).execute(),!this._initialized){this._initialized=!0;var u=function(t,e){var n=t.model,i=t.getRect(),o=new Pg({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),a="horizontal"===n.get("layout")?"width":"height";return o.setShape(a,0),Qm(o,{shape:{width:i.width,height:i.height}},e,function(){setTimeout(function(){r.removeClipPath()})}),o}(s,t);r.setClipPath(u)}this._data=o},e.prototype.incrementalPrepareRender=function(t,e,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},e.prototype.incrementalRender=function(t,e,n){for(var i=e.getData(),r=e.coordinateSystem,o=r.dimensions,a=sV(e),s=this._progressiveEls=[],l=t.start;l<t.end;l++){var c=aV(i,this._dataGroup,l,o,r);c.incremental=!0,lV(c,i,l,a),s.push(c)}},e.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},e.type="parallel",e}(eM);function oV(t,e,n,i){for(var r=[],o=0;o<n.length;o++){var a=n[o],s=t.get(t.mapDimension(a),e);cV(s,i.getAxis(a).type)||r.push(i.dataToPoint(s,a))}return r}function aV(t,e,n,i,r){var o=oV(t,n,i,r),a=new Hw({shape:{points:o},z2:10});return e.add(a),t.setItemGraphicEl(n,a),a}function sV(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),Cs(e=tp(e))&&(e=0),{smooth:e}}function lV(t,e,n,i){t.useStyle(e.getItemVisual(n,"style")),t.style.fill=null,t.setShape("smooth",i.smooth);var r=e.getItemModel(n),o=r.getModel("emphasis");Gm(t,r,"lineStyle"),Vm(t,o.get("focus"),o.get("blurScope"),o.get("disabled"))}function cV(t,e){return"category"===e?null==t:null==t||isNaN(t)}const uV=rV;function hV(t){var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var n={};return os(e.dimensions,function(t){var e=+t.replace("dim","");n[t]=e}),n}}const dV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return aD(null,this,{useEncodeDefaulter:hs(hV,null,this)})},e.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,n=this.getData(),i=[];return e.eachActiveState(n,function(e,r){t===e&&i.push(n.getRawIndex(r))}),i},e.type="series.parallel",e.dependencies=["parallel"],e.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"},e}(Hb);var pV=["lineStyle","opacity"];const fV={seriesType:"parallel",reset:function(t,e){var n=t.coordinateSystem,i={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){n.eachActiveState(e,function(t,n){var r=i[t];if("normal"===t&&e.hasItemOption){var o=e.getItemModel(n).get(pV,!0);null!=o&&(r=o)}e.ensureUniqueItemVisual(n,"style").opacity=r},t.start,t.end)}}}};function gV(t){!function(t){if(!t.parallel){var e=!1;os(t.series,function(t){t&&"parallel"===t.type&&(e=!0)}),e&&(t.parallel=[{}])}}(t),function(t){os(lp(t.parallelAxis),function(e){if(vs(e)){var n=e.parallelIndex||0,i=lp(t.parallel)[n];i&&i.parallelAxisDefault&&Za(e,i.parallelAxisDefault,!1)}})}(t)}var mV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){this._model=t,this._api=n,this._handlers||(this._handlers={},os(yV,function(t,e){n.getZr().on(e,this._handlers[e]=hs(t,this))},this)),aM(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},e.prototype.dispose=function(t,e){sM(this,"_throttledDispatchExpand"),os(this._handlers,function(t,n){e.getZr().off(n,t)}),this._handlers=null},e.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},e.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(Ja({type:"parallelAxisExpand"},t))},e.type="parallel",e}(Wb),yV={mousedown:function(t){vV(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(vV(this,"click")&&e){var n=[t.offsetX,t.offsetY];if(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2)>5)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==i.behavior&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&vV(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),i=n.behavior;"jump"===i&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===i?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===i?null:{duration:0}})}}};function vV(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}const _V=mV,xV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var e=this.option;t&&Za(e,t,!0),this._initDimensions()},e.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},e.prototype.setAxisExpand=function(t){os(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[];os(ls(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(t){return(t.get("parallelIndex")||0)===this.componentIndex},this),function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Uv);var bV=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.axisIndex=o,a}return Ma(e,t),e.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},e}($k);const wV=bV;function SV(t,e,n,i,r,o){t=t||0;var a=n[1]-n[0];if(null!=r&&(r=CV(r,[0,a])),null!=o&&(o=Math.max(o,null!=r?r:0)),"all"===i){var s=Math.abs(e[1]-e[0]);s=CV(s,[0,a]),r=o=CV(s,[r,o]),i=0}e[0]=CV(e[0],n),e[1]=CV(e[1],n);var l=MV(e,i);e[i]+=t;var c,u=r||0,h=n.slice();return l.sign<0?h[0]+=u:h[1]-=u,e[i]=CV(e[i],h),c=MV(e,i),null!=r&&(c.sign!==l.sign||c.span<r)&&(e[1-i]=e[i]+l.sign*r),c=MV(e,i),null!=o&&c.span>o&&(e[1-i]=e[i]+c.sign*o),e}function MV(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function CV(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var TV=os,IV=Math.min,DV=Math.max,kV=Math.floor,AV=Math.ceil,EV=Bd,LV=Math.PI,PV=function(){function t(t,e,n){this.type="parallel",this._axesMap=Fs(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=t.dimensions,r=t.parallelAxisIndex;TV(i,function(t,n){var i=r[n],o=e.getComponent("parallelAxis",i),a=this._axesMap.set(t,new wV(t,hk(o),[0,0],o.get("type"),i)),s="category"===a.type;a.onBand=s&&o.get("boundaryGap"),a.inverse=o.get("inverse"),o.axis=a,a.model=o,a.coordinateSystem=o.coordinateSystem=this},this)},t.prototype.update=function(t,e){this._updateAxesFromSeries(this._model,t)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,i=e.layoutBase,r=e.pixelDimIndex,o=t[1-r],a=t[r];return o>=n&&o<=n+e.axisLength&&a>=i&&a<=i+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype._updateAxesFromSeries=function(t,e){e.eachSeries(function(n){if(t.contains(n,e)){var i=n.getData();TV(this.dimensions,function(t){var e=this._axesMap.get(t);e.scale.unionExtentFromData(i,i.mapDimension(t)),uk(e.scale,e.model)},this)}},this)},t.prototype.resize=function(t,e){this._rect=Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()}),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,i=["x","y"],r=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[r[a]],l=[0,s],c=this.dimensions.length,u=OV(e.get("axisExpandWidth"),l),h=OV(e.get("axisExpandCount")||0,[0,c]),d=e.get("axisExpandable")&&c>3&&c>h&&h>1&&u>0&&s>0,p=e.get("axisExpandWindow");p?(t=OV(p[1]-p[0],l),p[1]=p[0]+t):(t=OV(u*(h-1),l),(p=[u*(e.get("axisExpandCenter")||kV(c/2))-t/2])[1]=p[0]+t);var f=(s-t)/(c-h);f<3&&(f=0);var g=[kV(EV(p[0]/u,1))+1,AV(EV(p[1]/u,1))-1],m=f/u*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[i[a]],layoutLength:s,axisBase:n[i[1-a]],axisLength:n[r[1-a]],axisExpandable:d,axisExpandWidth:u,axisCollapseWidth:f,axisExpandWindow:p,axisCount:c,winInnerIndices:g,axisExpandWindow0Pos:m}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),r=i.layout;e.each(function(t){var e=[0,i.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])}),TV(n,function(e,n){var o=(i.axisExpandable?BV:RV)(n,i),a={horizontal:{x:o.position,y:i.axisLength},vertical:{x:0,y:o.position}},s={horizontal:LV/2,vertical:0},l=[a[r].x+t.x,a[r].y+t.y],c=s[r],u=[1,0,0,1,0,0];Kl(u,u,c),Zl(u,u,l),this._axesLayout[e]={position:l,rotation:c,transform:u,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,i){null==n&&(n=0),null==i&&(i=t.count());var r=this._axesMap,o=this.dimensions,a=[],s=[];os(o,function(e){a.push(t.mapDimension(e)),s.push(r.get(e).model)});for(var l=this.hasAxisBrushed(),c=n;c<i;c++){var u=void 0;if(l){u="active";for(var h=t.getValues(a,c),d=0,p=o.length;d<p;d++)if("inactive"===s[d].getActiveState(h[d])){u="inactive";break}}else u="normal";e(u,c)}},t.prototype.hasAxisBrushed=function(){for(var t=this.dimensions,e=this._axesMap,n=!1,i=0,r=t.length;i<r;i++)"normal"!==e.get(t[i]).model.getActiveState()&&(n=!0);return n},t.prototype.axisCoordToPoint=function(t,e){return OS([t,0],this._axesLayout[e].transform)},t.prototype.getAxisLayout=function(t){return $a(this._axesLayout[t])},t.prototype.getSlidedAxisExpandWindow=function(t){var e=this._makeLayoutInfo(),n=e.pixelDimIndex,i=e.axisExpandWindow.slice(),r=i[1]-i[0],o=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:i};var a,s=t[n]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",c=e.axisCollapseWidth,u=this._model.get("axisExpandSlideTriggerArea"),h=null!=u[0];if(c)h&&c&&s<r*u[0]?(l="jump",a=s-r*u[2]):h&&c&&s>r*(1-u[0])?(l="jump",a=s-r*(1-u[2])):(a=s-r*u[1])>=0&&(a=s-r*(1-u[1]))<=0&&(a=0),(a*=e.axisExpandWidth/c)?SV(a,i,o,"all"):l="none";else{var d=i[1]-i[0];(i=[DV(0,o[1]*s/d-d/2)])[1]=IV(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:l}},t}();function OV(t,e){return IV(DV(t,e[0]),e[1])}function RV(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function BV(t,e){var n,i,r=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,c=s,u=!1;return t<l[0]?(n=t*s,i=s):t<=l[1]?(n=e.axisExpandWindow0Pos+t*o-e.axisExpandWindow[0],c=o,u=!0):(n=r-(a-1-t)*s,i=s),{position:n,axisNameAvailableWidth:c,axisLabelShow:u,nameTruncateMaxWidth:i}}const NV=PV,zV={create:function(t,e){var n=[];return t.eachComponent("parallel",function(i,r){var o=new NV(i,t,e);o.name="parallel_"+r,o.resize(i,e),i.coordinateSystem=o,o.model=i,n.push(o)}),t.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=t.getReferringComponents("parallel",Mp).models[0];t.coordinateSystem=e.coordinateSystem}}),n}};var FV=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.activeIntervals=[],n}return Ma(e,t),e.prototype.getAreaSelectStyle=function(){return Fp([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},e.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=$a(t);if(e)for(var n=e.length-1;n>=0;n--)Nd(e[n])},e.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var i=0,r=e.length;i<r;i++)if(e[i][0]<=t&&t<=e[i][1])return"active";return"inactive"},e}(Uv);is(FV,vk);const VV=FV;var HV=!0,jV=Math.min,WV=Math.max,GV=Math.pow,UV="globalPan",qV={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},YV={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},XV={brushStyle:{lineWidth:2,stroke:"rgba(210,219,238,0.3)",fill:"#D2DBEE"},transformable:!0,brushMode:"single",removeOnClick:!1},$V=0,ZV=function(t){function e(e){var n=t.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=e,n.group=new _d,n._uid="brushController_"+$V++,os(SH,function(t,e){this._handlers[e]=hs(t,this)},n),n}return Ma(e,t),e.prototype.enableBrush=function(t){return this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},e.prototype._doEnableBrush=function(t){var e=this._zr;this._enableGlobalPan||function(t,e,n){pR(t)[e]=n}(e,UV,this._uid),os(this._handlers,function(t,n){e.on(n,t)}),this._brushType=t.brushType,this._brushOption=Za($a(XV),t,!0)},e.prototype._doDisableBrush=function(){var t=this._zr;!function(t,e,n){var i=pR(t);i[e]===n&&(i[e]=null)}(t,UV,this._uid),os(this._handlers,function(e,n){t.off(n,e)}),this._brushType=this._brushOption=null},e.prototype.setPanels=function(t){if(t&&t.length){var e=this._panels={};os(t,function(t){e[t.panelId]=$a(t)})}else this._panels=null;return this},e.prototype.mount=function(t){t=t||{},this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=e.getLocalTransform(),this},e.prototype.updateCovers=function(t){t=as(t,function(t){return Za($a(XV),t,!0)});var e=this._covers,n=this._covers=[],i=this,r=this._creatingCover;return new CI(e,t,function(t,e){return o(t.__brushOption,e)},o).add(a).update(a).remove(function(t){e[t]!==r&&i.group.remove(e[t])}).execute(),this;function o(t,e){return(null!=t.id?t.id:"\0-brush-index-"+e)+"-"+t.brushType}function a(o,a){var s=t[o];if(null!=a&&e[a]===r)n[o]=e[a];else{var l=n[o]=null!=a?(e[a].__brushOption=s,e[a]):JV(i,KV(i,s));eH(i,l)}}},e.prototype.unmount=function(){return this.enableBrush(!1),oH(this),this._zr.remove(this.group),this},e.prototype.dispose=function(){this.unmount(),this.off()},e}(bl);function KV(t,e){var n=CH[e.brushType].createCover(t,e);return n.__brushOption=e,tH(n,e),t.group.add(n),n}function JV(t,e){var n=nH(e);return n.endCreating&&(n.endCreating(t,e),tH(e,e.__brushOption)),e}function QV(t,e){var n=e.__brushOption;nH(e).updateCoverShape(t,e,n.range,n)}function tH(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function eH(t,e){nH(e).updateCommon(t,e),QV(t,e)}function nH(t){return CH[t.__brushOption.brushType]}function iH(t,e,n){var i,r=t._panels;if(!r)return HV;var o=t._transform;return os(r,function(t){t.isTargetByCursor(e,n,o)&&(i=t)}),i}function rH(t,e){var n=t._panels;if(!n)return HV;var i=e.__brushOption.panelId;return null!=i?n[i]:HV}function oH(t){var e=t._covers,n=e.length;return os(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function aH(t,e){var n=as(t._covers,function(t){var e=t.__brushOption,n=$a(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function sH(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function lH(t,e,n,i){var r=new _d;return r.add(new Pg({name:"main",style:dH(n),silent:!0,draggable:!0,cursor:"move",drift:ds(gH,t,e,r,["n","s","w","e"]),ondragend:ds(aH,e,{isEnd:!0})})),os(i,function(n){r.add(new Pg({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:ds(gH,t,e,r,n),ondragend:ds(aH,e,{isEnd:!0})}))}),r}function cH(t,e,n,i){var r=i.brushStyle.lineWidth||0,o=WV(r,6),a=n[0][0],s=n[1][0],l=a-r/2,c=s-r/2,u=n[0][1],h=n[1][1],d=u-o+r/2,p=h-o+r/2,f=u-a,g=h-s,m=f+r,y=g+r;hH(t,e,"main",a,s,f,g),i.transformable&&(hH(t,e,"w",l,c,o,y),hH(t,e,"e",d,c,o,y),hH(t,e,"n",l,c,m,o),hH(t,e,"s",l,p,m,o),hH(t,e,"nw",l,c,o,o),hH(t,e,"ne",d,c,o,o),hH(t,e,"sw",l,p,o,o),hH(t,e,"se",d,p,o,o))}function uH(t,e){var n=e.__brushOption,i=n.transformable,r=e.childAt(0);r.useStyle(dH(n)),r.attr({silent:!i,cursor:i?"move":"default"}),os([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var r=e.childOfName(n.join("")),o=1===n.length?fH(t,n[0]):function(t,e){var n=[fH(t,e[0]),fH(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);r&&r.attr({silent:!i,invisible:!i,cursor:i?YV[o]+"-resize":null})})}function hH(t,e,n,i,r,o,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=jV(t[0][0],t[1][0]),n=jV(t[0][1],t[1][1]);return{x:e,y:n,width:WV(t[0][0],t[1][0])-e,height:WV(t[0][1],t[1][1])-n}}(vH(t,e,[[i,r],[i+o,r+a]])))}function dH(t){return Qa({strokeNoScale:!0},t.brushStyle)}function pH(t,e,n,i){var r=[jV(t,n),jV(e,i)],o=[WV(t,n),WV(e,i)];return[[r[0],o[0]],[r[1],o[1]]]}function fH(t,e){var n=RS({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return PS(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function gH(t,e,n,i,r,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=yH(e,r,o);os(i,function(t){var e=qV[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(pH(s[0][0],s[1][0],s[0][1],s[1][1])),eH(e,n),aH(e,{isEnd:!1})}function mH(t,e,n,i){var r=e.__brushOption.range,o=yH(t,n,i);os(r,function(t){t[0]+=o[0],t[1]+=o[1]}),eH(t,e),aH(t,{isEnd:!1})}function yH(t,e,n){var i=t.group,r=i.transformCoordToLocal(e,n),o=i.transformCoordToLocal(0,0);return[r[0]-o[0],r[1]-o[1]]}function vH(t,e,n){var i=rH(t,e);return i&&i!==HV?i.clipPath(n,t._transform):$a(n)}function _H(t){var e=t.event;e.preventDefault&&e.preventDefault()}function xH(t,e,n){return t.childOfName("main").contain(e,n)}function bH(t,e,n,i){var r,o=t._creatingCover,a=t._creatingPanel,s=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],i=e[0],r=n[0]-i[0],o=n[1]-i[1];return GV(r*r+o*o,.5)>6}(t)||o){if(a&&!o){"single"===s.brushMode&&oH(t);var l=$a(s);l.brushType=wH(l.brushType,a),l.panelId=a===HV?null:a.panelId,o=t._creatingCover=KV(t,l),t._covers.push(o)}if(o){var c=CH[wH(t._brushType,a)];o.__brushOption.range=c.getCreatingRange(vH(t,o,t._track)),i&&(JV(t,o),c.updateCommon(t,o)),QV(t,o),r={isEnd:i}}}else i&&"single"===s.brushMode&&s.removeOnClick&&iH(t,e,n)&&oH(t)&&(r={isEnd:i,removeOnClick:!0});return r}function wH(t,e){return"auto"===t?e.defaultBrushType:t}var SH={mousedown:function(t){if(this._dragging)MH(this,t);else if(!t.target||!t.target.draggable){_H(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=iH(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,i=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(t._brushType&&!function(t,e,n){var i=t._zr;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}(t,e.offsetX,e.offsetY)){var i=t._zr,r=t._covers,o=iH(t,e,n);if(!t._dragging)for(var a=0;a<r.length;a++){var s=r[a].__brushOption;if(o&&(o===HV||s.panelId===o.panelId)&&CH[s.brushType].contain(r[a],n[0],n[1]))return}o&&i.setCursorStyle("crosshair")}}(this,t,i),this._dragging){_H(t);var r=bH(this,t,i,!1);r&&aH(this,r)}},mouseup:function(t){MH(this,t)}};function MH(t,e){if(t._dragging){_H(e);var n=e.offsetX,i=e.offsetY,r=t.group.transformCoordToLocal(n,i),o=bH(t,e,r,!0);t._dragging=!1,t._track=[],t._creatingCover=null,o&&aH(t,o)}}var CH={lineX:TH(0),lineY:TH(1),rect:{createCover:function(t,e){function n(t){return t}return lH({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=sH(t);return pH(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,i){cH(t,e,n,i)},updateCommon:uH,contain:xH},polygon:{createCover:function(t,e){var n=new _d;return n.add(new Hw({name:"main",style:dH(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new zw({name:"main",draggable:!0,drift:ds(mH,t,e),ondragend:ds(aH,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,i){e.childAt(0).setShape({points:vH(t,e,n)})},updateCommon:uH,contain:xH}};function TH(t){return{createCover:function(e,n){return lH({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=sH(e);return[jV(n[0][t],n[1][t]),WV(n[0][t],n[1][t])]},updateCoverShape:function(e,n,i,r){var o,a=rH(e,n);if(a!==HV&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(t);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[i,o];t&&l.reverse(),cH(e,n,l,r)},updateCommon:uH,contain:xH}}const IH=ZV;function DH(t){return t=EH(t),function(e){return zS(e,t)}}function kH(t,e){return t=EH(t),function(n){var i=null!=e?e:n,r=i?t.width:t.height,o=i?t.x:t.y;return[o,o+(r||0)]}}function AH(t,e,n){var i=EH(t);return function(t,r){return i.contain(r[0],r[1])&&!SR(t,e,n)}}function EH(t){return dc.create(t)}var LH=["axisLine","axisTickLabel","axisName"],PH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new IH(n.getZr())).on("brush",hs(this._onBrush,this))},e.prototype.render=function(t,e,n,i){if(!function(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}(t,e,i)){this.axisModel=t,this.api=n,this.group.removeAll();var r=this._axisGroup;if(this._axisGroup=new _d,this.group.add(this._axisGroup),t.get("show")){var o=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,c=t.axis.dim,u=Ja({strokeContainThreshold:l},a.getAxisLayout(c)),h=new CO(t,u);os(LH,h.add,h),this._axisGroup.add(h.getGroup()),this._refreshBrushController(u,s,t,o,l,n),NS(r,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,e,n,i,r,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),c=dc.create({x:a[0],y:-r/2,width:s,height:r});c.x-=l,c.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:DH(c),isTargetByCursor:AH(c,o,i),getLinearBrushOtherExtent:kH(c,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return as(t.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}(n))},e.prototype._onBrush=function(t){var e=t.areas,n=this.axisModel,i=n.axis,r=as(e,function(t){return[i.coordToData(t.range[0],!0),i.coordToData(t.range[1],!0)]});(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:r})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(Wb);const OH=PH;var RH={type:"axisAreaSelect",event:"axisAreaSelected"},BH={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function NH(t){t.registerComponentView(_V),t.registerComponentModel(xV),t.registerCoordinateSystem("parallel",zV),t.registerPreprocessor(gV),t.registerComponentModel(VV),t.registerComponentView(OH),QP(t,"parallel",VV,BH),function(t){t.registerAction(RH,function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},function(e){e.axis.model.setActiveIntervals(t.intervals)})}),t.registerAction("parallelAxisExpand",function(t,e){e.eachComponent({mainType:"parallel",query:t},function(e){e.setAxisExpand(t)})})}(t)}var zH=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},FH=function(t){function e(e){return t.call(this,e)||this}return Ma(e,t),e.prototype.getDefaultShape=function(){return new zH},e.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},e.prototype.highlight=function(){Tm(this)},e.prototype.downplay=function(){Im(this)},e}(vg),VH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._focusAdjacencyDisabled=!1,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=this,r=t.getGraph(),o=this.group,a=t.layoutInfo,s=a.width,l=a.height,c=t.getData(),u=t.getData("edge"),h=t.get("orient");this._model=t,o.removeAll(),o.x=a.x,o.y=a.y,r.eachEdge(function(e){var n=new FH,i=Zg(n);i.dataIndex=e.dataIndex,i.seriesIndex=t.seriesIndex,i.dataType="edge";var r,a,c,d,p,f,g,m,y=e.getModel(),v=y.getModel("lineStyle"),_=v.get("curveness"),x=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),S=b.get("localY"),M=e.node2.getLayout(),C=e.node2.getModel(),T=C.get("localX"),I=C.get("localY"),D=e.getLayout();n.shape.extent=Math.max(1,D.dy),n.shape.orient=h,"vertical"===h?(r=(null!=w?w*s:x.x)+D.sy,a=(null!=S?S*l:x.y)+x.dy,c=(null!=T?T*s:M.x)+D.ty,p=r,f=a*(1-_)+(d=null!=I?I*l:M.y)*_,g=c,m=a*_+d*(1-_)):(r=(null!=w?w*s:x.x)+x.dx,a=(null!=S?S*l:x.y)+D.sy,p=r*(1-_)+(c=null!=T?T*s:M.x)*_,f=a,g=r*_+c*(1-_),m=d=(null!=I?I*l:M.y)+D.ty),n.setShape({x1:r,y1:a,x2:c,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(v.getItemStyle()),HH(n.style,h,e);var k=""+y.get("value"),A=cy(y,"edgeLabel");ly(n,A,{labelFetcher:{getFormattedLabel:function(e,n,i,r,o,a){return t.getFormattedLabel(e,n,"edge",r,Ds(o,A.normal&&A.normal.get("formatter"),k),a)}},labelDataIndex:e.dataIndex,defaultText:k}),n.setTextConfig({position:"inside"});var E=y.getModel("emphasis");Gm(n,y,"lineStyle",function(t){var n=t.getItemStyle();return HH(n,h,e),n}),o.add(n),u.setItemGraphicEl(e.dataIndex,n);var L=E.get("focus");Vm(n,"adjacency"===L?e.getAdjacentDataIndices():"trajectory"===L?e.getTrajectoryDataIndices():L,E.get("blurScope"),E.get("disabled"))}),r.eachNode(function(e){var n=e.getLayout(),i=e.getModel(),r=i.get("localX"),a=i.get("localY"),u=i.getModel("emphasis"),h=i.get(["itemStyle","borderRadius"])||0,d=new Pg({shape:{x:null!=r?r*s:n.x,y:null!=a?a*l:n.y,width:n.dx,height:n.dy,r:h},style:i.getModel("itemStyle").getItemStyle(),z2:10});ly(d,cy(i),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),d.disableLabelAnimation=!0,d.setStyle("fill",e.getVisual("color")),d.setStyle("decal",e.getVisual("style").decal),Gm(d,i),o.add(d),c.setItemGraphicEl(e.dataIndex,d),Zg(d).dataType="node";var p=u.get("focus");Vm(d,"adjacency"===p?e.getAdjacentDataIndices():"trajectory"===p?e.getTrajectoryDataIndices():p,u.get("blurScope"),u.get("disabled"))}),c.eachItemGraphicEl(function(e,r){c.getItemModel(r).get("draggable")&&(e.drift=function(e,o){i._focusAdjacencyDisabled=!0,this.shape.x+=e,this.shape.y+=o,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:c.getRawIndex(r),localX:this.shape.x/s,localY:this.shape.y/l})},e.ondragend=function(){i._focusAdjacencyDisabled=!1},e.draggable=!0,e.cursor="move")}),!this._data&&t.isAnimationEnabled()&&o.setClipPath(function(t,e){var n=new Pg({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Qm(n,{shape:{width:t.width+20}},e,function(){o.removeClipPath()}),n}(o.getBoundingRect(),t)),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(eM);function HH(t,e,n){switch(t.fill){case"source":t.fill=n.node1.getVisual("color"),t.decal=n.node1.getVisual("style").decal;break;case"target":t.fill=n.node2.getVisual("color"),t.decal=n.node2.getVisual("style").decal;break;case"gradient":var i=n.node1.getVisual("color"),r=n.node2.getVisual("color");gs(i)&&gs(r)&&(t.fill=new oS(0,0,+("horizontal"===e),+("vertical"===e),[{color:i,offset:0},{color:r,offset:1}]))}}const jH=VH;var WH=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],r=t.levels||[];this.levelModels=[];for(var o=this.levelModels,a=0;a<r.length;a++)null!=r[a].depth&&r[a].depth>=0&&(o[r[a].depth]=new Oy(r[a],this,e));var s=HF(i,n,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,i=n.getData().getItemLayout(e);if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t}),e.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,i=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(i){var r=i.depth,o=n.levelModels[r];o&&(t.parentModel=o)}return t})});return s.data},e.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,e,n){function i(t){return isNaN(t)||null==t}if("edge"===n){var r=this.getDataParams(t,n),o=r.data,a=r.value;return yb("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:i(a)})}var s=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,n).data.name;return yb("nameValue",{name:null!=l?l+"":null,value:s,noValue:i(s)})},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(e,n){var i=t.prototype.getDataParams.call(this,e,n);if(null==i.value&&"node"===n){var r=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=r}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(Hb);const GH=WH;function UH(t,e){t.eachSeriesByType("sankey",function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),r=function(t,e){return Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}(t,e);t.layoutInfo=r;var o=r.width,a=r.height,s=t.getGraph(),l=s.nodes,c=s.edges;!function(t){os(t,function(t){var e=ej(t.outEdges,tj),n=ej(t.inEdges,tj),i=t.getValue()||0,r=Math.max(e,n,i);t.setLayout({value:r},!0)})}(l),function(t,e,n,i,r,o,a,s,l){(function(t,e,n,i,r,o,a){for(var s=[],l=[],c=[],u=[],h=0,d=0;d<e.length;d++)s[d]=1;for(d=0;d<t.length;d++)l[d]=t[d].inEdges.length,0===l[d]&&c.push(t[d]);for(var p=-1;c.length;){for(var f=0;f<c.length;f++){var g=c[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),y=null!=m.depth&&m.depth>=0;y&&m.depth>p&&(p=m.depth),g.setLayout({depth:y?m.depth:h},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var v=0;v<g.outEdges.length;v++){var _=g.outEdges[v];s[e.indexOf(_)]=0;var x=_.node2;0===--l[t.indexOf(x)]&&u.indexOf(x)<0&&u.push(x)}}++h,c=u,u=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=p>h-1?p:h-1;a&&"left"!==a&&function(t,e,n,i){if("right"===e){for(var r=[],o=t,a=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:a},!0);for(var c=0;c<l.inEdges.length;c++){var u=l.inEdges[c];r.indexOf(u.node1)<0&&r.push(u.node1)}}o=r,r=[],++a}os(t,function(t){qH(t)||t.setLayout({depth:Math.max(0,i-t.getLayout().skNodeHeight)},!0)})}else"justify"===e&&function(t,e){os(t,function(t){qH(t)||t.outEdges.length||t.setLayout({depth:e},!0)})}(t,i)}(t,a,0,b),function(t,e,n){os(t,function(t){var i=t.getLayout().depth*e;"vertical"===n?t.setLayout({y:i},!0):t.setLayout({x:i},!0)})}(t,"vertical"===o?(r-n)/b:(i-n)/b,o)})(t,e,n,r,o,s,l),function(t,e,n,i,r,o,a){var s=function(t,e){var n=[],i="vertical"===e?"y":"x",r=Dp(t,function(t){return t.getLayout()[i]});return r.keys.sort(function(t,e){return t-e}),os(r.keys,function(t){n.push(r.buckets.get(t))}),n}(t,a);(function(t,e,n,i,r,o){var a=1/0;os(t,function(t){var e=t.length,s=0;os(t,function(t){s+=t.getLayout().value});var l="vertical"===o?(i-(e-1)*r)/s:(n-(e-1)*r)/s;l<a&&(a=l)}),os(t,function(t){os(t,function(t,e){var n=t.getLayout().value*a;"vertical"===o?(t.setLayout({x:e},!0),t.setLayout({dx:n},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:n},!0))})}),os(e,function(t){var e=+t.getValue()*a;t.setLayout({dy:e},!0)})})(s,e,n,i,r,a),YH(s,r,n,i,a);for(var l=1;o>0;o--)XH(s,l*=.99,a),YH(s,r,n,i,a),nj(s,l,a),YH(s,r,n,i,a)}(t,e,o,r,i,a,s),function(t,e){var n="vertical"===e?"x":"y";os(t,function(t){t.outEdges.sort(function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]}),t.inEdges.sort(function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]})}),os(t,function(t){var e=0,n=0;os(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),os(t.inEdges,function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy})})}(t,s)}(l,c,n,i,o,a,0!==ls(l,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))})}function qH(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function YH(t,e,n,i,r){var o="vertical"===r?"x":"y";os(t,function(t){var a,s,l;t.sort(function(t,e){return t.getLayout()[o]-e.getLayout()[o]});for(var c=0,u=t.length,h="vertical"===r?"dx":"dy",d=0;d<u;d++)(l=c-(s=t[d]).getLayout()[o])>0&&(a=s.getLayout()[o]+l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),c=s.getLayout()[o]+s.getLayout()[h]+e;if((l=c-e-("vertical"===r?i:n))>0)for(a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0),c=a,d=u-2;d>=0;--d)(l=(s=t[d]).getLayout()[o]+s.getLayout()[h]+e-c)>0&&(a=s.getLayout()[o]-l,"vertical"===r?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),c=s.getLayout()[o]})}function XH(t,e,n){os(t.slice().reverse(),function(t){os(t,function(t){if(t.outEdges.length){var i=ej(t.outEdges,$H,n)/ej(t.outEdges,tj);if(isNaN(i)){var r=t.outEdges.length;i=r?ej(t.outEdges,ZH,n)/r:0}if("vertical"===n){var o=t.getLayout().x+(i-QH(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(i-QH(t,n))*e;t.setLayout({y:a},!0)}}})})}function $H(t,e){return QH(t.node2,e)*t.getValue()}function ZH(t,e){return QH(t.node2,e)}function KH(t,e){return QH(t.node1,e)*t.getValue()}function JH(t,e){return QH(t.node1,e)}function QH(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function tj(t){return t.getValue()}function ej(t,e,n){for(var i=0,r=t.length,o=-1;++o<r;){var a=+e(t[o],n);isNaN(a)||(i+=a)}return i}function nj(t,e,n){os(t,function(t){os(t,function(t){if(t.inEdges.length){var i=ej(t.inEdges,KH,n)/ej(t.inEdges,tj);if(isNaN(i)){var r=t.inEdges.length;i=r?ej(t.inEdges,JH,n)/r:0}if("vertical"===n){var o=t.getLayout().x+(i-QH(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(i-QH(t,n))*e;t.setLayout({y:a},!0)}}})})}function ij(t){t.eachSeriesByType("sankey",function(t){var e=t.getGraph(),n=e.nodes,i=e.edges;if(n.length){var r=1/0,o=-1/0;os(n,function(t){var e=t.getLayout().value;e<r&&(r=e),e>o&&(o=e)}),os(n,function(e){var n=new fz({type:"color",mappingMethod:"linear",dataExtent:[r,o],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),i=e.getModel().get(["itemStyle","color"]);null!=i?(e.setVisual("color",i),e.setVisual("style",{fill:i})):(e.setVisual("color",n),e.setVisual("style",{fill:n}))})}i.length&&os(i,function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)})})}var rj=function(){function t(){}return t.prototype._hasEncodeRule=function(t){var e=this.getEncode();return e&&null!=e.get(t)},t.prototype.getInitialData=function(t,e){var n,i,r=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=r.get("type"),s=o.get("type");"category"===a?(t.layout="horizontal",n=r.getOrdinalMeta(),i=!this._hasEncodeRule("x")):"category"===s?(t.layout="vertical",n=o.getOrdinalMeta(),i=!this._hasEncodeRule("y")):t.layout=t.layout||"horizontal";var l=["x","y"],c="horizontal"===t.layout?0:1,u=this._baseAxisDim=l[c],h=l[1-c],d=[r,o],p=d[c].get("type"),f=d[1-c].get("type"),g=t.data;if(g&&i){var m=[];os(g,function(t,e){var n;ps(t)?(n=t.slice(),t.unshift(e)):ps(t.value)?((n=Ja({},t)).value=n.value.slice(),t.value.unshift(e)):n=t,m.push(n)}),t.data=m}var y=this.defaultValueDimensions,v=[{name:u,type:DI(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:DI(f),dimsDef:y.slice()}];return RP(this,{coordDimensions:v,dimensionsCount:y.length+1,encodeDefaulter:ds(a_,v,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t}(),oj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],n.visualDrawType="stroke",n}return Ma(e,t),e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(Hb);is(oj,rj,!0);const aj=oj;var sj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this.group,o=this._data;this._data||r.removeAll();var a="horizontal"===t.get("layout")?1:0;i.diff(o).add(function(t){if(i.hasValue(t)){var e=uj(i.getItemLayout(t),i,t,a,!0);i.setItemGraphicEl(t,e),r.add(e)}}).update(function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var s=i.getItemLayout(t);n?(ry(n),hj(s,n,i,t)):n=uj(s,i,t,a),r.add(n),i.setItemGraphicEl(t,n)}else r.remove(n)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&r.remove(e)}).execute(),this._data=i},e.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(t){t&&e.remove(t)})},e.type="boxplot",e}(eM),lj=function(){},cj=function(t){function e(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new lj},e.prototype.buildPath=function(t,e){var n=e.points,i=0;for(t.moveTo(n[i][0],n[i][1]),i++;i<4;i++)t.lineTo(n[i][0],n[i][1]);for(t.closePath();i<n.length;i++)t.moveTo(n[i][0],n[i][1]),i++,t.lineTo(n[i][0],n[i][1])},e}(vg);function uj(t,e,n,i,r){var o=t.ends,a=new cj({shape:{points:r?dj(o,i,t):o}});return hj(t,a,e,n,r),a}function hj(t,e,n,i,r){var o=n.hostModel;(0,a[r?"initProps":"updateProps"])(e,{shape:{points:t.ends}},o,i),e.useStyle(n.getItemVisual(i,"style")),e.style.strokeNoScale=!0,e.z2=100;var s=n.getItemModel(i),l=s.getModel("emphasis");Gm(e,s),Vm(e,l.get("focus"),l.get("blurScope"),l.get("disabled"))}function dj(t,e,n){return as(t,function(t){return(t=t.slice())[e]=n.initBaseline,t})}const pj=sj;var fj=os;function gj(t){var e=function(t){var e=[],n=[];return t.eachSeriesByType("boxplot",function(t){var i=t.getBaseAxis(),r=es(n,i);r<0&&(r=n.length,n[r]=i,e[r]={axis:i,seriesModels:[]}),e[r].seriesModels.push(t)}),e}(t);fj(e,function(t){var e=t.seriesModels;e.length&&(function(t){var e,n=t.axis,i=t.seriesModels,r=i.length,o=t.boxWidthList=[],a=t.boxOffsetList=[],s=[];if("category"===n.type)e=n.getBandWidth();else{var l=0;fj(i,function(t){l=Math.max(l,t.getData().count())});var c=n.getExtent();e=Math.abs(c[1]-c[0])/l}fj(i,function(t){var n=t.get("boxWidth");ps(n)||(n=[n,n]),s.push([Rd(n[0],e)||0,Rd(n[1],e)||0])});var u=.8*e-2,h=u/r*.3,d=(u-h*(r-1))/r,p=d/2-u/2;fj(i,function(t,e){a.push(p),p+=h+d,o.push(Math.min(Math.max(d,s[e][0]),s[e][1]))})}(t),fj(e,function(e,n){!function(t,e,n){var i=t.coordinateSystem,r=t.getData(),o=n/2,a="horizontal"===t.get("layout")?0:1,s=1-a,l=["x","y"],c=r.mapDimension(l[a]),u=r.mapDimensionsAll(l[s]);if(!(null==c||u.length<5))for(var h=0;h<r.count();h++){var d=r.get(c,h),p=_(d,u[2],h),f=_(d,u[0],h),g=_(d,u[1],h),m=_(d,u[3],h),y=_(d,u[4],h),v=[];x(v,g,!1),x(v,m,!0),v.push(f,g,y,m),b(v,f),b(v,y),b(v,p),r.setItemLayout(h,{initBaseline:p[s],ends:v})}function _(t,n,o){var l,c=r.get(n,o),u=[];return u[a]=t,u[s]=c,isNaN(t)||isNaN(c)?l=[NaN,NaN]:(l=i.dataToPoint(u))[a]+=e,l}function x(t,e,n){var i=e.slice(),r=e.slice();i[a]+=o,r[a]-=o,n?t.push(i,r):t.push(r,i)}function b(t,e){var n=e.slice(),i=e.slice();n[a]-=o,i[a]+=o,t.push(n,i)}}(e,t.boxOffsetList[n],t.boxWidthList[n])}))})}var mj={type:"echarts:boxplot",transform:function(t){var e=t.upstream;e.sourceFormat!==Kv&&Px("");var n=function(t,e){for(var n=[],i=[],r=(e=e||{}).boundIQR,o="none"===r||0===r,a=0;a<t.length;a++){var s=Nd(t[a].slice()),l=Jd(s,.25),c=Jd(s,.5),u=Jd(s,.75),h=s[0],d=s[s.length-1],p=(null==r?1.5:r)*(u-l),f=o?h:Math.max(h,l-p),g=o?d:Math.min(d,u+p),m=e.itemNameFormatter,y=fs(m)?m({value:a}):gs(m)?m.replace("{value}",a+""):a+"";n.push([y,f,l,c,u,g]);for(var v=0;v<s.length;v++){var _=s[v];if(_<f||_>g){var x=[y,_];i.push(x)}}}return{boxData:n,outliers:i}}(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}},yj=["itemStyle","borderColor"],vj=["itemStyle","borderColor0"],_j=["itemStyle","borderColorDoji"],xj=["itemStyle","color"],bj=["itemStyle","color0"];function wj(t,e){return e.get(t>0?xj:bj)}function Sj(t,e){return e.get(0===t?_j:t>0?yj:vj)}var Mj={seriesType:"candlestick",plan:Gb(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var n;null!=(n=t.next());){var i=e.getItemModel(n),r=e.getItemLayout(n).sign,o=i.getItemStyle();o.fill=wj(r,i),o.stroke=Sj(r,i)||o.fill,Ja(e.ensureUniqueItemVisual(n,"style"),o)}}}}};const Cj=Mj;var Tj=["color","borderColor"],Ij=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,e,n,i){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},e.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},e.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,i=this.group,r=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea();this._data||i.removeAll(),e.diff(n).add(function(n){if(e.hasValue(n)){var a=e.getItemLayout(n);if(o&&Ej(s,a))return;var l=Aj(a,0,!0);Qm(l,{shape:{points:a.ends}},t,n),Lj(l,e,n,r),i.add(l),e.setItemGraphicEl(n,l)}}).update(function(a,l){var c=n.getItemGraphicEl(l);if(e.hasValue(a)){var u=e.getItemLayout(a);o&&Ej(s,u)?i.remove(c):(c?(Jm(c,{shape:{points:u.ends}},t,a),ry(c)):c=Aj(u),Lj(c,e,a,r),i.add(c),e.setItemGraphicEl(a,c))}else i.remove(c)}).remove(function(t){var e=n.getItemGraphicEl(t);e&&i.remove(e)}).execute(),this._data=e},e.prototype._renderLarge=function(t){this._clear(),Bj(t,this.group);var e=t.get("clip",!0)?AL(t.coordinateSystem,!1,t):null;e?this.group.setClipPath(e):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,e){for(var n,i=e.getData(),r=i.getLayout("isSimpleBox");null!=(n=t.next());){var o=Aj(i.getItemLayout(n));Lj(o,i,n,r),o.incremental=!0,this.group.add(o),this._progressiveEls.push(o)}},e.prototype._incrementalRenderLarge=function(t,e){Bj(e,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(eM),Dj=function(){},kj=function(t){function e(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new Dj},e.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},e}(vg);function Aj(t,e,n){var i=t.ends;return new kj({shape:{points:n?Pj(i,t):i},z2:100})}function Ej(t,e){for(var n=!0,i=0;i<e.ends.length;i++)if(t.contain(e.ends[i][0],e.ends[i][1])){n=!1;break}return n}function Lj(t,e,n,i){var r=e.getItemModel(n);t.useStyle(e.getItemVisual(n,"style")),t.style.strokeNoScale=!0,t.__simpleBox=i,Gm(t,r);var o=e.getItemLayout(n).sign;os(t.states,function(t,e){var n=r.getModel(e),i=wj(o,n),a=Sj(o,n)||i,s=t.style||(t.style={});i&&(s.fill=i),a&&(s.stroke=a)});var a=r.getModel("emphasis");Vm(t,a.get("focus"),a.get("blurScope"),a.get("disabled"))}function Pj(t,e){return as(t,function(t){return(t=t.slice())[1]=e.initBaseline,t})}var Oj=function(){},Rj=function(t){function e(e){var n=t.call(this,e)||this;return n.type="largeCandlestickBox",n}return Ma(e,t),e.prototype.getDefaultShape=function(){return new Oj},e.prototype.buildPath=function(t,e){for(var n=e.points,i=0;i<n.length;)if(this.__sign===n[i++]){var r=n[i++];t.moveTo(r,n[i++]),t.lineTo(r,n[i++])}else i+=3},e}(vg);function Bj(t,e,n,i){var r=t.getData(),o=r.getLayout("largePoints"),a=new Rj({shape:{points:o},__sign:1,ignoreCoarsePointer:!0});e.add(a);var s=new Rj({shape:{points:o},__sign:-1,ignoreCoarsePointer:!0});e.add(s);var l=new Rj({shape:{points:o},__sign:0,ignoreCoarsePointer:!0});e.add(l),Nj(1,a,t),Nj(-1,s,t),Nj(0,l,t),i&&(a.incremental=!0,s.incremental=!0),n&&n.push(a,s)}function Nj(t,e,n,i){var r=Sj(t,n)||wj(t,n),o=n.getModel("itemStyle").getItemStyle(Tj);e.useStyle(o),e.style.fill=null,e.style.stroke=r}const zj=Ij;var Fj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],n}return Ma(e,t),e.prototype.getShadowDim=function(){return"open"},e.prototype.brushSelector=function(t,e,n){var i=e.getItemLayout(t);return i&&n.rect(i.brushRect)},e.type="series.candlestick",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},e}(Hb);is(Fj,rj,!0);const Vj=Fj;function Hj(t){t&&ps(t.series)&&os(t.series,function(t){vs(t)&&"k"===t.type&&(t.type="candlestick")})}var jj={seriesType:"candlestick",plan:Gb(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),i=function(t,e){var n,i=t.getBaseAxis(),r="category"===i.type?i.getBandWidth():(n=i.getExtent(),Math.abs(n[1]-n[0])/e.count()),o=Rd(Is(t.get("barMaxWidth"),r),r),a=Rd(Is(t.get("barMinWidth"),1),r),s=t.get("barWidth");return null!=s?Rd(s,r):Math.max(Math.min(r/2,o),a)}(t,n),r=["x","y"],o=n.getDimensionIndex(n.mapDimension(r[0])),a=as(n.mapDimensionsAll(r[1]),n.getDimensionIndex,n),s=a[0],l=a[1],c=a[2],u=a[3];if(n.setLayout({candleWidth:i,isSimpleBox:i<=1.3}),!(o<0||a.length<4))return{progress:t.pipelineContext.large?function(n,i){for(var r,a,h=ID(4*n.count),d=0,p=[],f=[],g=i.getStore(),m=!!t.get(["itemStyle","borderColorDoji"]);null!=(a=n.next());){var y=g.get(o,a),v=g.get(s,a),_=g.get(l,a),x=g.get(c,a),b=g.get(u,a);isNaN(y)||isNaN(x)||isNaN(b)?(h[d++]=NaN,d+=3):(h[d++]=Wj(g,a,v,_,l,m),p[0]=y,p[1]=x,r=e.dataToPoint(p,null,f),h[d++]=r?r[0]:NaN,h[d++]=r?r[1]:NaN,p[1]=b,r=e.dataToPoint(p,null,f),h[d++]=r?r[1]:NaN)}i.setLayout("largePoints",h)}:function(t,n){for(var r,a=n.getStore();null!=(r=t.next());){var h=a.get(o,r),d=a.get(s,r),p=a.get(l,r),f=a.get(c,r),g=a.get(u,r),m=Math.min(d,p),y=Math.max(d,p),v=M(m,h),_=M(y,h),x=M(f,h),b=M(g,h),w=[];C(w,_,0),C(w,v,1),w.push(I(b),I(_),I(x),I(v));var S=!!n.getItemModel(r).get(["itemStyle","borderColorDoji"]);n.setItemLayout(r,{sign:Wj(a,r,d,p,l,S),initBaseline:d>p?_[1]:v[1],ends:w,brushRect:T(f,g,h)})}function M(t,n){var i=[];return i[0]=n,i[1]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(i)}function C(t,e,n){var r=e.slice(),o=e.slice();r[0]=LS(r[0]+i/2,1,!1),o[0]=LS(o[0]-i/2,1,!0),n?t.push(r,o):t.push(o,r)}function T(t,e,n){var r=M(t,n),o=M(e,n);return r[0]-=i/2,o[0]-=i/2,{x:r[0],y:r[1],width:i,height:o[1]-r[1]}}function I(t){return t[0]=LS(t[0],1),t}}}}};function Wj(t,e,n,i,r,o){return n>i?-1:n<i?1:o?0:e>0?t.get(r,e-1)<=i?1:-1:1}const Gj=jj;function Uj(t,e){var n=e.rippleEffectColor||e.color;t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})})}var qj=function(t){function e(e,n){var i=t.call(this)||this,r=new dL(e,n),o=new _d;return i.add(r),i.add(o),i.updateData(e,n),i}return Ma(e,t),e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,i=t.rippleNumber,r=this.childAt(1),o=0;o<i;o++){var a=hC(e,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-o/i*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(s).start(),r.add(a)}Uj(r,t)},e.prototype.updateEffectAnimation=function(t){for(var e=this._effectCfg,n=this.childAt(1),i=["symbolType","period","rippleScale","rippleNumber"],r=0;r<i.length;r++){var o=i[r];if(e[o]!==t[o])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}Uj(n,t)},e.prototype.highlight=function(){Tm(this)},e.prototype.downplay=function(){Im(this)},e.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},e.prototype.updateData=function(t,e){var n=this,i=t.hostModel;this.childAt(0).updateData(t,e);var r=this.childAt(1),o=t.getItemModel(e),a=t.getItemVisual(e,"symbol"),s=dC(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"style"),c=l&&l.fill,u=o.getModel("emphasis");r.setScale(s),r.traverse(function(t){t.setStyle("fill",c)});var h=pC(t.getItemVisual(e,"symbolOffset"),s);h&&(r.x=h[0],r.y=h[1]);var d=t.getItemVisual(e,"symbolRotate");r.rotation=(d||0)*Math.PI/180||0;var p={};p.showEffectOn=i.get("showEffectOn"),p.rippleScale=o.get(["rippleEffect","scale"]),p.brushType=o.get(["rippleEffect","brushType"]),p.period=1e3*o.get(["rippleEffect","period"]),p.effectOffset=e/t.count(),p.z=i.getShallow("z")||0,p.zlevel=i.getShallow("zlevel")||0,p.symbolType=a,p.color=c,p.rippleEffectColor=o.get(["rippleEffect","color"]),p.rippleNumber=o.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(t){"emphasis"===t?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===t&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,Vm(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype.fadeOut=function(t){t&&t()},e}(_d);const Yj=qj;var Xj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(){this._symbolDraw=new yL(Yj)},e.prototype.render=function(t,e,n){var i=t.getData(),r=this._symbolDraw;r.updateData(i,{clipShape:this._getClipShape(t)}),this.group.add(r.group)},e.prototype._getClipShape=function(t){var e=t.coordinateSystem,n=e&&e.getArea&&e.getArea();return t.get("clip",!0)?n:null},e.prototype.updateTransform=function(t,e,n){var i=t.getData();this.group.dirty();var r=WL("").reset(t,e,n);r.progress&&r.progress({start:0,end:i.count(),count:i.count()},i),this._symbolDraw.updateLayout()},e.prototype._updateGroupTransform=function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=tc(e.getRoamTransform()),this.group.decomposeTransform())},e.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0)},e.type="effectScatter",e}(eM);const $j=Xj,Zj=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return aD(null,this,{useEncodeDefaulter:!0})},e.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},e.type="series.effectScatter",e.dependencies=["grid","polar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},e}(Hb);var Kj=function(t){function e(e,n,i){var r=t.call(this)||this;return r.add(r.createLine(e,n,i)),r._updateEffectSymbol(e,n),r}return Ma(e,t),e.prototype.createLine=function(t,e,n){return new _F(t,e,n)},e.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),i=n.get("symbolSize"),r=n.get("symbol");ps(i)||(i=[i,i]);var o=t.getItemVisual(e,"style"),a=n.get("color")||o&&o.stroke,s=this.childAt(1);this._symbolType!==r&&(this.remove(s),(s=hC(r,-.5,-.5,1,1,a)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",a),s.setStyle(n.getItemStyle(["color"])),s.scaleX=i[0],s.scaleY=i[1],s.setColor(a),this._symbolType=r,this._symbolScale=i,this._updateEffectAnimation(t,n,e))},e.prototype._updateEffectAnimation=function(t,e,n){var i=this.childAt(1);if(i){var r=t.getItemLayout(n),o=1e3*e.get("period"),a=e.get("loop"),s=e.get("roundTrip"),l=e.get("constantSpeed"),c=Ts(e.get("delay"),function(e){return e/t.count()*o/3});if(i.ignore=!0,this._updateAnimationPoints(i,r),l>0&&(o=this._getLineLength(i)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){i.stopAnimation();var u=void 0;u=fs(c)?c(n):c,i.__t>0&&(u=-o*i.__t),this._animateSymbol(i,o,u,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},e.prototype._animateSymbol=function(t,e,n,i,r){if(e>0){t.__t=0;var o=this,a=t.animate("",i).when(r?2*e:e,{__t:r?2:1}).delay(n).during(function(){o._updateSymbolPosition(t)});i||a.done(function(){o.remove(t)}),a.start()}},e.prototype._getLineLength=function(t){return cl(t.__p1,t.__cp1)+cl(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},e.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},e.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,i=t.__cp1,r=t.__t<1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=nu,l=iu;o[0]=s(e[0],i[0],n[0],r),o[1]=s(e[1],i[1],n[1],r);var c=t.__t<1?l(e[0],i[0],n[0],r):l(n[0],i[0],e[0],1-r),u=t.__t<1?l(e[1],i[1],n[1],r):l(n[1],i[1],e[1],1-r);t.rotation=-Math.atan2(u,c)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT<t.__t?(t.scaleY=1.05*cl(a,o),1===r&&(o[0]=a[0]+(o[0]-a[0])/2,o[1]=a[1]+(o[1]-a[1])/2)):1===t.__lastT?t.scaleY=2*cl(e,o):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=o[0],t.y=o[1]},e.prototype.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var n=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,n,e)},e}(_d);const Jj=Kj;var Qj=function(t){function e(e,n,i){var r=t.call(this)||this;return r._createPolyline(e,n,i),r}return Ma(e,t),e.prototype._createPolyline=function(t,e,n){var i=t.getItemLayout(e),r=new Hw({shape:{points:i}});this.add(r),this._updateCommonStl(t,e,n)},e.prototype.updateData=function(t,e,n){var i=t.hostModel;Jm(this.childAt(0),{shape:{points:t.getItemLayout(e)}},i,e),this._updateCommonStl(t,e,n)},e.prototype._updateCommonStl=function(t,e,n){var i=this.childAt(0),r=t.getItemModel(e),o=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||t.hasItemOption){var c=r.getModel("emphasis");o=c.getModel("lineStyle").getLineStyle(),l=c.get("disabled"),a=c.get("focus"),s=c.get("blurScope")}i.useStyle(t.getItemVisual(e,"style")),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,Vm(this,a,s,l)},e.prototype.updateLayout=function(t,e){this.childAt(0).setShape("points",t.getItemLayout(e))},e}(_d);const tW=Qj;var eW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._lastFrame=0,e._lastFramePercent=0,e}return Ma(e,t),e.prototype.createLine=function(t,e,n){return new tW(t,e,n)},e.prototype._updateAnimationPoints=function(t,e){this._points=e;for(var n=[0],i=0,r=1;r<e.length;r++){var o=e[r-1],a=e[r];i+=cl(o,a),n.push(i)}if(0!==i){for(r=0;r<n.length;r++)n[r]/=i;this._offsets=n,this._length=i}else this._length=0},e.prototype._getLineLength=function(){return this._length},e.prototype._updateSymbolPosition=function(t){var e=t.__t<1?t.__t:2-t.__t,n=this._points,i=this._offsets,r=n.length;if(i){var o,a=this._lastFrame;if(e<this._lastFramePercent){for(o=Math.min(a+1,r-1);o>=0&&!(i[o]<=e);o--);o=Math.min(o,r-2)}else{for(o=a;o<r&&!(i[o]>e);o++);o=Math.min(o-1,r-2)}var s=(e-i[o])/(i[o+1]-i[o]),l=n[o],c=n[o+1];t.x=l[0]*(1-s)+s*c[0],t.y=l[1]*(1-s)+s*c[1];var u=t.__t<1?c[0]-l[0]:l[0]-c[0],h=t.__t<1?c[1]-l[1]:l[1]-c[1];t.rotation=-Math.atan2(h,u)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},e}(Jj);const nW=eW;var iW=function(){this.polyline=!1,this.curveness=0,this.segs=[]},rW=function(t){function e(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return Ma(e,t),e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new iW},e.prototype.buildPath=function(t,e){var n,i=e.segs,r=e.curveness;if(e.polyline)for(n=this._off;n<i.length;){var o=i[n++];if(o>0){t.moveTo(i[n++],i[n++]);for(var a=1;a<o;a++)t.lineTo(i[n++],i[n++])}}else for(n=this._off;n<i.length;){var s=i[n++],l=i[n++],c=i[n++],u=i[n++];if(t.moveTo(s,l),r>0){var h=(s+c)/2-(l-u)*r,d=(l+u)/2-(c-s)*r;t.quadraticCurveTo(h,d,c,u)}else t.lineTo(c,u)}this.incremental&&(this._off=n,this.notClear=!0)},e.prototype.findDataIndex=function(t,e){var n=this.shape,i=n.segs,r=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<i.length;){var l=i[s++];if(l>0)for(var c=i[s++],u=i[s++],h=1;h<l;h++)if(Kf(c,u,d=i[s++],p=i[s++],o,t,e))return a;a++}else for(a=0,s=0;s<i.length;){c=i[s++],u=i[s++];var d=i[s++],p=i[s++];if(r>0){if(Qf(c,u,(c+d)/2-(u-p)*r,(u+p)/2-(d-c)*r,d,p,o,t,e))return a}else if(Kf(c,u,d,p,o,t,e))return a;a++}return-1},e.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),i=this.getBoundingRect();return t=n[0],e=n[1],i.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,i=1/0,r=-1/0,o=-1/0,a=0;a<e.length;){var s=e[a++],l=e[a++];n=Math.min(s,n),r=Math.max(s,r),i=Math.min(l,i),o=Math.max(l,o)}t=this._rect=new dc(n,i,r,o)}return t},e}(vg);const oW=function(){function t(){this.group=new _d}return t.prototype.updateData=function(t){this._clear();var e=this._create();e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t)},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clear()},t.prototype.incrementalUpdate=function(t,e){var n=this._newAdded[0],i=e.getLayout("linesPoints"),r=n&&n.shape.segs;if(r&&r.length<2e4){var o=r.length,a=new Float32Array(o+i.length);a.set(r),a.set(i,o),n.setShape({segs:a})}else{this._newAdded=[];var s=this._create();s.incremental=!0,s.setShape({segs:i}),this._setCommon(s,e),s.__startIndex=t.start}},t.prototype.remove=function(){this._clear()},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new rW({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(t),this.group.add(t),t},t.prototype._setCommon=function(t,e,n){var i=e.hostModel;t.setShape({polyline:i.get("polyline"),curveness:i.get(["lineStyle","curveness"])}),t.useStyle(i.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var r=e.getVisual("style");r&&r.stroke&&t.setStyle("stroke",r.stroke),t.setStyle("fill",null);var o=Zg(t);o.seriesIndex=i.seriesIndex,t.on("mousemove",function(e){o.dataIndex=null;var n=t.hoverDataIdx;n>0&&(o.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}();var aW={seriesType:"lines",plan:Gb(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),i=t.pipelineContext.large;return{progress:function(r,o){var a=[];if(i){var s=void 0,l=r.end-r.start;if(n){for(var c=0,u=r.start;u<r.end;u++)c+=t.getLineCoordsCount(u);s=new Float32Array(l+2*c)}else s=new Float32Array(4*l);var h=0,d=[];for(u=r.start;u<r.end;u++){var p=t.getLineCoords(u,a);n&&(s[h++]=p);for(var f=0;f<p;f++)d=e.dataToPoint(a[f],!1,d),s[h++]=d[0],s[h++]=d[1]}o.setLayout("linesPoints",s)}else for(u=r.start;u<r.end;u++){var g=o.getItemModel(u),m=(p=t.getLineCoords(u,a),[]);if(n)for(var y=0;y<p;y++)m.push(e.dataToPoint(a[y]));else{m[0]=e.dataToPoint(a[0]),m[1]=e.dataToPoint(a[1]);var v=g.get(["lineStyle","curveness"]);+v&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*v,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*v])}o.setItemLayout(u,m)}}}}}};const sW=aW,lW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this._updateLineDraw(i,t),o=t.get("zlevel"),a=t.get(["effect","trailLength"]),s=n.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(o).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&a>0&&(l||s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)})),r.updateData(i);var c=t.get("clip",!0)&&AL(t.coordinateSystem,!1,t);c?this.group.setClipPath(c):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,e,n){var i=t.getData();this._updateLineDraw(i,t).incrementalPrepareUpdate(i),this._clearLayer(n),this._finished=!1},e.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData()),this._finished=t.end===e.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,e,n){var i=t.getData(),r=t.pipelineContext;if(!this._finished||r.large||r.progressiveRender)return{update:!0};var o=sW.reset(t,e,n);o.progress&&o.progress({start:0,end:i.count(),count:i.count()},i),this._lineDraw.updateLayout(),this._clearLayer(n)},e.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,i=this._showEffect(e),r=!!e.get("polyline"),o=e.pipelineContext.large;return n&&i===this._hasEffet&&r===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new oW:new SF(r?i?nW:tW:i?Jj:_F),this._hasEffet=i,this._isPolyline=r,this._isLargeDraw=o),this.group.add(n.group),n},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var e=t.getZr();"svg"===e.painter.getType()||null==this._lastZlevel||e.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.type="lines",e}(eM);var cW="undefined"==typeof Uint32Array?Array:Uint32Array,uW="undefined"==typeof Float64Array?Array:Float64Array;function hW(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(t.data=as(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),Ka([e,t[0],t[1]])}))}var dW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.visualStyleAccessPath="lineStyle",n.visualDrawType="stroke",n}return Ma(e,t),e.prototype.init=function(e){e.data=e.data||[],hW(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(e){if(hW(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=Vs(this._flatCoords,e.flatCoords),this._flatCoordsOffset=Vs(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t);return e.option instanceof Array?e.option:e.getShallow("coords")},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r<i;r++)e[r]=e[r]||[],e[r][0]=this._flatCoords[n+2*r],e[r][1]=this._flatCoords[n+2*r+1];return i}var o=this._getCoordsFromItemModel(t);for(r=0;r<o.length;r++)e[r]=e[r]||[],e[r][0]=o[r][0],e[r][1]=o[r][1];return o.length},e.prototype._processFlatCoordsArray=function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),ys(t[0])){for(var n=t.length,i=new cW(n),r=new uW(n),o=0,a=0,s=0,l=0;l<n;){s++;var c=t[l++];i[a++]=o+e,i[a++]=c;for(var u=0;u<c;u++){var h=t[l++],d=t[l++];r[o++]=h,r[o++]=d}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,a),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,e){var n=new ZI(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],function(t,e,i,r){if(t instanceof Array)return NaN;n.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[r]:o:void 0}),n},e.prototype.formatTooltip=function(t,e,n){var i=this.getData().getItemModel(t),r=i.get("name");if(r)return r;var o=i.get("fromName"),a=i.get("toName"),s=[];return null!=o&&s.push(o),null!=a&&s.push(a),yb("nameValue",{name:s.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(Hb);const pW=dW;function fW(t){return t instanceof Array||(t=[t,t]),t}const gW={seriesType:"lines",reset:function(t){var e=fW(t.get("symbol")),n=fW(t.get("symbolSize")),i=t.getData();return i.setVisual("fromSymbol",e&&e[0]),i.setVisual("toSymbol",e&&e[1]),i.setVisual("fromSymbolSize",n&&n[0]),i.setVisual("toSymbolSize",n&&n[1]),{dataEach:i.hasItemOption?function(t,e){var n=t.getItemModel(e),i=fW(n.getShallow("symbol",!0)),r=fW(n.getShallow("symbolSize",!0));i[0]&&t.setItemVisual(e,"fromSymbol",i[0]),i[1]&&t.setItemVisual(e,"toSymbol",i[1]),r[0]&&t.setItemVisual(e,"fromSymbolSize",r[0]),r[1]&&t.setItemVisual(e,"toSymbolSize",r[1])}:null}}};var mW=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=Pa.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,n,i,r,o){var a=this._getBrush(),s=this._getGradient(r,"inRange"),l=this._getGradient(r,"outOfRange"),c=this.pointSize+this.blurSize,u=this.canvas,h=u.getContext("2d"),d=t.length;u.width=e,u.height=n;for(var p=0;p<d;++p){var f=t[p],g=f[0],m=f[1],y=i(f[2]);h.globalAlpha=y,h.drawImage(a,g-c,m-c)}if(!u.width||!u.height)return u;for(var v=h.getImageData(0,0,u.width,u.height),_=v.data,x=0,b=_.length,w=this.minOpacity,S=this.maxOpacity-w;x<b;){y=_[x+3]/256;var M=4*Math.floor(255*y);if(y>0){var C=o(y)?s:l;y>0&&(y=y*S+w),_[x++]=C[M],_[x++]=C[M+1],_[x++]=C[M+2],_[x++]=C[M+3]*y*256}else x+=4}return h.putImageData(v,0,0),u},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=Pa.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var i=t.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-e,e,this.pointSize,0,2*Math.PI,!0),i.closePath(),i.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,i=n[e]||(n[e]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,r),i[o++]=r[0],i[o++]=r[1],i[o++]=r[2],i[o++]=r[3];return i},t}();const yW=mW;function vW(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]}var _W=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i;e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(n){n===t&&(i=e)})}),this._progressiveEls=null,this.group.removeAll();var r=t.coordinateSystem;"cartesian2d"===r.type||"calendar"===r.type?this._renderOnCartesianAndCalendar(t,n,0,t.getData().count()):vW(r)&&this._renderOnGeo(r,t,i,n)},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},e.prototype.incrementalRender=function(t,e,n,i){var r=e.coordinateSystem;r&&(vW(r)?this.render(e,n,i):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(e,i,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,e,n,i,r){var o,a,s,l,c=t.coordinateSystem,u=EL(c,"cartesian2d");if(u){var h=c.getAxis("x"),d=c.getAxis("y");o=h.getBandWidth()+.5,a=d.getBandWidth()+.5,s=h.scale.getExtent(),l=d.scale.getExtent()}for(var p=this.group,f=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),m=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),v=t.get(["itemStyle","borderRadius"]),_=cy(t),x=t.getModel("emphasis"),b=x.get("focus"),w=x.get("blurScope"),S=x.get("disabled"),M=u?[f.mapDimension("x"),f.mapDimension("y"),f.mapDimension("value")]:[f.mapDimension("time"),f.mapDimension("value")],C=n;C<i;C++){var T=void 0,I=f.getItemVisual(C,"style");if(u){var D=f.get(M[0],C),k=f.get(M[1],C);if(isNaN(f.get(M[2],C))||isNaN(D)||isNaN(k)||D<s[0]||D>s[1]||k<l[0]||k>l[1])continue;var A=c.dataToPoint([D,k]);T=new Pg({shape:{x:A[0]-o/2,y:A[1]-a/2,width:o,height:a},style:I})}else{if(isNaN(f.get(M[1],C)))continue;T=new Pg({z2:1,shape:c.dataToRect([f.get(M[0],C)]).contentShape,style:I})}if(f.hasItemOption){var E=f.getItemModel(C),L=E.getModel("emphasis");g=L.getModel("itemStyle").getItemStyle(),m=E.getModel(["blur","itemStyle"]).getItemStyle(),y=E.getModel(["select","itemStyle"]).getItemStyle(),v=E.get(["itemStyle","borderRadius"]),b=L.get("focus"),w=L.get("blurScope"),S=L.get("disabled"),_=cy(E)}T.shape.r=v;var P=t.getRawValue(C),O="-";P&&null!=P[2]&&(O=P[2]+""),ly(T,_,{labelFetcher:t,labelDataIndex:C,defaultOpacity:I.opacity,defaultText:O}),T.ensureState("emphasis").style=g,T.ensureState("blur").style=m,T.ensureState("select").style=y,Vm(T,b,w,S),T.incremental=r,r&&(T.states.emphasis.hoverLayer=!0),p.add(T),f.setItemGraphicEl(C,T),this._progressiveEls&&this._progressiveEls.push(T)}},e.prototype._renderOnGeo=function(t,e,n,i){var r=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new yW;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),c=t.getRoamTransform();l.applyTransform(c);var u=Math.max(l.x,0),h=Math.max(l.y,0),d=Math.min(l.width+l.x,i.getWidth()),p=Math.min(l.height+l.y,i.getHeight()),f=d-u,g=p-h,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],y=a.mapArray(m,function(e,n,i){var r=t.dataToPoint([e,n]);return r[0]-=u,r[1]-=h,r.push(i),r}),v=n.getExtent(),_="visualMap.continuous"===n.type?function(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}(v,n.option.range):function(t,e,n){var i=t[1]-t[0],r=(e=as(e,function(e){return{interval:[(e.interval[0]-t[0])/i,(e.interval[1]-t[0])/i]}})).length,o=0;return function(t){var i;for(i=o;i<r;i++)if((a=e[i].interval)[0]<=t&&t<=a[1]){o=i;break}if(i===r)for(i=o-1;i>=0;i--){var a;if((a=e[i].interval)[0]<=t&&t<=a[1]){o=i;break}}return i>=0&&i<r&&n[i]}}(v,n.getPieceList(),n.option.selected);s.update(y,f,g,r.color.getNormalizer(),{inRange:r.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Cg({style:{width:f,height:g,x:u,y:h,image:s.canvas},silent:!0});this.group.add(x)},e.type="heatmap",e}(eM);const xW=_W,bW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){return aD(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=A_.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(Hb);var wW=["itemStyle","borderWidth"],SW=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],MW=new pw,CW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=this.group,r=t.getData(),o=this._data,a=t.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),c={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:SW[+s],categoryDim:SW[1-+s]};r.diff(o).add(function(t){if(r.hasValue(t)){var e=PW(r,t),n=TW(r,t,e,c),o=BW(r,c,n);r.setItemGraphicEl(t,o),i.add(o),HW(o,c,n)}}).update(function(t,e){var n=o.getItemGraphicEl(e);if(r.hasValue(t)){var a=PW(r,t),s=TW(r,t,a,c),l=zW(r,s);n&&l!==n.__pictorialShapeStr&&(i.remove(n),r.setItemGraphicEl(t,null),n=null),n?function(t,e,n){var i=n.animationModel,r=n.dataIndex;Jm(t.__pictorialBundle,{x:n.bundlePosition[0],y:n.bundlePosition[1]},i,r),n.symbolRepeat?kW(t,e,n,!0):AW(t,0,n,!0),EW(t,n,!0),LW(t,e,n,!0)}(n,c,s):n=BW(r,c,s,!0),r.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,i.add(n),HW(n,c,s)}else i.remove(n)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&NW(o,t,e.__pictorialSymbolMeta.animationModel,e)}).execute();var u=t.get("clip",!0)?AL(t.coordinateSystem,!1,t):null;return u?i.setClipPath(u):i.removeClipPath(),this._data=r,this.group},e.prototype.remove=function(t,e){var n=this.group,i=this._data;t.get("animation")?i&&i.eachItemGraphicEl(function(e){NW(i,Zg(e).dataIndex,t,e)}):n.removeAll()},e.type="pictorialBar",e}(eM);function TW(t,e,n,i){var r=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,c=n.get("symbolPatternSize")||2,u=n.isAnimationEnabled(),h={dataIndex:e,layout:r,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:l,animationModel:u?n:null,hoverScale:u&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!function(t,e,n,i,r){var o,a=i.valueDim,s=t.get("symbolBoundingData"),l=i.coordSys.getOtherAxis(i.coordSys.getBaseAxis()),c=l.toGlobalCoord(l.dataToCoord(0)),u=1-+(n[a.wh]<=0);if(ps(s)){var h=[IW(l,s[0])-c,IW(l,s[1])-c];h[1]<h[0]&&h.reverse(),o=h[u]}else o=null!=s?IW(l,s)-c:e?i.coordSysExtent[a.index][u]-c:n[a.wh];r.boundingLength=o,e&&(r.repeatCutLength=n[a.wh]);var d="x"===a.xy,p=l.inverse;r.pxSign=d&&!p||!d&&p?o>=0?1:-1:o>0?1:-1}(n,o,r,i,h),function(t,e,n,i,r,o,a,s,l,c){var u,h=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=t.getItemVisual(e,"symbolSize");(u=ps(f)?f.slice():null==f?["100%","100%"]:[f,f])[d.index]=Rd(u[d.index],p),u[h.index]=Rd(u[h.index],i?p:Math.abs(o)),c.symbolSize=u,(c.symbolScale=[u[0]/s,u[1]/s])[h.index]*=(l.isHorizontal?-1:1)*a}(t,e,r,o,0,h.boundingLength,h.pxSign,c,i,h),function(t,e,n,i,r){var o=t.get(wW)||0;o&&(MW.attr({scaleX:e[0],scaleY:e[1],rotation:n}),MW.updateTransform(),o/=MW.getLineScale(),o*=e[i.valueDim.index]),r.valueLineWidth=o||0}(n,h.symbolScale,l,i,h);var d=h.symbolSize,p=pC(n.get("symbolOffset"),d);return function(t,e,n,i,r,o,a,s,l,c,u,h){var d=u.categoryDim,p=u.valueDim,f=h.pxSign,g=Math.max(e[p.index]+s,0),m=g;if(i){var y=Math.abs(l),v=Ts(t.get("symbolMargin"),"15%")+"",_=!1;v.lastIndexOf("!")===v.length-1&&(_=!0,v=v.slice(0,v.length-1));var x=Rd(v,e[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=ep(i),M=S?i:jW((y+w)/b);b=g+2*(x=(y-M*g)/2/(_?M:Math.max(M-1,1))),w=_?0:2*x,S||"fixed"===i||(M=c?jW((Math.abs(c)+w)/b):0),m=M*b-w,h.repeatTimes=M,h.symbolMargin=x}var C=f*(m/2),T=h.pathPosition=[];T[d.index]=n[d.wh]/2,T[p.index]="start"===a?C:"end"===a?l-C:l/2,o&&(T[0]+=o[0],T[1]+=o[1]);var I=h.bundlePosition=[];I[d.index]=n[d.xy],I[p.index]=n[p.xy];var D=h.barRectShape=Ja({},n);D[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(T[p.index]+C)),D[d.wh]=n[d.wh];var k=h.clipShape={};k[d.xy]=-n[d.xy],k[d.wh]=u.ecSize[d.wh],k[p.xy]=0,k[p.wh]=n[p.wh]}(n,d,r,o,0,p,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,i,h),h}function IW(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function DW(t){var e=t.symbolPatternSize,n=hC(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function kW(t,e,n,i){var r=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,c=n.repeatTimes||0,u=0,h=o[e.valueDim.index]+a+2*n.symbolMargin;for(FW(t,function(t){t.__pictorialAnimationIndex=u,t.__pictorialRepeatTimes=c,u<c?VW(t,null,f(u),n,i):VW(t,null,{scaleX:0,scaleY:0},n,i,function(){r.remove(t)}),u++});u<c;u++){var d=DW(n);d.__pictorialAnimationIndex=u,d.__pictorialRepeatTimes=c,r.add(d);var p=f(u);VW(d,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,i)}function f(t){var e=s.slice(),i=n.pxSign,r=t;return("start"===n.symbolRepeatDirection?i>0:i<0)&&(r=c-1-t),e[l.index]=h*(r-c/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function AW(t,e,n,i){var r=t.__pictorialBundle,o=t.__pictorialMainPath;o?VW(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,i):(o=t.__pictorialMainPath=DW(n),r.add(o),VW(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,i))}function EW(t,e,n){var i=Ja({},e.barRectShape),r=t.__pictorialBarRect;r?VW(r,null,{shape:i},e,n):((r=t.__pictorialBarRect=new Pg({z2:2,shape:i,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(r))}function LW(t,e,n,i){if(n.symbolClip){var r=t.__pictorialClipPath,o=Ja({},n.clipShape),s=e.valueDim,l=n.animationModel,c=n.dataIndex;if(r)Jm(r,{shape:o},l,c);else{o[s.wh]=0,r=new Pg({shape:o}),t.__pictorialBundle.setClipPath(r),t.__pictorialClipPath=r;var u={};u[s.wh]=n.clipShape[s.wh],a[i?"updateProps":"initProps"](r,{shape:u},l,c)}}}function PW(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=OW,n.isAnimationEnabled=RW,n}function OW(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function RW(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function BW(t,e,n,i){var r=new _d,o=new _d;return r.add(o),r.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?kW(r,e,n):AW(r,0,n),EW(r,n,i),LW(r,e,n,i),r.__pictorialShapeStr=zW(t,n),r.__pictorialSymbolMeta=n,r}function NW(t,e,n,i){var r=i.__pictorialBarRect;r&&r.removeTextContent();var o=[];FW(i,function(t){o.push(t)}),i.__pictorialMainPath&&o.push(i.__pictorialMainPath),i.__pictorialClipPath&&(n=null),os(o,function(t){ey(t,{scaleX:0,scaleY:0},n,e,function(){i.parent&&i.parent.remove(i)})}),t.setItemGraphicEl(e,null)}function zW(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function FW(t,e,n){os(t.__pictorialBundle.children(),function(i){i!==t.__pictorialBarRect&&e.call(n,i)})}function VW(t,e,n,i,r,o){e&&t.attr(e),i.symbolClip&&!r?n&&t.attr(n):n&&a[r?"updateProps":"initProps"](t,n,i.animationModel,i.dataIndex,o)}function HW(t,e,n){var i=n.dataIndex,r=n.itemModel,o=r.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=r.getModel(["blur","itemStyle"]).getItemStyle(),l=r.getModel(["select","itemStyle"]).getItemStyle(),c=r.getShallow("cursor"),u=o.get("focus"),h=o.get("blurScope"),d=o.get("scale");FW(t,function(t){if(t instanceof Cg){var e=t.style;t.useStyle(Ja({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var i=t.ensureState("emphasis");i.style=a,d&&(i.scaleX=1.1*t.scaleX,i.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,c&&(t.cursor=c),t.z2=n.z2});var p=e.valueDim.posDesc[+(n.boundingLength>0)],f=t.__pictorialBarRect;f.ignoreClip=!0,ly(f,cy(r),{labelFetcher:e.seriesModel,labelDataIndex:i,defaultText:lL(e.seriesModel.getData(),i),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),Vm(t,u,h,o.get("disabled"))}function jW(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}const WW=CW,GW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.hasSymbolVisual=!0,n.defaultSymbol="roundRect",n}return Ma(e,t),e.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=Ny(XL.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(XL);var UW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._layers=[],n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=t.getData(),r=this,o=this.group,a=t.getLayerSeries(),s=i.getLayout("layoutInfo"),l=s.rect,c=s.boundaryGap;function u(t){return t.name}o.x=0,o.y=l.y+c[0];var h=new CI(this._layersSeries||[],a,u,u),d=[];function p(e,n,s){var l=r._layers;if("remove"!==e){for(var c,u,h=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var m=i.getItemLayout(f[g]),y=m.x,v=m.y0,_=m.y;h.push(y,v),p.push(y,v+_),c=i.getItemVisual(f[g],"style")}var x=i.getItemLayout(f[0]),b=t.getModel("label").get("margin"),w=t.getModel("emphasis");if("add"===e){var S=d[n]=new _d;u=new IL({shape:{points:h,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),S.add(u),o.add(S),t.isAnimationEnabled()&&u.setClipPath(function(t,e){var n=new Pg({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return Qm(n,{shape:{x:t.x-50,width:t.width+100,height:t.height+20}},e,function(){u.removeClipPath()}),n}(u.getBoundingRect(),t))}else S=l[s],u=S.childAt(0),o.add(S),d[n]=S,Jm(u,{shape:{points:h,stackedOnPoints:p}},t),ry(u);ly(u,cy(t),{labelDataIndex:f[g-1],defaultText:i.getName(f[g-1]),inheritColor:c.fill},{normal:{verticalAlign:"middle"}}),u.setTextConfig({position:null,local:!0});var M=u.getTextContent();M&&(M.x=x.x-b,M.y=x.y0+x.y/2),u.useStyle(c),i.setItemGraphicEl(n,u),Gm(u,t),Vm(u,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[n])}h.add(hs(p,this,"add")).update(hs(p,this,"update")).remove(hs(p,this,"remove")).execute(),this._layersSeries=a,this._layers=d},e.type="themeRiver",e}(eM);const qW=UW;var YW=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new NP(hs(this.getData,this),hs(this.getRawData,this))},e.prototype.fixData=function(t){var e=t.length,n={},i=Dp(t,function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]}),r=[];i.buckets.each(function(t,e){r.push({name:e,dataList:t})});for(var o=r.length,a=0;a<o;++a){for(var s=r[a].name,l=0;l<r[a].dataList.length;++l){var c=r[a].dataList[l][0]+"";n[c]=a}for(var c in n)n.hasOwnProperty(c)&&n[c]!==a&&(n[c]=a,t[e]=[c,0,s],e++)}return t},e.prototype.getInitialData=function(t,e){for(var n=this.getReferringComponents("singleAxis",Mp).models[0].get("type"),i=ls(t.data,function(t){return void 0!==t[2]}),r=this.fixData(i||[]),o=[],a=this.nameMap=Fs(),s=0,l=0;l<r.length;++l)o.push(r[l][2]),a.get(r[l][2])||(a.set(r[l][2],s),s++);var c=JI(r,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:DI(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,u=new ZI(c,this);return u.initData(r),u},e.prototype.getLayerSeries=function(){for(var t=this.getData(),e=t.count(),n=[],i=0;i<e;++i)n[i]=i;var r=t.mapDimension("single"),o=Dp(n,function(e){return t.get("name",e)}),a=[];return o.buckets.each(function(e,n){e.sort(function(e,n){return t.get(r,e)-t.get(r,n)}),a.push({name:n,indices:e})}),a},e.prototype.getAxisTooltipData=function(t,e,n){ps(t)||(t=t?[t]:[]);for(var i,r=this.getData(),o=this.getLayerSeries(),a=[],s=o.length,l=0;l<s;++l){for(var c=Number.MAX_VALUE,u=-1,h=o[l].indices.length,d=0;d<h;++d){var p=r.get(t[0],o[l].indices[d]),f=Math.abs(p-e);f<=c&&(i=p,c=f,u=o[l].indices[d])}a.push(u)}return{dataIndices:a,nestestValue:i}},e.prototype.formatTooltip=function(t,e,n){var i=this.getData();return yb("nameValue",{name:i.getName(t),value:i.get(i.mapDimension("value"),t)})},e.type="series.themeRiver",e.dependencies=["singleAxis"],e.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},e}(Hb);const XW=YW;function $W(t,e){t.eachSeriesByType("themeRiver",function(t){var e=t.getData(),n=t.coordinateSystem,i={},r=n.getRect();i.rect=r;var o=t.get("boundaryGap"),a=n.getAxis();i.boundaryGap=o,"horizontal"===a.orient?(o[0]=Rd(o[0],r.height),o[1]=Rd(o[1],r.height),ZW(e,t,r.height-o[0]-o[1])):(o[0]=Rd(o[0],r.width),o[1]=Rd(o[1],r.width),ZW(e,t,r.width-o[0]-o[1])),e.setLayout("layoutInfo",i)})}function ZW(t,e,n){if(t.count())for(var i,r=e.coordinateSystem,o=e.getLayerSeries(),a=t.mapDimension("single"),s=t.mapDimension("value"),l=as(o,function(e){return as(e.indices,function(e){var n=r.dataToPoint(t.get(a,e));return n[1]=t.get(s,e),n})}),c=function(t){for(var e=t.length,n=t[0].length,i=[],r=[],o=0,a=0;a<n;++a){for(var s=0,l=0;l<e;++l)s+=t[l][a][1];s>o&&(o=s),i.push(s)}for(var c=0;c<n;++c)r[c]=(o-i[c])/2;o=0;for(var u=0;u<n;++u){var h=i[u]+r[u];h>o&&(o=h)}return{y0:r,max:o}}(l),u=c.y0,h=n/c.max,d=o.length,p=o[0].indices.length,f=0;f<p;++f){i=u[f]*h,t.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:i,y:l[0][f][1]*h});for(var g=1;g<d;++g)i+=l[g-1][f][1]*h,t.setItemLayout(o[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:i,y:l[g][f][1]*h})}}var KW=function(t){function e(e,n,i,r){var o=t.call(this)||this;o.z2=2,o.textConfig={inside:!0},Zg(o).seriesIndex=n.seriesIndex;var a=new $g({z2:4,silent:e.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,e,n,i,r),o}return Ma(e,t),e.prototype.updateData=function(t,e,n,i,r){this.node=e,e.piece=this,n=n||this._seriesModel,i=i||this._ecModel;var o=this;Zg(o).dataIndex=e.dataIndex;var a=e.getModel(),s=a.getModel("emphasis"),l=e.getLayout(),c=Ja({},l);c.label=null;var u=e.getVisual("style");u.lineJoin="bevel";var h=e.getVisual("decal");h&&(u.decal=jC(h,r));var d=eP(a.getModel("itemStyle"),c,!0);Ja(c,d),os(nm,function(t){var e=o.ensureState(t),n=a.getModel([t,"itemStyle"]);e.style=n.getItemStyle();var i=eP(n,c);i&&(e.shape=i)}),t?(o.setShape(c),o.shape.r=l.r0,Qm(o,{shape:{r:l.r}},n,e.dataIndex)):(Jm(o,{shape:c},n),ry(o)),o.useStyle(u),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=i||this._ecModel;var f=s.get("focus");Vm(this,"relative"===f?Vs(e.getAncestorsIndices(),e.getDescendantIndices()):"ancestor"===f?e.getAncestorsIndices():"descendant"===f?e.getDescendantIndices():f,s.get("blurScope"),s.get("disabled"))},e.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),i=n.getModel("label"),r=this.node.getLayout(),o=r.endAngle-r.startAngle,a=(r.startAngle+r.endAngle)/2,s=Math.cos(a),l=Math.sin(a),c=this,u=c.getTextContent(),h=this.node.dataIndex,d=i.get("minAngle")/180*Math.PI,p=i.get("show")&&!(null!=d&&Math.abs(o)<d);function f(t,e){var n=t.get(e);return null==n?i.get(e):n}u.ignore=!p,os(im,function(i){var d="normal"===i?n.getModel("label"):n.getModel([i,"label"]),p="normal"===i,g=p?u:u.ensureState(i),m=t.getFormattedLabel(h,i);p&&(m=m||e.node.name),g.style=uy(d,{},null,"normal"!==i,!0),m&&(g.style.text=m);var y=d.get("show");null==y||p||(g.ignore=!y);var v,_=f(d,"position"),x=p?c:c.states[i],b=x.style.fill;x.textConfig={outsideFill:"inherit"===d.get("color")?b:null,inside:"outside"!==_};var w=f(d,"distance")||0,S=f(d,"align"),M=f(d,"rotate"),C=.5*Math.PI,T=1.5*Math.PI,I=eg("tangential"===M?Math.PI/2-a:a),D=I>C&&!qd(I-C)&&I<T;"outside"===_?(v=r.r+w,S=D?"right":"left"):S&&"center"!==S?"left"===S?(v=r.r0+w,S=D?"right":"left"):"right"===S&&(v=r.r-w,S=D?"left":"right"):(v=o===2*Math.PI&&0===r.r0?0:(r.r+r.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=v*s+r.cx,g.y=v*l+r.cy;var k=0;"radial"===M?k=eg(-a)+(D?Math.PI:0):"tangential"===M?k=eg(Math.PI/2-a)+(D?Math.PI:0):ys(M)&&(k=M*Math.PI/180),g.rotation=eg(k)}),u.dirtyStyle()},e}(Ew);const JW=KW;var QW="sunburstRootToNode",tG="sunburstHighlight",eG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n,i){var r=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,c=t.get("renderLabelForZeroData"),u=[];s.eachNode(function(t){u.push(t)});var h=this._oldChildren||[];!function(i,r){function s(t){return t.getId()}function u(s,u){!function(i,r){if(c||!i||i.getValue()||(i=null),i!==a&&r!==a)if(r&&r.piece)i?(r.piece.updateData(!1,i,t,e,n),o.setItemGraphicEl(i.dataIndex,r.piece)):(u=r)&&u.piece&&(l.remove(u.piece),u.piece=null);else if(i){var s=new JW(i,t,e,n);l.add(s),o.setItemGraphicEl(i.dataIndex,s)}var u}(null==s?null:i[s],null==u?null:r[u])}0===i.length&&0===r.length||new CI(r,i,s,s).add(u).update(u).remove(ds(u,null)).execute()}(u,h),function(i,o){o.depth>0?(r.virtualPiece?r.virtualPiece.updateData(!1,i,t,e,n):(r.virtualPiece=new JW(i,t,e,n),l.add(r.virtualPiece)),o.piece.off("click"),r.virtualPiece.on("click",function(t){r._rootToNode(o.parentNode)})):r.virtualPiece&&(l.remove(r.virtualPiece),r.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=u},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(e){var n=!1;t.seriesModel.getViewRoot().eachNode(function(i){if(!n&&i.piece&&i.piece===e.target){var r=i.getModel().get("nodeClick");if("rootToNode"===r)t._rootToNode(i);else if("link"===r){var o=i.getModel(),a=o.get("link");a&&Ev(a,o.get("target",!0)||"_blank")}n=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:QW,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var i=t[0]-n.cx,r=t[1]-n.cy,o=Math.sqrt(i*i+r*r);return o<=n.r&&o>=n.r0}},e.type="sunburst",e}(eM);const nG=eG;function iG(t){var e=0;os(t.children,function(t){iG(t);var n=t.value;ps(n)&&(n=n[0]),e+=n});var n=t.value;ps(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),ps(t.value)?t.value[0]=n:t.value=n}const rG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.ignoreStyleOnData=!0,n}return Ma(e,t),e.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};iG(n);var i=this._levelModels=as(t.levels||[],function(t){return new Oy(t,this,e)},this),r=wN.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=r.getNodeByDataIndex(e),o=i[n.depth];return o&&(t.parentModel=o),t})});return r.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=TN(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},e.prototype.enableAriaDecal=function(){PN(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(Hb);var oG=Math.PI/180;function aG(t,e,n){e.eachSeriesByType(t,function(t){var e=t.get("center"),i=t.get("radius");ps(i)||(i=[0,i]),ps(e)||(e=[e,e]);var r=n.getWidth(),o=n.getHeight(),a=Math.min(r,o),s=Rd(e[0],r),l=Rd(e[1],o),c=Rd(i[0],a/2),u=Rd(i[1],a/2),h=-t.get("startAngle")*oG,d=t.get("minAngle")*oG,p=t.getData().tree.root,f=t.getViewRoot(),g=f.depth,m=t.get("sort");null!=m&&sG(f,m);var y=0;os(f.children,function(t){!isNaN(t.getValue())&&y++});var v=f.getValue(),_=Math.PI/(v||y)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(u-c)/(b||1),S=t.get("clockwise"),M=t.get("stillShowZeroSum"),C=S?1:-1,T=function(e,n){if(e){var i=n;if(e!==p){var r=e.getValue(),o=0===v&&M?_:r*_;o<d&&(o=d),i=n+C*o;var u=e.depth-g-(x?-1:1),h=c+w*u,f=c+w*(u+1),m=t.getLevelModel(e);if(m){var y=m.get("r0",!0),b=m.get("r",!0),I=m.get("radius",!0);null!=I&&(y=I[0],b=I[1]),null!=y&&(h=Rd(y,a/2)),null!=b&&(f=Rd(b,a/2))}e.setLayout({angle:o,startAngle:n,endAngle:i,clockwise:S,cx:s,cy:l,r0:h,r:f})}if(e.children&&e.children.length){var D=0;os(e.children,function(t){D+=T(t,n+D)})}return i-n}};if(x){var I=c,D=c+w,k=2*Math.PI;p.setLayout({angle:k,startAngle:h,endAngle:h+k,clockwise:S,cx:s,cy:l,r0:I,r:D})}T(f,h)})}function sG(t,e){var n=t.children||[];t.children=function(t,e){if(fs(e)){var n=as(t,function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}});return n.sort(function(t,n){return e(t.params,n.params)}),as(n,function(e){return t[e.index]})}var i="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(i?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(i?-1:1):n})}(n,e),n.length&&os(t.children,function(t){sG(t,e)})}function lG(t){var e={};t.eachSeriesByType("sunburst",function(t){var n=t.getData(),i=n.tree;i.eachNode(function(r){var o=r.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(t,n,i){for(var r=t;r&&r.depth>1;)r=r.parentNode;var o=n.getColorFromPalette(r.name||r.dataIndex+"",e);return t.depth>1&&gs(o)&&(o=ku(o,(t.depth-1)/(i-1)*.5)),o}(r,t,i.root.height)),Ja(n.ensureUniqueItemVisual(r.dataIndex,"style"),o)})})}var cG={color:"fill",borderColor:"stroke"},uG={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},hG=xp();const dG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,e){return aD(null,this)},e.prototype.getDataParams=function(e,n,i){var r=t.prototype.getDataParams.call(this,e,n);return i&&(r.info=hG(i).info),r},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(Hb);function pG(t,e){return e=e||[0,0],as(["x","y"],function(n,i){var r=this.getAxis(n),o=e[i],a=t[i]/2;return"category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a))},this)}function fG(t,e){return e=e||[0,0],as([0,1],function(n){var i=e[n],r=t[n]/2,o=[],a=[];return o[n]=i-r,a[n]=i+r,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])},this)}function gG(t,e){var n=this.getAxis(),i=e instanceof Array?e[0]:e,r=(t instanceof Array?t[0]:t)/2;return"category"===n.type?n.getBandWidth():Math.abs(n.dataToCoord(i-r)-n.dataToCoord(i+r))}function mG(t,e){return e=e||[0,0],as(["Radius","Angle"],function(n,i){var r=this["get"+n+"Axis"](),o=e[i],a=t[i]/2,s="category"===r.type?r.getBandWidth():Math.abs(r.dataToCoord(o-a)-r.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s},this)}function yG(t,e,n,i){return t&&(t.legacy||!1!==t.legacy&&!n&&!i&&"tspan"!==e&&("text"===e||Ws(t,"text")))}function vG(t,e,n){var i,r,o,a=t;if("text"===e)o=a;else{o={},Ws(a,"text")&&(o.text=a.text),Ws(a,"rich")&&(o.rich=a.rich),Ws(a,"textFill")&&(o.fill=a.textFill),Ws(a,"textStroke")&&(o.stroke=a.textStroke),Ws(a,"fontFamily")&&(o.fontFamily=a.fontFamily),Ws(a,"fontSize")&&(o.fontSize=a.fontSize),Ws(a,"fontStyle")&&(o.fontStyle=a.fontStyle),Ws(a,"fontWeight")&&(o.fontWeight=a.fontWeight),r={type:"text",style:o,silent:!0},i={};var s=Ws(a,"textPosition");n?i.position=s?a.textPosition:"inside":s&&(i.position=a.textPosition),Ws(a,"textPosition")&&(i.position=a.textPosition),Ws(a,"textOffset")&&(i.offset=a.textOffset),Ws(a,"textRotation")&&(i.rotation=a.textRotation),Ws(a,"textDistance")&&(i.distance=a.textDistance)}return _G(o,t),os(o.rich,function(t){_G(t,t)}),{textConfig:i,textContent:r}}function _G(t,e){e&&(e.font=e.textFont||e.font,Ws(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),Ws(e,"textAlign")&&(t.align=e.textAlign),Ws(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),Ws(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),Ws(e,"textWidth")&&(t.width=e.textWidth),Ws(e,"textHeight")&&(t.height=e.textHeight),Ws(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),Ws(e,"textPadding")&&(t.padding=e.textPadding),Ws(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),Ws(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),Ws(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),Ws(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),Ws(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),Ws(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),Ws(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function xG(t,e,n){var i=t;i.textPosition=i.textPosition||n.position||"inside",null!=n.offset&&(i.textOffset=n.offset),null!=n.rotation&&(i.textRotation=n.rotation),null!=n.distance&&(i.textDistance=n.distance);var r=i.textPosition.indexOf("inside")>=0,o=t.fill||"#000";bG(i,e);var a=null==i.textFill;return r?a&&(i.textFill=n.insideFill||"#fff",!i.textStroke&&n.insideStroke&&(i.textStroke=n.insideStroke),!i.textStroke&&(i.textStroke=o),null==i.textStrokeWidth&&(i.textStrokeWidth=2)):(a&&(i.textFill=t.fill||n.outsideFill||"#000"),!i.textStroke&&n.outsideStroke&&(i.textStroke=n.outsideStroke)),i.text=e.text,i.rich=e.rich,os(e.rich,function(t){bG(t,t)}),i}function bG(t,e){e&&(Ws(e,"fill")&&(t.textFill=e.fill),Ws(e,"stroke")&&(t.textStroke=e.fill),Ws(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),Ws(e,"font")&&(t.font=e.font),Ws(e,"fontStyle")&&(t.fontStyle=e.fontStyle),Ws(e,"fontWeight")&&(t.fontWeight=e.fontWeight),Ws(e,"fontSize")&&(t.fontSize=e.fontSize),Ws(e,"fontFamily")&&(t.fontFamily=e.fontFamily),Ws(e,"align")&&(t.textAlign=e.align),Ws(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),Ws(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),Ws(e,"width")&&(t.textWidth=e.width),Ws(e,"height")&&(t.textHeight=e.height),Ws(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),Ws(e,"padding")&&(t.textPadding=e.padding),Ws(e,"borderColor")&&(t.textBorderColor=e.borderColor),Ws(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),Ws(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),Ws(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),Ws(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),Ws(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),Ws(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),Ws(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),Ws(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),Ws(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),Ws(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}var wG={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},SG=us(wG),MG=(ss($h,function(t,e){return t[e]=1,t},{}),$h.join(", "),["","style","shape","extra"]),CG=xp();function TG(t,e,n,i,r){var o=t+"Animation",a=Zm(t,i,r)||{},s=CG(e).userDuring;return a.duration>0&&(a.during=s?hs(PG,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),Ja(a,n[o]),a}function IG(t,e,n,i){var r=(i=i||{}).dataIndex,o=i.isInit,a=i.clearStyle,s=n.isAnimationEnabled(),l=CG(t),c=e.style;l.userDuring=e.during;var u={},h={};if(function(t,e,n){for(var i=0;i<SG.length;i++){var r=SG[i],o=wG[r],a=e[r];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(i=0;i<$h.length;i++){var s=$h[i];null!=e[s]&&(n[s]=e[s])}}(0,e,h),RG("shape",e,h),RG("extra",e,h),!o&&s&&(function(t,e,n){for(var i=e.transition,r=AG(i)?$h:lp(i||[]),o=0;o<r.length;o++){var a=r[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=t[a];n[a]=s}}}(t,e,u),OG("shape",t,e,u),OG("extra",t,e,u),function(t,e,n,i){if(n){var r,o=t.style;if(o){var a=n.transition,s=e.transition;if(a&&!AG(a)){var l=lp(a);!r&&(r=i.style={});for(var c=0;c<l.length;c++){var u=o[f=l[c]];r[f]=u}}else if(t.getAnimationStyleProps&&(AG(s)||AG(a)||es(s,"style")>=0)){var h=t.getAnimationStyleProps(),d=h?h.style:null;if(d){!r&&(r=i.style={});var p=us(n);for(c=0;c<p.length;c++){var f;d[f=p[c]]&&(u=o[f],r[f]=u)}}}}}}(t,e,c,u)),h.style=c,function(t,e,n){var i=e.style;if(!t.isGroup&&i){if(n){t.useStyle({});for(var r=t.animators,o=0;o<r.length;o++){var a=r[o];"style"===a.targetName&&a.changeTarget(t.style)}}t.setStyle(i)}e&&(e.style=null,e&&t.attr(e),e.style=i)}(t,h,a),function(t,e){Ws(e,"silent")&&(t.silent=e.silent),Ws(e,"ignore")&&(t.ignore=e.ignore),t instanceof gf&&Ws(e,"invisible")&&(t.invisible=e.invisible),t instanceof vg&&Ws(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}(t,e),s)if(o){var d={};os(MG,function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(d[t]=d[t]||{}),Ja(t?d[t]:d,n.enterFrom))});var p=TG("enter",t,e,n,r);p.duration>0&&t.animateFrom(d,p)}else!function(t,e,n,i,r){if(r){var o=TG("update",t,e,i,n);o.duration>0&&t.animateFrom(r,o)}}(t,e,r||0,n,u);DG(t,e),c?t.dirty():t.markRedraw()}function DG(t,e){for(var n=CG(t).leaveToProps,i=0;i<MG.length;i++){var r=MG[i],o=r?e[r]:e;o&&o.leaveTo&&(n||(n=CG(t).leaveToProps={}),r&&(n[r]=n[r]||{}),Ja(r?n[r]:n,o.leaveTo))}}function kG(t,e,n,i){if(t){var r=t.parent,o=CG(t).leaveToProps;if(o){var a=TG("update",t,e,n,0);a.done=function(){r.remove(t),i&&i()},t.animateTo(o,a)}else r.remove(t),i&&i()}}function AG(t){return"all"===t}var EG={},LG={setTransform:function(t,e){return EG.el[t]=e,this},getTransform:function(t){return EG.el[t]},setShape:function(t,e){var n=EG.el;return(n.shape||(n.shape={}))[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){var e=EG.el.shape;if(e)return e[t]},setStyle:function(t,e){var n=EG.el,i=n.style;return i&&(i[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){var e=EG.el.style;if(e)return e[t]},setExtra:function(t,e){return(EG.el.extra||(EG.el.extra={}))[t]=e,this},getExtra:function(t){var e=EG.el.extra;if(e)return e[t]}};function PG(){var t=this,e=t.el;if(e){var n=CG(e).userDuring,i=t.userDuring;n===i?(EG.el=e,i(LG)):t.el=t.userDuring=null}}function OG(t,e,n,i){var r=n[t];if(r){var o,a=e[t];if(a){var s=n.transition,l=r.transition;if(l)if(!o&&(o=i[t]={}),AG(l))Ja(o,a);else for(var c=lp(l),u=0;u<c.length;u++){var h=a[p=c[u]];o[p]=h}else if(AG(s)||es(s,t)>=0){!o&&(o=i[t]={});var d=us(a);for(u=0;u<d.length;u++){var p;h=a[p=d[u]],BG(r[p],h)&&(o[p]=h)}}}}}function RG(t,e,n){var i=e[t];if(i)for(var r=n[t]={},o=us(i),a=0;a<o.length;a++){var s=o[a];r[s]=uh(i[s])}}function BG(t,e){return rs(t)?t!==e:null!=t&&isFinite(t)}var NG=xp(),zG=["percent","easing","shape","style","extra"];function FG(t){t.stopAnimation("keyframe"),t.attr(NG(t))}function VG(t,e,n){if(n.isAnimationEnabled()&&e)if(ps(e))os(e,function(e){VG(t,e,n)});else{var i=e.keyframes,r=e.duration;if(n&&null==r){var o=Zm("enter",n,0);r=o&&o.duration}if(i&&r){var a=NG(t);os(MG,function(n){var o;n&&!t[n]||(i.sort(function(t,e){return t.percent-e.percent}),os(i,function(i){var s=t.animators,l=n?i[n]:i;if(l){var c=us(l);if(n||(c=ls(c,function(t){return es(zG,t)<0})),c.length){o||((o=t.animate(n,e.loop,!0)).scope="keyframe");for(var u=0;u<s.length;u++)s[u]!==o&&s[u].targetName===o.targetName&&s[u].stopTracks(c);n&&(a[n]=a[n]||{});var h=n?a[n]:a;os(c,function(e){h[e]=((n?t[n]:t)||{})[e]}),o.whenWithKeys(r*i.percent,l,c,i.easing)}}}),o&&o.delay(e.delay||0).duration(r).start(e.easing))})}}}var HG="emphasis",jG="normal",WG="blur",GG="select",UG=[jG,HG,WG,GG],qG={normal:["itemStyle"],emphasis:[HG,"itemStyle"],blur:[WG,"itemStyle"],select:[GG,"itemStyle"]},YG={normal:["label"],emphasis:[HG,"label"],blur:[WG,"label"],select:[GG,"label"]},XG=["x","y"],$G={normal:{},emphasis:{},blur:{},select:{}},ZG={cartesian2d:function(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:hs(pG,t)}}},geo:function(t){var e=t.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:t.getZoom()},api:{coord:function(e){return t.dataToPoint(e)},size:hs(fG,t)}}},single:function(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:hs(gG,t)}}},polar:function(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),i=e.getExtent();return i[0]>i[1]&&i.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:i[1],r0:i[0]},api:{coord:function(i){var r=e.dataToRadius(i[0]),o=n.dataToAngle(i[1]),a=t.coordToPoint([r,o]);return a.push(r,o*Math.PI/180),a},size:hs(mG,t)}}},calendar:function(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)}}}}};function KG(t){return t instanceof vg}function JG(t){return t instanceof gf}const QG=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n,i){this._progressiveEls=null;var r=this._data,o=t.getData(),a=this.group,s=rU(t,o,e,n);r||a.removeAll(),o.diff(r).add(function(e){aU(n,null,e,s(e,i),t,a,o)}).remove(function(e){var n=r.getItemGraphicEl(e);n&&kG(n,hG(n).option,t)}).update(function(e,l){var c=r.getItemGraphicEl(l);aU(n,c,e,s(e,i),t,a,o)}).execute();var l=t.get("clip",!0)?AL(t.coordinateSystem,!1,t):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},e.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll(),this._data=null},e.prototype.incrementalRender=function(t,e,n,i,r){var o=e.getData(),a=rU(e,o,n,i),s=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=!0,t.ensureState("emphasis").hoverLayer=!0)}for(var c=t.start;c<t.end;c++){var u=aU(null,null,c,a(c,r),e,this.group,o);u&&(u.traverse(l),s.push(u))}},e.prototype.eachRendered=function(t){qS(this._progressiveEls||this.group,t)},e.prototype.filterForExposedEvent=function(t,e,n,i){var r=e.element;if(null==r||n.name===r)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===r)return!0;return!1},e.type="custom",e}(eM);function tU(t){var e,n=t.type;if("path"===n){var i=t.shape,r=null!=i.width&&null!=i.height?{x:i.x||0,y:i.y||0,width:i.width,height:i.height}:null,o=mU(i);e=CS(o,null,r,i.layout||"center"),hG(e).customPathData=o}else if("image"===n)e=new Cg({}),hG(e).customImagePath=t.style.image;else if("text"===n)e=new $g({});else if("group"===n)e=new _d;else{if("compoundPath"===n)throw new Error('"compoundPath" is not supported yet.');var a=MS(n);a||Px(""),e=new a}return hG(e).customGraphicType=n,e.name=t.name,e.z2EmphasisLift=1,e.z2SelectLift=1,e}function eU(t,e,n,i,r,o,a){FG(e);var s=r&&r.normal.cfg;s&&e.setTextConfig(s),i&&null==i.transition&&(i.transition=XG);var l=i&&i.style;if(l){if("text"===e.type){var c=l;Ws(c,"textFill")&&(c.fill=c.textFill),Ws(c,"textStroke")&&(c.stroke=c.textStroke)}var u=void 0,h=KG(e)?l.decal:null;t&&h&&(h.dirty=!0,u=jC(h,t)),l.__decalPattern=u}JG(e)&&l&&(u=l.__decalPattern)&&(l.decal=u),IG(e,i,o,{dataIndex:n,isInit:a,clearStyle:!0}),VG(e,i.keyframeAnimation,o)}function nU(t,e,n,i,r){var o=e.isGroup?null:e,a=r&&r[t].cfg;if(o){var s=o.ensureState(t);if(!1===i){var l=o.getState(t);l&&(l.style=null)}else s.style=i||null;a&&(s.textConfig=a),Sm(o)}}function iU(t,e,n){var i=n===jG,r=i?e:uU(e,n),o=r?r.z2:null;null!=o&&((i?t:t.ensureState(n)).z2=o||0)}function rU(t,e,n,i){var r=t.get("renderItem"),o=t.coordinateSystem,a={};o&&(a=o.prepareCustoms?o.prepareCustoms(o):ZG[o.type](o));for(var s,l,c=Qa({getWidth:i.getWidth,getHeight:i.getHeight,getZr:i.getZr,getDevicePixelRatio:i.getDevicePixelRatio,value:function(t,n){return null==n&&(n=s),e.getStore().get(e.getDimensionIndex(t||0),n)},style:function(n,i){null==i&&(i=s);var r=e.getItemVisual(i,"style"),o=r&&r.fill,a=r&&r.opacity,l=v(i,jG).getItemStyle();null!=o&&(l.fill=o),null!=a&&(l.opacity=a);var c={inheritColor:gs(o)?o:"#000"},u=_(i,jG),h=uy(u,null,c,!1,!0);h.text=u.getShallow("show")?Is(t.getFormattedLabel(i,jG),lL(e,i)):null;var d=hy(u,c,!1);return b(n,l),l=xG(l,h,d),n&&x(l,n),l.legacy=!0,l},ordinalRawValue:function(t,n){null==n&&(n=s),t=t||0;var i=e.getDimensionInfo(t);if(!i){var r=e.getDimensionIndex(t);return r>=0?e.getStore().get(r,n):void 0}var o=e.get(i.name,n),a=i&&i.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,i){null==i&&(i=s);var r=v(i,HG).getItemStyle(),o=_(i,HG),a=uy(o,null,null,!0,!0);a.text=o.getShallow("show")?Ds(t.getFormattedLabel(i,HG),t.getFormattedLabel(i,jG),lL(e,i)):null;var l=hy(o,null,!0);return b(n,r),r=xG(r,a,l),n&&x(r,n),r.legacy=!0,r},visual:function(t,n){if(null==n&&(n=s),Ws(cG,t)){var i=e.getItemVisual(n,"style");return i?i[cG[t]]:null}if(Ws(uG,t))return e.getItemVisual(n,t)},barLayout:function(t){if("cartesian2d"===o.type)return function(t){var e=[],n=t.axis,i="axis0";if("category"===n.type){for(var r=n.getBandWidth(),o=0;o<t.count;o++)e.push(Qa({bandWidth:r,axisKey:i,stackId:DD+o},t));var a=PD(e),s=[];for(o=0;o<t.count;o++){var l=a[i][DD+o];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}}(Qa({axis:o.getBaseAxis()},t))},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(t){return my(t,n)}},a.api||{}),u={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:a.coordSys,dataInsideLength:e.count(),encode:oU(t.getData())},h={},d={},p={},f={},g=0;g<UG.length;g++){var m=UG[g];p[m]=t.getModel(qG[m]),f[m]=t.getModel(YG[m])}function y(t){return t===s?l||(l=e.getItemModel(t)):e.getItemModel(t)}function v(t,n){return e.hasItemOption?t===s?h[n]||(h[n]=y(t).getModel(qG[n])):y(t).getModel(qG[n]):p[n]}function _(t,n){return e.hasItemOption?t===s?d[n]||(d[n]=y(t).getModel(YG[n])):y(t).getModel(YG[n]):f[n]}return function(t,n){return s=t,l=null,h={},d={},r&&r(Qa({dataIndexInside:t,dataIndex:e.getRawIndex(t),actionType:n?n.type:null},u),c)};function x(t,e){for(var n in e)Ws(e,n)&&(t[n]=e[n])}function b(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}}function oU(t){var e={};return os(t.dimensions,function(n){var i=t.getDimensionInfo(n);if(!i.isExtraCoord){var r=i.coordDim;(e[r]=e[r]||[])[i.coordDimIndex]=t.getDimensionIndex(n)}}),e}function aU(t,e,n,i,r,o,a){if(i){var s=sU(t,e,n,i,r,o);return s&&a.setItemGraphicEl(n,s),s&&Vm(s,i.focus,i.blurScope,i.emphasisDisabled),s}o.remove(e)}function sU(t,e,n,i,r,o){var a=-1,s=e;e&&lU(e,i,r)&&(a=es(o.childrenRef(),e),e=null);var l,c,u=!e,h=e;h?h.clearStates():(h=tU(i),s&&(l=s,(c=h).copyTransform(l),JG(c)&&JG(l)&&(c.setStyle(l.style),c.z=l.z,c.z2=l.z2,c.zlevel=l.zlevel,c.invisible=l.invisible,c.ignore=l.ignore,KG(c)&&KG(l)&&c.setShape(l.shape)))),!1===i.morph?h.disableMorphing=!0:h.disableMorphing&&(h.disableMorphing=!1),$G.normal.cfg=$G.normal.conOpt=$G.emphasis.cfg=$G.emphasis.conOpt=$G.blur.cfg=$G.blur.conOpt=$G.select.cfg=$G.select.conOpt=null,$G.isLegacy=!1,function(t,e,n,i,r,o){if(!t.isGroup){cU(n,null,o),cU(n,HG,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,c=o.select.conOpt;if(null!=a||null!=s||null!=c||null!=l){var u=t.getTextContent();if(!1===a)u&&t.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},u?u.clearStates():(u=tU(a),t.setTextContent(u)),eU(null,u,e,a,null,i,r);for(var h=a&&a.style,d=0;d<UG.length;d++){var p=UG[d];if(p!==jG)nU(p,u,0,hU(a,o[p].conOpt,p),null)}h?u.dirty():u.markRedraw()}}}}(h,n,i,r,u,$G),function(t,e,n,i,r){var o=n.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var a=t.getClipPath();a&&lU(a,o,i)&&(a=null),a||(a=tU(o),t.setClipPath(a)),eU(null,a,e,o,null,i,r)}}(h,n,i,r,u),eU(t,h,n,i,$G,r,u),Ws(i,"info")&&(hG(h).info=i.info);for(var d=0;d<UG.length;d++){var p=UG[d];if(p!==jG)nU(p,h,0,hU(i,uU(i,p),p),$G)}return function(t,e,n){if(!t.isGroup){var i=t,r=n.currentZ,o=n.currentZLevel;i.z=r,i.zlevel=o;var a=e.z2;null!=a&&(i.z2=a||0);for(var s=0;s<UG.length;s++)iU(i,e,UG[s])}}(h,i,r),"group"===i.type&&function(t,e,n,i,r){var o=i.children,a=o?o.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,c=!1===s;if(a||l||c){if(l)return u={api:t,oldChildren:e.children()||[],newChildren:o||[],dataIndex:n,seriesModel:r,group:e},void new CI(u.oldChildren,u.newChildren,pU,pU,u).add(fU).update(fU).remove(gU).execute();var u;c&&e.removeAll();for(var h=0;h<a;h++){var d=o[h],p=e.childAt(h);d?(null==d.ignore&&(d.ignore=!1),sU(t,p,n,d,r,e)):p.ignore=!0}for(var f=e.childCount()-1;f>=h;f--){var g=e.childAt(f);dU(e,g,r)}}}(t,h,n,i,r),a>=0?o.replaceAt(h,a):o.add(h),h}function lU(t,e,n){var i,r=hG(t),o=e.type,a=e.shape,s=e.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==r.customGraphicType||"path"===o&&(i=a)&&(Ws(i,"pathData")||Ws(i,"d"))&&mU(a)!==r.customPathData||"image"===o&&Ws(s,"image")&&s.image!==r.customImagePath}function cU(t,e,n){var i=e?uU(t,e):t,r=e?hU(t,i,HG):t.style,o=t.type,a=i?i.textConfig:null,s=t.textContent,l=s?e?uU(s,e):s:null;if(r&&(n.isLegacy||yG(r,o,!!a,!!l))){n.isLegacy=!0;var c=vG(r,o,!e);!a&&c.textConfig&&(a=c.textConfig),!l&&c.textContent&&(l=c.textContent)}if(!e&&l){var u=l;!u.type&&(u.type="text")}var h=e?n[e]:n.normal;h.cfg=a,h.conOpt=l}function uU(t,e){return e?t?t[e]:null:t}function hU(t,e,n){var i=e&&e.style;return null==i&&n===HG&&t&&(i=t.styleEmphasis),i}function dU(t,e,n){e&&kG(e,hG(t).option,n)}function pU(t,e){var n=t&&t.name;return null!=n?n:"e\0\0"+e}function fU(t,e){var n=this.context,i=null!=t?n.newChildren[t]:null,r=null!=e?n.oldChildren[e]:null;sU(n.api,r,n.dataIndex,i,n.seriesModel,n.group)}function gU(t){var e=this.context,n=e.oldChildren[t];n&&kG(n,hG(n).option,e.seriesModel)}function mU(t){return t&&(t.pathData||t.d)}var yU=xp(),vU=$a,_U=hs,xU=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,i){var r=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,i||this._lastValue!==r||this._lastStatus!==o){this._lastValue=r,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,r,t,e,n);var c=l.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var u=this._moveAnimation=this.determineAnimation(t,e);if(a){var h=ds(bU,e,u);this.updatePointerEl(a,l,h),this.updateLabelEl(a,l,h,e)}else a=this._group=new _d,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);CU(a,e,!0),this._renderHandle(r)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),i=t.axis,r="category"===i.type,o=e.get("snap");if(!o&&!r)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(r&&i.getBandWidth()>a)return!0;if(o){var s=IO(t).seriesDataCount,l=i.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,i,r){},t.prototype.createPointerEl=function(t,e,n,i){var r=e.pointer;if(r){var o=yU(t).pointerEl=new a[r.type](vU(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,i){if(e.label){var r=yU(t).labelEl=new $g(vU(e.label));t.add(r),SU(r,i)}},t.prototype.updatePointerEl=function(t,e,n){var i=yU(t).pointerEl;i&&e.pointer&&(i.setStyle(e.pointer.style),n(i,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,i){var r=yU(t).labelEl;r&&(r.setStyle(e.label.style),n(r,{x:e.label.x,y:e.label.y}),SU(r,i))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,i=this._api.getZr(),r=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return r&&i.remove(r),void(this._handle=null);this._handle||(e=!0,r=this._handle=VS(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Hl(t.event)},onmousedown:_U(this._onHandleDragMove,this,0,0),drift:_U(this._onHandleDragMove,this),ondragend:_U(this._onHandleDragEnd,this)}),i.add(r)),CU(r,n,!1),r.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");ps(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,aM(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){bU(this._axisPointerModel,!e&&this._moveAnimation,this._handle,MU(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(MU(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(MU(i)),yU(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,i=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),i&&e.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),sM(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function bU(t,e,n,i){wU(yU(n).lastProp,i)||(yU(n).lastProp=i,e?Jm(n,i,t):(n.stopAnimation(),n.attr(i)))}function wU(t,e){if(vs(t)&&vs(e)){var n=!0;return os(e,function(e,i){n=n&&wU(t[i],e)}),!!n}return t===e}function SU(t,e){t[e.get(["label","show"])?"show":"hide"]()}function MU(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function CU(t,e,n){var i=e.get("z"),r=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=r&&(t.zlevel=r),t.silent=n)})}const TU=xU;function IU(t){var e,n=t.get("type"),i=t.getModel(n+"Style");return"line"===n?(e=i.getLineStyle()).fill=null:"shadow"===n&&((e=i.getAreaStyle()).stroke=null),e}function DU(t,e,n,i,r){var o=kU(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=wv(a.get("padding")||0),l=a.getFont(),c=ed(o,l),u=r.position,h=c.width+s[1]+s[3],d=c.height+s[0]+s[2],p=r.align;"right"===p&&(u[0]-=h),"center"===p&&(u[0]-=h/2);var f=r.verticalAlign;"bottom"===f&&(u[1]-=d),"middle"===f&&(u[1]-=d/2),function(t,e,n,i){var r=i.getWidth(),o=i.getHeight();t[0]=Math.min(t[0]+e,r)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(u,h,d,i);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:u[0],y:u[1],style:uy(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function kU(t,e,n,i,r){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:r.precision}),a=r.formatter;if(a){var s={value:pk(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};os(i,function(t){var e=n.getSeriesByIndex(t.seriesIndex),i=t.dataIndexInside,r=e&&e.getDataParams(i);r&&s.seriesData.push(r)}),gs(a)?o=a.replace("{value}",o):fs(a)&&(o=a(s))}return o}function AU(t,e,n){var i=[1,0,0,1,0,0];return Kl(i,i,n.rotation),Zl(i,i,n.position),OS([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],i)}function EU(t,e,n,i,r,o){var a=CO.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=r.get(["label","margin"]),DU(e,i,r,o,{position:AU(i.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function LU(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function PU(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function OU(t,e,n,i,r,o){return{cx:t,cy:e,r0:n,r:i,startAngle:r,endAngle:o,clockwise:!0}}var RU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.grid,s=i.get("type"),l=BU(a,o).getOtherAxis(o).getGlobalExtent(),c=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var u=IU(i),h=NU[s](o,c,l);h.style=u,t.graphicKey=h.type,t.pointer=h}EU(e,t,lO(a.model,n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=lO(e.axis.grid.model,e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=AU(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.grid,a=r.getGlobalExtent(!0),s=BU(o,r).getOtherAxis(r).getGlobalExtent(),l="x"===r.dim?0:1,c=[t.x,t.y];c[l]+=e[l],c[l]=Math.min(a[1],c[l]),c[l]=Math.max(a[0],c[l]);var u=(s[1]+s[0])/2,h=[u,u];return h[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:h,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},e}(TU);function BU(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var NU={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:LU([e,n[0]],[e,n[1]],zU(t))}},shadow:function(t,e,n){var i=Math.max(1,t.getBandWidth()),r=n[1]-n[0];return{type:"Rect",shape:PU([e-i/2,n[0]],[i,r],zU(t))}}};function zU(t){return"x"===t.dim?0:1}const FU=RU,VU=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Uv);var HU=xp(),jU=os;function WU(t,e,n){if(!Ia.node){var i=e.getZr();HU(i).records||(HU(i).records={}),function(t,e){function n(n,i){t.on(n,function(n){var r=function(t){var e={showTip:[],hideTip:[]},n=function(i){var r=e[i.type];r?r.push(i):(i.dispatchAction=n,t.dispatchAction(i))};return{dispatchAction:n,pendings:e}}(e);jU(HU(t).records,function(t){t&&i(t,n,r.dispatchAction)}),function(t,e){var n,i=t.showTip.length,r=t.hideTip.length;i?n=t.showTip[i-1]:r&&(n=t.hideTip[r-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}(r.pendings,e)})}HU(t).initialized||(HU(t).initialized=!0,n("click",ds(UU,"click")),n("mousemove",ds(UU,"mousemove")),n("globalout",GU))}(i,e),(HU(i).records[t]||(HU(i).records[t]={})).handler=n}}function GU(t,e,n){t.handler("leave",null,n)}function UU(t,e,n,i){e.handler(t,n,i)}function qU(t,e){if(!Ia.node){var n=e.getZr();(HU(n).records||{})[t]&&(HU(n).records[t]=null)}}var YU=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=e.getComponent("tooltip"),r=t.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";WU("axisPointer",n,function(t,e,n){"none"!==r&&("leave"===t||r.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},e.prototype.remove=function(t,e){qU("axisPointer",e)},e.prototype.dispose=function(t,e){qU("axisPointer",e)},e.type="axisPointer",e}(Wb);const XU=YU;function $U(t,e){var n,i=[],r=t.seriesIndex;if(null==r||!(n=e.getSeriesByIndex(r)))return{point:[]};var o=n.getData(),a=_p(o,t);if(null==a||a<0||ps(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)i=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c).dim,h=c.dim,d="x"===u||"radius"===u?1:0,p=o.mapDimension(h),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),i=l.dataToPoint(f)||[]}else i=l.dataToPoint(o.getValues(as(l.dimensions,function(t){return o.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),i=[g.x+g.width/2,g.y+g.height/2]}return{point:i,el:s}}var ZU=xp();function KU(t,e,n){var i=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||hs(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){nq(r)&&(r=$U({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=nq(r),c=o.axesInfo,u=s.axesInfo,h="leave"===i||nq(r),d={},p={},f={list:[],map:{}},g={showPointer:ds(QU,p),showTooltip:ds(tq,f)};os(s.coordSysMap,function(t,e){var n=l||t.containPoint(r);os(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,o=function(t,e){for(var n=0;n<(t||[]).length;n++){var i=t[n];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}(c,t);if(!h&&n&&(!c||o)){var a=o&&o.value;null!=a||l||(a=i.pointToData(r)),null!=a&&JU(t,a,g,!1,d)}})});var m={};return os(u,function(t,e){var n=t.linkGroup;n&&!p[e]&&os(n.axesInfo,function(e,i){var r=p[i];if(e!==t&&r){var o=r.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,eq(e),eq(t)))),m[t.key]=o}})}),os(m,function(t,e){JU(u[e],t,g,!0,d)}),function(t,e,n){var i=n.axesInfo=[];os(e,function(e,n){var r=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(r.status="show"),r.value=o.value,r.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(r.status="hide"),"show"===r.status&&i.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:r.value})})}(p,u,d),function(t,e,n,i){if(!nq(e)&&t.list.length){var r=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:r.dataIndexInside,dataIndex:r.dataIndex,seriesIndex:r.seriesIndex,dataByCoordSys:t.list})}else i({type:"hideTip"})}(f,r,t,a),function(t,e,n){var i=n.getZr(),r="axisPointerLastHighlights",o=ZU(i)[r]||{},a=ZU(i)[r]={};os(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&os(n.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;a[e]=t})});var s=[],l=[];os(o,function(t,e){!a[e]&&l.push(t)}),os(a,function(t,e){!o[e]&&s.push(t)}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(u,0,n),d}}function JU(t,e,n,i,r){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=function(t,e){var n=e.axis,i=n.dim,r=t,o=[],a=Number.MAX_VALUE,s=-1;return os(e.seriesModels,function(e,l){var c,u,h=e.getData().mapDimensionsAll(i);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(h,t,n);u=d.dataIndices,c=d.nestestValue}else{if(!(u=e.getData().indicesOfNearest(h[0],t,"category"===n.type?.5:null)).length)return;c=e.getData().get(h[0],u[0])}if(null!=c&&isFinite(c)){var p=t-c,f=Math.abs(p);f<=a&&((f<a||p>=0&&s<0)&&(a=f,s=p,r=c,o.length=0),os(u,function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:o,snapToValue:r}}(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==r.seriesIndex&&Ja(r,s[0]),!i&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function QU(t,e,n,i){t[e.key]={value:n,payloadBatch:i}}function tq(t,e,n,i){var r=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&r.length){var l=e.coordSys.model,c=kO(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:r.slice()})}}function eq(t){var e=t.axis.model,n={},i=n.axisDim=t.axis.dim;return n.axisIndex=n[i+"AxisIndex"]=e.componentIndex,n.axisName=n[i+"AxisName"]=e.name,n.axisId=n[i+"AxisId"]=e.id,n}function nq(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function iq(t){LO.registerAxisPointerClass("CartesianAxisPointer",FU),t.registerComponentModel(VU),t.registerComponentView(XU),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!ps(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=function(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var i=e.getComponent("tooltip"),r=e.getComponent("axisPointer"),o=r.get("link",!0)||[],a=[];os(n.getCoordinateSystems(),function(n){if(n.axisPointerEnabled){var s=kO(n.model),l=t.coordSysAxesInfo[s]={};t.coordSysMap[s]=n;var c=n.model.getModel("tooltip",i);if(os(n.getAxes(),ds(p,!1,null)),n.getTooltipAxes&&i&&c.get("show")){var u="axis"===c.get("trigger"),h="cross"===c.get(["axisPointer","type"]),d=n.getTooltipAxes(c.get(["axisPointer","axis"]));(u||h)&&os(d.baseAxes,ds(p,!h||"cross",u)),h&&os(d.otherAxes,ds(p,"cross",!1))}}function p(i,s,u){var h=u.model.getModel("axisPointer",r),d=h.get("show");if(d&&("auto"!==d||i||DO(h))){null==s&&(s=h.get("triggerTooltip")),h=i?function(t,e,n,i,r,o){var a=e.getModel("axisPointer"),s={};os(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){s[t]=$a(a.get(t))}),s.snap="category"!==t.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===r){var c=a.get(["label","show"]);if(l.show=null==c||c,!o){var u=s.lineStyle=a.get("crossStyle");u&&Qa(l,u.textStyle)}}return t.model.getModel("axisPointer",new Oy(s,n,i))}(u,c,r,e,i,s):h;var p=h.get("snap"),f=h.get("triggerEmphasis"),g=kO(u.model),m=s||p||"category"===u.type,y=t.axesInfo[g]={key:g,axis:u,coordSys:n,axisPointerModel:h,triggerTooltip:s,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:DO(h),seriesModels:[],linkGroup:null};l[g]=y,t.seriesInvolved=t.seriesInvolved||m;var v=function(t,e){for(var n=e.model,i=e.dim,r=0;r<t.length;r++){var o=t[r]||{};if(TO(o[i+"AxisId"],n.id)||TO(o[i+"AxisIndex"],n.componentIndex)||TO(o[i+"AxisName"],n.name))return r}}(o,u);if(null!=v){var _=a[v]||(a[v]={axesInfo:{}});_.axesInfo[g]=y,_.mapper=o[v].mapper,y.linkGroup=_}}}})}(n,t,e),n.seriesInvolved&&function(t,e){e.eachSeries(function(e){var n=e.coordinateSystem,i=e.get(["tooltip","trigger"],!0),r=e.get(["tooltip","show"],!0);n&&"none"!==i&&!1!==i&&"item"!==i&&!1!==r&&!1!==e.get(["axisPointer","show"],!0)&&os(t.coordSysAxesInfo[kO(n.model)],function(t){var i=t.axis;n.getAxis(i.dim)===i&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())})})}(n,t),n}(t,e)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},KU)}var rq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=a.getOtherAxis(o).getExtent(),l=o.dataToCoord(e),c=i.get("type");if(c&&"none"!==c){var u=IU(i),h=oq[c](o,a,l,s);h.style=u,t.graphicKey=h.type,t.pointer=h}var d=function(t,e,n,i,r){var o=e.axis,a=o.dataToCoord(t),s=i.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,c,u,h=i.getRadiusAxis().getExtent();if("radius"===o.dim){var d=[1,0,0,1,0,0];Kl(d,d,s),Zl(d,d,[i.cx,i.cy]),l=OS([a,-r],d);var p=e.getModel("axisLabel").get("rotate")||0,f=CO.innerTextLayout(s,p*Math.PI/180,-1);c=f.textAlign,u=f.textVerticalAlign}else{var g=h[1];l=i.coordToPoint([g+r,a]);var m=i.cx,y=i.cy;c=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",u=Math.abs(l[1]-y)/g<.3?"middle":l[1]>y?"top":"bottom"}return{position:l,align:c,verticalAlign:u}}(e,n,0,a,i.get(["label","margin"]));DU(t,n,i,r,d)},e}(TU),oq={line:function(t,e,n,i){return"angle"===t.dim?{type:"Line",shape:LU(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,i){var r=Math.max(1,t.getBandWidth()),o=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:OU(e.cx,e.cy,i[0],i[1],(-n-r/2)*o,(r/2-n)*o)}:{type:"Sector",shape:OU(e.cx,e.cy,n-r/2,n+r/2,0,2*Math.PI)}}};const aq=rq,sq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Uv);var lq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Mp).models[0]},e.type="polarAxis",e}(Uv);is(lq,vk);var cq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="angleAxis",e}(lq),uq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="radiusAxis",e}(lq),hq=function(t){function e(e,n){return t.call(this,"radius",e,n)||this}return Ma(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e}($k);hq.prototype.dataToRadius=$k.prototype.dataToCoord,hq.prototype.radiusToData=$k.prototype.coordToData;const dq=hq;var pq=xp(),fq=function(t){function e(e,n){return t.call(this,"angle",e,n||[0,360])||this}return Ma(e,t),e.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,i=n.getExtent(),r=n.count();if(i[1]-i[0]<1)return 0;var o=i[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=ed(null==o?"":o+"",e.getFont(),"center","top"),c=Math.max(l.height,7)/s;isNaN(c)&&(c=1/0);var u=Math.max(0,Math.floor(c)),h=pq(t.model),d=h.lastAutoInterval,p=h.lastTickCount;return null!=d&&null!=p&&Math.abs(d-u)<=1&&Math.abs(p-r)<=1&&d>u?u=d:(h.lastTickCount=r,h.lastAutoInterval=u),u},e}($k);fq.prototype.dataToAngle=$k.prototype.dataToCoord,fq.prototype.angleToData=$k.prototype.coordToData;const gq=fq;var mq=["radius","angle"],yq=function(){function t(t){this.dimensions=mq,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new dq,this._angleAxis=new gq,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===t&&e.push(n),i.scale.type===t&&e.push(i),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)])},t.prototype.pointToData=function(t,e){var n=this.pointToCoord(t);return[this._radiusAxis.radiusToData(n[0],e),this._angleAxis.angleToData(n[1],e)]},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,i=this.getAngleAxis(),r=i.getExtent(),o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);i.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,c=l<o?1:-1;l<o||l>a;)l+=360*c;return[s,l]},t.prototype.coordToPoint=function(t){var e=t[0],n=t[1]/180*Math.PI;return[Math.cos(n)*e+this.cx,-Math.sin(n)*e+this.cy]},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var n=t.getExtent(),i=Math.PI/180,r=1e-4;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*i,endAngle:-n[1]*i,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,i=e-this.cy,o=n*n+i*i,a=this.r,s=this.r0;return a!==s&&o-r<=a*a&&o+r>=s*s}}},t.prototype.convertToPixel=function(t,e,n){return vq(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return vq(e)===this?this.pointToData(n):null},t}();function vq(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const _q=yq;function xq(t,e){var n=this,i=n.getAngleAxis(),r=n.getRadiusAxis();if(i.scale.setExtent(1/0,-1/0),r.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===n){var e=t.getData();os(yk(e,"radius"),function(t){r.scale.unionExtentFromData(e,t)}),os(yk(e,"angle"),function(t){i.scale.unionExtentFromData(e,t)})}}),uk(i.scale,i.model),uk(r.scale,r.model),"category"===i.type&&!i.onBand){var o=i.getExtent(),a=360/i.scale.count();i.inverse?o[1]+=a:o[1]-=a,i.setExtent(o[0],o[1])}}function bq(t,e){var n;if(t.type=e.get("type"),t.scale=hk(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var i=e.get("startAngle"),r=null!==(n=e.get("endAngle"))&&void 0!==n?n:i+(t.inverse?-360:360);t.setExtent(i,r)}e.axis=t,t.model=e}const wq={dimensions:mq,create:function(t,e){var n=[];return t.eachComponent("polar",function(t,i){var r=new _q(i+"");r.update=xq;var o=r.getRadiusAxis(),a=r.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");bq(o,s),bq(a,l),function(t,e,n){var i=e.get("center"),r=n.getWidth(),o=n.getHeight();t.cx=Rd(i[0],r),t.cy=Rd(i[1],o);var a=t.getRadiusAxis(),s=Math.min(r,o)/2,l=e.get("radius");null==l?l=[0,"100%"]:ps(l)||(l=[0,l]);var c=[Rd(l[0],s),Rd(l[1],s)];a.inverse?a.setExtent(c[1],c[0]):a.setExtent(c[0],c[1])}(r,t,e),n.push(r),t.coordinateSystem=r,r.model=t}),t.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=t.getReferringComponents("polar",Mp).models[0];t.coordinateSystem=e.coordinateSystem}}),n}};var Sq=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function Mq(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var i=t.coordToPoint([e[0],n]),r=t.coordToPoint([e[1],n]);return{x1:i[0],y1:i[1],x2:r[0],y2:r[1]}}function Cq(t){return t.getRadiusAxis().inverse?0:1}function Tq(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var Iq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ma(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,i=n.polar,r=i.getRadiusAxis().getExtent(),o=n.getTicksCoords(),a=n.getMinorTicksCoords(),s=as(n.getViewLabels(),function(t){t=$a(t);var e=n.scale,i="ordinal"===e.type?e.getRawOrdinalNumber(t.tickValue):t.tickValue;return t.coord=n.dataToCoord(i),t});Tq(s),Tq(o),os(Sq,function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||Dq[e](this.group,t,i,o,a,r,s)},this)}},e.type="angleAxis",e}(LO),Dq={axisLine:function(t,e,n,i,r,o){var s,l=e.getModel(["axisLine","lineStyle"]),c=n.getAngleAxis(),u=Math.PI/180,h=c.getExtent(),d=Cq(n),p=d?0:1,f=360===Math.abs(h[1]-h[0])?"Circle":"Arc";(s=0===o[p]?new a[f]({shape:{cx:n.cx,cy:n.cy,r:o[d],startAngle:-h[0]*u,endAngle:-h[1]*u,clockwise:c.inverse},style:l.getLineStyle(),z2:1,silent:!0}):new Ow({shape:{cx:n.cx,cy:n.cy,r:o[d],r0:o[p]},style:l.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(s)},axisTick:function(t,e,n,i,r,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[Cq(n)],c=as(i,function(t){return new Uw({shape:Mq(n,[l,l+s],t.coord)})});t.add(DS(c,{style:Qa(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,i,r,o){if(r.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),c=o[Cq(n)],u=[],h=0;h<r.length;h++)for(var d=0;d<r[h].length;d++)u.push(new Uw({shape:Mq(n,[c,c+l],r[h][d].coord)}));t.add(DS(u,{style:Qa(s.getModel("lineStyle").getLineStyle(),Qa(a.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(t,e,n,i,r,o,a){var s=e.getCategories(!0),l=e.getModel("axisLabel"),c=l.get("margin"),u=e.get("triggerEvent");os(a,function(i,r){var a=l,h=i.tickValue,d=o[Cq(n)],p=n.coordToPoint([d+c,i.coord]),f=n.cx,g=n.cy,m=Math.abs(p[0]-f)/d<.3?"center":p[0]>f?"left":"right",y=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[h]){var v=s[h];vs(v)&&v.textStyle&&(a=new Oy(v.textStyle,l,l.ecModel))}var _=new $g({silent:CO.isLabelSilent(e),style:uy(a,{x:p[0],y:p[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:i.formattedLabel,align:m,verticalAlign:y})});if(t.add(_),u){var x=CO.makeAxisEventDataBase(e);x.targetType="axisLabel",x.value=i.rawLabel,Zg(_).eventData=x}},this)},splitLine:function(t,e,n,i,r,o){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var c=[],u=0;u<i.length;u++){var h=l++%s.length;c[h]=c[h]||[],c[h].push(new Uw({shape:Mq(n,o,i[u].coord)}))}for(u=0;u<c.length;u++)t.add(DS(c[u],{style:Qa({stroke:s[u%s.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(t,e,n,i,r,o){if(r.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<r.length;l++)for(var c=0;c<r[l].length;c++)s.push(new Uw({shape:Mq(n,o,r[l][c].coord)}));t.add(DS(s,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(t,e,n,i,r,o){if(i.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var c=[],u=Math.PI/180,h=-i[0].coord*u,d=Math.min(o[0],o[1]),p=Math.max(o[0],o[1]),f=e.get("clockwise"),g=1,m=i.length;g<=m;g++){var y=g===m?i[0].coord:i[g].coord,v=l++%s.length;c[v]=c[v]||[],c[v].push(new Ew({shape:{cx:n.cx,cy:n.cy,r0:d,r:p,startAngle:h,endAngle:-y*u,clockwise:f},silent:!0})),h=-y*u}for(g=0;g<c.length;g++)t.add(DS(c[g],{style:Qa({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}};const kq=Iq;var Aq=["axisLine","axisTickLabel","axisName"],Eq=["splitLine","splitArea","minorSplitLine"],Lq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="PolarAxisPointer",n}return Ma(e,t),e.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=this._axisGroup,i=this._axisGroup=new _d;this.group.add(i);var r=t.axis,o=r.polar,a=o.getAngleAxis(),s=r.getTicksCoords(),l=r.getMinorTicksCoords(),c=a.getExtent()[0],u=r.getExtent(),h=function(t,e,n){return{position:[t.cx,t.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}(o,t,c),d=new CO(t,h);os(Aq,d.add,d),i.add(d.getGroup()),NS(n,i,t),os(Eq,function(e){t.get([e,"show"])&&!r.scale.isBlank()&&Pq[e](this.group,t,o,c,u,s,l)},this)}},e.type="radiusAxis",e}(LO),Pq={splitLine:function(t,e,n,i,r,o){var s=e.getModel("splitLine").getModel("lineStyle"),l=s.get("color"),c=0,u=n.getAngleAxis(),h=Math.PI/180,d=u.getExtent(),p=360===Math.abs(d[1]-d[0])?"Circle":"Arc";l=l instanceof Array?l:[l];for(var f=[],g=0;g<o.length;g++){var m=c++%l.length;f[m]=f[m]||[],f[m].push(new a[p]({shape:{cx:n.cx,cy:n.cy,r:Math.max(o[g].coord,0),startAngle:-d[0]*h,endAngle:-d[1]*h,clockwise:u.inverse}}))}for(g=0;g<f.length;g++)t.add(DS(f[g],{style:Qa({stroke:l[g%l.length],fill:null},s.getLineStyle()),silent:!0}))},minorSplitLine:function(t,e,n,i,r,o,a){if(a.length){for(var s=e.getModel("minorSplitLine").getModel("lineStyle"),l=[],c=0;c<a.length;c++)for(var u=0;u<a[c].length;u++)l.push(new pw({shape:{cx:n.cx,cy:n.cy,r:a[c][u].coord}}));t.add(DS(l,{style:Qa({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(t,e,n,i,r,o){if(o.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var c=[],u=o[0].coord,h=1;h<o.length;h++){var d=l++%s.length;c[d]=c[d]||[],c[d].push(new Ew({shape:{cx:n.cx,cy:n.cy,r0:u,r:o[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=o[h].coord}for(h=0;h<c.length;h++)t.add(DS(c[h],{style:Qa({fill:s[h%s.length]},a.getAreaStyle()),silent:!0}))}}};const Oq=Lq;function Rq(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}function Bq(t,e){return e.dim+t.model.componentIndex}const Nq=function(t,e,n){var i={},r=function(t){var e={};os(t,function(t,n){var i=t.getData(),r=t.coordinateSystem,o=r.getBaseAxis(),a=Bq(r,o),s=o.getExtent(),l="category"===o.type?o.getBandWidth():Math.abs(s[1]-s[0])/i.count(),c=e[a]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=c.stacks;e[a]=c;var h=Rq(t);u[h]||c.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var d=Rd(t.get("barWidth"),l),p=Rd(t.get("barMaxWidth"),l),f=t.get("barGap"),g=t.get("barCategoryGap");d&&!u[h].width&&(d=Math.min(c.remainedWidth,d),u[h].width=d,c.remainedWidth-=d),p&&(u[h].maxWidth=p),null!=f&&(c.gap=f),null!=g&&(c.categoryGap=g)});var n={};return os(e,function(t,e){n[e]={};var i=t.stacks,r=t.bandWidth,o=Rd(t.categoryGap,r),a=Rd(t.gap,1),s=t.remainedWidth,l=t.autoWidthCount,c=(s-o)/(l+(l-1)*a);c=Math.max(c,0),os(i,function(t,e){var n=t.maxWidth;n&&n<c&&(n=Math.min(n,s),t.width&&(n=Math.min(n,t.width)),s-=n,t.width=n,l--)}),c=(s-o)/(l+(l-1)*a),c=Math.max(c,0);var u,h=0;os(i,function(t,e){t.width||(t.width=c),u=t,h+=t.width*(1+a)}),u&&(h-=u.width*a);var d=-h/2;os(i,function(t,i){n[e][i]=n[e][i]||{offset:d,width:t.width},d+=t.width*(1+a)})}),n}(ls(e.getSeriesByType(t),function(t){return!e.isSeriesFiltered(t)&&t.coordinateSystem&&"polar"===t.coordinateSystem.type}));e.eachSeriesByType(t,function(t){if("polar"===t.coordinateSystem.type){var e=t.getData(),n=t.coordinateSystem,o=n.getBaseAxis(),a=Bq(n,o),s=Rq(t),l=r[a][s],c=l.offset,u=l.width,h=n.getOtherAxis(o),d=t.coordinateSystem.cx,p=t.coordinateSystem.cy,f=t.get("barMinHeight")||0,g=t.get("barMinAngle")||0;i[s]=i[s]||[];for(var m=e.mapDimension(h.dim),y=e.mapDimension(o.dim),v=rD(e,m),_="radius"!==o.dim||!t.get("roundCap",!0),x=h.model.get("startValue"),b=h.dataToCoord(x||0),w=0,S=e.count();w<S;w++){var M=e.get(m,w),C=e.get(y,w),T=M>=0?"p":"n",I=b;v&&(i[s][C]||(i[s][C]={p:b,n:b}),I=i[s][C][T]);var D=void 0,k=void 0,A=void 0,E=void 0;if("radius"===h.dim){var L=h.dataToCoord(M)-b,P=o.dataToCoord(C);Math.abs(L)<f&&(L=(L<0?-1:1)*f),D=I,k=I+L,E=(A=P-c)-u,v&&(i[s][C][T]=k)}else{var O=h.dataToCoord(M,_)-b,R=o.dataToCoord(C);Math.abs(O)<g&&(O=(O<0?-1:1)*g),k=(D=R+c)+u,A=I,E=I+O,v&&(i[s][C][T]=E)}e.setItemLayout(w,{cx:d,cy:p,r0:D,r:k,startAngle:-A*Math.PI/180,endAngle:-E*Math.PI/180,clockwise:A>=E})}}})};var zq={startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:0}},Fq={splitNumber:5},Vq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="polar",e}(Wb);function Hq(t,e){e=e||{};var n=t.coordinateSystem,i=t.axis,r={},o=i.position,a=i.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],c={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};r.position=["vertical"===a?c.vertical[o]:l[0],"horizontal"===a?c.horizontal[o]:l[3]],r.rotation=Math.PI/2*{horizontal:0,vertical:1}[a],r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],t.get(["axisTick","inside"])&&(r.tickDirection=-r.tickDirection),Ts(e.labelInside,t.get(["axisLabel","inside"]))&&(r.labelDirection=-r.labelDirection);var u=e.rotate;return null==u&&(u=t.get(["axisLabel","rotate"])),r.labelRotation="top"===o?-u:u,r.z2=1,r}var jq=["axisLine","axisTickLabel","axisName"],Wq=["splitArea","splitLine"],Gq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.axisPointerClass="SingleAxisPointer",n}return Ma(e,t),e.prototype.render=function(e,n,i,r){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new _d;var s=Hq(e),l=new CO(e,s);os(jq,l.add,l),o.add(this._axisGroup),o.add(l.getGroup()),os(Wq,function(t){e.get([t,"show"])&&Uq[t](this,this.group,this._axisGroup,e)},this),NS(a,this._axisGroup,e),t.prototype.render.call(this,e,n,i,r)},e.prototype.remove=function(){RO(this)},e.type="singleAxis",e}(LO),Uq={splitLine:function(t,e,n,i){var r=i.axis;if(!r.scale.isBlank()){var o=i.getModel("splitLine"),a=o.getModel("lineStyle"),s=a.get("color");s=s instanceof Array?s:[s];for(var l=a.get("width"),c=i.coordinateSystem.getRect(),u=r.isHorizontal(),h=[],d=0,p=r.getTicksCoords({tickModel:o}),f=[],g=[],m=0;m<p.length;++m){var y=r.toGlobalCoord(p[m].coord);u?(f[0]=y,f[1]=c.y,g[0]=y,g[1]=c.y+c.height):(f[0]=c.x,f[1]=y,g[0]=c.x+c.width,g[1]=y);var v=new Uw({shape:{x1:f[0],y1:f[1],x2:g[0],y2:g[1]},silent:!0});AS(v.shape,l);var _=d++%s.length;h[_]=h[_]||[],h[_].push(v)}var x=a.getLineStyle(["color"]);for(m=0;m<h.length;++m)e.add(DS(h[m],{style:Qa({stroke:s[m%s.length]},x),silent:!0}))}},splitArea:function(t,e,n,i){OO(t,n,i,i)}};const qq=Gq;var Yq=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.getCoordSysModel=function(){return this},e.type="singleAxis",e.layoutMode="box",e.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}},e}(Uv);is(Yq,vk.prototype);const Xq=Yq;var $q=function(t){function e(e,n,i,r,o){var a=t.call(this,e,n,i)||this;return a.type=r||"value",a.position=o||"bottom",a}return Ma(e,t),e.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},e.prototype.pointToData=function(t,e){return this.coordinateSystem.pointToData(t)[0]},e}($k);const Zq=$q;var Kq=["single"],Jq=function(){function t(t,e,n){this.type="single",this.dimension="single",this.dimensions=Kq,this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var i=this.dimension,r=new Zq(i,hk(t),[0,0],t.get("type"),t.get("position")),o="category"===r.type;r.onBand=o&&t.get("boundaryGap"),r.inverse=t.get("inverse"),r.orient=t.get("orient"),t.axis=r,r.model=t,r.coordinateSystem=this,this._axis=r},t.prototype.update=function(t,e){t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData();os(e.mapDimensionsAll(this.dimension),function(t){this._axis.scale.unionExtentFromData(e,t)},this),uk(this._axis.scale,this._axis.model)}},this)},t.prototype.resize=function(t,e){this._rect=Nv({left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")},{width:e.getWidth(),height:e.getHeight()}),this._adjustAxis()},t.prototype.getRect=function(){return this._rect},t.prototype._adjustAxis=function(){var t=this._rect,e=this._axis,n=e.isHorizontal(),i=n?[0,t.width]:[0,t.height],r=e.inverse?1:0;e.setExtent(i[r],i[1-r]),this._updateAxisTransform(e,n?t.x:t.y)},t.prototype._updateAxisTransform=function(t,e){var n=t.getExtent(),i=n[0]+n[1],r=t.isHorizontal();t.toGlobalCoord=r?function(t){return t+e}:function(t){return i-t+e},t.toLocalCoord=r?function(t){return t-e}:function(t){return i-t+e}},t.prototype.getAxis=function(){return this._axis},t.prototype.getBaseAxis=function(){return this._axis},t.prototype.getAxes=function(){return[this._axis]},t.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},t.prototype.containPoint=function(t){var e=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},t.prototype.dataToPoint=function(t){var e=this.getAxis(),n=this.getRect(),i=[],r="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),i[r]=e.toGlobalCoord(e.dataToCoord(+t)),i[1-r]=0===r?n.y+n.height/2:n.x+n.width/2,i},t.prototype.convertToPixel=function(t,e,n){return Qq(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return Qq(e)===this?this.pointToData(n):null},t}();function Qq(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}const tY=Jq,eY={create:function(t,e){var n=[];return t.eachComponent("singleAxis",function(i,r){var o=new tY(i,t,e);o.name="single_"+r,o.resize(i,e),i.coordinateSystem=o,n.push(o)}),t.eachSeries(function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents("singleAxis",Mp).models[0];t.coordinateSystem=e&&e.coordinateSystem}}),n},dimensions:Kq};var nY=["x","y"],iY=["width","height"],rY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.makeElOption=function(t,e,n,i,r){var o=n.axis,a=o.coordinateSystem,s=sY(a,1-aY(o)),l=a.dataToPoint(e)[0],c=i.get("type");if(c&&"none"!==c){var u=IU(i),h=oY[c](o,l,s);h.style=u,t.graphicKey=h.type,t.pointer=h}EU(e,t,Hq(n),n,i,r)},e.prototype.getHandleTransform=function(t,e,n){var i=Hq(e,{labelInside:!1});i.labelMargin=n.get(["handle","margin"]);var r=AU(e.axis,t,i);return{x:r[0],y:r[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,e,n,i){var r=n.axis,o=r.coordinateSystem,a=aY(r),s=sY(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var c=sY(o,1-a),u=(c[1]+c[0])/2,h=[u,u];return h[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:h,tooltipOption:{verticalAlign:"middle"}}},e}(TU),oY={line:function(t,e,n){return{type:"Line",subPixelOptimize:!0,shape:LU([e,n[0]],[e,n[1]],aY(t))}},shadow:function(t,e,n){var i=t.getBandWidth(),r=n[1]-n[0];return{type:"Rect",shape:PU([e-i/2,n[0]],[i,r],aY(t))}}};function aY(t){return t.isHorizontal()?0:1}function sY(t,e){var n=t.getRect();return[n[nY[e]],n[nY[e]]+n[iY[e]]]}const lY=rY;var cY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="single",e}(Wb);function uY(t,e){var n,i=t.cellSize;1===(n=ps(i)?i:t.cellSize=[i,i]).length&&(n[1]=n[0]);var r=as([0,1],function(t){return function(t,e){return null!=t[Ov[e][0]]||null!=t[Ov[e][1]]&&null!=t[Ov[e][2]]}(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]});Vv(t,e,{type:"box",ignoreSize:r})}const hY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(e,n,i){var r=Hv(e);t.prototype.init.apply(this,arguments),uY(e,r)},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),uY(this.option,e)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Uv);var dY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){var i=this.group;i.removeAll();var r=t.coordinateSystem,o=r.getRangeInfo(),a=r.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,i),this._renderLines(t,o,a,i),this._renderYearText(t,o,a,i),this._renderMonthText(t,s,a,i),this._renderWeekText(t,s,o,a,i)},e.prototype._renderDayRect=function(t,e,n){for(var i=t.coordinateSystem,r=t.getModel("itemStyle").getItemStyle(),o=i.getCellWidth(),a=i.getCellHeight(),s=e.start.time;s<=e.end.time;s=i.getNextNDay(s,1).time){var l=i.dataToRect([s],!1).tl,c=new Pg({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:r});n.add(c)}},e.prototype._renderLines=function(t,e,n,i){var r=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var c=e.start,u=0;c.time<=e.end.time;u++){d(c.formatedDate),0===u&&(c=o.getDateInfo(e.start.y+"-"+e.start.m));var h=c.date;h.setMonth(h.getMonth()+1),c=o.getDateInfo(h)}function d(e){r._firstDayOfMonth.push(o.getDateInfo(e)),r._firstDayPoints.push(o.dataToRect([e],!1).tl);var l=r._getLinePointsOfOneWeek(t,e,n);r._tlpoints.push(l[0]),r._blpoints.push(l[l.length-1]),s&&r._drawSplitline(l,a,i)}d(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(r._getEdgesPoints(r._tlpoints,l,n),a,i),s&&this._drawSplitline(r._getEdgesPoints(r._blpoints,l,n),a,i)},e.prototype._getEdgesPoints=function(t,e,n){var i=[t[0].slice(),t[t.length-1].slice()],r="horizontal"===n?0:1;return i[0][r]=i[0][r]-e/2,i[1][r]=i[1][r]+e/2,i},e.prototype._drawSplitline=function(t,e,n){var i=new Hw({z2:20,shape:{points:t},style:e});n.add(i)},e.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var i=t.coordinateSystem,r=i.getDateInfo(e),o=[],a=0;a<7;a++){var s=i.getNextNDay(r.time,a),l=i.dataToRect([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},e.prototype._formatterLabel=function(t,e){return gs(t)&&t?(n=t,os(e,function(t,e){n=n.replace("{"+e+"}",t)}),n):fs(t)?t(e):e.nameMap;var n},e.prototype._yearTextPositionControl=function(t,e,n,i,r){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===i?(a+=r,s=["center","top"]):"left"===i?o-=r:"right"===i?(o+=r,s=["center","top"]):a-=r;var l=0;return"left"!==i&&"right"!==i||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},e.prototype._renderYearText=function(t,e,n,i){var r=t.getModel("yearLabel");if(r.get("show")){var o=r.get("margin"),a=r.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,c=(s[0][1]+s[1][1])/2,u="horizontal"===n?0:1,h={top:[l,s[u][1]],bottom:[l,s[1-u][1]],left:[s[1-u][0],c],right:[s[u][0],c]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var p=r.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new $g({z2:30,style:uy(r,{text:g}),silent:r.get("silent")});m.attr(this._yearTextPositionControl(m,h[a],n,a,o)),i.add(m)}},e.prototype._monthTextPositionControl=function(t,e,n,i,r){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=r,e&&(o="center"),"start"===i&&(a="bottom")):(s+=r,e&&(a="middle"),"start"===i&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderMonthText=function(t,e,n,i){var r=t.getModel("monthLabel");if(r.get("show")){var o=r.get("nameMap"),a=r.get("margin"),s=r.get("position"),l=r.get("align"),c=[this._tlpoints,this._blpoints];o&&!gs(o)||(o&&(e=Uy(o)||e),o=e.get(["time","monthAbbr"])||[]);var u="start"===s?0:1,h="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=r.get("silent"),f=0;f<c[u].length-1;f++){var g=c[u][f].slice(),m=this._firstDayOfMonth[f];if(d){var y=this._firstDayPoints[f];g[h]=(y[h]+c[0][f+1][h])/2}var v=r.get("formatter"),_=o[+m.m-1],x={yyyy:m.y,yy:(m.y+"").slice(2),MM:m.m,M:+m.m,nameMap:_},b=this._formatterLabel(v,x),w=new $g({z2:30,style:Ja(uy(r,{text:b}),this._monthTextPositionControl(g,d,n,s,a)),silent:p});i.add(w)}}},e.prototype._weekTextPositionControl=function(t,e,n,i,r){var o="center",a="middle",s=t[0],l=t[1],c="start"===n;return"horizontal"===e?(s=s+i+(c?1:-1)*r[0]/2,o=c?"right":"left"):(l=l+i+(c?1:-1)*r[1]/2,a=c?"bottom":"top"),{x:s,y:l,align:o,verticalAlign:a}},e.prototype._renderWeekText=function(t,e,n,i,r){var o=t.getModel("dayLabel");if(o.get("show")){var a=t.coordinateSystem,s=o.get("position"),l=o.get("nameMap"),c=o.get("margin"),u=a.getFirstDayOfWeek();l&&!gs(l)||(l&&(e=Uy(l)||e),l=e.get(["time","dayOfWeekShort"])||as(e.get(["time","dayOfWeekAbbr"]),function(t){return t[0]}));var h=a.getNextNDay(n.end.time,7-n.lweek).time,d=[a.getCellWidth(),a.getCellHeight()];c=Rd(c,Math.min(d[1],d[0])),"start"===s&&(h=a.getNextNDay(n.start.time,-(7+n.fweek)).time,c=-c);for(var p=o.get("silent"),f=0;f<7;f++){var g,m=a.getNextNDay(h,f),y=a.dataToRect([m.time],!1).center;g=Math.abs((f+u)%7);var v=new $g({z2:30,style:Ja(uy(o,{text:l[g]}),this._weekTextPositionControl(y,i,s,c,d)),silent:p});r.add(v)}}},e.type="calendar",e}(Wb);const pY=dY;var fY=864e5,gY=function(){function t(e,n,i){this.type="calendar",this.dimensions=t.dimensions,this.getDimensionsInfo=t.getDimensionsInfo,this._model=e}return t.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},t.prototype.getRangeInfo=function(){return this._rangeInfo},t.prototype.getModel=function(){return this._model},t.prototype.getRect=function(){return this._rect},t.prototype.getCellWidth=function(){return this._sw},t.prototype.getCellHeight=function(){return this._sh},t.prototype.getOrient=function(){return this._orient},t.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},t.prototype.getDateInfo=function(t){var e=(t=Xd(t)).getFullYear(),n=t.getMonth()+1,i=n<10?"0"+n:""+n,r=t.getDate(),o=r<10?"0"+r:""+r,a=t.getDay();return{y:e+"",m:i,d:o,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+i+"-"+o,date:t}},t.prototype.getNextNDay=function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},t.prototype.update=function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,i=["width","height"],r=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),a="horizontal"===this._orient?[n,7]:[7,n];os([0,1],function(t){c(r,t)&&(o[i[t]]=r[t]*a[t])});var s={width:e.getWidth(),height:e.getHeight()},l=this._rect=Nv(o,s);function c(t,e){return null!=t[e]&&"auto"!==t[e]}os([0,1],function(t){c(r,t)||(r[t]=l[i[t]]/a[t])}),this._sw=r[0],this._sh=r[1]},t.prototype.dataToPoint=function(t,e){ps(t)&&(t=t[0]),null==e&&(e=!0);var n=this.getDateInfo(t),i=this._rangeInfo,r=n.formatedDate;if(e&&!(n.time>=i.start.time&&n.time<i.end.time+fY))return[NaN,NaN];var o=n.day,a=this._getRangeInfo([i.start.time,r]).nthWeek;return"vertical"===this._orient?[this._rect.x+o*this._sw+this._sw/2,this._rect.y+a*this._sh+this._sh/2]:[this._rect.x+a*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]},t.prototype.pointToData=function(t){var e=this.pointToDate(t);return e&&e.time},t.prototype.dataToRect=function(t,e){var n=this.dataToPoint(t,e);return{contentShape:{x:n[0]-(this._sw-this._lineWidth)/2,y:n[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},t.prototype.pointToDate=function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,n=Math.floor((t[1]-this._rect.y)/this._sh)+1,i=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,e-1,i):this._getDateByWeeksAndDay(e,n-1,i)},t.prototype.convertToPixel=function(t,e,n){var i=mY(e);return i===this?i.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){var i=mY(e);return i===this?i.pointToData(n):null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.prototype._initRangeOption=function(){var t,e=this._model.get("range");if(ps(e)&&1===e.length&&(e=e[0]),ps(e))t=e;else{var n=e.toString();if(/^\d{4}$/.test(n)&&(t=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var i=this.getDateInfo(n),r=i.date;r.setMonth(r.getMonth()+1);var o=this.getNextNDay(r,-1);t=[i.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)return e;var a=this._getRangeInfo(t);return a.start.time>a.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var i=Math.floor(n[1].time/fY)-Math.floor(n[0].time/fY)+1,r=new Date(n[0].time),o=r.getDate(),a=n[1].date.getDate();r.setDate(o+i-1);var s=r.getDate();if(s!==a)for(var l=r.getTime()-n[1].time>0?1:-1;(s=r.getDate())!==a&&(r.getTime()-n[1].time)*l>0;)i-=l,r.setDate(s-l);var c=Math.floor((i+n[0].day+6)/7),u=e?1-c:c-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:i,weeks:c,nthWeek:u,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var i=this._getRangeInfo(n);if(t>i.weeks||0===t&&e<i.fweek||t===i.weeks&&e>i.lweek)return null;var r=7*(t-1)-i.fweek+e,o=new Date(i.start.time);return o.setDate(+i.start.d+r),this.getDateInfo(o)},t.create=function(e,n){var i=[];return e.eachComponent("calendar",function(r){var o=new t(r,e,n);i.push(o),r.coordinateSystem=o}),e.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=i[t.get("calendarIndex")||0])}),i},t.dimensions=["time","value"],t}();function mY(t){var e=t.calendarModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}const yY=gY;function vY(t,e){var n;return os(e,function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)}),n}var _Y=["transition","enterFrom","leaveTo"],xY=_Y.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function bY(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var i=n?_Y:xY,r=0;r<i.length;r++){var o=i[r];null==t[o]&&null!=e[o]&&(t[o]=e[o])}}var wY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.preventAutoZ=!0,n}return Ma(e,t),e.prototype.mergeOption=function(e,n){var i=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,n),this.option.elements=i},e.prototype.optionUpdated=function(t,e){var n=this.option,i=(e?n:t).elements,r=n.elements=e?[]:n.elements,o=[];this._flatten(i,o,null);var a=pp(r,o,"normalMerge"),s=this._elOptionsToUpdate=[];os(a,function(t,e){var n=t.newOption;n&&(s.push(n),function(t,e){var n=t.existing;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var i=e.parentOption;i?e.parentId=i.id:n&&(e.parentId=n.parentId)}e.parentOption=null}(t,n),function(t,e,n){var i=Ja({},n),r=t[e],o=n.$action||"merge";"merge"===o?r?(Za(r,i,!0),Vv(r,i,{ignoreSize:!0}),jv(n,r),bY(n,r),bY(n,r,"shape"),bY(n,r,"style"),bY(n,r,"extra"),n.clipPath=r.clipPath):t[e]=i:"replace"===o?t[e]=i:"remove"===o&&r&&(t[e]=null)}(r,e,n),function(t,e){if(t&&(t.hv=e.hv=[vY(e,["left","right"]),vY(e,["top","bottom"])],"group"===t.type)){var n=t,i=e;null==n.width&&(n.width=i.width=0),null==n.height&&(n.height=i.height=0)}}(r[e],n))},this),n.elements=ls(r,function(t){return t&&delete t.$action,null!=t})},e.prototype._flatten=function(t,e,n){os(t,function(t){if(t){n&&(t.parentOption=n),e.push(t);var i=t.children;i&&i.length&&this._flatten(i,e,t),delete t.children}},this)},e.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},e.type="graphic",e.defaultOption={elements:[]},e}(Uv),SY={path:null,compoundPath:null,group:_d,image:Cg,text:$g},MY=xp(),CY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(){this._elMap=Fs()},e.prototype.render=function(t,e,n){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},e.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var n=this._elMap,i=this.group,r=t.get("z"),o=t.get("zlevel");os(e,function(e){var a=mp(e.id,null),s=null!=a?n.get(a):null,l=mp(e.parentId,null),c=null!=l?n.get(l):i,u=e.type,h=e.style;"text"===u&&h&&e.hv&&e.hv[1]&&(h.textVerticalAlign=h.textBaseline=h.verticalAlign=h.align=null);var d=e.textContent,p=e.textConfig;if(h&&yG(h,u,!!p,!!d)){var f=vG(h,u,!0);!p&&f.textConfig&&(p=e.textConfig=f.textConfig),!d&&f.textContent&&(d=f.textContent)}var g=function(t){return t=Ja({},t),os(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(Pv),function(e){delete t[e]}),t}(e),m=e.$action||"merge",y="merge"===m,v="replace"===m;if(y){var _=s;(T=!s)?_=IY(a,c,e.type,n):(_&&(MY(_).isNew=!1),FG(_)),_&&(IG(_,g,t,{isInit:T}),kY(_,e,r,o))}else if(v){DY(s,e,n,t);var x=IY(a,c,e.type,n);x&&(IG(x,g,t,{isInit:!0}),kY(x,e,r,o))}else"remove"===m&&(DG(s,e),DY(s,e,n,t));var b=n.get(a);if(b&&d)if(y){var w=b.getTextContent();w?w.attr(d):b.setTextContent(new $g(d))}else v&&b.setTextContent(new $g(d));if(b){var S=e.clipPath;if(S){var M=S.type,C=void 0,T=!1;if(y){var I=b.getClipPath();C=(T=!I||MY(I).type!==M)?TY(M):I}else v&&(T=!0,C=TY(M));b.setClipPath(C),IG(C,S,t,{isInit:T}),VG(C,S.keyframeAnimation,t)}var D=MY(b);b.setTextConfig(p),D.option=e,function(t,e,n){var i=Zg(t).eventData;t.silent||t.ignore||i||(i=Zg(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=n.info)}(b,t,e),GS({el:b,componentModel:t,itemName:b.name,itemTooltipOption:e.tooltip}),VG(b,e.keyframeAnimation,t)}})}},e.prototype._relocate=function(t,e){for(var n=t.option.elements,i=this.group,r=this._elMap,o=e.getWidth(),a=e.getHeight(),s=["x","y"],l=0;l<n.length;l++)if((f=null!=(p=mp((d=n[l]).id,null))?r.get(p):null)&&f.isGroup){var c=(g=f.parent)===i,u=MY(f),h=MY(g);u.width=Rd(u.option.width,c?o:h.width)||0,u.height=Rd(u.option.height,c?a:h.height)||0}for(l=n.length-1;l>=0;l--){var d,p,f;if(f=null!=(p=mp((d=n[l]).id,null))?r.get(p):null){var g=f.parent,m=(h=MY(g),{}),y=zv(f,d,g===i?{width:o,height:a}:{width:h.width,height:h.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!MY(f).isNew&&y){for(var v=d.transition,_={},x=0;x<s.length;x++){var b=s[x],w=m[b];v&&(AG(v)||es(v,b)>=0)?_[b]=w:f[b]=w}Jm(f,_,t,0)}else f.attr(m)}}},e.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){DY(n,MY(n).option,e,t._lastGraphicModel)}),this._elMap=Fs()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(Wb);function TY(t){var e=new(Ws(SY,t)?SY[t]:MS(t))({});return MY(e).type=t,e}function IY(t,e,n,i){var r=TY(n);return e.add(r),i.set(t,r),MY(r).id=t,MY(r).isNew=!0,r}function DY(t,e,n,i){t&&t.parent&&("group"===t.type&&t.traverse(function(t){DY(t,e,n,i)}),kG(t,e,i),n.removeKey(MY(t).id))}function kY(t,e,n,i){t.isGroup||os([["cursor",gf.prototype.cursor],["zlevel",i||0],["z",n||0],["z2",0]],function(n){var i=n[0];Ws(e,i)?t[i]=Is(e[i],n[1]):null==t[i]&&(t[i]=n[1])}),os(us(e),function(n){if(0===n.indexOf("on")){var i=e[n];t[n]=fs(i)?i:null}}),Ws(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var AY=["x","y","radius","angle","single"],EY=["cartesian2d","polar","singleAxis"];function LY(t){return t+"Axis"}function PY(t){var e=t.ecModel,n={infoList:[],infoMap:Fs()};return t.eachTargetAxis(function(t,i){var r=e.getComponent(LY(t),i);if(r){var o=r.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(r)}}}),n}var OY=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),RY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=["percent","percent"],n}return Ma(e,t),e.prototype.init=function(t,e,n){var i=BY(t);this.settledOption=i,this.mergeDefaultAndTheme(t,n),this._doInit(i)},e.prototype.mergeOption=function(t){var e=BY(t);Za(this.option,t,!0),Za(this.settledOption,e,!0),this._doInit(e)},e.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;os([["start","startValue"],["end","endValue"]],function(t,i){"value"===this._rangePropMode[i]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=Fs();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return os(AY,function(n){var i=this.getReferringComponents(LY(n),Cp);if(i.specified){e=!0;var r=new OY;os(i.models,function(t){r.add(t.componentIndex)}),t.set(n,r)}},this),e},e.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,i=!0;if(i){var r="vertical"===e?"y":"x";o(n.findComponents({mainType:r+"Axis"}),r)}function o(e,n){var r=e[0];if(r){var o=new OY;if(o.add(r.componentIndex),t.set(n,o),i=!1,"x"===n||"y"===n){var a=r.getReferringComponents("grid",Mp).models[0];a&&os(e,function(t){r.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",Mp).models[0]&&o.add(t.componentIndex)})}}}i&&o(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single"),i&&os(AY,function(e){if(i){var r=n.findComponents({mainType:LY(e),filter:function(t){return"category"===t.get("type",!0)}});if(r[0]){var o=new OY;o.add(r[0].componentIndex),t.set(e,o),i=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");os([["start","startValue"],["end","endValue"]],function(i,r){var o=null!=t[i[0]],a=null!=t[i[1]];o&&!a?e[r]="percent":!o&&a?e[r]="value":n?e[r]=n[r]:o&&(e[r]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(LY(e),n))},this),t},e.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,i){os(n.indexList,function(n){t.call(e,i,n)})})},e.prototype.getAxisProxy=function(t,e){var n=this.getAxisModel(t,e);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(t,e){var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(LY(t),e)},e.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;os([["start","startValue"],["end","endValue"]],function(i){null==t[i[0]]&&null==t[i[1]]||(e[i[0]]=n[i[0]]=t[i[0]],e[i[1]]=n[i[1]]=t[i[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var e=this.option;os(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getDataValueWindow();var n=this.findRepresentativeAxisProxy();return n?n.getDataValueWindow():void 0},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var e,n=this._targetAxisInfoMap.keys(),i=0;i<n.length;i++)for(var r=n[i],o=this._targetAxisInfoMap.get(r),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(r,o.indexList[a]);if(s.hostedBy(this))return s;e||(e=s)}return e},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(Uv);function BY(t){var e={};return os(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}const NY=RY,zY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="dataZoom.select",e}(NY),FY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n,i){this.dataZoomModel=t,this.ecModel=e,this.api=n},e.type="dataZoom",e}(Wb),VY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="dataZoom.select",e}(FY);var HY=os,jY=Nd,WY=function(){function t(t,e,n,i){this._dimName=t,this._axisIndex=e,this.ecModel=i,this._dataZoomModel=n}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries(function(e){if(function(t){var e=t.get("coordinateSystem");return es(EY,e)>=0}(e)){var n=LY(this._dimName),i=e.getReferringComponents(n,Mp).models[0];i&&this._axisIndex===i.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return $a(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,n=this._dataExtent,i=this.getAxisModel().axis.scale,r=this._dataZoomModel.getRangePropMode(),o=[0,100],a=[],s=[];HY(["start","end"],function(l,c){var u=t[l],h=t[l+"Value"];"percent"===r[c]?(null==u&&(u=o[c]),h=i.parse(Od(u,o,n))):(e=!0,u=Od(h=null==h?n[c]:i.parse(h),n,o)),s[c]=null==h||isNaN(h)?n[c]:h,a[c]=null==u||isNaN(u)?o[c]:u}),jY(s),jY(a);var l=this._minMaxSpan;function c(t,e,n,r,o){var a=o?"Span":"ValueSpan";SV(0,t,n,"all",l["min"+a],l["max"+a]);for(var s=0;s<2;s++)e[s]=Od(t[s],n,r,!0),o&&(e[s]=i.parse(e[s]))}return e?c(s,a,n,o,!1):c(a,s,o,n,!0),{valueWindow:s,percentWindow:a}},t.prototype.reset=function(t){if(t===this._dataZoomModel){var e=this.getTargetSeriesModels();this._dataExtent=function(t,e,n){var i=[1/0,-1/0];HY(n,function(t){!function(t,e,n){e&&os(yk(e,n),function(n){var i=e.getApproximateExtent(n);i[0]<t[0]&&(t[0]=i[0]),i[1]>t[1]&&(t[1]=i[1])})}(i,t.getData(),e)});var r=t.getAxisModel(),o=sk(r.axis.scale,r,i).calculate();return[o.min,o.max]}(this,this._dimName,e),this._updateMinMaxSpan();var n=this.calculateDataWindow(t.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(t,e){if(t===this._dataZoomModel){var n=this._dimName,i=this.getTargetSeriesModels(),r=t.get("filterMode"),o=this._valueWindow;"none"!==r&&HY(i,function(t){var e=t.getData(),i=e.mapDimensionsAll(n);if(i.length){if("weakFilter"===r){var a=e.getStore(),s=as(i,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,r,l=0;l<i.length;l++){var c=a.get(s[l],t),u=!isNaN(c),h=c<o[0],d=c>o[1];if(u&&!h&&!d)return!0;u&&(r=!0),h&&(e=!0),d&&(n=!0)}return r&&e&&n})}else HY(i,function(n){if("empty"===r)t.setData(e=e.map(n,function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN}));else{var i={};i[n]=o,e.selectRange(i)}});HY(i,function(t){e.setApproximateExtent(o,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._dataExtent;HY(["min","max"],function(i){var r=e.get(i+"Span"),o=e.get(i+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?r=Od(n[0]+o,n,[0,100],!0):null!=r&&(o=Od(r,[0,100],n,!0)-n[0]),t[i+"Span"]=r,t[i+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var t=this.getAxisModel(),e=this._percentWindow,n=this._valueWindow;if(e){var i=Vd(n,[0,500]);i=Math.min(i,20);var r=t.axis.scale.rawExtentInfo;0!==e[0]&&r.setDeterminedMinMax("min",+n[0].toFixed(i)),100!==e[1]&&r.setDeterminedMinMax("max",+n[1].toFixed(i)),r.freeze()}},t}();const GY=WY,UY={getTargetSeries:function(t){function e(e){t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(i,r){var o=t.getComponent(LY(i),r);e(i,r,o,n)})})}e(function(t,e,n,i){n.__dzAxisProxy=null});var n=[];e(function(e,i,r,o){r.__dzAxisProxy||(r.__dzAxisProxy=new GY(e,i,o,t),n.push(r.__dzAxisProxy))});var i=Fs();return os(n,function(t){os(t.getTargetSeriesModels(),function(t){i.set(t.uid,t)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(e,n){t.getAxisProxy(e,n).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getDataPercentWindow(),i=e.getDataValueWindow();t.setCalculatedRange({start:n[0],end:n[1],startValue:i[0],endValue:i[1]})}})}};var qY=!1;function YY(t){qY||(qY=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,UY),function(t){t.registerAction("dataZoom",function(t,e){os(function(t,e){var n,i=Fs(),r=[],o=Fs();t.eachComponent({mainType:"dataZoom",query:e},function(t){o.get(t.uid)||s(t)});do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var r=i.get(t);r&&r[n]&&(e=!0)}),e}(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),r.push(t),t.eachTargetAxis(function(t,e){(i.get(t)||i.set(t,[]))[e]=!0})}return r}(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function XY(t){t.registerComponentModel(zY),t.registerComponentView(VY),YY(t)}var $Y=function(){},ZY={};function KY(t,e){ZY[t]=e}function JY(t){return ZY[t]}const QY=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.optionUpdated=function(){t.prototype.optionUpdated.apply(this,arguments);var e=this.ecModel;os(this.option.feature,function(t,n){var i=JY(n);i&&(i.getDefaultOption&&(i.defaultOption=i.getDefaultOption(e)),Za(t,i.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Uv);function tX(t,e){var n=wv(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),new Pg({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1})}var eX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.render=function(t,e,n,i){var r=this.group;if(r.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features={}),c=[];os(s,function(t,e){c.push(e)}),new CI(this._featureNames||[],c).add(u).update(u).remove(ds(u,null)).execute(),this._featureNames=c,function(t,e,n){var i=e.getBoxLayoutParams(),r=e.get("padding"),o={width:n.getWidth(),height:n.getHeight()},a=Nv(i,o,r);Bv(e.get("orient"),t,e.get("itemGap"),a.width,a.height),zv(t,i,o,r)}(r,t,n),r.add(tX(r.getBoundingRect(),t)),a||r.eachChild(function(t){var e=t.__title,i=t.ensureState("emphasis"),a=i.textConfig||(i.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!fs(l)&&e){var c=l.style||(l.style={}),u=ed(e,$g.makeFont(c)),h=t.x+r.x,d=!1;t.y+r.y+o+u.height>n.getHeight()&&(a.position="top",d=!0);var p=d?-5-u.height:o+10;h+u.width/2>n.getWidth()?(a.position=["100%",p],c.align="right"):h-u.width/2<0&&(a.position=[0,p],c.align="left")}})}function u(u,h){var d,p=c[u],f=c[h],g=s[p],m=new Oy(g,t,t.ecModel);if(i&&null!=i.newTitle&&i.featureName===p&&(g.title=i.newTitle),p&&!f){if(function(t){return 0===t.indexOf("my")}(p))d={onclick:m.option.onclick,featureName:p};else{var y=JY(p);if(!y)return;d=new y}l[p]=d}else if(!(d=l[f]))return;d.uid=By("toolbox-feature"),d.model=m,d.ecModel=e,d.api=n;var v=d instanceof $Y;p||!f?!m.get("show")||v&&d.unusable?v&&d.remove&&d.remove(e,n):(function(i,s,l){var c,u,h=i.getModel("iconStyle"),d=i.getModel(["emphasis","iconStyle"]),p=s instanceof $Y&&s.getIcons?s.getIcons():i.get("icon"),f=i.get("title")||{};gs(p)?(c={})[l]=p:c=p,gs(f)?(u={})[l]=f:u=f;var g=i.iconPaths={};os(c,function(l,c){var p=VS(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(h.getItemStyle()),p.ensureState("emphasis").style=d.getItemStyle();var f=new $g({style:{text:u[c],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:my({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},e)},ignore:!0});p.setTextContent(f),GS({el:p,componentModel:t,itemName:c,formatterParamsExtra:{title:u[c]}}),p.__title=u[c],p.on("mouseover",function(){var e=d.getItemStyle(),i=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:d.get("textFill")||e.fill||e.stroke||"#000",backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||i}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==i.get(["iconStatus",c])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===i.get(["iconStatus",c])?Tm:Im)(p),r.add(p),p.on("click",hs(s.onclick,s,e,n,c)),g[c]=p})}(m,d,p),m.setIconStatus=function(t,e){var n=this.option,i=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,i[t]&&("emphasis"===e?Tm:Im)(i[t])},d instanceof $Y&&d.render&&d.render(m,e,n,i)):v&&d.dispose&&d.dispose(e,n)}},e.prototype.updateView=function(t,e,n,i){os(this._features,function(t){t instanceof $Y&&t.updateView&&t.updateView(t.model,e,n,i)})},e.prototype.remove=function(t,e){os(this._features,function(n){n instanceof $Y&&n.remove&&n.remove(t,e)}),this.group.removeAll()},e.prototype.dispose=function(t,e){os(this._features,function(n){n instanceof $Y&&n.dispose&&n.dispose(t,e)})},e.type="toolbox",e}(Wb);const nX=eX;var iX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.onclick=function(t,e){var n=this.model,i=n.get("name")||t.get("title.0.text")||"echarts",r="svg"===e.getZr().painter.getType(),o=r?"svg":n.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),s=Ia.browser;if("function"!=typeof MouseEvent||!s.newEdge&&(s.ie||s.edge))if(window.navigator.msSaveOrOpenBlob||r){var l=a.split(","),c=l[0].indexOf("base64")>-1,u=r?decodeURIComponent(l[1]):l[1];c&&(u=window.atob(u));var h=i+"."+o;if(window.navigator.msSaveOrOpenBlob){for(var d=u.length,p=new Uint8Array(d);d--;)p[d]=u.charCodeAt(d);var f=new Blob([p]);window.navigator.msSaveOrOpenBlob(f,h)}else{var g=document.createElement("iframe");document.body.appendChild(g);var m=g.contentWindow,y=m.document;y.open("image/svg+xml","replace"),y.write(u),y.close(),m.focus(),y.execCommand("SaveAs",!0,h),document.body.removeChild(g)}}else{var v=n.get("lang"),_='<body style="margin:0;"><img src="'+a+'" style="max-width:100%;" title="'+(v&&v[0]||"")+'" /></body>',x=window.open();x.document.write(_),x.document.title=i}else{var b=document.createElement("a");b.download=i+"."+o,b.target="_blank",b.href=a;var w=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});b.dispatchEvent(w)}},e.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},e}($Y);const rX=iX;var oX="__ec_magicType_stack__",aX=[["line","bar"],["stack"]],sX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return os(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},e.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},e.prototype.onclick=function(t,e,n){var i=this.model,r=i.get(["seriesIndex",n]);if(lX[n]){var o,a={series:[]};os(aX,function(t){es(t,n)>=0&&os(t,function(t){i.setIconStatus(t,"normal")})}),i.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==r?null:{seriesIndex:r}},function(t){var e=t.subType,r=t.id,o=lX[n](e,r,t,i);o&&(Qa(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var c=l.dim+"Axis",u=t.getReferringComponents(c,Mp).models[0].componentIndex;a[c]=a[c]||[];for(var h=0;h<=u;h++)a[c][u]=a[c][u]||{};a[c][u].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(o=Za({stack:i.option.title.tiled,tiled:i.option.title.stack},i.option.title),"emphasis"!==i.get(["iconStatus",n])&&(s="tiled")),e.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},e}($Y),lX={line:function(t,e,n,i){if("bar"===t)return Za({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","line"])||{},!0)},bar:function(t,e,n,i){if("line"===t)return Za({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},i.get(["option","bar"])||{},!0)},stack:function(t,e,n,i){var r=n.get("stack")===oX;if("line"===t||"bar"===t)return i.setIconStatus("stack",r?"normal":"emphasis"),Za({id:e,stack:r?"":oX},i.get(["option","stack"])||{},!0)}};aI({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});const cX=sX;var uX=new Array(60).join("-"),hX="\t";function dX(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var pX=new RegExp("[\t]+","g");var fX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.onclick=function(t,e){setTimeout(function(){e.dispatchAction({type:"hideTip"})});var n=e.getDom(),i=this.model;this._dom&&n.removeChild(this._dom);var r=document.createElement("div");r.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",r.style.backgroundColor=i.get("backgroundColor")||"#fff";var o=document.createElement("h4"),a=i.get("lang")||[];o.innerHTML=a[0]||i.get("title"),o.style.cssText="margin:10px 20px",o.style.color=i.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="overflow:auto";var c=i.get("optionToContent"),u=i.get("contentToOption"),h=function(t){var e,n,i,r=function(t){var e={},n=[],i=[];return t.eachRawSeries(function(t){var r=t.coordinateSystem;if(!r||"cartesian2d"!==r.type&&"polar"!==r.type)n.push(t);else{var o=r.getBaseAxis();if("category"===o.type){var a=o.dim+"_"+o.index;e[a]||(e[a]={categoryAxis:o,valueAxis:r.getOtherAxis(o),series:[]},i.push({axisDim:o.dim,axisIndex:o.index})),e[a].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:i}}(t);return{value:ls([(n=r.seriesGroupByCategoryAxis,i=[],os(n,function(t,e){var n=t.categoryAxis,r=t.valueAxis.dim,o=[" "].concat(as(t.series,function(t){return t.name})),a=[n.model.getCategories()];os(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(r),function(t){return t}))});for(var s=[o.join(hX)],l=0;l<a[0].length;l++){for(var c=[],u=0;u<a.length;u++)c.push(a[u][l]);s.push(c.join(hX))}i.push(s.join("\n"))}),i.join("\n\n"+uX+"\n\n")),(e=r.other,as(e,function(t){var e=t.getRawData(),n=[t.name],i=[];return e.each(e.dimensions,function(){for(var t=arguments.length,r=arguments[t-1],o=e.getName(r),a=0;a<t-1;a++)i[a]=arguments[a];n.push((o?o+hX:"")+i.join(hX))}),n.join("\n")}).join("\n\n"+uX+"\n\n"))],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join("\n\n"+uX+"\n\n"),meta:r.meta}}(t);if(fs(c)){var d=c(e.getOption());gs(d)?s.innerHTML=d:bs(d)&&s.appendChild(d)}else{l.readOnly=i.get("readOnly");var p=l.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=i.get("textColor"),p.borderColor=i.get("textareaBorderColor"),p.backgroundColor=i.get("textareaColor"),l.value=h.value,s.appendChild(l)}var f=h.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",y=document.createElement("div"),v=document.createElement("div");m+=";background-color:"+i.get("buttonColor"),m+=";color:"+i.get("buttonTextColor");var _=this;function x(){n.removeChild(r),_._dom=null}Fl(y,"click",x),Fl(v,"click",function(){if(null==u&&null!=c||null!=u&&null==c)x();else{var t;try{t=fs(u)?u(s,e.getOption()):function(t,e){var n=t.split(new RegExp("\n*"+uX+"\n*","g")),i={series:[]};return os(n,function(t,n){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(hX)>=0)return!0}(t)){var r=function(t){for(var e=t.split(/\n+/g),n=[],i=as(dX(e.shift()).split(pX),function(t){return{name:t,data:[]}}),r=0;r<e.length;r++){var o=dX(e[r]).split(pX);n.push(o.shift());for(var a=0;a<o.length;a++)i[a]&&(i[a].data[r]=o[a])}return{series:i,categories:n}}(t),o=e[n],a=o.axisDim+"Axis";o&&(i[a]=i[a]||[],i[a][o.axisIndex]={data:r.categories},i.series=i.series.concat(r.series))}else r=function(t){for(var e=t.split(/\n+/g),n=dX(e.shift()),i=[],r=0;r<e.length;r++){var o=dX(e[r]);if(o){var a=o.split(pX),s="",l=void 0,c=!1;isNaN(a[0])?(c=!0,s=a[0],a=a.slice(1),i[r]={name:s,value:[]},l=i[r].value):l=i[r]=[];for(var u=0;u<a.length;u++)l.push(+a[u]);1===l.length&&(c?i[r].value=l[0]:i[r]=l[0])}}return{name:n,data:i}}(t),i.series.push(r)}),i}(l.value,f)}catch(t){throw x(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),x()}}),y.innerHTML=a[1],v.innerHTML=a[2],v.style.cssText=y.style.cssText=m,!i.get("readOnly")&&g.appendChild(v),g.appendChild(y),r.appendChild(o),r.appendChild(s),r.appendChild(g),s.style.height=n.clientHeight-80+"px",n.appendChild(r),this._dom=r},e.prototype.remove=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,e){this.remove(t,e)},e.getDefaultOption=function(t){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"}},e}($Y);function gX(t,e){return as(t,function(t,n){var i=e&&e[n];if(vs(i)&&!ps(i)){vs(t)&&!ps(t)||(t={value:t});var r=null!=i.name&&null==t.name;return t=Qa(t,i),r&&delete t.name,t}return t})}aI({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var n=[];os(t.newOption.series,function(t){var i=e.getSeriesByName(t.name)[0];if(i){var r=i.get("data");n.push({name:t.name,data:gX(t.data,r)})}else n.push(Ja({type:"scatter"},t))}),e.mergeOption(Qa({series:n},t.newOption))});const mX=fX;var yX=os,vX=xp();function _X(t){var e=vX(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var xX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.onclick=function(t,e){!function(t){vX(t).snapshots=null}(t),e.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])}},e}($Y);aI({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});const bX=xX;var wX=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],SX=function(){function t(t,e,n){var i=this;this._targetInfoList=[];var r=CX(e,t);os(TX,function(t,e){(!n||!n.include||es(n.include,e)>=0)&&t(r,i._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var i=kX[t.brushType](0,n,e);t.__rangeOffset={offset:EX[t.brushType](i.values,t.range,[1,1]),xyMinMax:i.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){os(t,function(t){var i=this.findTargetInfo(t,e);i&&!0!==i&&os(i.coordSyses,function(i){var r=kX[t.brushType](1,i,t.range,!0);n(t,r.values,i,e)})},this)},t.prototype.setInputRanges=function(t,e){os(t,function(t){var n=this.findTargetInfo(t,e);if(t.range=t.range||[],n&&!0!==n){t.panelId=n.panelId;var i=kX[t.brushType](0,n.coordSys,t.coordRange),r=t.__rangeOffset;t.range=r?EX[t.brushType](i.values,r.offset,function(t,e){var n=PX(t),i=PX(e),r=[n[0]/i[0],n[1]/i[1]];return isNaN(r[0])&&(r[0]=1),isNaN(r[1])&&(r[1]=1),r}(i.xyMinMax,r.xyMinMax)):i.values}},this)},t.prototype.makePanelOpts=function(t,e){return as(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:DH(i),isTargetByCursor:AH(i,t,n.coordSysModel),getLinearBrushOtherExtent:kH(i)}})},t.prototype.controlSeries=function(t,e,n){var i=this.findTargetInfo(t,n);return!0===i||i&&es(i.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,i=CX(e,t),r=0;r<n.length;r++){var o=n[r],a=t.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<IX.length;s++)if(IX[s](i,o))return o}return!0},t}();function MX(t){return t[0]>t[1]&&t.reverse(),t}function CX(t,e){return wp(t,e,{includeMainTypes:wX})}var TX={grid:function(t,e){var n=t.xAxisModels,i=t.yAxisModels,r=t.gridModels,o=Fs(),a={},s={};(n||i||r)&&(os(n,function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0}),os(i,function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0}),os(r,function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),o.each(function(t){var r=t.coordinateSystem,o=[];os(r.getCartesians(),function(t,e){(es(n,t.getAxis("x").model)>=0||es(i,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:DX.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){os(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:DX.geo})})}},IX=[function(t,e){var n=t.xAxisModel,i=t.yAxisModel,r=t.gridModel;return!r&&n&&(r=n.axis.grid.model),!r&&i&&(r=i.axis.grid.model),r&&r===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],DX={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys,e=t.getBoundingRect().clone();return e.applyTransform(PS(t)),e}},kX={lineX:ds(AX,0),lineY:ds(AX,1),rect:function(t,e,n,i){var r=t?e.pointToData([n[0][0],n[1][0]],i):e.dataToPoint([n[0][0],n[1][0]],i),o=t?e.pointToData([n[0][1],n[1][1]],i):e.dataToPoint([n[0][1],n[1][1]],i),a=[MX([r[0],o[0]]),MX([r[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,i){var r=[[1/0,-1/0],[1/0,-1/0]];return{values:as(n,function(n){var o=t?e.pointToData(n,i):e.dataToPoint(n,i);return r[0][0]=Math.min(r[0][0],o[0]),r[1][0]=Math.min(r[1][0],o[1]),r[0][1]=Math.max(r[0][1],o[0]),r[1][1]=Math.max(r[1][1],o[1]),o}),xyMinMax:r}}};function AX(t,e,n,i){var r=n.getAxis(["x","y"][t]),o=MX(as([0,1],function(t){return e?r.coordToData(r.toLocalCoord(i[t]),!0):r.toGlobalCoord(r.dataToCoord(i[t]))})),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var EX={lineX:ds(LX,0),lineY:ds(LX,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return as(t,function(t,i){return[t[0]-n[0]*e[i][0],t[1]-n[1]*e[i][1]]})}};function LX(t,e,n,i){return[e[0]-i[t]*n[0],e[1]-i[t]*n[1]]}function PX(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}const OX=SX;var RX,BX,NX=os,zX=sp+"toolbox-dataZoom_",FX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.render=function(t,e,n,i){this._brushController||(this._brushController=new IH(n.getZr()),this._brushController.on("brush",hs(this._onBrush,this)).mount()),function(t,e,n,i,r){var o=n._isZoomActive;i&&"takeGlobalCursor"===i.type&&(o="dataZoomSelect"===i.key&&i.dataZoomSelectActive),n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new OX(HX(t),e,{include:["grid"]}).makePanelOpts(r,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(a).enableBrush(!(!o||!a.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,i,n),function(t,e){t.setIconStatus("back",function(t){return _X(t).length}(e)>1?"emphasis":"normal")}(t,e)},e.prototype.onclick=function(t,e,n){VX[n].call(this)},e.prototype.remove=function(t,e){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},i=this.ecModel;this._brushController.updateCovers([]),new OX(HX(this.model),i,{include:["grid"]}).matchOutputRanges(e,i,function(t,e,n){if("cartesian2d"===n.type){var i=t.brushType;"rect"===i?(r("x",n,e[0]),r("y",n,e[1])):r({lineX:"x",lineY:"y"}[i],n,e)}}),function(t,e){var n=_X(t);yX(e,function(e,i){for(var r=n.length-1;r>=0&&!n[r][i];r--);if(r<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(o){var a=o.getPercentRange();n[0][i]={dataZoomId:i,start:a[0],end:a[1]}}}}),n.push(e)}(i,n),this._dispatchZoomAction(n)}function r(t,e,r){var o=e.getAxis(t),a=o.model,s=function(t,e,n){var i;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(i=n)}),i}(t,a,i),l=s.findRepresentativeAxisProxy(a).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(r=SV(0,r.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(n[s.id]={dataZoomId:s.id,startValue:r[0],endValue:r[1]})}},e.prototype._dispatchZoomAction=function(t){var e=[];NX(t,function(t,n){e.push($a(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},e.getDefaultOption=function(t){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}}},e}($Y),VX={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=_X(t),n=e[e.length-1];e.length>1&&e.pop();var i={};return yX(n,function(t,n){for(var r=e.length-1;r>=0;r--)if(t=e[r][n]){i[n]=t;break}}),i}(this.ecModel))}};function HX(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}RX="dataZoom",BX=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var i=e.getModel(n),r=[],o=wp(t,HX(i));return NX(o.xAxisModels,function(t){return a(t,"xAxis","xAxisIndex")}),NX(o.yAxisModels,function(t){return a(t,"yAxis","yAxisIndex")}),r}function a(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:i.get("filterMode",!0)||"filter",id:zX+e+o};a[n]=o,r.push(a)}},Es(null==f_.get(RX)&&BX),f_.set(RX,BX);const jX=FX,WX=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Uv);function GX(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function UX(t){if(Ia.domSupported)for(var e=document.documentElement.style,n=0,i=t.length;n<i;n++)if(t[n]in e)return t[n]}var qX=UX(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function YX(t,e){if(!t)return e;e=bv(e,!0);var n=t.indexOf(e);return(t=-1===n?e:"-"+t.slice(0,n)+"-"+e).toLowerCase()}var XX=YX(UX(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),$X=YX(qX,"transform"),ZX="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(Ia.transform3dSupported?"will-change:transform;":"");function KX(t,e,n){var i=t.toFixed(0)+"px",r=e.toFixed(0)+"px";if(!Ia.transformSupported)return n?"top:"+r+";left:"+i+";":[["top",r],["left",i]];var o=Ia.transform3dSupported,a="translate"+(o?"3d":"")+"("+i+","+r+(o?",0":"")+")";return n?"top:0;left:0;"+$X+":"+a+";":[["top",0],["left",0],[qX,a]]}function JX(t,e,n,i,r){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&function(t,e,n,i,r){Il(Tl,e,i,r,!0)&&Il(t,n,Tl[0],Tl[1])}(t,a,n,i,r)}else{t[0]=i,t[1]=r;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var QX=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Ia.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=t.getZr(),r=e.appendTo,o=r&&(gs(r)?document.querySelector(r):bs(r)?r:fs(r)&&r(t.getDom()));JX(this._styleCoord,i,o,t.getWidth()/2,t.getHeight()/2),(o||t.getDom()).appendChild(n),this._api=t,this._container=o;var a=this;n.onmouseenter=function(){a._enterable&&(clearTimeout(a._hideTimeout),a._show=!0),a._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!a._enterable){var e=i.handler;zl(i.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){a._inContent=!1,a._enterable&&a._show&&a.hideLater(a._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(o="position",(a=(r=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(r))?o?a[o]:a:null),i=e.style;"absolute"!==i.position&&"absolute"!==n&&(i.position="relative")}var r,o,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,r=this._styleCoord;n.innerHTML?i.cssText=ZX+function(t,e,n){var i=[],r=t.get("transitionDuration"),o=t.get("backgroundColor"),a=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),h=Ib(t,"html"),d=l+"px "+c+"px "+a+"px "+s;return i.push("box-shadow:"+d),e&&r&&i.push(function(t,e){var n="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+n,r="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+n,r+=Ia.transformSupported?","+$X+i:",left"+i+",top"+i),XX+":"+r}(r,n)),o&&i.push("background-color:"+o),os(["width","color","radius"],function(e){var n="border-"+e,r=bv(n),o=t.get(r);null!=o&&i.push(n+":"+o+("color"===e?"":"px"))}),i.push(function(t){var e=[],n=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont());var r=Is(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+r+"px");var o=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return o&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+o),os(["decoration","align"],function(n){var i=t.get(n);i&&e.push("text-"+n+":"+i)}),e.join(";")}(u)),null!=h&&i.push("padding:"+wv(h).join("px ")+"px"),i.join(";")+";"}(t,!this._firstShow,this._longHide)+KX(r[0],r[1],!0)+"border-color:"+Av(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,i,r){var o=this.el;if(null!=t){var a="";if(gs(r)&&"item"===n.get("trigger")&&!GX(n)&&(a=function(t,e,n){if(!gs(n)||"inside"===n)return"";var i=t.get("backgroundColor"),r=t.get("borderWidth");e=Av(e);var o,a,s="left"===(o=n)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(r),6),c="",u=$X+":";es(["left","right"],s)>-1?(c+="top:50%",u+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(c+="left:50%",u+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var h=a*Math.PI/180,d=l+r,p=d*Math.abs(Math.cos(h))+d*Math.abs(Math.sin(h)),f=e+" solid "+r+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(c+=";"+s+":-"+Math.round(100*((p-Math.SQRT2*r)/2+Math.SQRT2*r-(p-d)/2))/100+"px")+";"+u+";","border-bottom:"+f,"border-right:"+f,"background-color:"+i+";"].join("")+'"></div>'}(n,i,r)),gs(t))o.innerHTML=t+a;else if(t){o.innerHTML="",ps(t)||(t=[t]);for(var s=0;s<t.length;s++)bs(t[s])&&t[s].parentNode!==o&&o.appendChild(t[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}}else o.innerHTML=""},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el;return t?[t.offsetWidth,t.offsetHeight]:[0,0]},t.prototype.moveTo=function(t,e){if(this.el){var n=this._styleCoord;if(JX(n,this._zr,this._container,t,e),null!=n[0]&&null!=n[1]){var i=this.el.style;os(KX(n[0],n[1]),function(t){i[t[0]]=t[1]})}}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){var t=this,e=this.el.style;e.visibility="hidden",e.opacity="0",Ia.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return t._longHide=!0},500)},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(hs(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var t=this.el.parentNode;t&&t.removeChild(this.el),this.el=this._container=null},t}();const t$=QX;var e$=function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),r$(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return t.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),this._alwaysShowContent=e},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(t,e,n,i,r){var o=this;vs(t)&&Px(""),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new $g({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:i,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Ib(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),os(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(t){o.el.style[t]=n.get(t)}),os(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(t){o.el.style[t]=a.get(t)||0}),this._zr.add(this.el);var s=this;this.el.on("mouseover",function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on("mouseout",function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),n=i$(t.style);return[e.width+n.left+n.right,e.height+n.top+n.bottom]},t.prototype.moveTo=function(t,e){var n=this.el;if(n){var i=this._styleCoord;r$(i,this._zr,t,e),t=i[0],e=i[1];var r=n.style,o=n$(r.borderWidth||0),a=i$(r);n.x=t+o+a.left,n.y=e+o+a.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(hs(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function n$(t){return Math.max(0,t)}function i$(t){var e=n$(t.shadowBlur||0),n=n$(t.shadowOffsetX||0),i=n$(t.shadowOffsetY||0);return{left:n$(e-n),right:n$(e+n),top:n$(e-i),bottom:n$(e+i)}}function r$(t,e,n,i){t[0]=n,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}const o$=e$;var a$=new Pg({shape:{x:-1,y:-1,width:2,height:2}}),s$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(t,e){if(!Ia.node&&e.getDom()){var n,i=t.getComponent("tooltip"),r=this._renderMode="auto"===(n=i.get("renderMode"))?Ia.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===r?new o$(e):new t$(e,{appendTo:i.get("appendToBody",!0)?"body":i.get("appendTo",!0)})}},e.prototype.render=function(t,e,n){if(!Ia.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n;var i=this._tooltipContent;i.update(t),i.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&t.get("transitionDuration")?aM(this,"_updatePosition",50,"fixRate"):sM(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");WU("itemTooltip",this._api,hs(function(e,n,i){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(n,i):"leave"===e&&this._hide(i))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,i=t.get("triggerOn");if(null!=this._lastX&&null!=this._lastY&&"none"!==i&&"click"!==i){var r=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&r.manuallyShowTip(t,e,n,{x:r._lastX,y:r._lastY,dataByCoordSys:r._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,e,n,i){if(i.from!==this.uid&&!Ia.node&&n.getDom()){var r=c$(i,n);this._ticket="";var o=i.dataByCoordSys,a=function(t,e,n){var i=Sp(t).queryOptionMap,r=i.keys()[0];if(r&&"series"!==r){var o,a=Tp(e,r,i.get(r),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a)return n.getViewOfComponentModel(a).group.traverse(function(e){var n=Zg(e).tooltipConfig;if(n&&n.name===t.name)return o=e,!0}),o?{componentMainType:r,componentIndex:a.componentIndex,el:o}:void 0}}(i,e,n);if(a){var s=a.el.getBoundingRect().clone();s.applyTransform(a.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:a.el,position:i.position,positionDefault:"bottom"},r)}else if(i.tooltip&&null!=i.x&&null!=i.y){var l=a$;l.x=i.x,l.y=i.y,l.update(),Zg(l).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:l},r)}else if(o)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:o,tooltipOption:i.tooltipOption},r);else if(null!=i.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,i))return;var c=$U(i,e),u=c.point[0],h=c.point[1];null!=u&&null!=h&&this._tryShow({offsetX:u,offsetY:h,target:c.el,position:i.position,positionDefault:"bottom"},r)}else null!=i.x&&null!=i.y&&(n.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:n.getZr().findHover(i.x,i.y).target},r))}},e.prototype.manuallyHideTip=function(t,e,n,i){var r=this._tooltipContent;this._tooltipModel&&r.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(c$(i,n))},e.prototype._manuallyAxisShowTip=function(t,e,n,i){var r=i.seriesIndex,o=i.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=r&&null!=o&&null!=a){var s=e.getSeriesByIndex(r);if(s&&"axis"===l$([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:r,dataIndex:o,position:i.position}),!0}},e.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var i=t.dataByCoordSys;if(i&&i.length)this._showAxisTooltip(i,t);else if(n){var r,o;if("legend"===Zg(n).ssrType)return;this._lastDataByCoordSys=null,JM(n,function(t){return null!=Zg(t).dataIndex?(r=t,!0):null!=Zg(t).tooltipConfig?(o=t,!0):void 0},!0),r?this._showSeriesItemTooltip(t,r,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._hide(e)}},e.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=hs(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},e.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,i=this._tooltipModel,r=[e.offsetX,e.offsetY],o=l$([e.tooltipOption],i),a=this._renderMode,s=[],l=yb("section",{blocks:[],noHeader:!0}),c=[],u=new Db;os(t,function(t){os(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),r=t.value;if(e&&null!=r){var o=kU(r,e.axis,n,t.seriesDataIndices,t.valueLabelOpt),h=yb("section",{header:o,noHeader:!Ls(o),sortBlocks:!0,blocks:[]});l.blocks.push(h),os(t.seriesDataIndices,function(l){var d=n.getSeriesByIndex(l.seriesIndex),p=l.dataIndexInside,f=d.getDataParams(p);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=pk(e.axis,{value:r}),f.axisValueLabel=o,f.marker=u.makeTooltipMarker("item",Av(f.color),a);var g=kx(d.formatTooltip(p,!0,null)),m=g.frag;if(m){var y=l$([d],i).get("valueFormatter");h.blocks.push(y?Ja({valueFormatter:y},m):m)}g.text&&c.push(g.text),s.push(f)}})}})}),l.blocks.reverse(),c.reverse();var h=e.position,d=o.get("order"),p=Sb(l,u,a,d,n.get("useUTC"),o.get("textStyle"));p&&c.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=c.join(f);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,h,r[0],r[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",r[0],r[1],h,null,u)})},e.prototype._showSeriesItemTooltip=function(t,e,n){var i=this._ecModel,r=Zg(e),o=r.seriesIndex,a=i.getSeriesByIndex(o),s=r.dataModel||a,l=r.dataIndex,c=r.dataType,u=s.getData(c),h=this._renderMode,d=t.positionDefault,p=l$([u.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,c),m=new Db;g.marker=m.makeTooltipMarker("item",Av(g.color),h);var y=kx(s.formatTooltip(l,!1,c)),v=p.get("order"),_=p.get("valueFormatter"),x=y.frag,b=x?Sb(_?Ja({valueFormatter:_},x):x,m,h,v,i.get("useUTC"),p.get("textStyle")):y.text,w="item_"+s.name+"_"+l;this._showOrMove(p,function(){this._showTooltipContent(p,b,g,w,t.offsetX,t.offsetY,t.position,t.target,m)}),n({type:"showTip",dataIndexInside:l,dataIndex:u.getRawIndex(l),seriesIndex:o,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,e,n){var i="html"===this._renderMode,r=Zg(e),o=r.tooltipConfig.option||{},a=o.encodeHTMLContent;gs(o)&&(o={content:o,formatter:o},a=!0),a&&i&&o.content&&((o=$a(o)).content=El(o.content));var s=[o],l=this._ecModel.getComponent(r.componentMainType,r.componentIndex);l&&s.push(l),s.push({formatter:o.content});var c=t.positionDefault,u=l$(s,this._tooltipModel,c?{position:c}:null),h=u.get("content"),d=Math.random()+"",p=new Db;this._showOrMove(u,function(){var n=$a(u.get("formatterParams")||{});this._showTooltipContent(u,h,n,d,t.offsetX,t.offsetY,t.position,e,p)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,e,n,i,r,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var u=t.get("formatter");a=a||t.get("position");var h=e,d=this._getNearestPoint([r,o],n,t.get("trigger"),t.get("borderColor")).color;if(u)if(gs(u)){var p=t.ecModel.get("useUTC"),f=ps(n)?n[0]:n;h=u,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(h=iv(f.axisValue,h,p)),h=Tv(h,n,!0)}else if(fs(u)){var g=hs(function(e,i){e===this._ticket&&(c.setContent(i,l,t,d,a),this._updatePosition(t,a,r,o,c,n,s))},this);this._ticket=i,h=u(n,i,g)}else h=u;c.setContent(h,l,t,d,a),c.show(t,d),this._updatePosition(t,a,r,o,c,n,s)}},e.prototype._getNearestPoint=function(t,e,n,i){return"axis"===n||ps(e)?{color:i||("html"===this._renderMode?"#fff":"none")}:ps(e)?void 0:{color:i||e.color||e.borderColor}},e.prototype._updatePosition=function(t,e,n,i,r,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var c=r.getSize(),u=t.get("align"),h=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),fs(e)&&(e=e([n,i],o,r.el,d,{viewSize:[s,l],contentSize:c.slice()})),ps(e))n=Rd(e[0],s),i=Rd(e[1],l);else if(vs(e)){var p=e;p.width=c[0],p.height=c[1];var f=Nv(p,{width:s,height:l});n=f.x,i=f.y,u=null,h=null}else if(gs(e)&&a){var g=function(t,e,n,i){var r=n[0],o=n[1],a=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-r/2,l=e.y+u/2-o/2;break;case"top":s=e.x+c/2-r/2,l=e.y-o-a;break;case"bottom":s=e.x+c/2-r/2,l=e.y+u+a;break;case"left":s=e.x-r-a,l=e.y+u/2-o/2;break;case"right":s=e.x+c+a,l=e.y+u/2-o/2}return[s,l]}(e,d,c,t.get("borderWidth"));n=g[0],i=g[1]}else g=function(t,e,n,i,r,o,a){var s=n.getSize(),l=s[0],c=s[1];return null!=o&&(t+l+o+2>i?t-=l+o:t+=o),null!=a&&(e+c+a>r?e-=c+a:e+=a),[t,e]}(n,i,r,s,l,u?null:20,h?null:20),n=g[0],i=g[1];u&&(n-=u$(u)?c[0]/2:"right"===u?c[0]:0),h&&(i-=u$(h)?c[1]/2:"bottom"===h?c[1]:0),GX(t)&&(g=function(t,e,n,i,r){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,i)-a,e=Math.min(e+s,r)-s,[t=Math.max(t,0),e=Math.max(e,0)]}(n,i,r,s,l),n=g[0],i=g[1]),r.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,i=this._cbParamsList,r=!!n&&n.length===t.length;return r&&os(n,function(n,o){var a=n.dataByAxis||[],s=(t[o]||{}).dataByAxis||[];(r=r&&a.length===s.length)&&os(a,function(t,n){var o=s[n]||{},a=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(r=r&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===l.length)&&os(a,function(t,e){var n=l[e];r=r&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),i&&os(t.seriesDataIndices,function(t){var n=t.seriesIndex,o=e[n],a=i[n];o&&a&&a.data!==o.data&&(r=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!r},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,e){!Ia.node&&e.getDom()&&(sM(this,"_updatePosition"),this._tooltipContent.dispose(),qU("itemTooltip",e))},e.type="tooltip",e}(Wb);function l$(t,e,n){var i,r=e.ecModel;n?(i=new Oy(n,r,r),i=new Oy(e.option,i,r)):i=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof Oy&&(a=a.get("tooltip",!0)),gs(a)&&(a={formatter:a}),a&&(i=new Oy(a,i,r)))}return i}function c$(t,e){return t.dispatchAction||hs(e.dispatchAction,e)}function u$(t){return"center"===t||"middle"===t}const h$=s$;var d$=["rect","polygon","keep","clear"];function p$(t,e){var n=lp(t?t.brush:[]);if(n.length){var i=[];os(n,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(i=i.concat(e))});var r=t&&t.toolbox;ps(r)&&(r=r[0]),r||(r={feature:{}},t.toolbox=[r]);var o=r.feature||(r.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,i),function(t){var e={};os(t,function(t){e[t]=1}),t.length=0,os(e,function(e,n){t.push(n)})}(s),e&&!s.length&&s.push.apply(s,d$)}}var f$=os;function g$(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function m$(t,e,n){var i={};return f$(e,function(e){var r,o=i[e]=((r=function(){}).prototype.__hidden=r.prototype,new r);f$(t[e],function(t,i){if(fz.isValidType(i)){var r={type:i,visual:t};n&&n(r,e),o[i]=new fz(r),"opacity"===i&&((r=$a(r)).type="colorAlpha",o.__hidden.__alphaForOpacity=new fz(r))}})}),i}function y$(t,e,n){var i;os(n,function(t){e.hasOwnProperty(t)&&g$(e[t])&&(i=!0)}),i&&os(n,function(n){e.hasOwnProperty(n)&&g$(e[n])?t[n]=$a(e[n]):delete t[n]})}var v$={lineX:_$(0),lineY:_$(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&Ck(n.range,t[0],t[1])},rect:function(t,e,n){var i=n.range;if(!t||i.length<=1)return!1;var r=t.x,o=t.y,a=t.width,s=t.height,l=i[0];return!!(Ck(i,r,o)||Ck(i,r+a,o)||Ck(i,r,o+s)||Ck(i,r+a,o+s)||dc.create(t).contain(l[0],l[1])||HS(r,o,r+a,o,i)||HS(r,o,r,o+s,i)||HS(r+a,o,r+a,o+s,i)||HS(r,o+s,r+a,o+s,i))||void 0}}};function _$(t){var e=["x","y"],n=["width","height"];return{point:function(e,n,i){if(e){var r=i.range;return x$(e[t],r)}},rect:function(i,r,o){if(i){var a=o.range,s=[i[e[t]],i[e[t]]+i[n[t]]];return s[1]<s[0]&&s.reverse(),x$(s[0],a)||x$(s[1],a)||x$(a[0],s)||x$(a[1],s)}}}}function x$(t,e){return e[0]<=t&&t<=e[1]}var b$=["inBrush","outOfBrush"],w$="__ecBrushSelect",S$="__ecInBrushSelectEvent";function M$(t){t.eachComponent({mainType:"brush"},function(e){(e.brushTargetManager=new OX(e.option,t)).setInputRanges(e.areas,t)})}function C$(t,e,n){var i,r,o=[];t.eachComponent({mainType:"brush"},function(t){n&&"takeGlobalCursor"===n.type&&t.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})}),M$(t),t.eachComponent({mainType:"brush"},function(e,n){var a={brushId:e.id,brushIndex:n,brushName:e.name,areas:$a(e.areas),selected:[]};o.push(a);var s=e.option,l=s.brushLink,c=[],u=[],h=[],d=!1;n||(i=s.throttleType,r=s.throttleDelay);var p=as(e.areas,function(t){var e=D$[t.brushType],n=Qa({boundingRect:e?e(t):void 0},t);return n.selectors=function(t){var e=t.brushType,n={point:function(i){return v$[e].point(i,n,t)},rect:function(i){return v$[e].rect(i,n,t)}};return n}(n),n}),f=m$(e.option,b$,function(t){t.mappingMethod="fixed"});function g(t){return"all"===l||!!c[t]}function m(t){return!!t.length}ps(l)&&os(l,function(t){c[t]=1}),t.eachSeries(function(n,i){var r=h[i]=[];"parallel"===n.subType?function(t,e){var n=t.coordinateSystem;d=d||n.hasAxisBrushed(),g(e)&&n.eachActiveState(t.getData(),function(t,e){"active"===t&&(u[e]=1)})}(n,i):function(n,i,r){if(n.brushSelector&&!function(t,e){var n=t.option.seriesIndex;return null!=n&&"all"!==n&&(ps(n)?es(n,e)<0:e!==n)}(e,i)&&(os(p,function(i){e.brushTargetManager.controlSeries(i,n,t)&&r.push(i),d=d||m(r)}),g(i)&&m(r))){var o=n.getData();o.each(function(t){I$(n,r,o,t)&&(u[t]=1)})}}(n,i,r)}),t.eachSeries(function(t,e){var n={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};a.selected.push(n);var i=h[e],r=t.getData(),o=g(e)?function(t){return u[t]?(n.dataIndex.push(r.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(e){return I$(t,i,r,e)?(n.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(e)?d:m(i))&&function(t,e,n,i){var r,o={};function a(t){return YM(n,r,t)}function s(t,e){$M(n,r,t,e)}function l(t,l){r=t;var c=n.getRawDataItem(r);if(!c||!1!==c.visualMap)for(var u=i.call(undefined,t),h=e[u],d=o[u],p=0,f=d.length;p<f;p++){var g=d[p];h[g]&&h[g].applyVisual(t,a,s)}}os(t,function(t){var n=fz.prepareVisualTypes(e[t]);o[t]=n}),n.each(l)}(b$,f,r,o)})}),function(t,e,n,i,r){if(r){var o=t.getZr();if(!o[S$])o[w$]||(o[w$]=T$),aM(o,w$,n,e)(t,i)}}(e,i,r,o,n)}function T$(t,e){if(!t.isDisposed()){var n=t.getZr();n[S$]=!0,t.dispatchAction({type:"brushSelect",batch:e}),n[S$]=!1}}function I$(t,e,n,i){for(var r=0,o=e.length;r<o;r++){var a=e[r];if(t.brushSelector(i,n,a.selectors,a))return!0}}var D$={rect:function(t){return k$(t.range)},polygon:function(t){for(var e,n=t.range,i=0,r=n.length;i<r;i++){e=e||[[1/0,-1/0],[1/0,-1/0]];var o=n[i];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&k$(e)}};function k$(t){return new dc(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}const A$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new IH(e.getZr())).on("brush",hs(this._onBrush,this)).mount()},e.prototype.render=function(t,e,n,i){this.model=t,this._updateController(t,e,n,i)},e.prototype.updateTransform=function(t,e,n,i){M$(e),this._updateController(t,e,n,i)},e.prototype.updateVisual=function(t,e,n,i){this.updateTransform(t,e,n,i)},e.prototype.updateView=function(t,e,n,i){this._updateController(t,e,n,i)},e.prototype._updateController=function(t,e,n,i){(!i||i.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:$a(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:$a(n),$from:e})},e.type="brush",e}(Wb);function E$(t,e){return Za({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Oy(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}const L$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.areas=[],n.brushOption={},n}return Ma(e,t),e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&y$(n,t,["inBrush","outOfBrush"]);var i=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:"#ddd"},i.hasOwnProperty("liftZ")||(i.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=as(t,function(t){return E$(this.option,t)},this))},e.prototype.setBrushOption=function(t){this.brushOption=E$(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Uv);var P$=["rect","polygon","lineX","lineY","keep","clear"];const O$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ma(e,t),e.prototype.render=function(t,e,n){var i,r,o;e.eachComponent({mainType:"brush"},function(t){i=t.brushType,r=t.brushOption.brushMode||"single",o=o||!!t.areas.length}),this._brushType=i,this._brushMode=r,os(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===r:"clear"===e?o:e===i)?"emphasis":"normal")})},e.prototype.updateView=function(t,e,n){this.render(t,e,n)},e.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return os(t.get("type",!0),function(t){e[t]&&(n[t]=e[t])}),n},e.prototype.onclick=function(t,e,n){var i=this._brushType,r=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?i:i!==n&&n,brushMode:"keep"===n?"multiple"===r?"single":"multiple":r}})},e.getDefaultOption=function(t){return{show:!0,type:P$.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])}},e}($Y);var R$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return Ma(e,t),e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Uv),B$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var i=this.group,r=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=Is(t.get("textBaseline"),t.get("textVerticalAlign")),l=new $g({style:uy(r,{text:t.get("text"),fill:r.getTextColor()},{disableBox:!0}),z2:10}),c=l.getBoundingRect(),u=t.get("subtext"),h=new $g({style:uy(o,{text:u,fill:o.getTextColor(),y:c.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,h.silent=!p&&!f,d&&l.on("click",function(){Ev(d,"_"+t.get("target"))}),p&&h.on("click",function(){Ev(p,"_"+t.get("subtarget"))}),Zg(l).eventData=Zg(h).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,i.add(l),u&&i.add(h);var g=i.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var y=Nv(m,{width:n.getWidth(),height:n.getHeight()},t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?y.x+=y.width:"center"===a&&(y.x+=y.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?y.y+=y.height:"middle"===s&&(y.y+=y.height/2),s=s||"top"),i.x=y.x,i.y=y.y,i.markRedraw();var v={align:a,verticalAlign:s};l.setStyle(v),h.setStyle(v),g=i.getBoundingRect();var _=y.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new Pg({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});i.add(b)}},e.type="title",e}(Wb),N$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode="box",n}return Ma(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},e.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t,e=this.option,n=e.data||[],i=e.axisType,r=this._names=[];"category"===i?(t=[],os(n,function(e,n){var i,o=mp(hp(e),"");vs(e)?(i=$a(e)).value=n:i=n,t.push(i),r.push(o)})):t=n;var o={category:"ordinal",time:"time",value:"number"}[i]||"number";(this._data=new ZI([{name:"value",type:o}],this)).initData(t,r)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Uv);const z$=N$;var F$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="timeline.slider",e.defaultOption=Ny(z$.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(z$);is(F$,Dx.prototype);const V$=F$,H$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="timeline",e}(Wb);var j$=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.type=r||"value",o}return Ma(e,t),e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},e}($k);const W$=j$;var G$=Math.PI,U$=xp(),q$=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(t,e){this.api=e},e.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var i=this._layout(t,n),r=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(i,t);t.formatTooltip=function(t){return yb("nameValue",{noName:!0,value:a.scale.getLabel({value:t})})},os(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](i,r,a,t)},this),this._renderAxisLabel(i,o,a,t),this._position(i,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,e){var n,i,r,o,a=t.get(["label","position"]),s=t.get("orient"),l=function(t,e){return Nv(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e),c={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2<e.getHeight()/2?"-":"+":l.x+l.width/2<e.getWidth()/2?"+":"-":gs(a)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][a]:a)>=0||"+"===n?"left":"right"},u={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},h={horizontal:0,vertical:G$/2},d="vertical"===s?l.height:l.width,p=t.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,y=g+m,v=t.get(["label","rotate"])||0;v=v*G$/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,M=d;"left"===_||"bottom"===_?(x&&(i=[0,0],S+=y),b&&(r=[S,0],S+=y),w&&(o=[M-g,0],M-=y)):(x&&(i=[M-g,0],M-=y),b&&(r=[0,0],S+=y),w&&(o=[M-g,0],M-=y));var C=[S,M];return t.get("inverse")&&C.reverse(),{viewRect:l,mainLength:d,orient:s,rotation:h[s],labelRotation:v,labelPosOpt:n,labelAlign:t.get(["label","align"])||c[s],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[s],playPosition:i,prevBtnPosition:r,nextBtnPosition:o,axisExtent:C,controlSize:g,controlGap:m}},e.prototype._position=function(t,e){var n=this._mainGroup,i=this._labelGroup,r=t.viewRect;if("vertical"===t.orient){var o=[1,0,0,1,0,0],a=r.x,s=r.y+r.height;Zl(o,o,[-a,-s]),Kl(o,o,-G$/2),Zl(o,o,[a,s]),(r=r.clone()).applyTransform(o)}var l=m(r),c=m(n.getBoundingRect()),u=m(i.getBoundingRect()),h=[n.x,n.y],d=[i.x,i.y];d[0]=h[0]=l[0][0];var p,f=t.labelPosOpt;function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function m(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function y(t,e,n,i,r){t[i]+=n[i][r]-e[i][r]}null==f||gs(f)?(y(h,c,l,1,p="+"===f?0:1),y(d,u,l,1,1-p)):(y(h,c,l,1,p=f>=0?0:1),d[1]=h[1]+f),n.setPosition(h),i.setPosition(d),n.rotation=i.rotation=t.rotation,g(n),g(i)},e.prototype._createAxis=function(t,e){var n=e.getData(),i=e.get("axisType"),r=function(t,e){if(e=e||t.get("type"))switch(e){case"category":return new bD({ordinalMeta:t.getCategories(),extent:[1/0,-1/0]});case"time":return new qD({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new MD}}(e,i);r.getTicks=function(){return n.mapArray(["value"],function(t){return{value:t}})};var o=n.getDataExtent("value");r.setExtent(o[0],o[1]),r.calcNiceTicks();var a=new W$("value",r,t.axisExtent,i);return a.model=e,a},e.prototype._createGroup=function(t){var e=this[t]=new _d;return this.group.add(e),e},e.prototype._renderAxisLine=function(t,e,n,i){var r=n.getExtent();if(i.get(["lineStyle","show"])){var o=new Uw({shape:{x1:r[0],y1:0,x2:r[1],y2:0},style:Ja({lineCap:"round"},i.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new Uw({shape:{x1:r[0],x2:this._currentPointer?this._currentPointer.x:r[0],y1:0,y2:0},style:Qa({lineCap:"round",lineWidth:o.style.lineWidth},i.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},e.prototype._renderAxisTick=function(t,e,n,i){var r=this,o=i.getData(),a=n.scale.getTicks();this._tickSymbols=[],os(a,function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),c=s.getModel(["emphasis","itemStyle"]),u=s.getModel(["progress","itemStyle"]),h={x:a,y:0,onclick:hs(r._changeTimeline,r,t.value)},d=Y$(s,l,e,h);d.ensureState("emphasis").style=c.getItemStyle(),d.ensureState("progress").style=u.getItemStyle(),Fm(d);var p=Zg(d);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=i):p.dataIndex=p.dataModel=null,r._tickSymbols.push(d)})},e.prototype._renderAxisLabel=function(t,e,n,i){var r=this;if(n.getLabelModel().get("show")){var o=i.getData(),a=n.getViewLabels();this._tickLabels=[],os(a,function(i){var a=i.tickValue,s=o.getItemModel(a),l=s.getModel("label"),c=s.getModel(["emphasis","label"]),u=s.getModel(["progress","label"]),h=n.dataToCoord(i.tickValue),d=new $g({x:h,y:0,rotation:t.labelRotation-t.rotation,onclick:hs(r._changeTimeline,r,a),silent:!1,style:uy(l,{text:i.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});d.ensureState("emphasis").style=uy(c),d.ensureState("progress").style=uy(u),e.add(d),Fm(d),U$(d).dataIndex=a,r._tickLabels.push(d)})}},e.prototype._renderControl=function(t,e,n,i){var r=t.controlSize,o=t.rotation,a=i.getModel("controlStyle").getItemStyle(),s=i.getModel(["emphasis","controlStyle"]).getItemStyle(),l=i.getPlayState(),c=i.get("inverse",!0);function u(t,n,l,c){if(t){var u=od(Is(i.get(["controlStyle",n+"BtnSize"]),r),r),h=function(t,e,n,i){var r=i.style,o=VS(t.get(["controlStyle",e]),i||{},new dc(n[0],n[1],n[2],n[3]));return r&&o.setStyle(r),o}(i,n+"Icon",[0,-u/2,u,u],{x:t[0],y:t[1],originX:r/2,originY:0,rotation:c?-o:0,rectHover:!0,style:a,onclick:l});h.ensureState("emphasis").style=s,e.add(h),Fm(h)}}u(t.nextBtnPosition,"next",hs(this._changeTimeline,this,c?"-":"+")),u(t.prevBtnPosition,"prev",hs(this._changeTimeline,this,c?"+":"-")),u(t.playPosition,l?"stop":"play",hs(this._handlePlayClick,this,!l),!0)},e.prototype._renderCurrentPointer=function(t,e,n,i){var r=i.getData(),o=i.getCurrentIndex(),a=r.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=hs(s._handlePointerDrag,s),t.ondragend=hs(s._handlePointerDragend,s),X$(t,s._progressLine,o,n,i,!0)},onUpdate:function(t){X$(t,s._progressLine,o,n,i)}};this._currentPointer=Y$(a,a,this._mainGroup,{},this._currentPointer,l)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],i=Nd(this._axis.getExtent().slice());n>i[1]&&(n=i[1]),n<i[0]&&(n=i[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var r=this._progressLine;r&&(r.shape.x2=n,r.dirty());var o=this._findNearestTick(n),a=this.model;(e||o!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(o)},e.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var e=t.model;t._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},e.prototype._toAxisCoord=function(t){return OS(t,this._mainGroup.getLocalTransform(),!0)},e.prototype._findNearestTick=function(t){var e,n=this.model.getData(),i=1/0,r=this._axis;return n.each(["value"],function(n,o){var a=r.dataToCoord(n),s=Math.abs(a-t);s<i&&(i=s,e=o)}),e},e.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},e.prototype._changeTimeline=function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},e.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),e=this._tickSymbols,n=this._tickLabels;if(e)for(var i=0;i<e.length;i++)e&&e[i]&&e[i].toggleState("progress",i<t);if(n)for(i=0;i<n.length;i++)n&&n[i]&&n[i].toggleState("progress",U$(n[i]).dataIndex<=t)},e.type="timeline.slider",e}(H$);function Y$(t,e,n,i,r,o){var a=e.get("color");r?(r.setColor(a),n.add(r),o&&o.onUpdate(r)):((r=hC(t.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(r),o&&o.onCreate(r));var s=e.getItemStyle(["color"]);r.setStyle(s),i=Za({rectHover:!0,z2:100},i,!0);var l=dC(t.get("symbolSize"));i.scaleX=l[0]/2,i.scaleY=l[1]/2;var c=pC(t.get("symbolOffset"),l);c&&(i.x=(i.x||0)+c[0],i.y=(i.y||0)+c[1]);var u=t.get("symbolRotate");return i.rotation=(u||0)*Math.PI/180||0,r.attr(i),r.updateTransform(),r}function X$(t,e,n,i,r,o){if(!t.dragging){var a=r.getModel("checkpointStyle"),s=i.dataToCoord(r.getData().get("value",n));if(o||!a.get("animation",!0))t.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};t.stopAnimation(null,!0),t.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}const $$=q$;function Z$(t){var e=t&&t.timeline;ps(e)||(e=e?[e]:[]),os(e,function(t){t&&function(t){var e=t.type,n={number:"value",time:"time"};if(n[e]&&(t.axisType=n[e],delete t.type),K$(t),J$(t,"controlPosition")){var i=t.controlStyle||(t.controlStyle={});J$(i,"position")||(i.position=t.controlPosition),"none"!==i.position||J$(i,"show")||(i.show=!1,delete i.position),delete t.controlPosition}os(t.data||[],function(t){vs(t)&&!ps(t)&&(!J$(t,"value")&&J$(t,"name")&&(t.value=t.name),K$(t))})}(t)})}function K$(t){var e=t.itemStyle||(t.itemStyle={}),n=e.emphasis||(e.emphasis={}),i=t.label||t.label||{},r=i.normal||(i.normal={}),o={normal:1,emphasis:1};os(i,function(t,e){o[e]||J$(r,e)||(r[e]=t)}),n.label&&!J$(i,"emphasis")&&(i.emphasis=n.label,delete n.label)}function J$(t,e){return t.hasOwnProperty(e)}function Q$(t,e){if(!t)return!1;for(var n=ps(t)?t:[t],i=0;i<n.length;i++)if(n[i]&&n[i][e])return!0;return!1}function tZ(t){cp(t,"label",["show"])}var eZ=xp(),nZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.createdBySelf=!1,n}return Ma(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},e.prototype.isAnimationEnabled=function(){if(Ia.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},e.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},e.prototype._mergeOption=function(t,e,n,i){var r=this.mainType;n||e.eachSeries(function(t){var n=t.get(this.mainType,!0),o=eZ(t)[r];n&&n.data?(o?o._mergeOption(n,e,!0):(i&&tZ(n),os(n.data,function(t){t instanceof Array?(tZ(t[0]),tZ(t[1])):tZ(t)}),Ja(o=this.createMarkerModelFromSeries(n,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),o.__hostSeries=t),eZ(t)[r]=o):eZ(t)[r]=null},this)},e.prototype.formatTooltip=function(t,e,n){var i=this.getData(),r=this.getRawValue(t),o=i.getName(t);return yb("section",{header:this.name,blocks:[yb("nameValue",{name:o,value:r,noName:!o,noValue:null==r})]})},e.prototype.getData=function(){return this._data},e.prototype.setData=function(t){this._data=t},e.prototype.getDataParams=function(t,e){var n=Dx.prototype.getDataParams.call(this,t,e),i=this.__hostSeries;return i&&(n.seriesId=i.id,n.seriesName=i.name,n.seriesType=i.subType),n},e.getMarkerModelFromSeries=function(t,e){return eZ(t)[e]},e.type="marker",e.dependencies=["series","grid","polar","geo"],e}(Uv);is(nZ,Dx.prototype);const iZ=nZ,rZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markPoint",e.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},e}(iZ);function oZ(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function aZ(t,e,n,i,r,o){var a=[],s=rD(e,i)?e.getCalculationInfo("stackResultDimension"):i,l=dZ(e,s,t),c=e.indicesOfNearest(s,l)[0];a[r]=e.get(n,c),a[o]=e.get(s,c);var u=e.get(i,c),h=zd(e.get(i,c));return(h=Math.min(h,20))>=0&&(a[o]=+a[o].toFixed(h)),[a,u]}var sZ={min:ds(aZ,"min"),max:ds(aZ,"max"),average:ds(aZ,"average"),median:ds(aZ,"median")};function lZ(t,e){if(e){var n=t.getData(),i=t.coordinateSystem,r=i&&i.dimensions;if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!ps(e.coord)&&ps(r)){var o=cZ(e,n,i,t);if((e=$a(e)).type&&sZ[e.type]&&o.baseAxis&&o.valueAxis){var a=es(r,o.baseAxis.dim),s=es(r,o.valueAxis.dim),l=sZ[e.type](n,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&ps(r))for(var c=e.coord,u=0;u<2;u++)sZ[c[u]]&&(c[u]=dZ(n,n.mapDimension(r[u]),c[u]));else e.coord=[];return e}}function cZ(t,e,n,i){var r={};return null!=t.valueIndex||null!=t.valueDim?(r.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,r.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}(i,r.valueDataDim)),r.baseAxis=n.getOtherAxis(r.valueAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim)):(r.baseAxis=i.getBaseAxis(),r.valueAxis=n.getOtherAxis(r.baseAxis),r.baseDataDim=e.mapDimension(r.baseAxis.dim),r.valueDataDim=e.mapDimension(r.valueAxis.dim)),r}function uZ(t,e){return!(t&&t.containData&&e.coord&&!oZ(e))||t.containData(e.coord)}function hZ(t,e){return t?function(t,n,i,r){return Ox(r<2?t.coord&&t.coord[r]:t.value,e[r])}:function(t,n,i,r){return Ox(t.value,e[r])}}function dZ(t,e,n){if("average"===n){var i=0,r=0;return t.each(e,function(t,e){isNaN(t)||(i+=t,r++)}),i/r}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var pZ=xp();const fZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.init=function(){this.markerGroupMap=Fs()},e.prototype.render=function(t,e,n){var i=this,r=this.markerGroupMap;r.each(function(t){pZ(t).keep=!1}),e.eachSeries(function(t){var r=iZ.getMarkerModelFromSeries(t,i.type);r&&i.renderSeries(t,r,e,n)}),r.each(function(t){!pZ(t).keep&&i.group.remove(t.group)})},e.prototype.markKeep=function(t){pZ(t).keep=!0},e.prototype.toggleBlurSeries=function(t,e){var n=this;os(t,function(t){var i=iZ.getMarkerModelFromSeries(t,n.type);i&&i.getData().eachItemGraphicEl(function(t){t&&(e?Dm(t):km(t))})})},e.type="marker",e}(Wb);function gZ(t,e,n){var i=e.coordinateSystem;t.each(function(r){var o,a=t.getItemModel(r),s=Rd(a.get("x"),n.getWidth()),l=Rd(a.get("y"),n.getHeight());if(isNaN(s)||isNaN(l)){if(e.getMarkerPosition)o=e.getMarkerPosition(t.getValues(t.dimensions,r));else if(i){var c=t.get(i.dimensions[0],r),u=t.get(i.dimensions[1],r);o=i.dataToPoint([c,u])}}else o=[s,l];isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),t.setItemLayout(r,o)})}var mZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=iZ.getMarkerModelFromSeries(t,"markPoint");e&&(gZ(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())},this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new yL),c=function(t,e,n){var i;i=t?as(t&&t.dimensions,function(t){return Ja(Ja({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})}):[{name:"value",type:"float"}];var r=new ZI(i,n),o=as(n.get("data"),ds(lZ,e));t&&(o=ls(o,ds(uZ,t)));var a=hZ(!!t,i);return r.initData(o,null,a),r}(r,t,e);e.setData(c),gZ(e.getData(),t,i),c.each(function(t){var n=c.getItemModel(t),i=n.getShallow("symbol"),r=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(fs(i)||fs(r)||fs(o)||fs(s)){var u=e.getRawValue(t),h=e.getDataParams(t);fs(i)&&(i=i(u,h)),fs(r)&&(r=r(u,h)),fs(o)&&(o=o(u,h)),fs(s)&&(s=s(u,h))}var d=n.getModel("itemStyle").getItemStyle(),p=XM(a,"color");d.fill||(d.fill=p),c.setItemVisual(t,{symbol:i,symbolSize:r,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})}),l.updateData(c),this.group.add(l.group),c.eachItemGraphicEl(function(t){t.traverse(function(t){Zg(t).dataModel=e})}),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markPoint",e}(fZ);const yZ=mZ,vZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(iZ);var _Z=xp(),xZ=function(t,e,n,i){var r,o=t.getData();if(ps(i))r=i;else{var a=i.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=i.xAxis||null!=i.yAxis){var s=void 0,l=void 0;if(null!=i.yAxis||null!=i.xAxis)s=e.getAxis(null!=i.yAxis?"y":"x"),l=Ts(i.yAxis,i.xAxis);else{var c=cZ(i,o,e,t);s=c.valueAxis,l=dZ(o,oD(o,c.valueDataDim),a)}var u="x"===s.dim?0:1,h=1-u,d=$a(i),p={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,p.coord[h]=1/0;var f=n.get("precision");f>=0&&ys(l)&&(l=+l.toFixed(Math.min(f,20))),d.coord[u]=p.coord[u]=l,r=[d,p,{type:a,valueIndex:i.valueIndex,value:l}]}else r=[]}var g=[lZ(t,r[0]),lZ(t,r[1]),Ja({},r[2])];return g[2].type=g[2].type||null,Za(g[2],g[0]),Za(g[2],g[1]),g};function bZ(t){return!isNaN(t)&&!isFinite(t)}function wZ(t,e,n,i){var r=1-t,o=i.dimensions[t];return bZ(e[r])&&bZ(n[r])&&e[t]===n[t]&&i.getAxis(o).containData(e[t])}function SZ(t,e){if("cartesian2d"===t.type){var n=e[0].coord,i=e[1].coord;if(n&&i&&(wZ(1,n,i,t)||wZ(0,n,i,t)))return!0}return uZ(t,e[0])&&uZ(t,e[1])}function MZ(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Rd(s.get("x"),r.getWidth()),c=Rd(s.get("y"),r.getHeight());if(isNaN(l)||isNaN(c)){if(i.getMarkerPosition)o=i.getMarkerPosition(t.getValues(t.dimensions,e));else{var u=a.dimensions,h=t.get(u[0],e),d=t.get(u[1],e);o=a.dataToPoint([h,d])}if(EL(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");u=a.dimensions,bZ(t.get(u[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):bZ(t.get(u[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(c)||(o[1]=c)}else o=[l,c];t.setItemLayout(e,o)}const CZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=iZ.getMarkerModelFromSeries(t,"markLine");if(e){var i=e.getData(),r=_Z(e).from,o=_Z(e).to;r.each(function(e){MZ(r,e,!0,t,n),MZ(o,e,!1,t,n)}),i.each(function(t){i.setItemLayout(t,[r.getItemLayout(t),o.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new SF);this.group.add(l.group);var c=function(t,e,n){var i;i=t?as(t&&t.dimensions,function(t){return Ja(Ja({},e.getData().getDimensionInfo(e.getData().mapDimension(t))||{}),{name:t,ordinalMeta:null})}):[{name:"value",type:"float"}];var r=new ZI(i,n),o=new ZI(i,n),a=new ZI([],n),s=as(n.get("data"),ds(xZ,e,t,n));t&&(s=ls(s,ds(SZ,t)));var l=hZ(!!t,i);return r.initData(as(s,function(t){return t[0]}),null,l),o.initData(as(s,function(t){return t[1]}),null,l),a.initData(as(s,function(t){return t[2]})),a.hasItemOption=!0,{from:r,to:o,line:a}}(r,t,e),u=c.from,h=c.to,d=c.line;_Z(e).from=u,_Z(e).to=h,e.setData(d);var p=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),m=e.get("symbolOffset");function y(e,n,r){var o=e.getItemModel(n);MZ(e,n,r,t,i);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=XM(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:Is(o.get("symbolOffset",!0),m[r?0:1]),symbolRotate:Is(o.get("symbolRotate",!0),g[r?0:1]),symbolSize:Is(o.get("symbolSize"),f[r?0:1]),symbol:Is(o.get("symbol",!0),p[r?0:1]),style:s})}ps(p)||(p=[p,p]),ps(f)||(f=[f,f]),ps(g)||(g=[g,g]),ps(m)||(m=[m,m]),c.from.each(function(t){y(u,t,!0),y(h,t,!1)}),d.each(function(t){var e=d.getItemModel(t).getModel("lineStyle").getLineStyle();d.setItemLayout(t,[u.getItemLayout(t),h.getItemLayout(t)]),null==e.stroke&&(e.stroke=u.getItemVisual(t,"style").fill),d.setItemVisual(t,{fromSymbolKeepAspect:u.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:u.getItemVisual(t,"symbolOffset"),fromSymbolRotate:u.getItemVisual(t,"symbolRotate"),fromSymbolSize:u.getItemVisual(t,"symbolSize"),fromSymbol:u.getItemVisual(t,"symbol"),toSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:h.getItemVisual(t,"symbolOffset"),toSymbolRotate:h.getItemVisual(t,"symbolRotate"),toSymbolSize:h.getItemVisual(t,"symbolSize"),toSymbol:h.getItemVisual(t,"symbol"),style:e})}),l.updateData(d),c.line.eachItemGraphicEl(function(t){Zg(t).dataModel=e,t.traverse(function(t){Zg(t).dataModel=e})}),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},e.type="markLine",e}(fZ),TZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(iZ);var IZ=xp(),DZ=function(t,e,n,i){var r=i[0],o=i[1];if(r&&o){var a=lZ(t,r),s=lZ(t,o),l=a.coord,c=s.coord;l[0]=Ts(l[0],-1/0),l[1]=Ts(l[1],-1/0),c[0]=Ts(c[0],1/0),c[1]=Ts(c[1],1/0);var u=Ka([{},a,s]);return u.coord=[a.coord,s.coord],u.x0=a.x,u.y0=a.y,u.x1=s.x,u.y1=s.y,u}};function kZ(t){return!isNaN(t)&&!isFinite(t)}function AZ(t,e,n,i){var r=1-t;return kZ(e[r])&&kZ(n[r])}function EZ(t,e){var n=e.coord[0],i=e.coord[1],r={coord:n,x:e.x0,y:e.y0},o={coord:i,x:e.x1,y:e.y1};return EL(t,"cartesian2d")?!(!n||!i||!AZ(1,n,i)&&!AZ(0,n,i))||function(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!oZ(e)&&!oZ(n))||t.containZone(e.coord,n.coord)}(t,r,o):uZ(t,r)||uZ(t,o)}function LZ(t,e,n,i,r){var o,a=i.coordinateSystem,s=t.getItemModel(e),l=Rd(s.get(n[0]),r.getWidth()),c=Rd(s.get(n[1]),r.getHeight());if(isNaN(l)||isNaN(c)){if(i.getMarkerPosition){var u=t.getValues(["x0","y0"],e),h=t.getValues(["x1","y1"],e),d=a.clampData(u),p=a.clampData(h),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?h[0]:u[0]:f[0]=d[0]>p[0]?u[0]:h[0],"y0"===n[1]?f[1]=d[1]>p[1]?h[1]:u[1]:f[1]=d[1]>p[1]?u[1]:h[1],o=i.getMarkerPosition(f,n,!0)}else{var g=[v=t.get(n[0],e),_=t.get(n[1],e)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(EL(a,"cartesian2d")){var m=a.getAxis("x"),y=a.getAxis("y"),v=t.get(n[0],e),_=t.get(n[1],e);kZ(v)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):kZ(_)&&(o[1]=y.toGlobalCoord(y.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(c)||(o[1]=c)}else o=[l,c];return o}var PZ=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],OZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=iZ.getMarkerModelFromSeries(t,"markArea");if(e){var i=e.getData();i.each(function(e){var r=as(PZ,function(r){return LZ(i,e,r,t,n)});i.setItemLayout(e,r),i.getItemGraphicEl(e).setShape("points",r)})}},this)},e.prototype.renderSeries=function(t,e,n,i){var r=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new _d});this.group.add(l.group),this.markKeep(l);var c=function(t,e,n){var i,r;if(t){var o=as(t&&t.dimensions,function(t){var n=e.getData();return Ja(Ja({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})});r=as(["x0","y0","x1","y1"],function(t,e){return{name:t,type:o[e%2].type}}),i=new ZI(r,n)}else i=new ZI(r=[{name:"value",type:"float"}],n);var a=as(n.get("data"),ds(DZ,e,t,n));t&&(a=ls(a,ds(EZ,t)));var s=t?function(t,e,n,i){return Ox(t.coord[Math.floor(i/2)][i%2],r[i])}:function(t,e,n,i){return Ox(t.value,r[i])};return i.initData(a,null,s),i.hasItemOption=!0,i}(r,t,e);e.setData(c),c.each(function(e){var n=as(PZ,function(n){return LZ(c,e,n,t,i)}),o=r.getAxis("x").scale,s=r.getAxis("y").scale,l=o.getExtent(),u=s.getExtent(),h=[o.parse(c.get("x0",e)),o.parse(c.get("x1",e))],d=[s.parse(c.get("y0",e)),s.parse(c.get("y1",e))];Nd(h),Nd(d);var p=!!(l[0]>h[1]||l[1]<h[0]||u[0]>d[1]||u[1]<d[0]);c.setItemLayout(e,{points:n,allClipped:p});var f=c.getItemModel(e).getModel("itemStyle").getItemStyle(),g=XM(a,"color");f.fill||(f.fill=g,gs(f.fill)&&(f.fill=Bu(f.fill,.4))),f.stroke||(f.stroke=g),c.setItemVisual(e,"style",f)}),c.diff(IZ(l).data).add(function(t){var e=c.getItemLayout(t);if(!e.allClipped){var n=new zw({shape:{points:e.points}});c.setItemGraphicEl(t,n),l.group.add(n)}}).update(function(t,n){var i=IZ(l).data.getItemGraphicEl(n),r=c.getItemLayout(t);r.allClipped?i&&l.group.remove(i):(i?Jm(i,{shape:{points:r.points}},e,t):i=new zw({shape:{points:r.points}}),c.setItemGraphicEl(t,i),l.group.add(i))}).remove(function(t){var e=IZ(l).data.getItemGraphicEl(t);l.group.remove(e)}).execute(),c.eachItemGraphicEl(function(t,n){var i=c.getItemModel(n),r=c.getItemVisual(n,"style");t.useStyle(c.getItemVisual(n,"style")),ly(t,cy(i),{labelFetcher:e,labelDataIndex:n,defaultText:c.getName(n)||"",inheritColor:gs(r.fill)?Bu(r.fill,1):"#000"}),Gm(t,i),Vm(t,null,null,i.get(["emphasis","disabled"])),Zg(t).dataModel=e}),IZ(l).data=c,l.group.silent=e.get("silent")||t.get("silent")},e.type="markArea",e}(fZ);const RZ=OZ;var BZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.layoutMode={type:"box",ignoreSize:!0},n}return Ma(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},e.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),ps(e)&&os(e,function(t,i){gs(t)&&(t={type:t}),e[i]=Za(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n<t.length;n++){var i=t[n].get("name");if(this.isSelected(i)){this.select(i),e=!0;break}}!e&&this.select(t[0].get("name"))}},e.prototype._updateData=function(t){var e=[],n=[];t.eachRawSeries(function(i){var r,o=i.name;if(n.push(o),i.legendVisualProvider){var a=i.legendVisualProvider.getAllNames();t.isSeriesFiltered(i)||(n=n.concat(a)),a.length?e=e.concat(a):r=!0}else r=!0;r&&yp(i)&&e.push(i.name)}),this._availableNames=n;var i=this.get("data")||e,r=Fs(),o=as(i,function(t){return(gs(t)||ys(t))&&(t={name:t}),r.get(t.name)?null:(r.set(t.name,!0),new Oy(t,this,this.ecModel))},this);this._data=ls(o,function(t){return!!t})},e.prototype.getData=function(){return this._data},e.prototype.select=function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&os(this._data,function(t){e[t.get("name")]=!1}),e[t]=!0},e.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},e.prototype.toggleSelected=function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},e.prototype.allSelect=function(){var t=this._data,e=this.option.selected;os(t,function(t){e[t.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var t=this._data,e=this.option.selected;os(t,function(t){var n=t.get("name",!0);e.hasOwnProperty(n)||(e[n]=!0),e[n]=!e[n]})},e.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&es(this._availableNames,t)>=0},e.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Uv);const NZ=BZ;var zZ=ds,FZ=os,VZ=_d,HZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!1,n}return Ma(e,t),e.prototype.init=function(){this.group.add(this._contentGroup=new VZ),this.group.add(this._selectorGroup=new VZ),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,e,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var r=t.get("align"),o=t.get("orient");r&&"auto"!==r||(r="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(r,t,e,n,a,o,s);var l=t.getBoxLayoutParams(),c={width:n.getWidth(),height:n.getHeight()},u=t.get("padding"),h=Nv(l,c,u),d=this.layoutInner(t,r,h,i,a,s),p=Nv(Qa({width:d.width,height:d.height},l),c,u);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=tX(d,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,e,n,i,r,o,a){var s=this.getContentGroup(),l=Fs(),c=e.get("selectedMode"),u=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&u.push(t.id)}),FZ(e.getData(),function(r,o){var a=r.get("name");if(!this.newlineDisabled&&(""===a||"\n"===a)){var h=new VZ;return h.newline=!0,void s.add(h)}var d=n.getSeriesByName(a)[0];if(!l.get(a))if(d){var p=d.getData(),f=p.getVisual("legendLineStyle")||{},g=p.getVisual("legendIcon"),m=p.getVisual("style"),y=this._createItem(d,a,o,r,e,t,f,m,g,c,i);y.on("click",zZ(jZ,a,null,i,u)).on("mouseover",zZ(GZ,d.name,null,i,u)).on("mouseout",zZ(UZ,d.name,null,i,u)),n.ssr&&y.eachChild(function(t){var e=Zg(t);e.seriesIndex=d.seriesIndex,e.dataIndex=o,e.ssrType="legend"}),l.set(a,!0)}else n.eachRawSeries(function(s){if(!l.get(a)&&s.legendVisualProvider){var h=s.legendVisualProvider;if(!h.containName(a))return;var d=h.indexOfName(a),p=h.getItemVisual(d,"style"),f=h.getItemVisual(d,"legendIcon"),g=Iu(p.fill);g&&0===g[3]&&(g[3]=.2,p=Ja(Ja({},p),{fill:Nu(g,"rgba")}));var m=this._createItem(s,a,o,r,e,t,{},p,f,c,i);m.on("click",zZ(jZ,null,a,i,u)).on("mouseover",zZ(GZ,null,a,i,u)).on("mouseout",zZ(UZ,null,a,i,u)),n.ssr&&m.eachChild(function(t){var e=Zg(t);e.seriesIndex=s.seriesIndex,e.dataIndex=o,e.ssrType="legend"}),l.set(a,!0)}},this)},this),r&&this._createSelector(r,e,i,o,a)},e.prototype._createSelector=function(t,e,n,i,r){var o=this.getSelectorGroup();FZ(t,function(t){var i=t.type,r=new $g({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===i?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});o.add(r),ly(r,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),Fm(r)})},e.prototype._createItem=function(t,e,n,i,r,o,a,s,l,c,u){var h,d,p,f=t.visualDrawType,g=r.get("itemWidth"),m=r.get("itemHeight"),y=r.isSelected(e),v=i.get("symbolRotate"),_=i.get("symbolKeepAspect"),x=i.get("icon"),b=function(t,e,n,i,r,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),FZ(t,function(n,i){"inherit"===t[i]&&(t[i]=e[i])})}var l=e.getModel("itemStyle"),c=l.getItemStyle(),u=0===t.lastIndexOf("empty",0)?"fill":"stroke",h=l.getShallow("decal");c.decal=h&&"inherit"!==h?jC(h,a):i.decal,"inherit"===c.fill&&(c.fill=i[r]),"inherit"===c.stroke&&(c.stroke=i[u]),"inherit"===c.opacity&&(c.opacity=("fill"===r?i:n).opacity),s(c,i);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===c.fill&&(c.fill=i.fill),"auto"===c.stroke&&(c.stroke=i.fill),"auto"===p.stroke&&(p.stroke=i.fill),!o){var f=e.get("inactiveBorderWidth"),g=c[u];c.lineWidth="auto"===f?i.lineWidth>0&&g?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:c,lineStyle:p}}(l=x||l||"roundRect",i,a,s,f,y,u),w=new VZ,S=i.getModel("textStyle");if(!fs(t.getLegendIcon)||x&&"inherit"!==x){var M="inherit"===x&&t.getData().getVisual("symbol")?"inherit"===v?t.getData().getVisual("symbolRotate"):v:0;w.add((h={itemWidth:g,itemHeight:m,icon:l,iconRotate:M,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:_},(p=hC(d=h.icon||"roundRect",0,0,h.itemWidth,h.itemHeight,h.itemStyle.fill,h.symbolKeepAspect)).setStyle(h.itemStyle),p.rotation=(h.iconRotate||0)*Math.PI/180,p.setOrigin([h.itemWidth/2,h.itemHeight/2]),d.indexOf("empty")>-1&&(p.style.stroke=p.style.fill,p.style.fill="#fff",p.style.lineWidth=2),p))}else w.add(t.getLegendIcon({itemWidth:g,itemHeight:m,icon:l,iconRotate:v,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:_}));var C="left"===o?g+5:-5,T=o,I=r.get("formatter"),D=e;gs(I)&&I?D=I.replace("{name}",null!=e?e:""):fs(I)&&(D=I(e));var k=y?S.getTextColor():i.get("inactiveColor");w.add(new $g({style:uy(S,{text:D,x:C,y:m/2,fill:k,align:T,verticalAlign:"middle"},{inheritColor:k})}));var A=new Pg({shape:w.getBoundingRect(),style:{fill:"transparent"}}),E=i.getModel("tooltip");return E.get("show")&&GS({el:A,componentModel:r,itemName:e,itemTooltipOption:E.option}),w.add(A),w.eachChild(function(t){t.silent=!0}),A.silent=!c,this.getContentGroup().add(w),Fm(w),w.__legendDataIndex=n,w},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Bv(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),c=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),r){Bv("horizontal",s,t.get("selectorItemGap",!0));var u=s.getBoundingRect(),h=[-u.x,-u.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?h[p]+=l[f]+d:c[p]+=u[f]+d,h[1-p]+=l[g]/2-u[g]/2,s.x=h[0],s.y=h[1],a.x=c[0],a.y=c[1];var y={x:0,y:0};return y[f]=l[f]+d+u[f],y[g]=Math.max(l[g],u[g]),y[m]=Math.min(0,u[m]+h[1-p]),y}return a.x=c[0],a.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(Wb);function jZ(t,e,n,i){UZ(t,e,n,i),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),GZ(t,e,n,i)}function WZ(t){for(var e,n=t.getZr().storage.getDisplayList(),i=0,r=n.length;i<r&&!(e=n[i].states.emphasis);)i++;return e&&e.hoverLayer}function GZ(t,e,n,i){WZ(n)||n.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function UZ(t,e,n,i){WZ(n)||n.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}const qZ=HZ;function YZ(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var n=0;n<e.length;n++)if(!e[n].isSelected(t.name))return!1;return!0})}function XZ(t,e,n){var i="allSelect"===t||"inverseSelect"===t,r={},o=[];n.eachComponent({mainType:"legend",query:e},function(n){i?n[t]():n[t](e.name),$Z(n,r),o.push(n.componentIndex)});var a={};return n.eachComponent("legend",function(t){os(r,function(e,n){t[e?"select":"unSelect"](n)}),$Z(t,a)}),i?{selected:a,legendIndex:o}:{name:e.name,selected:a}}function $Z(t,e){var n=e||{};return os(t.getData(),function(e){var i=e.get("name");if("\n"!==i&&""!==i){var r=t.isSelected(i);Ws(n,i)?n[i]=n[i]&&r:n[i]=r}}),n}function ZZ(t){t.registerComponentModel(NZ),t.registerComponentView(qZ),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,YZ),t.registerSubTypeDefaulter("legend",function(){return"plain"}),function(t){t.registerAction("legendToggleSelect","legendselectchanged",ds(XZ,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",ds(XZ,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",ds(XZ,"inverseSelect")),t.registerAction("legendSelect","legendselected",ds(XZ,"select")),t.registerAction("legendUnSelect","legendunselected",ds(XZ,"unSelect"))}(t)}function KZ(t,e,n){var i=[1,1];i[t.getOrient().index]=0,Vv(e,n,{type:"box",ignoreSize:!!i})}const JZ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(e,n,i){var r=Hv(e);t.prototype.init.call(this,e,n,i),KZ(this,e,r)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),KZ(this,this.option,e)},e.type="legend.scroll",e.defaultOption=Ny(NZ.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(NZ);var QZ=_d,tK=["width","height"],eK=["x","y"],nK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.newlineDisabled=!0,n._currentIndex=0,n}return Ma(e,t),e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new QZ),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new QZ)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(e,n,i,r,o,a,s){var l=this;t.prototype.renderInner.call(this,e,n,i,r,o,a,s);var c=this._controllerGroup,u=n.get("pageIconSize",!0),h=ps(u)?u:[u,u];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(t,e){var i=t+"DataIndex",o=VS(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:hs(l._pageGo,l,i,n,r)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});o.name=t,c.add(o)}c.add(new $g({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},e.prototype.layoutInner=function(t,e,n,i,r,o){var a=this.getSelectorGroup(),s=t.getOrient().index,l=tK[s],c=eK[s],u=tK[1-s],h=eK[1-s];r&&Bv("horizontal",a,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=$a(n);r&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(t,i,g,s,l,u,h,c);if(r){if("end"===o)f[s]+=m[l]+d;else{var y=p[l]+d;f[s]-=y,m[c]-=y}m[l]+=p[l]+d,f[1-s]+=m[h]+m[u]/2-p[u]/2,m[u]=Math.max(m[u],p[u]),m[h]=Math.min(m[h],p[h]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},e.prototype._layoutContentAndController=function(t,e,n,i,r,o,a,s){var l=this.getContentGroup(),c=this._containerGroup,u=this._controllerGroup;Bv(t.get("orient"),l,t.get("itemGap"),i?n.width:null,i?null:n.height),Bv("horizontal",u,t.get("pageButtonItemGap",!0));var h=l.getBoundingRect(),d=u.getBoundingRect(),p=this._showController=h[r]>n[r],f=[-h.x,-h.y];e||(f[i]=l[s]);var g=[0,0],m=[-d.x,-d.y],y=Is(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[i]+=n[r]-d[r]:g[i]+=d[r]+y),m[1-i]+=h[o]/2-d[o]/2,l.setPosition(f),c.setPosition(g),u.setPosition(m);var v={x:0,y:0};if(v[r]=p?n[r]:h[r],v[o]=Math.max(h[o],d[o]),v[a]=Math.min(0,d[a]+m[1-i]),c.__rectSize=n[r],p){var _={x:0,y:0};_[r]=Math.max(n[r]-d[r]-y,0),_[o]=v[o],c.setClipPath(new Pg({shape:_})),c.__rectSize=_[r]}else u.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Jm(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),v},e.prototype._pageGo=function(t,e,n){var i=this._getPageInfo(e)[t];null!=i&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:e.id})},e.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;os(["pagePrev","pageNext"],function(i){var r=null!=e[i+"DataIndex"],o=n.childOfName(i);o&&(o.setStyle("fill",r?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=r?"pointer":"default")});var i=n.childOfName("pageText"),r=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;i&&r&&i.setStyle("text",gs(r)?r.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):r({current:a,total:s}))},e.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,r=t.getOrient().index,o=tK[r],a=eK[r],s=this._findTargetItemIndex(e),l=n.children(),c=l[s],u=l.length,h=u?1:0,d={contentPosition:[n.x,n.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!c)return d;var p=v(c);d.contentPosition[r]=-p.s;for(var f=s+1,g=p,m=p,y=null;f<=u;++f)(!(y=v(l[f]))&&m.e>g.s+i||y&&!_(y,g.s))&&(g=m.i>g.i?m:y)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=y;for(f=s-1,g=p,m=p,y=null;f>=-1;--f)(y=v(l[f]))&&_(m,y.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=y;return d;function v(t){if(t){var e=t.getBoundingRect(),n=e[a]+t[a];return{s:n,e:n+e[o],i:t.__legendDataIndex}}}function _(t,e){return t.e>=e&&t.s<=e+i}},e.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild(function(i,r){var o=i.__legendDataIndex;null==n&&null!=o&&(n=r),o===t&&(e=r)}),null!=e?e:n):0;var e,n},e.type="legend.scroll",e}(qZ);const iK=nK;function rK(t){bI(ZZ),t.registerComponentModel(JZ),t.registerComponentView(iK),function(t){t.registerAction("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})})}(t)}const oK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="dataZoom.inside",e.defaultOption=Ny(NY.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(NY);var aK=xp();function sK(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}function lK(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function cK(t,e,n,i){return t.coordinateSystem.containPoint([n,i])}var uK=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return Ma(e,t),e.prototype.render=function(e,n,i){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),function(t,e,n){aK(t).coordSysRecordMap.each(function(t){var i=t.dataZoomInfoMap.get(e.uid);i&&(i.getRange=n)})}(i,e,{pan:hs(hK.pan,this),zoom:hs(hK.zoom,this),scrollMove:hs(hK.scrollMove,this)}))},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){!function(t,e){for(var n=aK(t).coordSysRecordMap,i=n.keys(),r=0;r<i.length;r++){var o=i[r],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=e.uid;s.get(l)&&(s.removeKey(l),s.keys().length||sK(n,a))}}}(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(FY),hK={zoom:function(t,e,n,i){var r=this.range,o=r.slice(),a=t.axisModels[0];if(a){var s=pK[e](null,[i.originX,i.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],c=Math.max(1/i.scale,0);o[0]=(o[0]-l)*c+l,o[1]=(o[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return SV(0,o,[0,100],0,u.minSpan,u.maxSpan),this.range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}},pan:dK(function(t,e,n,i,r,o){var a=pK[i]([o.oldX,o.oldY],[o.newX,o.newY],e,r,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength}),scrollMove:dK(function(t,e,n,i,r,o){return pK[i]([0,0],[o.scrollDelta,o.scrollDelta],e,r,n).signal*(t[1]-t[0])*o.scrollDelta})};function dK(t){return function(e,n,i,r){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s)return SV(t(a,s,e,n,i,r),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var pK={grid:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,i,r){var o=n.axis,a={},s=r.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=c[1]-c[0],a.pixelStart=c[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,i,r){var o=n.axis,a=r.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}};const fK=uK;function gK(t){YY(t),t.registerComponentModel(oK),t.registerComponentView(fK),function(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(t,e){var n=aK(e),i=n.coordSysRecordMap||(n.coordSysRecordMap=Fs());i.each(function(t){t.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(t){os(PY(t).infoList,function(n){var r=n.model.uid,o=i.get(r)||i.set(r,function(t,e){var n={model:e,containsPoint:ds(cK,e),dispatchAction:ds(lK,t),dataZoomInfoMap:null,controller:null},i=n.controller=new vR(t.getZr());return os(["pan","zoom","scrollMove"],function(t){i.on(t,function(e){var i=[];n.dataZoomInfoMap.each(function(r){if(e.isAvailableBehavior(r.model.option)){var o=(r.getRange||{})[t],a=o&&o(r.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!r.model.get("disabled",!0)&&a&&i.push({dataZoomId:r.model.id,start:a[0],end:a[1]})}}),i.length&&n.dispatchAction(i)})}),n}(e,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=Fs())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})})}),i.each(function(t){var e,n=t.controller,r=t.dataZoomInfoMap;if(r){var o=r.keys()[0];null!=o&&(e=r.get(o))}if(e){var a=function(t){var e,n="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},r=!0;return t.each(function(t){var o=t.model,a=!o.get("disabled",!0)&&(!o.get("zoomLock",!0)||"move");i[n+a]>i[n+e]&&(e=a),r=r&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!r}}}(r);n.enable(a.controlType,a.opt),n.setPointerChecker(t.containsPoint),aM(t,"dispatchAction",e.model.get("throttle",!0),"fixRate")}else sK(i,t)})})}(t)}const mK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Ny(NY.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(NY);var yK=Pg,vK="horizontal",_K="vertical",xK=["line","bar","candlestick","scatter"],bK={easing:"cubicOut",duration:100,delay:0},wK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._displayables={},n}return Ma(e,t),e.prototype.init=function(t,e){this.api=e,this._onBrush=hs(this._onBrush,this),this._onBrushEnd=hs(this._onBrushEnd,this)},e.prototype.render=function(e,n,i,r){if(t.prototype.render.apply(this,arguments),aM(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();r&&"dataZoom"===r.type&&r.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){sM(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new _d;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,i=this._findCoordRect(),r={width:e.getWidth(),height:e.getHeight()},o=this._orient===vK?{right:r.width-i.x-i.width,top:r.height-30-7-n,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=Hv(t.option);os(["right","top","width","height"],function(t){"ph"===a[t]&&(a[t]=o[t])});var s=Nv(a,r);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===_K&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,i=this.dataZoomModel.getFirstTargetAxisModel(),r=i&&i.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==vK||r?n===vK&&r?{scaleY:a?1:-1,scaleX:-1}:n!==_K||r?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]);t.x=e.x-s.x,t.y=e.y-s.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,i=t.get("brushSelect");n.add(new yK({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var r=new yK({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:hs(this._onClickPanel,this)}),o=this.api.getZr();i?(r.on("mousedown",this._onBrushStart,this),r.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(r)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],i=t.series,r=i.getRawData(),o=i.getShadowDim&&i.getShadowDim(),a=o&&r.getDimensionInfo(o)?i.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(r!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var c=r.getDataExtent(a),u=.3*(c[1]-c[0]);c=[c[0]-u,c[1]+u];var h,d=[0,e[1]],p=[0,e[0]],f=[[e[0],0],[0,0]],g=[],m=p[1]/(r.count()-1),y=0,v=Math.round(r.count()/e[0]);r.each([a],function(t,e){if(v>0&&e%v)y+=m;else{var n=null==t||isNaN(t)||""===t,i=n?0:Od(t,c,d,!0);n&&!h&&e?(f.push([f[f.length-1][0],0]),g.push([g[g.length-1][0],0])):!n&&h&&(f.push([y,0]),g.push([y,0])),f.push([y,i]),g.push([y,i]),y+=m,h=n}}),s=this._shadowPolygonPts=f,l=this._shadowPolylinePts=g}this._shadowData=r,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var _=this.dataZoomModel,x=0;x<3;x++){var b=w(1===x);this._displayables.sliderGroup.add(b),this._displayables.dataShadowSegs.push(b)}}}function w(t){var e=_.getModel(t?"selectedDataBackground":"dataBackground"),n=new _d,i=new zw({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),r=new Hw({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(i),n.add(r),n}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,i=this.ecModel;return t.eachTargetAxis(function(r,o){os(t.getAxisProxy(r,o).getTargetSeriesModels(),function(t){if(!(n||!0!==e&&es(xK,t.get("type"))<0)){var a,s=i.getComponent(LY(r),o).axis,l={x:"y",y:"x",radius:"angle",angle:"radius"}[r],c=t.coordinateSystem;null!=l&&c.getOtherAxis&&(a=c.getOtherAxis(s).inverse),l=t.getData().mapDimension(l),n={thisAxis:s,series:t,thisDim:r,otherDim:l,otherAxisInverse:a}}},this)},this),n}},e.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],i=e.handleLabels=[null,null],r=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,c=a.get("brushSelect"),u=e.filler=new yK({silent:c,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});r.add(u),r.add(new yK({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),os([0,1],function(e){var o=a.get("handleIcon");!lC[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o);var s=hC(o,-1,0,2,2,null,!0);s.attr({cursor:SK(this._orient),draggable:!0,drift:hs(this._onDragMove,this,e),ondragend:hs(this._onDragEnd,this),onmouseover:hs(this._showDataInfo,this,!0),onmouseout:hs(this._showDataInfo,this,!1),z2:5});var l=s.getBoundingRect(),c=a.get("handleSize");this._handleHeight=Rd(c,this._size[1]),this._handleWidth=l.width/l.height*this._handleHeight,s.setStyle(a.getModel("handleStyle").getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),Fm(s);var u=a.get("handleColor");null!=u&&(s.style.fill=u),r.add(n[e]=s);var h=a.getModel("textStyle"),d=(a.get("handleLabel")||{}).show||!1;t.add(i[e]=new $g({silent:!0,invisible:!d,style:uy(h,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:h.getTextColor(),font:h.getFont()}),z2:10}))},this);var h=u;if(c){var d=Rd(a.get("moveHandleSize"),o[1]),p=e.moveHandle=new Pg({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=e.moveHandleIcon=hC(a.get("moveHandleIcon"),-f/2,-f/2,f,f,"#fff",!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(h=e.moveZone=new Pg({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",function(){s.enterEmphasis(p)}).on("mouseout",function(){s.leaveEmphasis(p)}),r.add(p),r.add(g),r.add(h)}h.attr({draggable:!0,cursor:SK(this._orient),drift:hs(this._onDragMove,this,"all"),ondragstart:hs(this._showDataInfo,this,!0),ondragend:hs(this._onDragEnd,this),onmouseover:hs(this._showDataInfo,this,!0),onmouseout:hs(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Od(t[0],[0,100],e,!0),Od(t[1],[0,100],e,!0)]},e.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,i=this._handleEnds,r=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];SV(e,i,r,n.get("zoomLock")?"all":t,null!=o.minSpan?Od(o.minSpan,a,r,!0):null,null!=o.maxSpan?Od(o.maxSpan,a,r,!0):null);var s=this._range,l=this._range=Nd([Od(i[0],r,a,!0),Od(i[1],r,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},e.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,i=Nd(n.slice()),r=this._size;os([0,1],function(t){var i=e.handles[t],o=this._handleHeight;i.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:r[1]/2-o/2})},this),e.filler.setShape({x:i[0],y:0,width:i[1]-i[0],height:r[1]});var o={x:i[0],width:i[1]-i[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,i[0],i[1],r[0]],l=0;l<a.length;l++){var c=a[l],u=c.getClipPath();u||(u=new Pg,c.setClipPath(u)),u.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:r[1]})}this._updateDataInfo(t)},e.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,n=this._displayables,i=n.handleLabels,r=this._orient,o=["",""];if(e.get("showDetail")){var a=e.findRepresentativeAxisProxy();if(a){var s=a.getAxisModel().axis,l=this._range,c=t?a.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:a.getDataValueWindow();o=[this._formatLabel(c[0],s),this._formatLabel(c[1],s)]}}var u=Nd(this._handleEnds.slice());function h(t){var e=PS(n.handles[t].parent,this.group),a=RS(0===t?"right":"left",e),s=this._handleWidth/2+5,l=OS([u[t]+(0===t?-s:s),this._size[1]/2],e);i[t].setStyle({x:l[0],y:l[1],verticalAlign:r===vK?"middle":a,align:r===vK?a:"center",text:o[t]})}h.call(this,0),h.call(this,1)},e.prototype._formatLabel=function(t,e){var n=this.dataZoomModel,i=n.get("labelFormatter"),r=n.get("labelPrecision");null!=r&&"auto"!==r||(r=e.getPixelPrecision());var o=null==t||isNaN(t)?"":"category"===e.type||"time"===e.type?e.scale.getLabel({value:Math.round(t)}):t.toFixed(Math.min(r,20));return fs(i)?i(t,o):gs(i)?i.replace("{value}",o):o},e.prototype._showDataInfo=function(t){var e=(this.dataZoomModel.get("handleLabel")||{}).show||!1,n=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,i=t||this._dragging?n:e,r=this._displayables,o=r.handleLabels;o[0].attr("invisible",!i),o[1].attr("invisible",!i),r.moveHandle&&this.api[i?"enterEmphasis":"leaveEmphasis"](r.moveHandle,1)},e.prototype._onDragMove=function(t,e,n,i){this._dragging=!0,Hl(i.event);var r=OS([e,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(t,r[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(t){var e=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>e[0]||n[1]<0||n[1]>e[1])){var i=this._handleEnds,r=(i[0]+i[1])/2,o=this._updateInterval("all",n[0]-r);this._updateView(),o&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new nc(e,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var i=this._getViewExtent(),r=[0,100];this._range=Nd([Od(n.x,i,r,!0),Od(n.x+n.width,i,r,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Hl(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,e){var n=this._displayables,i=this.dataZoomModel,r=n.brushRect;r||(r=n.brushRect=new yK({silent:!0,style:i.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(r)),r.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),c=this._size;s[0]=Math.max(Math.min(c[0],s[0]),0),r.setShape({x:l[0],y:0,width:s[0]-l[0],height:c[1]})},e.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?bK:null,start:e[0],end:e[1]})},e.prototype._findCoordRect=function(){var t,e=PY(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var i=this.api.getWidth(),r=this.api.getHeight();t={x:.2*i,y:.2*r,width:.6*i,height:.6*r}}return t},e.type="dataZoom.slider",e}(FY);function SK(t){return"vertical"===t?"ns-resize":"ew-resize"}const MK=wK;function CK(t){t.registerComponentModel(mK),t.registerComponentView(MK),YY(t)}var TK={get:function(t,e,n){var i=$a((IK[t]||{})[e]);return n&&ps(i)?i[i.length-1]:i}},IK={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const DK=TK;var kK=fz.mapVisual,AK=fz.eachVisual,EK=ps,LK=os,PK=Nd,OK=Od,RK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.stateList=["inRange","outOfRange"],n.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],n.layoutMode={type:"box",ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return Ma(e,t),e.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},e.prototype.optionUpdated=function(t,e){var n=this.option;!e&&y$(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var e=this.stateList;t=hs(t,this),this.controllerVisuals=m$(this.option.controller,e,t),this.targetVisuals=m$(this.option.target,e,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,e=[];return null==t||"all"===t?this.ecModel.eachSeries(function(t,n){e.push(n)}):e=lp(t),e},e.prototype.eachTargetSeries=function(t,e){os(this.getTargetSeriesIndices(),function(n){var i=this.ecModel.getSeriesByIndex(n);i&&t.call(e,i)},this)},e.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries(function(n){n===t&&(e=!0)}),e},e.prototype.formatValueText=function(t,e,n){var i,r=this.option,o=r.precision,a=this.dataBound,s=r.formatter;n=n||["<",">"],ps(t)&&(t=t.slice(),i=!0);var l=e?t:i?[c(t[0]),c(t[1])]:c(t);return gs(s)?s.replace("{value}",i?l[0]:l).replace("{value2}",i?l[1]:l):fs(s)?i?s(t[0],t[1]):s(t):i?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function c(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,e=PK([t.min,t.max]);this._dataExtent=e},e.prototype.getDataDimensionIndex=function(t){var e=this.option.dimension;if(null!=e)return t.getDimensionIndex(e);for(var n=t.dimensions,i=n.length-1;i>=0;i--){var r=n[i],o=t.getDimensionInfo(r);if(!o.isCalculationCoord)return o.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},i=e.target||(e.target={}),r=e.controller||(e.controller={});Za(i,n),Za(r,n);var o=this.isCategory();function a(n){EK(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}a.call(this,i),a.call(this,r),function(t,e,n){var i=t[e],r=t[n];i&&!r&&(r=t[n]={},LK(i,function(t,e){if(fz.isValidType(e)){var n=DK.get(e,"inactive",o);null!=n&&(r[e]=n,"color"!==e||r.hasOwnProperty("opacity")||r.hasOwnProperty("colorAlpha")||(r.opacity=[0,0]))}}))}.call(this,i,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,i=this.get("inactiveColor"),r=this.getItemSymbol()||"roundRect";LK(this.stateList,function(a){var s=this.itemSize,l=t[a];l||(l=t[a]={color:o?i:[i]}),null==l.symbol&&(l.symbol=e&&$a(e)||(o?r:[r])),null==l.symbolSize&&(l.symbolSize=n&&$a(n)||(o?s[0]:[s[0],s[0]])),l.symbol=kK(l.symbol,function(t){return"none"===t?r:t});var c=l.symbolSize;if(null!=c){var u=-1/0;AK(c,function(t){t>u&&(u=t)}),l.symbolSize=kK(c,function(t){return OK(t,[0,u],[0,s[0]],!0)})}},this)}.call(this,r)},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Uv);const BK=RK;var NK=[20,140],zK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=NK[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=NK[1])},e.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):ps(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),os(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),e=Nd((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},e.prototype.getValueState=function(t){var e=this.option.range,n=this.getExtent();return(e[0]<=n[0]||e[0]<=t)&&(e[1]>=n[1]||t<=e[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries(function(n){var i=[],r=n.getData();r.each(this.getDataDimensionIndex(r),function(e,n){t[0]<=e&&e<=t[1]&&i.push(n)},this),e.push({seriesId:n.id,dataIndex:i})},this),e},e.prototype.getVisualMeta=function(t){var e=FK(0,0,this.getExtent()),n=FK(0,0,this.option.range.slice()),i=[];function r(e,n){i.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;a<l&&(!n.length||e[a]<=n[0]);a++)e[a]<n[o]&&r(e[a],"outOfRange");for(var c=1;o<s;o++,c=0)c&&i.length&&r(n[o],"outOfRange"),r(n[o],"inRange");for(c=1;a<l;a++)(!n.length||n[n.length-1]<e[a])&&(c&&(i.length&&r(i[i.length-1].value,"outOfRange"),c=0),r(e[a],"outOfRange"));var u=i.length;return{stops:i,outerColors:[u?i[0].color:"transparent",u?i[u-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=Ny(BK.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(BK);function FK(t,e,n){if(n[0]===n[1])return n.slice();for(var i=(n[1]-n[0])/200,r=n[0],o=[],a=0;a<=200&&r<n[1];a++)o.push(r),r+=i;return o.push(n[1]),o}const VK=zK,HK=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return Ma(e,t),e.prototype.init=function(t,e){this.ecModel=t,this.api=e},e.prototype.render=function(t,e,n,i){this.visualMapModel=t,!1!==t.get("show")?this.doRender(t,e,n,i):this.group.removeAll()},e.prototype.renderBackground=function(t){var e=this.visualMapModel,n=wv(e.get("padding")||0),i=t.getBoundingRect();t.add(new Pg({z2:-1,silent:!0,shape:{x:i.x-n[3],y:i.y-n[0],width:i.width+n[3]+n[1],height:i.height+n[0]+n[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},e.prototype.getControllerVisual=function(t,e,n){var i=(n=n||{}).forceState,r=this.visualMapModel,o={};if("color"===e){var a=r.get("contentColor");o.color=a}function s(t){return o[t]}function l(t,e){o[t]=e}var c=r.controllerVisuals[i||r.getValueState(t)];return os(fz.prepareVisualTypes(c),function(i){var r=c[i];n.convertOpacityToAlpha&&"opacity"===i&&(i="colorAlpha",r=c.__alphaForOpacity),fz.dependsOn(i,e)&&r&&r.applyVisual(t,s,l)}),o[e]},e.prototype.positionGroup=function(t){var e=this.visualMapModel,n=this.api;zv(t,e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(t,e,n,i){},e.type="visualMap",e}(Wb);var jK=[["left","right","width"],["top","bottom","height"]];function WK(t,e,n){var i=t.option,r=i.align;if(null!=r&&"auto"!==r)return r;for(var o={width:e.getWidth(),height:e.getHeight()},a="horizontal"===i.orient?1:0,s=jK[a],l=[0,null,10],c={},u=0;u<3;u++)c[jK[1-a][u]]=l[u],c[s[u]]=2===u?n[0]:i[s[u]];var h=[["x","width",3],["y","height",0]][a],d=Nv(c,o,i.padding);return s[(d.margin[h[2]]||0)+d[h[0]]+.5*d[h[1]]<.5*o[h[1]]?0:1]}function GK(t,e){return os(t||[],function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var UK=Od,qK=os,YK=Math.min,XK=Math.max,$K=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return Ma(e,t),e.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this._hoverLinkFromSeriesMouseOver=hs(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=hs(this._hideIndicator,this)},e.prototype.doRender=function(t,e,n,i){i&&"selectDataRange"===i.type&&i.from===this.uid||this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var n=t.get("text");this._renderEndsText(e,n,0),this._renderEndsText(e,n,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},e.prototype._renderEndsText=function(t,e,n){if(e){var i=e[1-n];i=null!=i?i+"":"";var r=this.visualMapModel,o=r.get("textGap"),a=r.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),c=this._applyTransform(0===n?"bottom":"top",s),u=this._orient,h=this.visualMapModel.textStyleModel;this.group.add(new $g({style:uy(h,{x:l[0],y:l[1],verticalAlign:"horizontal"===u?"middle":c,align:"horizontal"===u?c:"center",text:i})}))}},e.prototype._renderBar=function(t){var e=this.visualMapModel,n=this._shapes,i=e.itemSize,r=this._orient,o=this._useHandle,a=WK(e,this.api,i),s=n.mainGroup=this._createBarGroup(a),l=new _d;s.add(l),l.add(n.outOfRange=ZK()),l.add(n.inRange=ZK(null,o?JK(this._orient):null,hs(this._dragHandle,this,"all",!1),hs(this._dragHandle,this,"all",!0))),l.setClipPath(new Pg({shape:{x:0,y:0,width:i[0],height:i[1],r:3}}));var c=e.textStyleModel.getTextRect("国"),u=XK(c.width,c.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(e,s,0,i,u,r),this._createHandle(e,s,1,i,u,r)),this._createIndicator(e,s,i,u,r),t.add(s)},e.prototype._createHandle=function(t,e,n,i,r,o){var a=hs(this._dragHandle,this,n,!1),s=hs(this._dragHandle,this,n,!0),l=od(t.get("handleSize"),i[0]),c=hC(t.get("handleIcon"),-l/2,-l/2,l,l,null,!0),u=JK(this._orient);c.attr({cursor:u,draggable:!0,drift:a,ondragend:s,onmousemove:function(t){Hl(t.event)}}),c.x=i[0]/2,c.useStyle(t.getModel("handleStyle").getItemStyle()),c.setStyle({strokeNoScale:!0,strokeFirst:!0}),c.style.lineWidth*=2,c.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),Um(c,!0),e.add(c);var h=this.visualMapModel.textStyleModel,d=new $g({cursor:u,draggable:!0,drift:a,onmousemove:function(t){Hl(t.event)},ondragend:s,style:uy(h,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[l,0],f=this._shapes;f.handleThumbs[n]=c,f.handleLabelPoints[n]=p,f.handleLabels[n]=d},e.prototype._createIndicator=function(t,e,n,i,r){var o=od(t.get("indicatorSize"),n[0]),a=hC(t.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=t.getModel("indicatorStyle").getItemStyle();if(a instanceof Cg){var l=a.style;a.useStyle(Ja({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);e.add(a);var c=this.visualMapModel.textStyleModel,u=new $g({silent:!0,invisible:!0,style:uy(c,{x:0,y:0,text:""})});this.group.add(u);var h=[("horizontal"===r?i/2:6)+n[0]/2,0],d=this._shapes;d.indicator=a,d.indicatorLabel=u,d.indicatorLabelPoint=h,this._firstShowIndicator=!0},e.prototype._dragHandle=function(t,e,n,i){if(this._useHandle){if(this._dragging=!e,!e){var r=this._applyTransform([n,i],this._shapes.mainGroup,!0);this._updateInterval(t,r[1]),this._hideIndicator(),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():KK(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},e.prototype._resetInterval=function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),n=t.getExtent(),i=[0,t.itemSize[1]];this._handleEnds=[UK(e[0],n,i,!0),UK(e[1],n,i,!0)]},e.prototype._updateInterval=function(t,e){e=e||0;var n=this.visualMapModel,i=this._handleEnds,r=[0,n.itemSize[1]];SV(e,i,r,t,0);var o=n.getExtent();this._dataInterval=[UK(i[0],r,o,!0),UK(i[1],r,o,!0)]},e.prototype._updateView=function(t){var e=this.visualMapModel,n=e.getExtent(),i=this._shapes,r=[0,e.itemSize[1]],o=t?r:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,r,"outOfRange");i.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),i.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},e.prototype._createBarVisual=function(t,e,n,i){var r={forceState:i,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,r),a=[this.getControllerVisual(t[0],"symbolSize",r),this.getControllerVisual(t[1],"symbolSize",r)],s=this._createBarPoints(n,a);return{barColor:new oS(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},e.prototype._makeColorGradient=function(t,e){var n=[],i=(t[1]-t[0])/100;n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var r=1;r<100;r++){var o=t[0]+i*r;if(o>t[1])break;n.push({color:this.getControllerVisual(o,"color",e),offset:r/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},e.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},e.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new _d("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},e.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,i=this.visualMapModel,r=n.handleThumbs,o=n.handleLabels,a=i.itemSize,s=i.getExtent(),l=this._applyTransform("left",n.mainGroup);qK([0,1],function(c){var u=r[c];u.setStyle("fill",e.handlesColor[c]),u.y=t[c];var h=UK(t[c],[0,a[1]],s,!0),d=this.getControllerVisual(h,"symbolSize");u.scaleX=u.scaleY=d/a[0],u.x=a[0]-d/2;var p=OS(n.handleLabelPoints[c],PS(u,this.group));if("horizontal"===this._orient){var f="left"===l||"top"===l?(a[0]-d)/2:(a[0]-d)/-2;p[1]+=f}o[c].setStyle({x:p[0],y:p[1],text:i.formatValueText(this._dataInterval[c]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,e,n,i){var r=this.visualMapModel,o=r.getExtent(),a=r.itemSize,s=[0,a[1]],l=this._shapes,c=l.indicator;if(c){c.attr("invisible",!1);var u=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),h=this.getControllerVisual(t,"symbolSize"),d=UK(t,o,s,!0),p=a[0]-h/2,f={x:c.x,y:c.y};c.y=d,c.x=p;var g=OS(l.indicatorLabelPoint,PS(c,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var y=this._applyTransform("left",l.mainGroup),v="horizontal"===this._orient;m.setStyle({text:(n||"")+r.formatValueText(e),verticalAlign:v?y:"middle",align:v?"center":y});var _={x:p,y:d,style:{fill:u}},x={style:{x:g[0],y:g[1]}};if(r.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};c.x=f.x,c.y=f.y,c.animateTo(_,b),m.animateTo(x,b)}else c.attr(_),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;S<w.length;S++)this.api.enterBlur(w[S])}},e.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var n=t.visualMapModel.itemSize,i=t._applyTransform([e.offsetX,e.offsetY],t._shapes.mainGroup,!0,!0);i[1]=YK(XK(0,i[1]),n[1]),t._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=n[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(t,e){var n=this.visualMapModel,i=n.itemSize;if(n.option.hoverLink){var r=[0,i[1]],o=n.getExtent();t=YK(XK(r[0],t),r[1]);var a=function(t,e,n){var i=6,r=t.get("hoverLinkDataSize");return r&&(i=UK(r,e,n,!0)/2),i}(n,o,r),s=[t-a,t+a],l=UK(t,r,o,!0),c=[UK(s[0],r,o,!0),UK(s[1],r,o,!0)];s[0]<r[0]&&(c[0]=-1/0),s[1]>r[1]&&(c[1]=1/0),e&&(c[0]===-1/0?this._showIndicator(l,c[1],"< ",a):c[1]===1/0?this._showIndicator(l,c[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var u=this._hoverLinkDataIndices,h=[];(e||KK(n))&&(h=this._hoverLinkDataIndices=n.findTargetDataIndices(c));var d=function(t,e){var n={},i={};return r(t||[],n),r(e||[],i,n),[o(n),o(i)];function r(t,e,n){for(var i=0,r=t.length;i<r;i++){var o=mp(t[i].seriesId,null);if(null==o)return;for(var a=lp(t[i].dataIndex),s=n&&n[o],l=0,c=a.length;l<c;l++){var u=a[l];s&&s[u]?s[u]=null:(e[o]||(e[o]={}))[u]=1}}}function o(t,e){var n=[];for(var i in t)if(t.hasOwnProperty(i)&&null!=t[i])if(e)n.push(+i);else{var r=o(t[i],!0);r.length&&n.push({seriesId:i,dataIndex:r})}return n}}(u,h);this._dispatchHighDown("downplay",GK(d[0],n)),this._dispatchHighDown("highlight",GK(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(JM(t.target,function(t){var n=Zg(t);if(null!=n.dataIndex)return e=n,!0},!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),i=this.visualMapModel;if(i.isTargetSeries(n)){var r=n.getData(e.dataType),o=r.getStore().get(i.getDataDimensionIndex(r),e.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n<e.length;n++)this.api.leaveBlur(e[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",GK(t,this.visualMapModel)),t.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(t,e,n,i){var r=PS(e,i?null:this.group);return ps(t)?OS(t,r,n):RS(t,r,n)},e.prototype._dispatchHighDown=function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(HK);function ZK(t,e,n,i){return new zw({shape:{points:t},draggable:!!n,cursor:e,drift:n,onmousemove:function(t){Hl(t.event)},ondragend:i})}function KK(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function JK(t){return"vertical"===t?"ns-resize":"ew-resize"}const QK=$K;var tJ={type:"selectDataRange",event:"dataRangeSelected",update:"update"},eJ=function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})},nJ=[{createOnAllSeries:!0,reset:function(t,e){var n=[];return e.eachComponent("visualMap",function(e){var i,r,o,a,s,l=t.pipelineContext;!e.isTargetSeries(t)||l&&l.large||n.push((i=e.stateList,r=e.targetVisuals,o=hs(e.getValueState,e),a=e.getDataDimensionIndex(t.getData()),s={},os(i,function(t){var e=fz.prepareVisualTypes(r[t]);s[t]=e}),{progress:function(t,e){var n,i;function l(t){return YM(e,i,t)}function c(t,n){$M(e,i,t,n)}null!=a&&(n=e.getDimensionIndex(a));for(var u=e.getStore();null!=(i=t.next());){var h=e.getRawDataItem(i);if(!h||!1!==h.visualMap)for(var d=null!=a?u.get(n,i):i,p=o(d),f=r[p],g=s[p],m=0,y=g.length;m<y;m++){var v=g[m];f[v]&&f[v].applyVisual(d,l,c)}}}}))}),n}},{createOnAllSeries:!0,reset:function(t,e){var n=t.getData(),i=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var r=e.getVisualMeta(hs(iJ,null,t,e))||{stops:[],outerColors:[]},o=e.getDataDimensionIndex(n);o>=0&&(r.dimension=o,i.push(r))}}),t.getData().setVisual("visualMeta",i)}}];function iJ(t,e,n,i){for(var r=e.targetVisuals[i],o=fz.prepareVisualTypes(r),a={color:XM(t.getData(),"color")},s=0,l=o.length;s<l;s++){var c=o[s],u=r["opacity"===c?"__alphaForOpacity":c];u&&u.applyVisual(n,h,d)}return a.color;function h(t){return a[t]}function d(t,e){a[t]=e}}var rJ=os;function oJ(t){var e=t&&t.visualMap;ps(e)||(e=e?[e]:[]),rJ(e,function(t){if(t){aJ(t,"splitList")&&!aJ(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&ps(e)&&rJ(e,function(t){vs(t)&&(aJ(t,"start")&&!aJ(t,"min")&&(t.min=t.start),aJ(t,"end")&&!aJ(t,"max")&&(t.max=t.end))})}})}function aJ(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var sJ=!1;function lJ(t){sJ||(sJ=!0,t.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"}),t.registerAction(tJ,eJ),os(nJ,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(oJ))}function cJ(t){t.registerComponentModel(VK),t.registerComponentView(QK),lJ(t)}var uJ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n._pieceList=[],n}return Ma(e,t),e.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],hJ[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var r=this.option.categories;this.resetVisual(function(t,e){"categories"===i?(t.mappingMethod="category",t.categories=$a(r)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=as(this._pieceList,function(t){return t=$a(t),"inRange"!==e&&(t.visual=null),t}))})},e.prototype.completeVisualOption=function(){var e=this.option,n={},i=fz.listVisualTypes(),r=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}os(e.pieces,function(t){os(i,function(e){t.hasOwnProperty(e)&&(n[e]=1)})}),os(n,function(t,n){var i=!1;os(this.stateList,function(t){i=i||o(e,t,n)||o(e.target,t,n)},this),!i&&os(this.stateList,function(t){(e[t]||(e[t]={}))[n]=DK.get(n,"inRange"===t?"active":"inactive",r)})},this),t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,e){var n=this.option,i=this._pieceList,r=(e?n:t).selected||{};if(n.selected=r,os(i,function(t,e){var n=this.getSelectedMapKey(t);r.hasOwnProperty(n)||(r[n]=!0)},this),"single"===n.selectedMode){var o=!1;os(i,function(t,e){var n=this.getSelectedMapKey(t);r[n]&&(o?r[n]=!1:o=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=$a(t)},e.prototype.getValueState=function(t){var e=fz.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries(function(i){var r=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(e,i){fz.findPieceIndex(e,n)===t&&r.push(i)},this),e.push({seriesId:i.id,dataIndex:r})},this),e},e.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},e.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],i=this,r=this._pieceList.slice();if(r.length){var o=r[0].interval[0];o!==-1/0&&r.unshift({interval:[-1/0,o]}),(o=r[r.length-1].interval[1])!==1/0&&r.push({interval:[o,1/0]})}else r.push({interval:[-1/0,1/0]});var a=-1/0;return os(r,function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])},this),{stops:e,outerColors:n}}function s(r,o){var a=i.getRepresentValue({interval:r});o||(o=i.getValueState(a));var s=t(a,o);r[0]===-1/0?n[0]=s:r[1]===1/0?n[1]=s:e.push({value:r[0],color:s},{value:r[1],color:s})}},e.type="visualMap.piecewise",e.defaultOption=Ny(BK.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(BK),hJ={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),i=this.getExtent(),r=e.splitNumber;r=Math.max(parseInt(r,10),1),e.splitNumber=r;for(var o=(i[1]-i[0])/r;+o.toFixed(n)!==o&&n<5;)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var a=0,s=i[0];a<r;s+=o,a++){var l=a===r-1?i[1]:s+o;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[i[1],1/0],close:[0,0]}),Qd(t),os(t,function(t,e){t.index=e,t.text=this.formatValueText(t.interval)},this)},categories:function(t){var e=this.option;os(e.categories,function(e){t.push({text:this.formatValueText(e,!0),value:e})},this),dJ(e,t)},pieces:function(t){var e=this.option;os(e.pieces,function(e,n){vs(e)||(e={value:e});var i={text:"",index:n};if(null!=e.label&&(i.text=e.label),e.hasOwnProperty("value")){var r=i.value=e.value;i.interval=[r,r],i.close=[1,1]}else{for(var o=i.interval=[],a=i.close=[0,0],s=[1,0,1],l=[-1/0,1/0],c=[],u=0;u<2;u++){for(var h=[["gte","gt","min"],["lte","lt","max"]][u],d=0;d<3&&null==o[u];d++)o[u]=e[h[d]],a[u]=s[d],c[u]=2===d;null==o[u]&&(o[u]=l[u])}c[0]&&o[1]===1/0&&(a[0]=0),c[1]&&o[0]===-1/0&&(a[1]=0),o[0]===o[1]&&a[0]&&a[1]&&(i.value=o[0])}i.visual=fz.retrieveVisuals(e),t.push(i)},this),dJ(e,t),Qd(t),os(t,function(t){var e=t.close,n=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)},this)}};function dJ(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}const pJ=uJ;var fJ=function(t){function e(){var n=null!==t&&t.apply(this,arguments)||this;return n.type=e.type,n}return Ma(e,t),e.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),i=e.textStyleModel,r=i.getFont(),o=i.getTextColor(),a=this._getItemAlign(),s=e.itemSize,l=this._getViewData(),c=l.endsText,u=Ts(e.get("showLabel",!0),!c),h=!e.get("selectedMode");c&&this._renderEndsText(t,c[0],s,u,a),os(l.viewPieceList,function(i){var l=i.piece,c=new _d;c.onclick=hs(this._onItemClick,this,l),this._enableHoverLink(c,i.indexInModelPieceList);var d=e.getRepresentValue(l);if(this._createItemSymbol(c,d,[0,0,s[0],s[1]],h),u){var p=this.visualMapModel.getValueState(d);c.add(new $g({style:{x:"right"===a?-n:s[0]+n,y:s[1]/2,text:l.text,verticalAlign:"middle",align:a,font:r,fill:o,opacity:"outOfRange"===p?.5:1},silent:h}))}t.add(c)},this),c&&this._renderEndsText(t,c[1],s,u,a),Bv(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",function(){return i("highlight")}).on("mouseout",function(){return i("downplay")});var i=function(t){var i=n.visualMapModel;i.option.hoverLink&&n.api.dispatchAction({type:t,batch:GK(i.findTargetDataIndices(e),i)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return WK(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},e.prototype._renderEndsText=function(t,e,n,i,r){if(e){var o=new _d,a=this.visualMapModel.textStyleModel;o.add(new $g({style:uy(a,{x:i?"right"===r?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:i?r:"center",text:e})})),t.add(o)}},e.prototype._getViewData=function(){var t=this.visualMapModel,e=as(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),i=t.get("orient"),r=t.get("inverse");return("horizontal"===i?r:!r)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},e.prototype._createItemSymbol=function(t,e,n,i){var r=hC(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color"));r.silent=i,t.add(r)},e.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,i=n.selectedMode;if(i){var r=$a(n.selected),o=e.getSelectedMapKey(t);"single"===i||!0===i?(r[o]=!0,os(r,function(t,e){r[e]=e===o})):r[o]=!r[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:r})}},e.type="visualMap.piecewise",e}(HK);const gJ=fJ;function mJ(t){t.registerComponentModel(pJ),t.registerComponentView(gJ),lJ(t)}var yJ={label:{enabled:!0},decal:{show:!1}},vJ=xp(),_J={};function xJ(t,e){var n=t.getModel("aria");if(n.get("enabled")){var i=$a(yJ);Za(i.label,t.getLocaleModel().get("aria"),!1),Za(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var e=Fs();t.eachSeries(function(t){if(!t.isColorBySeries()){var n=e.get(t.type);n||(n={},e.set(t.type,n)),vJ(t).scope=n}}),t.eachRawSeries(function(e){if(!t.isSeriesFiltered(e))if(fs(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=v_(e.ecModel,e.name,_J,t.getSeriesCount()),r=n.getVisual("decal");n.setVisual("decal",c(r,i))}else{var o=e.getRawData(),a={},s=vJ(e).scope;n.each(function(t){var e=n.getRawIndex(t);a[e]=t});var l=o.count();o.each(function(t){var i=a[t],r=o.getName(t)||t+"",u=v_(e.ecModel,r,s,l),h=n.getItemVisual(i,"decal");n.setItemVisual(i,"decal",c(h,u))})}}function c(t,e){var n=t?Ja(Ja({},e),t):e;return n.dirty=!0,n}})}}(),function(){var i=e.getZr().dom;if(i){var o=t.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=Qa(a.option,o),a.get("enabled"))if(i.setAttribute("role","img"),a.get("description"))i.setAttribute("aria-label",a.get("description"));else{var s,l=t.getSeriesCount(),c=a.get(["data","maxCount"])||10,u=a.get(["series","maxCount"])||10,h=Math.min(l,u);if(!(l<1)){var d=function(){var e=t.get("title");return e&&e.length&&(e=e[0]),e&&e.text}();s=d?r(a.get(["general","withTitle"]),{title:d}):a.get(["general","withoutTitle"]);var p=[];s+=r(l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]),{seriesCount:l}),t.eachSeries(function(e,n){if(n<h){var i=void 0,o=e.get("name")?"withName":"withoutName";i=r(i=l>1?a.get(["series","multiple",o]):a.get(["series","single",o]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(x=e.subType,b=t.getLocaleModel().get(["series","typeNames"]),b[x]||b.chart)});var s=e.getData();s.count()>c?i+=r(a.get(["data","partialData"]),{displayCnt:c}):i+=a.get(["data","allData"]);for(var u=a.get(["data","separator","middle"]),d=a.get(["data","separator","end"]),f=a.get(["data","excludeDimensionId"]),g=[],m=0;m<s.count();m++)if(m<c){var y=s.getName(m),v=f?ls(s.getValues(m),function(t,e){return-1===es(f,e)}):s.getValues(m),_=a.get(["data",y?"withName":"withoutName"]);g.push(r(_,{name:y,value:v.join(u)}))}i+=g.join(u)+d,p.push(i)}var x,b});var f=a.getModel(["series","multiple","separator"]),g=f.get("middle"),m=f.get("end");s+=p.join(g)+m,i.setAttribute("aria-label",s)}}}}()}function r(t,e){if(!gs(t))return t;var n=t;return os(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}}function bJ(t){if(t&&t.aria){var e=t.aria;null!=e.show&&(e.enabled=e.show),e.label=e.label||{},os(["description","general","series","data"],function(t){null!=e[t]&&(e.label[t]=e[t])})}}var wJ={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},SJ=function(){function t(t){null==(this._condVal=gs(t)?new RegExp(t):Ms(t)?t:null)&&Px("")}return t.prototype.evaluate=function(t){var e=typeof t;return gs(e)?this._condVal.test(t):!!ys(e)&&this._condVal.test(t+"")},t}(),MJ=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),CJ=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(!t[e].evaluate())return!1;return!0},t}(),TJ=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].evaluate())return!0;return!1},t}(),IJ=function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),DJ=function(){function t(){}return t.prototype.evaluate=function(){for(var t=!!this.valueParser,e=(0,this.getValue)(this.valueGetterParam),n=t?this.valueParser(e):null,i=0;i<this.subCondList.length;i++)if(!this.subCondList[i].evaluate(t?n:e))return!1;return!0},t}();function kJ(t,e){if(!0===t||!1===t){var n=new MJ;return n.value=t,n}return EJ(t)||Px(""),t.and?AJ("and",t,e):t.or?AJ("or",t,e):t.not?function(t,e){var n=t.not;EJ(n)||Px("");var i=new IJ;return i.child=kJ(n,e),i.child||Px(""),i}(t,e):function(t,e){for(var n=e.prepareGetValue(t),i=[],r=us(t),o=t.parser,a=o?Bx(o):null,s=0;s<r.length;s++){var l=r[s];if("parser"!==l&&!e.valueGetterAttrMap.get(l)){var c=Ws(wJ,l)?wJ[l]:l,u=t[l],h=a?a(u):u,d=Hx(c,h)||"reg"===c&&new SJ(h);d||Px(""),i.push(d)}}i.length||Px("");var p=new DJ;return p.valueGetterParam=n,p.valueParser=a,p.getValue=e.getValue,p.subCondList=i,p}(t,e)}function AJ(t,e,n){var i=e[t];ps(i)||Px(""),i.length||Px("");var r="and"===t?new CJ:new TJ;return r.children=as(i,function(t){return kJ(t,n)}),r.children.length||Px(""),r}function EJ(t){return vs(t)&&!rs(t)}var LJ=function(){function t(t,e){this._cond=kJ(t,e)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}(),PJ={type:"echarts:filter",transform:function(t){for(var e,n,i,r=t.upstream,o=(n=t.config,i={valueGetterAttrMap:Fs({dimension:!0}),prepareGetValue:function(t){var e=t.dimension;Ws(t,"dimension")||Px("");var n=r.getDimensionInfo(e);return n||Px(""),{dimIdx:n.index}},getValue:function(t){return r.retrieveValueFromItem(e,t.dimIdx)}},new LJ(n,i)),a=[],s=0,l=r.count();s<l;s++)e=r.getRawDataItem(s),o.evaluate()&&a.push(e);return{data:a}}},OJ={type:"echarts:sort",transform:function(t){var e=t.upstream,n=t.config,i="",r=lp(n);r.length||Px(i);var o=[];os(r,function(t){var n=t.dimension,r=t.order,a=t.parser,s=t.incomparable;null==n&&Px(i),"asc"!==r&&"desc"!==r&&Px(i),s&&"min"!==s&&"max"!==s&&Px(""),"asc"!==r&&"desc"!==r&&Px("");var l=e.getDimensionInfo(n);l||Px(i);var c=a?Bx(a):null;a&&!c&&Px(i),o.push({dimIdx:l.index,parser:c,comparator:new Fx(r,s)})});var a=e.sourceFormat;a!==Kv&&a!==Jv&&Px(i);for(var s=[],l=0,c=e.count();l<c;l++)s.push(e.getRawDataItem(l));return s.sort(function(t,n){for(var i=0;i<o.length;i++){var r=o[i],a=e.retrieveValueFromItem(t,r.dimIdx),s=e.retrieveValueFromItem(n,r.dimIdx);r.parser&&(a=r.parser(a),s=r.parser(s));var l=r.comparator.evaluate(a,s);if(0!==l)return l}return 0}),{data:s}}},RJ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ma(e,t),e.prototype.init=function(e,n,i){t.prototype.init.call(this,e,n,i),this._sourceManager=new cb(this),ub(this)},e.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),ub(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:n_},e}(Uv),BJ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return Ma(e,t),e.type="dataset",e}(Wb),NJ=Zf.CMD;function zJ(t,e){return Math.abs(t-e)<1e-5}function FJ(t){var e,n,i,r,o,a=t.data,s=t.len(),l=[],c=0,u=0,h=0,d=0;function p(t,n){e&&e.length>2&&l.push(e),e=[t,n]}function f(t,n,i,r){zJ(t,i)&&zJ(n,r)||e.push(t,n,i,r,i,r)}function g(t,n,i,r,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,c=n<t?-1:1,u=Math.cos(t),h=Math.sin(t),d=Math.cos(n),p=Math.sin(n),f=u*o+i,g=h*a+r,m=d*o+i,y=p*a+r,v=o*l*c,_=a*l*c;e.push(f-v*h,g+_*u,m+v*p,y-_*d,m,y)}for(var m=0;m<s;){var y=a[m++],v=1===m;switch(v&&(h=c=a[m],d=u=a[m+1],y!==NJ.L&&y!==NJ.C&&y!==NJ.Q||(e=[h,d])),y){case NJ.M:c=h=a[m++],u=d=a[m++],p(h,d);break;case NJ.L:f(c,u,n=a[m++],i=a[m++]),c=n,u=i;break;case NJ.C:e.push(a[m++],a[m++],a[m++],a[m++],c=a[m++],u=a[m++]);break;case NJ.Q:n=a[m++],i=a[m++],r=a[m++],o=a[m++],e.push(c+2/3*(n-c),u+2/3*(i-u),r+2/3*(n-r),o+2/3*(i-o),r,o),c=r,u=o;break;case NJ.A:var _=a[m++],x=a[m++],b=a[m++],w=a[m++],S=a[m++],M=a[m++]+S;m+=1;var C=!a[m++];n=Math.cos(S)*b+_,i=Math.sin(S)*w+x,v?p(h=n,d=i):f(c,u,n,i),c=Math.cos(M)*b+_,u=Math.sin(M)*w+x;for(var T=(C?-1:1)*Math.PI/2,I=S;C?I>M:I<M;I+=T)g(I,C?Math.max(I+T,M):Math.min(I+T,M),_,x,b,w);break;case NJ.R:h=c=a[m++],d=u=a[m++],n=h+a[m++],i=d+a[m++],p(n,d),f(n,d,n,i),f(n,i,h,i),f(h,i,h,d),f(h,d,n,d);break;case NJ.Z:e&&f(c,u,h,d),c=h,u=d}}return e&&e.length>2&&l.push(e),l}function VJ(t,e,n,i,r,o,a,s,l,c){if(zJ(t,n)&&zJ(e,i)&&zJ(r,a)&&zJ(o,s))l.push(a,s);else{var u=2/c,h=u*u,d=a-t,p=s-e,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-t,m=i-e,y=r-a,v=o-s,_=g*g+m*m,x=y*y+v*v;if(_<h&&x<h)l.push(a,s);else{var b=d*g+p*m,w=-d*y-p*v;if(_-b*b<h&&b>=0&&x-w*w<h&&w>=0)l.push(a,s);else{var S=[],M=[];Qc(t,n,r,a,.5,S),Qc(e,i,o,s,.5,M),VJ(S[0],M[0],S[1],M[1],S[2],M[2],S[3],M[3],l,c),VJ(S[4],M[4],S[5],M[5],S[6],M[6],S[7],M[7],l,c)}}}}function HJ(t,e,n){var i=t[e],r=t[1-e],o=Math.abs(i/r),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],c=0;c<a;c++)l.push(s);var u=n-a*s;if(u>0)for(c=0;c<u;c++)l[c%a]+=1;return l}function jJ(t,e,n){for(var i=t.r0,r=t.r,o=t.startAngle,a=t.endAngle,s=Math.abs(a-o),l=s*r,c=r-i,u=l>Math.abs(c),h=HJ([l,c],u?0:1,e),d=(u?s:c)/h.length,p=0;p<h.length;p++)for(var f=(u?c:s)/h[p],g=0;g<h[p];g++){var m={};u?(m.startAngle=o+d*p,m.endAngle=o+d*(p+1),m.r0=i+f*g,m.r=i+f*(g+1)):(m.startAngle=o+f*g,m.endAngle=o+f*(g+1),m.r0=i+d*p,m.r=i+d*(p+1)),m.clockwise=t.clockwise,m.cx=t.cx,m.cy=t.cy,n.push(m)}}function WJ(t,e,n,i){return t*i-n*e}function GJ(t,e,n,i,r,o,a,s){var l=n-t,c=i-e,u=a-r,h=s-o,d=WJ(u,h,l,c);if(Math.abs(d)<1e-6)return null;var p=WJ(t-r,e-o,u,h)/d;return p<0||p>1?null:new nc(p*l+t,p*c+e)}function UJ(t,e,n){var i=new nc;nc.sub(i,n,e),i.normalize();var r=new nc;return nc.sub(r,t,e),r.dot(i)}function qJ(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function YJ(t){var e=t.points,n=[],i=[];Mf(e,n,i);var r=new dc(n[0],n[1],i[0]-n[0],i[1]-n[1]),o=r.width,a=r.height,s=r.x,l=r.y,c=new nc,u=new nc;return o>a?(c.x=u.x=s+o/2,c.y=l,u.y=l+a):(c.y=u.y=l+a/2,c.x=s,u.x=s+o),function(t,e,n){for(var i=t.length,r=[],o=0;o<i;o++){var a=t[o],s=t[(o+1)%i],l=GJ(a[0],a[1],s[0],s[1],e.x,e.y,n.x,n.y);l&&r.push({projPt:UJ(l,e,n),pt:l,idx:o})}if(r.length<2)return[{points:t},{points:t}];r.sort(function(t,e){return t.projPt-e.projPt});var c=r[0],u=r[r.length-1];if(u.idx<c.idx){var h=c;c=u,u=h}var d=[c.pt.x,c.pt.y],p=[u.pt.x,u.pt.y],f=[d],g=[p];for(o=c.idx+1;o<=u.idx;o++)qJ(f,t[o].slice());for(qJ(f,p),qJ(f,d),o=u.idx+1;o<=c.idx+i;o++)qJ(g,t[o%i].slice());return qJ(g,d),qJ(g,p),[{points:f},{points:g}]}(e,c,u)}function XJ(t,e,n,i){if(1===n)i.push(e);else{var r=Math.floor(n/2),o=t(e);XJ(t,o[0],r,i),XJ(t,o[1],n-r,i)}return i}function $J(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function ZJ(t,e){var n=t.length,i=e.length;if(n===i)return[t,e];for(var r=[],o=[],a=n<i?t:e,s=Math.min(n,i),l=Math.abs(i-n)/6,c=(s-2)/6,u=Math.ceil(l/c)+1,h=[a[0],a[1]],d=l,p=2;p<s;){var f=a[p-2],g=a[p-1],m=a[p++],y=a[p++],v=a[p++],_=a[p++],x=a[p++],b=a[p++];if(d<=0)h.push(m,y,v,_,x,b);else{for(var w=Math.min(d,u-1)+1,S=1;S<=w;S++){var M=S/w;Qc(f,m,v,x,M,r),Qc(g,y,_,b,M,o),f=r[3],g=o[3],h.push(r[1],o[1],r[2],o[2],f,g),m=r[5],y=o[5],v=r[6],_=o[6]}d-=w-1}}return a===t?[h,e]:[t,h]}function KJ(t,e){for(var n=t.length,i=t[n-2],r=t[n-1],o=[],a=0;a<e.length;)o[a++]=i,o[a++]=r;return o}function JJ(t){for(var e=0,n=0,i=0,r=t.length,o=0,a=r-2;o<r;a=o,o+=2){var s=t[a],l=t[a+1],c=t[o],u=t[o+1],h=s*u-c*l;e+=h,n+=(s+c)*h,i+=(l+u)*h}return 0===e?[t[0]||0,t[1]||0]:[n/e/3,i/e/3,e]}function QJ(t,e,n,i){for(var r=(t.length-2)/6,o=1/0,a=0,s=t.length,l=s-2,c=0;c<r;c++){for(var u=6*c,h=0,d=0;d<s;d+=2){var p=0===d?u:(u+d-2)%l+2,f=t[p]-n[0],g=t[p+1]-n[1],m=e[d]-i[0]-f,y=e[d+1]-i[1]-g;h+=m*m+y*y}h<o&&(o=h,a=c)}return a}function tQ(t){for(var e=[],n=t.length,i=0;i<n;i+=2)e[i]=t[n-i-2],e[i+1]=t[n-i-1];return e}function eQ(t){return t.__isCombineMorphing}var nQ="__mOriginal_";function iQ(t,e,n){var i=nQ+e,r=t[i]||t[e];t[i]||(t[i]=t[e]);var o=n.replace,a=n.after,s=n.before;t[e]=function(){var t,e=arguments;return s&&s.apply(this,e),t=o?o.apply(this,e):r.apply(this,e),a&&a.apply(this,e),t}}function rQ(t,e){var n=nQ+e;t[n]&&(t[e]=t[n],t[n]=null)}function oQ(t,e){for(var n=0;n<t.length;n++)for(var i=t[n],r=0;r<i.length;){var o=i[r],a=i[r+1];i[r++]=e[0]*o+e[2]*a+e[4],i[r++]=e[1]*o+e[3]*a+e[5]}}function aQ(t,e){var n=t.getUpdatedPathProxy(),i=e.getUpdatedPathProxy(),r=function(t,e){for(var n,i,r,o=[],a=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],c=e[s],u=void 0,h=void 0;l?c?(i=u=(n=ZJ(l,c))[0],r=h=n[1]):(h=KJ(r||l,l),u=l):(u=KJ(i||c,c),h=c),o.push(u),a.push(h)}return[o,a]}(FJ(n),FJ(i)),o=r[0],a=r[1],s=t.getComputedTransform(),l=e.getComputedTransform();s&&oQ(o,s),l&&oQ(a,l),iQ(e,"updateTransform",{replace:function(){this.transform=null}}),e.transform=null;var c=function(t,e,n,i){for(var r,o=[],a=0;a<t.length;a++){var s=t[a],l=e[a],c=JJ(s),u=JJ(l);null==r&&(r=c[2]<0!=u[2]<0);var h=[],d=[],p=0,f=1/0,g=[],m=s.length;r&&(s=tQ(s));for(var y=6*QJ(s,l,c,u),v=m-2,_=0;_<v;_+=2){var x=(y+_)%v+2;h[_+2]=s[x]-c[0],h[_+3]=s[x+1]-c[1]}h[0]=s[y]-c[0],h[1]=s[y+1]-c[1];for(var b=i/10,w=-i/2;w<=i/2;w+=b){var S=Math.sin(w),M=Math.cos(w),C=0;for(_=0;_<s.length;_+=2){var T=h[_],I=h[_+1],D=l[_]-u[0],k=l[_+1]-u[1],A=D*M-k*S,E=D*S+k*M;g[_]=A,g[_+1]=E;var L=A-T,P=E-I;C+=L*L+P*P}if(C<f){f=C,p=w;for(var O=0;O<g.length;O++)d[O]=g[O]}}o.push({from:h,to:d,fromCp:c,toCp:u,rotation:-p})}return o}(o,a,0,Math.PI),u=[];iQ(e,"buildPath",{replace:function(t){for(var n=e.__morphT,i=1-n,r=[],o=0;o<c.length;o++){var a=c[o],s=a.from,l=a.to,h=a.rotation*n,d=a.fromCp,p=a.toCp,f=Math.sin(h),g=Math.cos(h);pl(r,d,p,n);for(var m=0;m<s.length;m+=2){var y=s[m],v=s[m+1],_=y*i+(S=l[m])*n,x=v*i+(M=l[m+1])*n;u[m]=_*g-x*f+r[0],u[m+1]=_*f+x*g+r[1]}var b=u[0],w=u[1];for(t.moveTo(b,w),m=2;m<s.length;){var S=u[m++],M=u[m++],C=u[m++],T=u[m++],I=u[m++],D=u[m++];b===S&&w===M&&C===I&&T===D?t.lineTo(I,D):t.bezierCurveTo(S,M,C,T,I,D),b=I,w=D}}}})}function sQ(t,e,n){if(!t||!e)return e;var i=n.done,r=n.during;return aQ(t,e),e.__morphT=0,e.animateTo({__morphT:1},Qa({during:function(t){e.dirtyShape(),r&&r(t)},done:function(){rQ(e,"buildPath"),rQ(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape(),i&&i()}},n)),e}function lQ(t,e,n,i,r,o){t=r===n?0:Math.round(32767*(t-n)/(r-n)),e=o===i?0:Math.round(32767*(e-i)/(o-i));for(var a,s=0,l=32768;l>0;l/=2){var c=0,u=0;(t&l)>0&&(c=1),(e&l)>0&&(u=1),s+=l*l*(3*c^u),0===u&&(1===c&&(t=l-1-t,e=l-1-e),a=t,t=e,e=a)}return s}function cQ(t){var e=1/0,n=1/0,i=-1/0,r=-1/0,o=as(t,function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),i=Math.max(s,i),r=Math.max(l,r),[s,l]});return as(o,function(o,a){return{cp:o,z:lQ(o[0],o[1],e,n,i,r),path:t[a]}}).sort(function(t,e){return t.z-e.z}).map(function(t){return t.path})}function uQ(t){return function(t,e){var n,i=[],r=t.shape;switch(t.type){case"rect":!function(t,e,n){for(var i=t.width,r=t.height,o=i>r,a=HJ([i,r],o?0:1,e),s=o?"width":"height",l=o?"height":"width",c=o?"x":"y",u=o?"y":"x",h=t[s]/a.length,d=0;d<a.length;d++)for(var p=t[l]/a[d],f=0;f<a[d];f++){var g={};g[c]=d*h,g[u]=f*p,g[s]=h,g[l]=p,g.x+=t.x,g.y+=t.y,n.push(g)}}(r,e,i),n=Pg;break;case"sector":jJ(r,e,i),n=Ew;break;case"circle":jJ({r0:0,r:r.r,startAngle:0,endAngle:2*Math.PI,cx:r.cx,cy:r.cy},e,i),n=Ew;break;default:var o=t.getComputedTransform(),a=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,s=as(function(t,e){var n=FJ(t),i=[];e=e||1;for(var r=0;r<n.length;r++){var o=n[r],a=[],s=o[0],l=o[1];a.push(s,l);for(var c=2;c<o.length;){var u=o[c++],h=o[c++],d=o[c++],p=o[c++],f=o[c++],g=o[c++];VJ(s,l,u,h,d,p,f,g,a,e),s=f,l=g}i.push(a)}return i}(t.getUpdatedPathProxy(),a),function(t){return function(t){for(var e=[],n=0;n<t.length;)e.push([t[n++],t[n++]]);return e}(t)}),l=s.length;if(0===l)XJ(YJ,{points:s[0]},e,i);else if(l===e)for(var c=0;c<l;c++)i.push({points:s[c]});else{var u=0,h=as(s,function(t){var e=[],n=[];Mf(t,e,n);var i=(n[1]-e[1])*(n[0]-e[0]);return u+=i,{poly:t,area:i}});h.sort(function(t,e){return e.area-t.area});var d=e;for(c=0;c<l;c++){var p=h[c];if(d<=0)break;var f=c===l-1?d:Math.ceil(p.area/u*e);f<0||(XJ(YJ,{points:p.poly},f,i),d-=f)}}n=zw}if(!n)return function(t,e){for(var n=[],i=0;i<e;i++)n.push(uw(t));return n}(t,e);var g=[];for(c=0;c<i.length;c++){var m=new n;m.setShape(i[c]),$J(t,m),g.push(m)}return g}(t.path,t.count)}function hQ(t){return ps(t[0])}function dQ(t,e){for(var n=[],i=t.length,r=0;r<i;r++)n.push({one:t[r],many:[]});for(r=0;r<e.length;r++){var o=e[r].length,a=void 0;for(a=0;a<o;a++)n[a%i].many.push(e[r][a])}var s=0;for(r=i-1;r>=0;r--)if(!n[r].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var c=Math.ceil(o/2);n[r].many=l.slice(c,o),n[s].many=l.slice(0,c),s++}return n}var pQ={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),i=0;i<t.count;i++){var r=uw(t.path);r.setStyle("opacity",n),e.push(r)}return e},split:null};function fQ(t,e,n,i,r,o){if(t.length&&e.length){var a=Zm("update",i,r);if(a&&a.duration>0){var s,l,c=i.getModel("universalTransition").get("delay"),u=Object.assign({setToFinal:!0},a);hQ(t)&&(s=t,l=e),hQ(e)&&(s=e,l=t);for(var h=s?s===t:t.length>e.length,d=s?dQ(l,s):dQ(h?e:t,[h?t:e]),p=0,f=0;f<d.length;f++)p+=d[f].many.length;var g=0;for(f=0;f<d.length;f++)m(d[f],h,g,p),g+=d[f].many.length}}function m(t,e,i,r,a){var s=t.many,l=t.one;if(1!==s.length||a)for(var h=Qa({dividePath:pQ[n],individualDelay:c&&function(t,e,n,o){return c(t+i,r)}},u),d=e?function(t,e,n){var i=[];!function t(e){for(var n=0;n<e.length;n++){var r=e[n];eQ(r)?t(r.childrenRef()):r instanceof vg&&i.push(r)}}(t);var r=i.length;if(!r)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(n.dividePath||uQ)({path:e,count:r});if(o.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};i=cQ(i),o=cQ(o);for(var a=n.done,s=n.during,l=n.individualDelay,c=new Kh,u=0;u<r;u++){var h=i[u],d=o[u];d.parent=e,d.copyTransform(c),l||aQ(h,d)}function p(t){for(var e=0;e<o.length;e++)o[e].addSelfToZr(t)}function f(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,rQ(e,"addSelfToZr"),rQ(e,"removeSelfFromZr")}e.__isCombineMorphing=!0,e.childrenRef=function(){return o},iQ(e,"addSelfToZr",{after:function(t){p(t)}}),iQ(e,"removeSelfFromZr",{after:function(t){for(var e=0;e<o.length;e++)o[e].removeSelfFromZr(t)}});var g=o.length;if(l){var m=g,y=function(){0===--m&&(f(),a&&a())};for(u=0;u<g;u++){var v=l?Qa({delay:(n.delay||0)+l(u,g,i[u],o[u]),done:y},n):n;sQ(i[u],o[u],v)}}else e.__morphT=0,e.animateTo({__morphT:1},Qa({during:function(t){for(var n=0;n<g;n++){var i=o[n];i.__morphT=e.__morphT,i.dirtyShape()}s&&s(t)},done:function(){f();for(var e=0;e<t.length;e++)rQ(t[e],"updateTransform");a&&a()}},n));return e.__zr&&p(e.__zr),{fromIndividuals:i,toIndividuals:o,count:g}}(s,l,h):function(t,e,n){var i=e.length,r=[],o=n.dividePath||uQ;if(eQ(t)){!function t(e){for(var n=0;n<e.length;n++){var i=e[n];eQ(i)?t(i.childrenRef()):i instanceof vg&&r.push(i)}}(t.childrenRef());var a=r.length;if(a<i)for(var s=0,l=a;l<i;l++)r.push(uw(r[s++%a]));r.length=i}else{r=o({path:t,count:i});var c=t.getComputedTransform();for(l=0;l<r.length;l++)r[l].setLocalTransform(c);if(r.length!==i)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}r=cQ(r),e=cQ(e);var u=n.individualDelay;for(l=0;l<i;l++){var h=u?Qa({delay:(n.delay||0)+u(l,i,r[l],e[l])},n):n;sQ(r[l],e[l],h)}return{fromIndividuals:r,toIndividuals:e,count:e.length}}(l,s,h),p=d.fromIndividuals,f=d.toIndividuals,g=p.length,y=0;y<g;y++)v=c?Qa({delay:c(y,g)},u):u,o(p[y],f[y],e?s[y]:t.one,e?t.one:s[y],v);else{var v,_=e?s[0]:l,x=e?l:s[0];eQ(_)?m({many:[_],one:x},!0,i,r,!0):(sQ(_,x,v=c?Qa({delay:c(i,r)},u):u),o(_,x,_,x,v))}}}function gQ(t){if(!t)return[];if(ps(t)){for(var e=[],n=0;n<t.length;n++)e.push(gQ(t[n]));return e}var i=[];return t.traverse(function(t){t instanceof vg&&!t.disableMorphing&&!t.invisible&&!t.ignore&&i.push(t)}),i}var mQ,yQ,vQ=xp();function _Q(t,e,n,i){var r=function(t,e){for(var n=t.dimensions,i=0;i<n.length;i++){var r=t.getDimensionInfo(n[i]);if(r&&0===r.otherDims[e])return n[i]}}(t,i?"itemChildGroupId":"itemGroupId");if(r){var o=function(t,e,n){var i=t.getDimensionInfo(n),r=i&&i.ordinalMeta;if(i){var o=t.get(i.name,e);return r&&r.categories[o]||o+""}}(t,e,r);return o}var a=t.getRawDataItem(e),s=i?"childGroupId":"groupId";return a&&a[s]?a[s]+"":i?void 0:n||t.getId(e)}function xQ(t){var e=[];return os(t,function(t){var n=t.data,i=t.dataGroupId;if(!(n.count()>1e4))for(var r=n.getIndices(),o=0;o<r.length;o++)e.push({data:n,groupId:_Q(n,o,i,!1),childGroupId:_Q(n,o,i,!0),divide:t.divide,dataIndex:o})}),e}function bQ(t,e,n){t.traverse(function(t){t instanceof vg&&Qm(t,{style:{opacity:0}},e,{dataIndex:n,isFrom:!0})})}function wQ(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function SQ(t){t.stopAnimation(),t.isGroup&&t.traverse(function(t){t.stopAnimation()})}function MQ(t,e,n){var i=xQ(t),r=xQ(e);function o(t,e,n,i,r){(n||t)&&e.animateFrom({style:n&&n!==t?Ja(Ja({},n.style),t.style):t.style},r)}var a=!1,s=0,l=Fs(),c=Fs();i.forEach(function(t){t.groupId&&l.set(t.groupId,!0),t.childGroupId&&c.set(t.childGroupId,!0)});for(var u=0;u<r.length;u++){var h=r[u].groupId;if(c.get(h)){s=1;break}var d=r[u].childGroupId;if(d&&l.get(d)){s=2;break}}function p(t,e){return function(n){var i=n.data,r=n.dataIndex;return e?i.getId(r):t?1===s?n.childGroupId:n.groupId:2===s?n.childGroupId:n.groupId}}var f=function(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++){var r=t[i],o=e[i];if(r.data.getId(r.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(i,r),g={};if(!f)for(u=0;u<r.length;u++){var m=r[u],y=m.data.getItemGraphicEl(m.dataIndex);y&&(g[y.id]=!0)}function v(t,e){var n=i[e],s=r[t],l=s.data.hostModel,c=n.data.getItemGraphicEl(n.dataIndex),u=s.data.getItemGraphicEl(s.dataIndex);c!==u?c&&g[c.id]||u&&(SQ(u),c?(SQ(c),wQ(c),a=!0,fQ(gQ(c),gQ(u),s.divide,l,t,o)):bQ(u,l,t)):u&&function(t,e,n){var i=Zm("update",n,e);i&&t.traverse(function(t){if(t instanceof gf){var e=function(t){return $m(t).oldStyle}(t);e&&t.animateFrom({style:e},i)}})}(u,s.dataIndex,l)}new CI(i,r,p(!0,f),p(!1,f),null,"multiple").update(v).updateManyToOne(function(t,e){var n=r[t],s=n.data,l=s.hostModel,c=s.getItemGraphicEl(n.dataIndex),u=ls(as(e,function(t){return i[t].data.getItemGraphicEl(i[t].dataIndex)}),function(t){return t&&t!==c&&!g[t.id]});c&&(SQ(c),u.length?(os(u,function(t){SQ(t),wQ(t)}),a=!0,fQ(gQ(u),gQ(c),n.divide,l,t,o)):bQ(c,l,n.dataIndex))}).updateOneToMany(function(t,e){var n=i[e],s=n.data.getItemGraphicEl(n.dataIndex);if(!s||!g[s.id]){var l=ls(as(t,function(t){return r[t].data.getItemGraphicEl(r[t].dataIndex)}),function(t){return t&&t!==s}),c=r[t[0]].data.hostModel;l.length&&(os(l,function(t){return SQ(t)}),s?(SQ(s),wQ(s),a=!0,fQ(gQ(s),gQ(l),n.divide,c,t[0],o)):os(l,function(e){return bQ(e,c,t[0])}))}}).updateManyToMany(function(t,e){new CI(e,t,function(t){return i[t].data.getId(i[t].dataIndex)},function(t){return r[t].data.getId(r[t].dataIndex)}).update(function(n,i){v(t[n],e[i])}).execute()}).execute(),a&&os(e,function(t){var e=t.data.hostModel,i=e&&n.getViewOfSeriesModel(e),r=Zm("update",e,0);i&&e.isAnimationEnabled()&&r&&r.duration>0&&i.group.traverse(function(t){t instanceof vg&&!t.animators.length&&t.animateFrom({style:{opacity:0}},r)})})}function CQ(t){return t.getModel("universalTransition").get("seriesKey")||t.id}function TQ(t){return ps(t)?t.sort().join(","):t}function IQ(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function DQ(t,e){for(var n=0;n<t.length;n++)if(null!=e.seriesIndex&&e.seriesIndex===t[n].seriesIndex||null!=e.seriesId&&e.seriesId===t[n].id)return n}bI([function(t){t.registerPainter("canvas",YA)}]),bI([function(t){t.registerPainter("svg",aL)}]),bI([function(t){t.registerChartView(jL),t.registerSeriesModel(sL),t.registerLayout(WL("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,qL("line"))},function(t){t.registerChartView(xP),t.registerSeriesModel($L),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,ds(OD,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,RD("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,qL("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)})})},function(t){t.registerChartView(OP),t.registerSeriesModel(FP),ZM("pie",t.registerAction),t.registerLayout(ds(CP,"pie")),t.registerProcessor(IP("pie")),t.registerProcessor({seriesType:"pie",reset:function(t,e){var n=t.getData();n.filterSelf(function(t){var e=n.mapDimension("value"),i=n.get(e,t);return!(ys(i)&&!isNaN(i)&&i<0)})}})},function(t){bI(GO),t.registerSeriesModel(VP),t.registerChartView(UP),t.registerLayout(WL("scatter"))},function(t){bI(uR),t.registerChartView(ZO),t.registerSeriesModel(JO),t.registerLayout(UO),t.registerProcessor(IP("radar")),t.registerPreprocessor(XO)},function(t){bI(UB),t.registerChartView(bB),t.registerSeriesModel(SB),t.registerLayout(CB),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,MB),ZM("map",t.registerAction)},function(t){t.registerChartView(uN),t.registerSeriesModel(DN),t.registerLayout(AN),t.registerVisual(EN),function(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var n=t.dataIndex,i=e.getData().tree.getNodeByDataIndex(n);i.isExpand=!i.isExpand})}),t.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(t,e,n){e.eachComponent({mainType:"series",subType:"tree",query:t},function(e){var i=HB(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)})})}(t)},function(t){t.registerSeriesModel(BN),t.registerChartView(QN),t.registerVisual(mz),t.registerLayout(kz),function(t){for(var e=0;e<LN.length;e++)t.registerAction({type:LN[e],update:"updateView"},Gs);t.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"treemap",query:t},function(e,n){var i=SN(t,["treemapZoomToNode","treemapRootToNode"],e);if(i){var r=e.getViewRoot();r&&(t.direction=CN(r,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}})})}(t)},function(t){t.registerChartView(OF),t.registerSeriesModel(WF),t.registerProcessor(Rz),t.registerVisual(Bz),t.registerVisual(zz),t.registerLayout(Xz),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,nF),t.registerLayout(rF),t.registerCoordinateSystem("graphView",{dimensions:kB.dimensions,create:oF}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},Gs),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},Gs),t.registerAction(GF,function(t,e,n){e.eachComponent({mainType:"series",query:t},function(e){var i=HB(e.coordinateSystem,t,void 0,n);e.setCenter&&e.setCenter(i.center),e.setZoom&&e.setZoom(i.zoom)})})},function(t){t.registerChartView(ZF),t.registerSeriesModel(KF)},function(t){t.registerChartView(tV),t.registerSeriesModel(nV),t.registerLayout(iV),t.registerProcessor(IP("funnel"))},function(t){bI(NH),t.registerChartView(uV),t.registerSeriesModel(dV),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,fV)},function(t){t.registerChartView(jH),t.registerSeriesModel(GH),t.registerLayout(UH),t.registerVisual(ij),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:"series",subType:"sankey",query:t},function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])})})},function(t){t.registerSeriesModel(aj),t.registerChartView(pj),t.registerLayout(gj),t.registerTransform(mj)},function(t){t.registerChartView(zj),t.registerSeriesModel(Vj),t.registerPreprocessor(Hj),t.registerVisual(Cj),t.registerLayout(Gj)},function(t){t.registerChartView($j),t.registerSeriesModel(Zj),t.registerLayout(WL("effectScatter"))},function(t){t.registerChartView(lW),t.registerSeriesModel(pW),t.registerLayout(sW),t.registerVisual(gW)},function(t){t.registerChartView(xW),t.registerSeriesModel(bW)},function(t){t.registerChartView(WW),t.registerSeriesModel(GW),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,ds(OD,"pictorialBar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,RD("pictorialBar"))},function(t){t.registerChartView(qW),t.registerSeriesModel(XW),t.registerLayout($W),t.registerProcessor(IP("themeRiver"))},function(t){t.registerChartView(nG),t.registerSeriesModel(rG),t.registerLayout(ds(aG,"sunburst")),t.registerProcessor(ds(IP,"sunburst")),t.registerVisual(lG),function(t){t.registerAction({type:QW,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,n){var i=SN(t,[QW],e);if(i){var r=e.getViewRoot();r&&(t.direction=CN(r,i.node)?"rollUp":"drillDown"),e.resetViewRoot(i.node)}})}),t.registerAction({type:tG,update:"none"},function(t,e,n){t=Ja({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e){var n=SN(t,[tG],e);n&&(t.dataIndex=n.node.dataIndex)}),n.dispatchAction(Ja(t,{type:"highlight"}))}),t.registerAction({type:"sunburstUnhighlight",update:"updateView"},function(t,e,n){t=Ja({},t),n.dispatchAction(Ja(t,{type:"downplay"}))})}(t)},function(t){t.registerChartView(QG),t.registerSeriesModel(dG)}]),bI(function(t){bI(GO),bI(iq)}),bI(function(t){bI(iq),LO.registerAxisPointerClass("PolarAxisPointer",aq),t.registerCoordinateSystem("polar",wq),t.registerComponentModel(sq),t.registerComponentView(Vq),QP(t,"angle",cq,zq),QP(t,"radius",uq,Fq),t.registerComponentView(kq),t.registerComponentView(Oq),t.registerLayout(ds(Nq,"bar"))}),bI(UB),bI(function(t){bI(iq),LO.registerAxisPointerClass("SingleAxisPointer",lY),t.registerComponentView(cY),t.registerComponentView(qq),t.registerComponentModel(Xq),QP(t,"single",Xq,Xq.defaultOption),t.registerCoordinateSystem("single",eY)}),bI(NH),bI(function(t){t.registerComponentModel(hY),t.registerComponentView(pY),t.registerCoordinateSystem("calendar",yY)}),bI(function(t){t.registerComponentModel(wY),t.registerComponentView(CY),t.registerPreprocessor(function(t){var e=t.graphic;ps(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])})}),bI(function(t){t.registerComponentModel(QY),t.registerComponentView(nX),KY("saveAsImage",rX),KY("magicType",cX),KY("dataView",mX),KY("dataZoom",jX),KY("restore",bX),bI(XY)}),bI(function(t){bI(iq),t.registerComponentModel(WX),t.registerComponentView(h$),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Gs),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Gs)}),bI(iq),bI(function(t){t.registerComponentView(A$),t.registerComponentModel(L$),t.registerPreprocessor(p$),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,C$),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},Gs),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},Gs),KY("brush",O$)}),bI(function(t){t.registerComponentModel(R$),t.registerComponentView(B$)}),bI(function(t){t.registerComponentModel(V$),t.registerComponentView($$),t.registerSubTypeDefaulter("timeline",function(){return"slider"}),function(t){t.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e,n){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.getPlayState()&&(i.setPlayState(!1),n.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),e.resetOption("timeline",{replaceMerge:i.get("replaceMerge",!0)}),Qa({currentIndex:i.option.currentIndex},t)}),t.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var n=e.getComponent("timeline");n&&null!=t.playState&&n.setPlayState(t.playState)})}(t),t.registerPreprocessor(Z$)}),bI(function(t){t.registerComponentModel(rZ),t.registerComponentView(yZ),t.registerPreprocessor(function(t){Q$(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}),bI(function(t){t.registerComponentModel(vZ),t.registerComponentView(CZ),t.registerPreprocessor(function(t){Q$(t.series,"markLine")&&(t.markLine=t.markLine||{})})}),bI(function(t){t.registerComponentModel(TZ),t.registerComponentView(RZ),t.registerPreprocessor(function(t){Q$(t.series,"markArea")&&(t.markArea=t.markArea||{})})}),bI(function(t){bI(ZZ),bI(rK)}),bI(function(t){bI(gK),bI(CK)}),bI(gK),bI(CK),bI(function(t){bI(cJ),bI(mJ)}),bI(cJ),bI(mJ),bI(function(t){t.registerPreprocessor(bJ),t.registerVisual(t.PRIORITY.VISUAL.ARIA,xJ)}),bI(function(t){t.registerTransform(PJ),t.registerTransform(OJ)}),bI(function(t){t.registerComponentModel(RJ),t.registerComponentView(BJ)}),bI(function(t){t.registerUpdateLifecycle("series:beforeupdate",function(t,e,n){os(lp(n.seriesTransition),function(t){os(lp(t.to),function(t){for(var e=n.updatedSeries,i=0;i<e.length;i++)(null!=t.seriesIndex&&t.seriesIndex===e[i].seriesIndex||null!=t.seriesId&&t.seriesId===e[i].id)&&(e[i][Lb]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(t,e,n){var i=vQ(e);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var r=n.seriesTransition;if(r)os(lp(r),function(t){!function(t,e,n,i){var r=[],o=[];os(lp(t.from),function(t){var n=DQ(e.oldSeries,t);n>=0&&r.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],divide:IQ(e.oldData[n]),groupIdDim:t.dimension})}),os(lp(t.to),function(t){var i=DQ(n.updatedSeries,t);if(i>=0){var r=n.updatedSeries[i].getData();o.push({dataGroupId:e.oldDataGroupIds[i],data:r,divide:IQ(r),groupIdDim:t.dimension})}}),r.length>0&&o.length>0&&MQ(r,o,i)}(t,i,n,e)});else{var o=function(t,e){var n=Fs(),i=Fs(),r=Fs();return os(t.oldSeries,function(e,n){var o=t.oldDataGroupIds[n],a=t.oldData[n],s=CQ(e),l=TQ(s);i.set(l,{dataGroupId:o,data:a}),ps(s)&&os(s,function(t){r.set(t,{key:l,dataGroupId:o,data:a})})}),os(e.updatedSeries,function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),o=t.getData(),a=CQ(t),s=TQ(a),l=i.get(s);if(l)n.set(s,{oldSeries:[{dataGroupId:l.dataGroupId,divide:IQ(l.data),data:l.data}],newSeries:[{dataGroupId:e,divide:IQ(o),data:o}]});else if(ps(a)){var c=[];os(a,function(t){var e=i.get(t);e.data&&c.push({dataGroupId:e.dataGroupId,divide:IQ(e.data),data:e.data})}),c.length&&n.set(s,{oldSeries:c,newSeries:[{dataGroupId:e,data:o,divide:IQ(o)}]})}else{var u=r.get(a);if(u){var h=n.get(u.key);h||(h={oldSeries:[{dataGroupId:u.dataGroupId,data:u.data,divide:IQ(u.data)}],newSeries:[]},n.set(u.key,h)),h.newSeries.push({dataGroupId:e,data:o,divide:IQ(o)})}}}}),n}(i,n);os(o.keys(),function(t){var n=o.get(t);MQ(n.oldSeries,n.newSeries,e)})}os(n.updatedSeries,function(t){t[Lb]&&(t[Lb]=!1)})}for(var a=t.getSeries(),s=i.oldSeries=[],l=i.oldDataGroupIds=[],c=i.oldData=[],u=0;u<a.length;u++){var h=a[u].getData();h.count()<1e4&&(s.push(a[u]),l.push(a[u].get("dataGroupId")),c.push(h))}})}),bI(FA),(yQ=mQ||(mQ={}))[yQ.Init=0]="Init",yQ[yQ.Loading=1]="Loading",yQ[yQ.Loaded=2]="Loaded",yQ[yQ.Rendered=3]="Rendered",yQ[yQ.Error=4]="Error";var kQ,AQ,EQ,LQ,PQ,OQ,RQ,BQ={},NQ=[],zQ=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function FQ(t,e){for(var n in e)t[n]=e[n];return t}function VQ(t){var e=t.parentNode;e&&e.removeChild(t)}function HQ(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++EQ:r};return null==r&&null!=AQ.vnode&&AQ.vnode(o),o}function jQ(t){return t.children}function WQ(t,e){this.props=t,this.context=e}function GQ(t,e){if(null==e)return t.__?GQ(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?GQ(t):null}function UQ(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return UQ(t)}}function qQ(t){(!t.__d&&(t.__d=!0)&&LQ.push(t)&&!YQ.__r++||PQ!==AQ.debounceRendering)&&((PQ=AQ.debounceRendering)||setTimeout)(YQ)}function YQ(){for(var t;YQ.__r=LQ.length;)t=LQ.sort(function(t,e){return t.__v.__b-e.__v.__b}),LQ=[],t.some(function(t){var e,n,i,r,o,a;t.__d&&(o=(r=(e=t).__v).__e,(a=e.__P)&&(n=[],(i=FQ({},r)).__v=r.__v+1,e0(a,r,i,e.__n,void 0!==a.ownerSVGElement,null!=r.__h?[o]:null,n,null==o?GQ(r):o,r.__h),n0(n,r),r.__e!=o&&UQ(r)))})}function XQ(t,e,n,i,r,o,a,s,l,c){var u,h,d,p,f,g,m,y=i&&i.__k||NQ,v=y.length;for(n.__k=[],u=0;u<e.length;u++)if(null!=(p=n.__k[u]=null==(p=e[u])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?HQ(null,p,null,null,p):Array.isArray(p)?HQ(jQ,{children:p},null,null,null):p.__b>0?HQ(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(d=y[u])||d&&p.key==d.key&&p.type===d.type)y[u]=void 0;else for(h=0;h<v;h++){if((d=y[h])&&p.key==d.key&&p.type===d.type){y[h]=void 0;break}d=null}e0(t,p,d=d||BQ,r,o,a,s,l,c),f=p.__e,(h=p.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,p),m.push(h,p.__c||f,p)),null!=f?(null==g&&(g=f),"function"==typeof p.type&&p.__k===d.__k?p.__d=l=$Q(p,l,t):l=ZQ(t,p,d,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=GQ(d))}for(n.__e=g,u=v;u--;)null!=y[u]&&o0(y[u],y[u]);if(m)for(u=0;u<m.length;u++)r0(m[u],m[++u],m[++u])}function $Q(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?$Q(i,e,n):ZQ(n,i,i,r,i.__e,e));return e}function ZQ(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function KQ(t,e,n){"-"===e[0]?t.setProperty(e,n):t[e]=null==n?"":"number"!=typeof n||zQ.test(e)?n:n+"px"}function JQ(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||KQ(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||KQ(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?t0:QQ,o):t.removeEventListener(e,o?t0:QQ,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&-1==e.indexOf("-")?t.removeAttribute(e):t.setAttribute(e,n))}}function QQ(t){this.l[t.type+!1](AQ.event?AQ.event(t):t)}function t0(t){this.l[t.type+!0](AQ.event?AQ.event(t):t)}function e0(t,e,n,i,r,o,a,s,l){var c,u,h,d,p,f,g,m,y,v,_,x,b,w,S,M=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=AQ.__b)&&c(e);try{t:if("function"==typeof M){if(m=e.props,y=(c=M.contextType)&&i[c.__c],v=c?y?y.props.value:c.__:i,n.__c?g=(u=e.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?e.__c=u=new M(m,v):(e.__c=u=new WQ(m,v),u.constructor=M,u.render=a0),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=v,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=FQ({},u.__s)),FQ(u.__s,M.getDerivedStateFromProps(m,u.__s))),d=u.props,p=u.state,h)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,v)||e.__v===n.__v){for(u.props=m,u.state=u.__s,e.__v!==n.__v&&(u.__d=!1),u.__v=e,e.__e=n.__e,e.__k=n.__k,e.__k.forEach(function(t){t&&(t.__=e)}),_=0;_<u._sb.length;_++)u.__h.push(u._sb[_]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,p,f)})}if(u.context=v,u.props=m,u.__v=e,u.__P=t,x=AQ.__r,b=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(e),c=u.render(u.props,u.state,u.context),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[]}else do{u.__d=!1,x&&x(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++b<25);u.state=u.__s,null!=u.getChildContext&&(i=FQ(FQ({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(d,p)),S=null!=c&&c.type===jQ&&null==c.key?c.props.children:c,XQ(t,Array.isArray(S)?S:[S],e,n,i,r,o,a,s,l),u.base=e.__e,e.__h=null,u.__h.length&&a.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=i0(n.__e,e,n,i,r,o,a,l);(c=AQ.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),AQ.__e(t,e,n)}}function n0(t,e){AQ.__c&&AQ.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){AQ.__e(t,e.__v)}})}function i0(t,e,n,i,r,o,a,s){var l,c,u,h=n.props,d=e.props,p=e.type,f=0;if("svg"===p&&(r=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){t=l,o[f]=null;break}if(null==t){if(null===p)return document.createTextNode(d);t=r?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,d.is&&d),o=null,s=!1}if(null===p)h===d||s&&t.data===d||(t.data=d);else{if(o=o&&kQ.call(t.childNodes),c=(h=n.props||BQ).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},f=0;f<t.attributes.length;f++)h[t.attributes[f].name]=t.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||JQ(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||JQ(t,o,e[o],n[o],i)}(t,d,h,r,s),u)e.__k=[];else if(f=e.props.children,XQ(t,Array.isArray(f)?f:[f],e,n,i,r&&"foreignObject"!==p,o,a,o?o[0]:n.__k&&GQ(n,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&VQ(o[f]);s||("value"in d&&void 0!==(f=d.value)&&(f!==t.value||"progress"===p&&!f||"option"===p&&f!==h.value)&&JQ(t,"value",f,h.value,!1),"checked"in d&&void 0!==(f=d.checked)&&f!==t.checked&&JQ(t,"checked",f,h.checked,!1))}return t}function r0(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){AQ.__e(t,n)}}function o0(t,e,n){var i,r;if(AQ.unmount&&AQ.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||r0(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){AQ.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&o0(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||VQ(t.__e),t.__=t.__e=t.__d=void 0}function a0(t,e,n){return this.constructor(t,n)}kQ=NQ.slice,AQ={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},EQ=0,WQ.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=FQ({},this.state),"function"==typeof t&&(t=t(FQ({},n),this.props)),t&&FQ(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),qQ(this))},WQ.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),qQ(this))},WQ.prototype.render=jQ,LQ=[],YQ.__r=0,OQ=0,function(t){t[t.Initiator=0]="Initiator",t[t.ServerFilter=1]="ServerFilter",t[t.ServerSort=2]="ServerSort",t[t.ServerLimit=3]="ServerLimit",t[t.Extractor=4]="Extractor",t[t.Transformer=5]="Transformer",t[t.Filter=6]="Filter",t[t.Sort=7]="Sort",t[t.Limit=8]="Limit"}(RQ||(RQ={}));var s0,l0,c0,u0=[],h0=[],d0=AQ.__b,p0=AQ.__r,f0=AQ.diffed,g0=AQ.__c,m0=AQ.unmount;function y0(){for(var t;t=u0.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(b0),t.__H.__h.forEach(w0),t.__H.__h=[]}catch(e){t.__H.__h=[],AQ.__e(e,t.__v)}}AQ.__b=function(t){s0=null,d0&&d0(t)},AQ.__r=function(t){p0&&p0(t);var e=(s0=t.__c).__H;e&&(l0===s0?(e.__h=[],s0.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=h0,t.__N=t.i=void 0})):(e.__h.forEach(b0),e.__h.forEach(w0),e.__h=[])),l0=s0},AQ.diffed=function(t){f0&&f0(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==u0.push(e)&&c0===AQ.requestAnimationFrame||((c0=AQ.requestAnimationFrame)||x0)(y0)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==h0&&(t.__=t.__V),t.i=void 0,t.__V=h0})),l0=s0=null},AQ.__c=function(t,e){e.some(function(t){try{t.__h.forEach(b0),t.__h=t.__h.filter(function(t){return!t.__||w0(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],AQ.__e(n,t.__v)}}),g0&&g0(t,e)},AQ.unmount=function(t){m0&&m0(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(t){try{b0(t)}catch(t){e=t}}),n.__H=void 0,e&&AQ.__e(e,n.__v))};var v0,_0="function"==typeof requestAnimationFrame;function x0(t){var e,n=function(){clearTimeout(i),_0&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);_0&&(e=requestAnimationFrame(n))}function b0(t){var e=s0,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),s0=e}function w0(t){var e=s0;t.__c=t.__(),s0=e}function S0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function M0(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S0(Object(n),!0).forEach(function(e){C0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S0(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function C0(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function I0(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function D0(){return{currentYear:(new Date).getFullYear(),currentMonth:(new Date).getMonth()+1,events:[],loading:!1,showAddModal:!1,selectedDate:null,newEvent:{title:"",description:"",event_type:"meeting",start_date:"",start_time:"",end_date:"",end_time:"",all_day:!1,location:"",color:"#3788d8",priority:"medium",status:"scheduled"},init(){const t=new URLSearchParams(window.location.search);this.currentYear=parseInt(t.get("year"))||this.currentYear,this.currentMonth=parseInt(t.get("month"))||this.currentMonth,this.loadEvents()},get monthNames(){return["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"]},get currentMonthName(){return"".concat(this.monthNames[this.currentMonth-1]," ").concat(this.currentYear)},get calendarDays(){const t=new Date(this.currentYear,this.currentMonth-1,1),e=(new Date(this.currentYear,this.currentMonth,0),new Date(t));e.setDate(e.getDate()-t.getDay());const n=[],i=new Date;for(let t=0;t<42;t++){const r=new Date(e);r.setDate(e.getDate()+t);const o=r.getDate(),a=r.getMonth()===this.currentMonth-1,s=r.toDateString()===i.toDateString(),l=r.toISOString().split("T")[0],c=this.getEventsForDate(l);n.push({date:r,dayNumber:o,isCurrentMonth:a,isToday:s,dateString:l,events:c})}return n},getEventsForDate(t){return this.events.filter(e=>e.start_date===t)},async loadEvents(){this.loading=!0;try{const t=new Date(this.currentYear,this.currentMonth-1,1).toISOString().split("T")[0],e=new Date(this.currentYear,this.currentMonth,0).toISOString().split("T")[0],n=await fetch("/api/crm/calendar/events?start=".concat(t,"&end=").concat(e));if(n.ok){const t=await n.json();this.events=t||[]}}catch(t){console.error("Erro ao carregar eventos:",t),this.showAlert("Erro ao carregar eventos","error")}finally{this.loading=!1}},previousMonth(){1===this.currentMonth?(this.currentMonth=12,this.currentYear--):this.currentMonth--,this.updateURL(),this.loadEvents()},nextMonth(){12===this.currentMonth?(this.currentMonth=1,this.currentYear++):this.currentMonth++,this.updateURL(),this.loadEvents()},goToToday(){const t=new Date;this.currentYear=t.getFullYear(),this.currentMonth=t.getMonth()+1,this.updateURL(),this.loadEvents()},changeView(t){let e;switch(t){case"month":default:e="/apps/crm/calendar";break;case"week":e="/apps/crm/calendar/week";break;case"day":e="/apps/crm/calendar/day"}window.location.href=e},updateURL(){const t=new URL(window.location);t.searchParams.set("year",this.currentYear),t.searchParams.set("month",this.currentMonth),window.history.pushState({},"",t)},showAddEventModal(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.selectedDate=t,t&&(this.newEvent.start_date=t),this.showAddModal=!0},async addEvent(){try{const t=await fetch("/api/crm/calendar/events",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.newEvent)});if(t.ok)this.showAlert("Evento criado com sucesso","success"),this.showAddModal=!1,this.resetNewEvent(),this.loadEvents();else{const e=await t.json();this.showAlert(e.message||"Erro ao criar evento","error")}}catch(t){console.error("Erro ao criar evento:",t),this.showAlert("Erro ao criar evento","error")}},resetNewEvent(){this.newEvent={title:"",description:"",event_type:"meeting",start_date:"",start_time:"",end_date:"",end_time:"",all_day:!1,location:"",color:"#3788d8",priority:"medium",status:"scheduled"}},showEventDetails(t){window.Swal?window.Swal.fire({title:t.title,html:'\n <div class="text-start">\n <p><strong>Descrição:</strong> '.concat(t.description||"N/A","</p>\n <p><strong>Tipo:</strong> ").concat(t.event_type,"</p>\n <p><strong>Data:</strong> ").concat(t.start_date,"</p>\n <p><strong>Hora:</strong> ").concat(t.start_time||"Todo o dia","</p>\n <p><strong>Local:</strong> ").concat(t.location||"N/A","</p>\n <p><strong>Prioridade:</strong> ").concat(t.priority,"</p>\n <p><strong>Status:</strong> ").concat(t.status,"</p>\n </div>\n "),icon:"info",confirmButtonText:"Editar",showCancelButton:!0,cancelButtonText:"Fechar",showDenyButton:!0,denyButtonText:"Eliminar"}).then(e=>{e.isConfirmed?this.editEvent(t.id):e.isDenied&&this.deleteEvent(t.id)}):alert("Evento: ".concat(t.title,"\nDescrição: ").concat(t.description||"N/A"))},showAlert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";window.Swal?window.Swal.fire({title:"success"===e?"Sucesso!":"Atenção",text:t,icon:e,confirmButtonText:"OK"}):alert(t)},getEventClass(t){const e=["calendar-event"];return"high"===t.priority?e.push("high-priority"):"medium"===t.priority?e.push("medium-priority"):"low"===t.priority&&e.push("low-priority"),e.join(" ")},async loadTodayEvents(){try{const t=await fetch("/api/crm/calendar/today");if(t.ok)return(await t.json()).events||[]}catch(t){console.error("Erro ao carregar eventos de hoje:",t)}return[]},async loadUpcomingEvents(){try{const t=await fetch("/api/crm/calendar/upcoming?limit=5");if(t.ok)return(await t.json()).events||[]}catch(t){console.error("Erro ao carregar eventos próximos:",t)}return[]},async deleteEvent(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/crm/calendar/events/".concat(t,"/delete"),{method:"POST"});if(e.ok)this.showAlert("Evento eliminado com sucesso","success"),this.loadEvents();else{const t=await e.json();this.showAlert(t.message||"Erro ao eliminar evento","error")}}catch(t){console.error("Erro ao eliminar evento:",t),this.showAlert("Erro ao eliminar evento","error")}},async editEvent(t){try{const e=await fetch("/api/crm/calendar/events/".concat(t));if(e.ok){const t=await e.json();this.newEvent=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T0(Object(n),!0).forEach(function(e){I0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T0(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t),this.showAddModal=!0}}catch(t){console.error("Erro ao carregar evento:",t),this.showAlert("Erro ao carregar evento","error")}}}}function k0(){return{searchQuery:"",usersList:[],channelsList:[],contactsList:[],selectedTab:"chats",selectedUser:null,selectedChannel:null,selectedContact:null,messages:[],messageInput:"",loadingMessages:!1,replyTo:null,showEmojiPicker:!1,showAttachment:!1,init(){console.log("=== CHAT COMPONENT INITIALIZED ==="),console.log("Chat component initialized"),this.loadUsers(),this.loadChannels(),this.loadContacts(),setTimeout(()=>{console.log("Chat state after init:",{usersList:this.usersList.length,channelsList:this.channelsList.length,contactsList:this.contactsList.length,selectedUser:this.selectedUser,messageInput:this.messageInput}),this.usersList.length>0&&!this.selectedUser&&(this.selectUser(this.usersList[0]),console.log("Auto-selected first user:",this.usersList[0]))},1e3)},selectTab(t){this.selectedTab=t},selectUser(t){this.selectedUser=t,this.selectedChannel=null,this.selectedContact=null,this.loadMessages(t.id,"user"),this.markAsRead(t.id)},selectChannel(t){this.selectedChannel=t,this.selectedUser=null,this.selectedContact=null,this.loadMessages(t.id,"channel")},selectContact(t){this.selectedContact=t,this.selectedUser=null,this.selectedChannel=null,this.loadMessages(t.id,"contact")},async fetchJsonSafe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{const n=await fetch(t,e),i=n.headers.get("content-type");if(i&&i.includes("application/json"))return await n.json();{const t=await n.text();return console.error("Resposta não JSON:",t),null}}catch(t){return console.error("Erro na requisição:",t),null}},async loadUsers(){try{const t=await this.fetchJsonSafe("/api/chat/users");t&&t.success&&t.data&&t.data.users?(this.usersList=t.data.users,console.log("Users loaded:",this.usersList)):console.error("Invalid users data:",t)}catch(t){console.error("Error loading users:",t)}},async loadChannels(){try{const t=await this.fetchJsonSafe("/api/chat/channels");t&&t.success&&t.data&&t.data.channels?(this.channelsList=t.data.channels,console.log("Channels loaded:",this.channelsList)):console.error("Invalid channels data:",t)}catch(t){console.error("Error loading channels:",t)}},async loadContacts(){try{const t=await this.fetchJsonSafe("/api/chat/contacts");t&&t.success&&t.data?(this.contactsList=t.data,console.log("Contacts loaded:",this.contactsList)):console.error("Invalid contacts data:",t)}catch(t){console.error("Error loading contacts:",t)}},async loadMessages(t,e){this.loadingMessages=!0;try{let n="";"user"===e?n="/api/chat/messages?userId=".concat(t):"channel"===e?n="/api/chat/messages?channelId=".concat(t):"contact"===e&&(n="/api/chat/messages?contactId=".concat(t));const i=await this.fetchJsonSafe(n);i&&i.success&&i.data?(this.messages=i.data,console.log("Messages loaded:",this.messages)):(this.messages=[],console.error("Invalid messages data:",i))}catch(t){console.error("Error loading messages:",t),this.messages=[]}finally{this.loadingMessages=!1,this.$nextTick(()=>this.scrollToBottom())}},async sendMessage(){if(console.log("sendMessage() called"),console.log("messageInput:",this.messageInput),console.log("selectedUser:",this.selectedUser),this.messageInput.trim()&&this.selectedUser)try{const t={message:this.messageInput,to_id:this.selectedUser.id,from_id:1,reply_to:this.replyTo?this.replyTo.id:null};console.log("Sending message data:",t);const e=await this.fetchJsonSafe("/api/chat/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});console.log("Response from server:",e),e&&e.success&&e.data?(this.messages.push(e.data),this.messageInput="",this.replyTo=null,this.$nextTick(()=>this.scrollToBottom()),console.log("Message sent successfully")):console.error("Failed to send message:",e)}catch(t){console.error("Error sending message:",t)}else console.log("Cannot send message: empty input or no user selected")},scrollToBottom(){const t=document.getElementById("chatMessages");t&&(t.scrollTop=t.scrollHeight)},filteredUsers(){if(!this.searchQuery.trim())return this.usersList;const t=this.searchQuery.toLowerCase();return this.usersList.filter(e=>e.name.toLowerCase().includes(t))},filteredChannels(){if(!this.searchQuery.trim())return this.channelsList;const t=this.searchQuery.toLowerCase();return this.channelsList.filter(e=>e.name.toLowerCase().includes(t))},filteredContacts(){if(!this.searchQuery.trim())return this.contactsList;const t=this.searchQuery.toLowerCase();return this.contactsList.filter(e=>e.name.toLowerCase().includes(t))},isActiveUser(t){return this.selectedUser&&this.selectedUser.id===t.id},isActiveChannel(t){return this.selectedChannel&&this.selectedChannel.id===t.id},isActiveContact(t){return this.selectedContact&&this.selectedContact.id===t.id},markAsRead(t){const e=this.usersList.find(e=>e.id===t);e&&(e.messagecount=0)},setReply(t){this.replyTo=t},cancelReply(){this.replyTo=null},async deleteMessage(t){try{const e=await this.fetchJsonSafe("/api/chat/messages?messageId=".concat(t.id),{method:"DELETE"});e&&e.success?(this.messages=this.messages.filter(e=>e.id!==t.id),console.log("Message deleted successfully")):console.error("Failed to delete message:",e)}catch(t){console.error("Error deleting message:",t)}},toggleEmojiPicker(){this.showEmojiPicker=!this.showEmojiPicker},addEmoji(t){this.messageInput+=t,this.showEmojiPicker=!1},toggleAttachment(){this.showAttachment=!this.showAttachment},addAttachment(t){this.showAttachment=!1,console.log("File attachment:",t)},isOwnMessage:t=>t.is_from_me,isReply:t=>!!t.reply_to,getReplyMessage(t){return t.reply_to?this.messages.find(e=>e.id===t.reply_to):null},getStatusClass:t=>"online"===t?"bg-success":"away"===t?"bg-warning":"bg-secondary"}}function A0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function E0(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?A0(Object(n),!0).forEach(function(e){L0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A0(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L0(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P0(t){if(!t||"string"!=typeof t)return!1;const e=t.toUpperCase();return["ECO","KCO","REF","KEF","BPC","SOPT","SYS","REC","KSP"].some(t=>e.startsWith(t))}function O0(t){try{if(!t||""===t||"string"==typeof t&&/^\d+$/.test(t)&&0===parseInt(t))return!1;if(P0(t))return!0;if(!/^\d+$/.test(t))return!1;const e=t.length;if(8===e){const e=t.split("").map(t=>parseInt(t)),n=e[1]+e[3]+e[5];return(10-(3*(e[0]+e[2]+e[4]+e[6])+n)%10)%10===e[7]}if(13===e){const e=t.split("").map(t=>parseInt(t)),n=3*(e[1]+e[3]+e[5]+e[7]+e[9]+e[11])+(e[0]+e[2]+e[4]+e[6]+e[8]+e[10]);return 10*Math.ceil(n/10)-n===e[12]}return!1}catch(t){return!1}}new(function(){function t(){}var e=t.prototype;return e.format=function(t,e){return"[Grid.js] ["+e.toUpperCase()+"]: "+t},e.error=function(t,e){void 0===e&&(e=!1);var n=this.format(t,"error");if(e)throw Error(n);console.error(n)},e.warn=function(t){console.warn(this.format(t,"warn"))},e.info=function(t){console.info(this.format(t,"info"))},t}()),function(t){t[t.Header=0]="Header",t[t.Footer=1]="Footer",t[t.Cell=2]="Cell"}(v0||(v0={})),"undefined"!=typeof Symbol&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator"))),function(t,e){var n={__c:e="__cC"+OQ++,__:null,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some(qQ)},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};n.Provider.__=n.Consumer.contextType=n}(),n(2803),n(1989),n(7495),n(5440),n(2762),n(9463),n(2953),n(3296),n(7208),n(8408),n(6910),n(1396);const R0=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{isValidEAN:O0,isSystemEAN:P0,products:[],filters:{},pagination:{page:1,limit:20,total:0,pages:0,start:0,end:0,showing:0},loading:!1,searchTerm:"",searchDebounce:null,showSuggestions:!1,selectedTab:"all",sorting:{column:"last_update",direction:"DESC"},filterOptions:{families:[],brands:[],suppliers:[]},priceRange:{min:0,max:1e3},priceMinValue:"",priceMaxValue:"",stockFilter:{active:!1,minimumValue:1},viewMode:"list",currentPage:1,totalProducts:0,totalPages:0,limit:20,suggestions:{brands:[],families:[],suppliers:[],eans:[]},suggestionsLoading:!1,suggestionsQuery:"",onlySelected:!1,initialEAN:t.initialEAN||"",initialOnlySelected:t.initialOnlySelected||!1,brandSearch:"",supplierSearch:"",categorySearch:"",counters:{total:0,published:0},openBrands:!1,openSuppliers:!1,openCategories:!1,init(){this.loadUserPreferences(),this.processUrlParameters(),this.initialEAN&&/^\d{6,}$/.test(this.initialEAN)&&(this.filters.search=this.initialEAN,this.searchTerm=this.initialEAN),this.onlySelected=this.initialOnlySelected,this.loadFilters(),this.loadProducts(),this.loadPriceRange(),this.$nextTick(()=>{}),this.$root.addEventListener("apply-family-filter",t=>{this.applyFamilyFilter(t.detail)}),this.$nextTick(()=>{this.initializeTooltips()})},processUrlParameters(){const t=new URLSearchParams(window.location.search),e=t.get("ean");if(e){console.log("🔍 EAN detectado na URL:",e),this.searchTerm=e,this.filters.search=e;const t=this.isValidEAN(e),n=/^\d{6,}$/.test(e);t?(this.suggestions.eans=[{ean:e,name:"EAN válido",display:e+" - EAN válido"}],console.log("✅ EAN válido detectado na URL:",e)):n?(this.suggestions.eans=[{ean:e,name:"EAN parcial",display:e+" - EAN parcial"}],console.log("⚠️ EAN parcial detectado na URL:",e)):console.log("🔍 Termo de pesquisa detectado na URL:",e)}const n=t.get("search");n&&!e&&(console.log("🔍 Termo de pesquisa detectado na URL:",n),this.searchTerm=n,this.filters.search=n);const i=t.get("page");i&&(this.pagination.page=parseInt(i),console.log("📄 Página detectada na URL:",i));const r=t.get("limit");r&&(this.pagination.limit=parseInt(r),console.log("📊 Limite detectado na URL:",r));const o=t.get("sort");o&&(this.sorting.column=o,console.log("🔄 Ordenação detectada na URL:",o));const a=t.get("order");a&&(this.sorting.direction=a,console.log("📈 Direção detectada na URL:",a));const s=t.getAll("family_id[]");s.length>0&&(this.filters.family_id=s.map(t=>parseInt(t)),console.log("🏷️ Categorias detectadas na URL:",s));const l=t.getAll("family_id_op[]");l.length>0&&(this.filters.family_id_op=l.map(t=>parseInt(t)),console.log("🏷️ Categorias OP detectadas na URL:",l));const c=t.getAll("brand_id[]");c.length>0&&(this.filters.brand_id=c.map(t=>parseInt(t)),console.log("🏭 Marcas detectadas na URL:",c));const u=t.getAll("supplier_id[]");u.length>0&&(this.filters.supplier_id=u.map(t=>parseInt(t)),console.log("🚚 Fornecedores detectados na URL:",u));const h=t.get("price_min");h&&(this.filters.price_min=parseFloat(h),console.log("💰 Preço mínimo detectado na URL:",h));const d=t.get("price_max");d&&(this.filters.price_max=parseFloat(d),console.log("💰 Preço máximo detectado na URL:",d));const p=t.get("stock_min");p&&(this.filters.stock_min=parseInt(p),this.stockFilter.active=!0,this.stockFilter.minimumValue=parseInt(p),console.log("📦 Stock mínimo detectado na URL:",p));const f=t.get("published_wdmi");f&&(this.filters.published_wdmi=f,console.log("🌐 Publicado WDMI detectado na URL:",f));const g=t.get("published_op24");g&&(this.filters.published_op24=g,console.log("🌐 Publicado OP24 detectado na URL:",g));const m=t.get("with_images");m&&(this.filters.with_images=m,console.log("🖼️ Com imagens detectado na URL:",m));const y=t.get("without_images");y&&(this.filters.without_images=y,console.log("🖼️ Sem imagens detectado na URL:",y)),"1"===t.get("onlySelected")&&(this.onlySelected=!0,console.log("✅ Só selecionados detectado na URL"));const v=t.get("tab");v&&(this.selectedTab=v,console.log("📑 Tab detectada na URL:",v))},updateUrlWithoutRefresh(){const t=new URL(window.location),e=new URLSearchParams;this.searchTerm&&(this.isValidEAN(this.searchTerm)?e.set("ean",this.searchTerm):e.set("search",this.searchTerm)),this.pagination.page>1&&e.set("page",this.pagination.page),20!==this.pagination.limit&&e.set("limit",this.pagination.limit),"last_update"!==this.sorting.column&&e.set("sort",this.sorting.column),"DESC"!==this.sorting.direction&&e.set("order",this.sorting.direction),this.filters.family_id&&this.filters.family_id.length>0&&this.filters.family_id.forEach(t=>e.append("family_id[]",t)),this.filters.family_id_op&&this.filters.family_id_op.length>0&&this.filters.family_id_op.forEach(t=>e.append("family_id_op[]",t)),this.filters.brand_id&&this.filters.brand_id.length>0&&this.filters.brand_id.forEach(t=>e.append("brand_id[]",t)),this.filters.supplier_id&&this.filters.supplier_id.length>0&&this.filters.supplier_id.forEach(t=>e.append("supplier_id[]",t)),this.filters.price_min&&e.set("price_min",this.filters.price_min),this.filters.price_max&&e.set("price_max",this.filters.price_max),this.filters.stock_min&&e.set("stock_min",this.filters.stock_min),this.filters.published_wdmi&&e.set("published_wdmi",this.filters.published_wdmi),this.filters.published_op24&&e.set("published_op24",this.filters.published_op24),this.filters.with_images&&e.set("with_images",this.filters.with_images),this.filters.without_images&&e.set("without_images",this.filters.without_images),this.onlySelected&&e.set("onlySelected","1");const n=e.toString()?"".concat(t.pathname,"?").concat(e.toString()):t.pathname;window.history.pushState({},"",n),console.log("🔗 URL atualizada:",n)},getRowClass:t=>t.supplier_name&&t.supplier_name.toLowerCase().includes("wdmi")?"table-danger":1===t.is_selected||"1"===t.is_selected?"table-success":1===t.is_alternative||"1"===t.is_alternative?"table-warning":"",getProductTooltip(t){let e='<div class="text-start">';if(t.price_wdmi&&parseFloat(t.price_wdmi)!==parseFloat(t.price)&&(e+='<strong>Preço WDMI:</strong> <span class="text-success fw-bold">'.concat(parseFloat(t.price_wdmi).toFixed(2),"€</span><br>")),t.price_op24&&parseFloat(t.price_op24)!==parseFloat(t.price)&&(e+='<strong>Preço OP24:</strong> <span class="text-primary fw-bold">'.concat(parseFloat(t.price_op24).toFixed(2),"€</span><br>")),t.tax&&parseFloat(t.tax)>0&&(e+='<strong>Taxa WDMI:</strong> <span class="text-info">+'.concat(parseFloat(t.tax).toFixed(2),"€</span><br>")),t.alternative_tax&&parseFloat(t.alternative_tax)>0&&(e+='<strong>Taxa OP24:</strong> <span class="text-info">+'.concat(parseFloat(t.alternative_tax).toFixed(2),"€</span><br>")),t.price&&t.price_wdmi){const n=parseFloat(t.price),i=(parseFloat(t.price_wdmi)-n)/n*100;i>0&&(e+='<strong>Margem WDMI:</strong> <span class="'.concat(i>20?"text-success":i>10?"text-warning":"text-danger",'">').concat(i.toFixed(1),"%</span><br>"))}if(t.price&&t.price_op24){const n=parseFloat(t.price),i=(parseFloat(t.price_op24)-n)/n*100;i>0&&(e+='<strong>Margem OP24:</strong> <span class="'.concat(i>20?"text-success":i>10?"text-warning":"text-danger",'">').concat(i.toFixed(1),"%</span>"))}return e+="</div>",e},initializeTooltips(){"undefined"!=typeof bootstrap&&bootstrap.Tooltip?setTimeout(()=>{document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(t=>{const e=bootstrap.Tooltip.getInstance(t);e&&e.dispose()});const t=document.querySelectorAll('[data-bs-toggle="tooltip"]');console.log("🔍 Encontrados ".concat(t.length,' elementos com data-bs-toggle="tooltip"'));const e=[...t].map(t=>{try{return new bootstrap.Tooltip(t,{trigger:"hover",placement:"top",html:!0,delay:{show:300,hide:100}})}catch(t){return console.error("❌ Erro ao inicializar tooltip:",t),null}}).filter(t=>null!==t);console.log("🔧 ".concat(e.length," tooltips inicializados com sucesso"))},100):console.warn("⚠️ Bootstrap Tooltip não está disponível")},isBestProduct:t=>1===t.is_selected||"1"===t.is_selected,isSecondBestProduct:(t,e)=>1===t.is_alternative||"1"===t.is_alternative,async loadFilters(){try{const t=await fetch("/api/ecommerce/filter-options"),e=await t.json();e.success&&e.data?(this.filterOptions={families:this.buildFamilyTree(e.data.families||[]),brands:e.data.brands||[],suppliers:e.data.suppliers||[]},this.filterOptions.brands=this.filterOptions.brands.filter(t=>t&&t.brand_id),this.filterOptions.suppliers=this.filterOptions.suppliers.filter(t=>t&&t.supplier_id),console.log("Filter options loaded (tree):",this.filterOptions.families)):(console.error("Erro ao carregar filtros:",e),this.filterOptions={families:[],brands:[],suppliers:[]})}catch(t){console.error("Error loading filters:",t),this.filterOptions={families:[],brands:[],suppliers:[]}}},async loadProducts(){this.loading=!0;try{const t=new URLSearchParams({page:this.pagination.page,limit:this.pagination.limit,sort:this.sorting.column,order:this.sorting.direction});this.filters.search&&t.append("search",this.filters.search),Array.isArray(this.filters.family_id)?this.filters.family_id.forEach(e=>t.append("family_id[]",e)):this.filters.family_id&&t.append("family_id[]",this.filters.family_id),Array.isArray(this.filters.family_id_op)?this.filters.family_id_op.forEach(e=>t.append("family_id_op[]",e)):this.filters.family_id_op&&t.append("family_id_op[]",this.filters.family_id_op),Array.isArray(this.filters.brand_id)?this.filters.brand_id.forEach(e=>t.append("brand_id[]",e)):this.filters.brand_id&&t.append("brand_id[]",this.filters.brand_id),Array.isArray(this.filters.supplier_id)?this.filters.supplier_id.forEach(e=>t.append("supplier_id[]",e)):this.filters.supplier_id&&t.append("supplier_id[]",this.filters.supplier_id),this.filters.stock_min&&t.append("stock_min",this.filters.stock_min),this.filters.price_min&&t.append("price_min",this.filters.price_min),this.filters.price_max&&t.append("price_max",this.filters.price_max),this.filters.published_wdmi&&t.append("published_wdmi",this.filters.published_wdmi),this.filters.published_op24&&t.append("published_op24",this.filters.published_op24),this.onlySelected&&t.append("onlySelected",1);const e=await fetch("/api/ecommerce/products?".concat(t.toString())),n=await e.json();console.log("[DEBUG] API response",n),n.success&&(this.products=n.data,this.pagination=n.pagination,this.currentPage=this.pagination.page,this.totalProducts=this.pagination.total,this.totalPages=this.pagination.pages,this.limit=this.pagination.limit,n.meta&&n.meta.counters&&(this.counters={total:n.meta.counters.total||0,published:n.meta.counters.published||0,published_wdmi:n.meta.counters.published_wdmi||0,published_op24:n.meta.counters.published_op24||0},console.log("📊 Counters updated from API response:",this.counters)),console.log("[DEBUG] Produtos recebidos:",this.products),console.log("[DEBUG] Paginação recebida:",this.pagination),this.renderPagination(),this.$nextTick(()=>{this.initializeTooltips()}))}catch(t){console.error("Error loading products:",t)}finally{this.loading=!1}},async loadPriceRange(){try{const t=new URLSearchParams;this.filters.search&&t.append("search",this.filters.search),Array.isArray(this.filters.family_id)?this.filters.family_id.forEach(e=>t.append("family_id[]",e)):this.filters.family_id&&t.append("family_id[]",this.filters.family_id),Array.isArray(this.filters.family_id_op)?this.filters.family_id_op.forEach(e=>t.append("family_id_op[]",e)):this.filters.family_id_op&&t.append("family_id_op[]",this.filters.family_id_op),Array.isArray(this.filters.brand_id)?this.filters.brand_id.forEach(e=>t.append("brand_id[]",e)):this.filters.brand_id&&t.append("brand_id[]",this.filters.brand_id),Array.isArray(this.filters.supplier_id)?this.filters.supplier_id.forEach(e=>t.append("supplier_id[]",e)):this.filters.supplier_id&&t.append("supplier_id[]",this.filters.supplier_id),this.filters.stock_min&&t.append("stock_min",this.filters.stock_min),this.filters.published_wdmi&&t.append("published_wdmi",this.filters.published_wdmi),this.filters.published_op24&&t.append("published_op24",this.filters.published_op24),this.onlySelected&&t.append("onlySelected",1);const e=await fetch("/api/ecommerce/products/price-range?".concat(t.toString())),n=await e.json();n.success&&n.data&&(this.priceRange={min:n.data.min||0,max:n.data.max||1e3},void 0!==this.filters.price_min&&(this.priceMinValue=Number(this.filters.price_min)),void 0!==this.filters.price_max&&(this.priceMaxValue=Number(this.filters.price_max)))}catch(t){console.error("Error loading price range:",t)}},updatePriceRange(){this.loadPriceRange()},renderPagination(){const t=document.getElementById("pagination-container");if(!t)return;const{page:e,pages:n}=this.pagination;if(n<=1)return void(t.innerHTML="");const i=this.getVisiblePages();let r='<nav><ul class="pagination justify-content-center">';r+='<li class="page-item'.concat(1===e?" disabled":"",'"><a class="page-link" href="#" data-page="prev">&laquo;</a></li>'),i[0]>1&&(r+='<li class="page-item"><a class="page-link" href="#" data-page="1">1</a></li>',i[0]>2&&(r+='<li class="page-item disabled"><span class="page-link">...</span></li>')),i.forEach(t=>{r+='<li class="page-item'.concat(t===e?" active":"",'"><a class="page-link" href="#" data-page="').concat(t,'">').concat(t,"</a></li>")}),i[i.length-1]<n&&(i[i.length-1]<n-1&&(r+='<li class="page-item disabled"><span class="page-link">...</span></li>'),r+='<li class="page-item"><a class="page-link" href="#" data-page="'.concat(n,'">').concat(n,"</a></li>")),r+='<li class="page-item'.concat(e===n?" disabled":"",'"><a class="page-link" href="#" data-page="next">&raquo;</a></li>'),r+="</ul></nav>",t.innerHTML=r,t.querySelectorAll("a.page-link[data-page]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault();const r=t.getAttribute("data-page");"prev"===r&&e>1?this.goToPage(e-1):"next"===r&&e<n?this.goToPage(e+1):isNaN(parseInt(r))||this.goToPage(parseInt(r))})})},applyFilter(t,e,n){["brand_id","family_id","supplier_id"].includes(t)?(Array.isArray(this.filters[t])||(this.filters[t]=[]),n?this.filters[t].includes(e)||this.filters[t].push(e):(this.filters[t]=this.filters[t].filter(t=>t!==e),0===this.filters[t].length&&delete this.filters[t])):e?this.filters[t]=e:delete this.filters[t],this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},clearFilters(){this.filters={},this.searchTerm="",this.pagination.page=1,this.onlySelected=!1,this.selectedTab="all",this.priceMinValue="",this.priceMaxValue="",this.stockFilter.active=!1,this.stockFilter.minimumValue=1,this.sorting.column="last_update",this.sorting.direction="DESC",this.$nextTick(()=>{document.querySelectorAll(".form-check-input[type=checkbox][name^=brand_id], .form-check-input[type=checkbox][name^=family_id], .form-check-input[type=checkbox][name^=supplier_id], #published_wdmi, #published_op24, #with_images, #without_images").forEach(t=>{t.checked=!1})}),this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh(),console.log("🧹 Todos os filtros limpos - URL atualizada")},async searchProducts(){if(this.searchTerm){this.filters={search:this.searchTerm};const t=this.searchTerm.toLowerCase();this.suggestions={brands:(this.filterOptions.brands||[]).filter(e=>e.brand_name&&e.brand_name.toLowerCase().includes(t)),families:this.flattenFamilies(this.filterOptions.families||[]).filter(e=>e.name&&e.name.toLowerCase().includes(t)),suppliers:(this.filterOptions.suppliers||[]).filter(e=>e.supplier_display_name&&e.supplier_display_name.toLowerCase().includes(t)),eans:[]},this.isValidEAN(this.searchTerm)&&(this.suggestions.eans=[{ean:this.searchTerm,name:"EAN válido",display:this.searchTerm+" - EAN válido"}]),this.showSuggestions=this.suggestions.brands.length+this.suggestions.families.length+this.suggestions.suppliers.length+this.suggestions.eans.length>0}else this.filters={},this.showSuggestions=!1;this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},clearSearch(){this.searchTerm="",this.filters={},this.showSuggestions=!1,this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},nextPage(){this.pagination.hasNext&&(this.pagination.page++,this.loadProducts())},prevPage(){this.pagination.hasPrev&&(this.pagination.page--,this.loadProducts())},goToPage(t){this.pagination.page=t,this.loadProducts(),this.updateUrlWithoutRefresh()},getVisiblePages(){const t=this.pagination.page,e=this.pagination.pages;let n=Math.max(1,t-2),i=Math.min(e,t+2);return i-n<4&&(1===n?i=Math.min(e,n+4):n=Math.max(1,i-4)),Array.from({length:i-n+1},(t,e)=>n+e)},changeLimit(t){this.pagination.limit=parseInt(t),this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh(),this.saveUserPreferences(),console.log("📊 Limite alterado para:",t)},editProduct(t){console.log("Edit product:",t)},deleteProduct(t){console.log("Delete product:",t)},switchTab(t){this.selectedTab=t;const e=this.filters.search;switch(this.filters={},e&&(this.filters.search=e),this.onlySelected=!1,t){case"all":break;case"selected":this.onlySelected=!0;break;case"published":this.filters.published_wdmi="1"}this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh()},viewProduct(t){t.id?window.open("/apps/ecommerce/products/details/".concat(t.id),"_blank"):this.showProductDetailsModal(t)},showProductDetailsModal(t){const e='\n <div class="modal fade" id="productDetailsModal" tabindex="-1">\n <div class="modal-dialog modal-lg">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title">Detalhes do Produto</h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal"></button>\n </div>\n <div class="modal-body">\n <div class="row">\n <div class="col-md-6">\n <p><strong>EAN:</strong> '.concat(t.ean||"N/A","</p>\n <p><strong>Nome:</strong> ").concat(t.name||"N/A","</p>\n <p><strong>Marca:</strong> ").concat(t.brand_name||"N/A","</p>\n <p><strong>Fornecedor:</strong> ").concat(t.supplier_name||"N/A",'</p>\n </div>\n <div class="col-md-6">\n <p><strong>Preço:</strong> €').concat(t.price||"0.00","</p>\n <p><strong>Preço c/IVA:</strong> €").concat(t.price_with_vat||"0.00","</p>\n <p><strong>Stock:</strong> ").concat(t.stock||0,"</p>\n <p><strong>Status:</strong> \n ").concat(t.is_selected?'<span class="badge bg-success">Selecionado</span>':'<span class="badge bg-secondary">Não selecionado</span>',"\n ").concat(t.published_wdmi?'<span class="badge bg-success ms-1">WDMI</span>':"","\n ").concat(t.published_op24?'<span class="badge bg-primary ms-1">OP24</span>':"",'\n </p>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fechar</button>\n <button type="button" class="btn btn-primary" onclick="window.open(\'/apps/ecommerce/products/details/').concat(t.ean,"', '_blank')\">Ver Página Completa</button>\n </div>\n </div>\n </div>\n </div>\n "),n=document.getElementById("productDetailsModal");n&&n.remove(),document.body.insertAdjacentHTML("beforeend",e),new bootstrap.Modal(document.getElementById("productDetailsModal")).show(),document.getElementById("productDetailsModal").addEventListener("hidden.bs.modal",function(){this.remove()})},async onSearchInput(t){const e=t.target.value;if(this.suggestionsQuery=e,this.searchDebounce&&clearTimeout(this.searchDebounce),!e)return this.suggestions={brands:[],families:[],suppliers:[],eans:[]},this.showSuggestions=!1,this.filters={},this.pagination.page=1,void this.loadProducts();const n=O0(e),i=/^\d{6,}$/.test(e),r=e.toLowerCase();if(this.suggestions={brands:(this.filterOptions.brands||[]).filter(t=>t.brand_name&&t.brand_name.toLowerCase().includes(r)),families:this.flattenFamilies(this.filterOptions.families||[]).filter(t=>t.name&&t.name.toLowerCase().includes(r)),suppliers:(this.filterOptions.suppliers||[]).filter(t=>t.supplier_display_name&&t.supplier_display_name.toLowerCase().includes(r)),eans:[]},n)this.suggestions.eans=[{ean:e,name:"EAN válido",display:e+" - EAN válido"}],this.showSuggestions=!1;else if(i){this.suggestionsLoading=!0;try{const t=await fetch("/api/ecommerce/search-hints?q=".concat(encodeURIComponent(e))),n=await t.json();n.success&&n.eans&&(this.suggestions.eans=n.eans)}catch(t){console.error("Erro ao buscar EANs similares:",t)}this.suggestionsLoading=!1}this.showSuggestions=this.suggestions.brands.length+this.suggestions.families.length+this.suggestions.suppliers.length+this.suggestions.eans.length>0,this.searchDebounce=setTimeout(()=>{let t="termo";n?t="EAN válido":i&&(t="EAN parcial"),console.log("🔍 Auto-searching for: ".concat(e," (").concat(t,")")),this.filters={search:e},this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},500)},selectSuggestion(t,e){if("brand"===t)this.filters.brand_id||(this.filters.brand_id=[]),this.filters.brand_id.includes(e.brand_id)||this.filters.brand_id.push(e.brand_id),this.searchTerm="";else if("family"===t){const t=function(e,n){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(const r of e){if([...i,r.name].join(" -> ")===n)return r;if(r.children&&r.children.length){const e=t(r.children,n,[...i,r.name]);if(e)return e}}return null},n=t(this.filterOptions.families,e.breadcrumb);if(console.log("DEBUG: Nó encontrado para autocomplete:",n),n)if(console.log("DEBUG: Filhos do nó:",n.children),n.family_ids&&n.family_ids.length||n.family_ids_op&&n.family_ids_op.length||!n.children||!n.children.length)this.applyFamilyFilter(n);else{const t=e=>{for(const n of e)(n.family_ids&&n.family_ids.length||n.family_ids_op&&n.family_ids_op.length)&&this.applyFamilyFilter(n),n.children&&n.children.length&&t(n.children)};t(n.children)}else console.warn("DEBUG: Não encontrou nó para breadcrumb",e.breadcrumb);this.searchTerm=""}else"supplier"===t?(this.filters.supplier_id||(this.filters.supplier_id=[]),this.filters.supplier_id.includes(e.supplier_id)||this.filters.supplier_id.push(e.supplier_id),this.searchTerm=""):"ean"===t&&(this.filters.eans||(this.filters.eans=[]),this.filters.eans.includes(e)||this.filters.eans.push(e),this.searchTerm="");this.showSuggestions=!1,this.pagination.page=1,this.loadProducts()},handleFilterInputKeyup(t,e){if("Enter"===e.key){let n=[];"brand"===t&&(n=this.filterOptions.brands.filter(t=>t.brand_name&&t.brand_name.toLowerCase().includes(e.target.value.toLowerCase()))),"supplier"===t&&(n=this.filterOptions.suppliers.filter(t=>t.supplier_display_name&&t.supplier_display_name.toLowerCase().includes(e.target.value.toLowerCase()))),"family"===t&&(n=this.filterOptions.families.filter(t=>t.family_name&&t.family_name.toLowerCase().includes(e.target.value.toLowerCase()))),1===n.length&&("brand"===t&&this.applyFilter("brand_id",n[0].brand_id),"supplier"===t&&this.applyFilter("supplier",n[0].supplier_display_name),"family"===t&&this.applyFilter("family_id",n[0].family_id))}},applyStockFilter(){this.stockFilter.active?this.filters.stock_min=this.stockFilter.minimumValue:delete this.filters.stock_min,this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},handleServerSort(t){const e={ean:"ean",name:"name",brand_name:"brand_name",price:"price",price_with_vat:"price",stock:"stock",supplier_name:"supplier_name",published_status:"published_status"}[t];e&&(this.sorting.column===e?this.sorting.direction="ASC"===this.sorting.direction?"DESC":"ASC":(this.sorting.column=e,this.sorting.direction="ASC"),this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh())},processFamilies(t){function e(t){return t&&"string"==typeof t?t.toLowerCase().trim().replace(/\s+/g," ").replace(/[^\w\s]/g,"").trim():""}function n(t){return t&&"string"==typeof t?t.toLowerCase().trim().replace(/\s+/g," ").split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):""}console.log("Processando famílias:",t.length);const i={};for(const n of t){const t=n.family_name||n.nome||n.name||"",r=e(t);r&&(i[r]?i[r].all_names.includes(t)||i[r].all_names.push(t):i[r]={family_name:t,family_ids:[],family_ids_op:[],all_names:[t]},"wdmi"===n.provider&&i[r].family_ids.push(n.family_id),"op24"===n.provider&&i[r].family_ids_op.push(n.family_id))}const r=Object.values(i).map(t=>{const e=function(t){if(!t||0===t.length)return"";if(1===t.length)return n(t[0]);const e=t.find(t=>t===n(t));if(e)return e;return n(t.find(t=>/^[A-Z]/.test(t))||t.reduce((t,e)=>e.length>t.length?e:t))}(t.all_names);return{family_name:e,family_ids:t.family_ids,family_ids_op:t.family_ids_op}}).sort((t,e)=>t.family_name.localeCompare(e.family_name,"pt"));return console.log("Famílias processadas:",r.length),console.log("Primeiras 5 famílias:",r.slice(0,5)),this.filterOptions.families=r,r},applyFamilyFilter(t){this.filters.family_id||(this.filters.family_id=[]),this.filters.family_id_op||(this.filters.family_id_op=[]),t.family_ids&&t.family_ids.length&&t.family_ids.forEach(t=>{t&&!this.filters.family_id.includes(t)&&this.filters.family_id.push(t)}),t.family_ids_op&&t.family_ids_op.length&&t.family_ids_op.forEach(t=>{t&&!this.filters.family_id_op.includes(t)&&this.filters.family_id_op.push(t)});const{ids:e,ids_op:n}=function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e.children&&e.children.length)for(const r of e.children)r.family_ids&&r.family_ids.length&&n.push(...r.family_ids),r.family_ids_op&&r.family_ids_op.length&&i.push(...r.family_ids_op),t(r,n,i);return{ids:n,ids_op:i}}(t);for(const t of e)t&&!this.filters.family_id.includes(t)&&this.filters.family_id.push(t);for(const t of n)t&&!this.filters.family_id_op.includes(t)&&this.filters.family_id_op.push(t);this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh()},buildFamilyTree(t){const e=[],n=(t,e,n,i)=>{let r=t.find(t=>t.path===i);return r||(r={name:e,children:[],family_ids:[],family_ids_op:[],level:n,path:i,key:i},t.push(r)),r};for(const i of t){const t=i.family_name||i.nome||i.name||"";if(!t.trim())continue;const r=t.split("->").map(t=>t.trim());let o=e,a=null,s="";r.forEach((t,e)=>{s=s?s+"->"+t:t,a=n(o,t,e,s),o=a.children}),"wdmi"!==i.provider||a.family_ids.includes(i.family_id)||a.family_ids.push(i.family_id),"op24"!==i.provider||a.family_ids_op.includes(i.family_id)||a.family_ids_op.push(i.family_id)}return function t(e){return e.filter(t=>t.key).map(e=>E0(E0({},e),{},{children:t(e.children)}))}(e)},hasAnyChildChecked(t){return!!(t.family_ids&&this.filters.family_id&&t.family_ids.some(t=>this.filters.family_id.includes(t))||t.family_ids_op&&this.filters.family_id_op&&t.family_ids_op.some(t=>this.filters.family_id_op.includes(t)))||!(!t.children||!t.children.length)&&t.children.some(t=>this.hasAnyChildChecked(t))},removeSupplier(t){this.filters.supplier_id=(this.filters.supplier_id||[]).filter(e=>e!==t),this.pagination.page=1,this.loadProducts(),this.updatePriceRange(),this.updateUrlWithoutRefresh()},getSupplierNameById(t){const e=(this.filterOptions.suppliers||[]).find(e=>e.supplier_id===t);return e?e.supplier_display_name:t},removeBrand(t){this.filters.brand_id=(this.filters.brand_id||[]).filter(e=>e!==t),this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh()},getBrandNameById(t){const e=(this.filterOptions.brands||[]).find(e=>e.brand_id===t);return e?e.brand_name:t},removeFamily(t){this.filters.family_id=(this.filters.family_id||[]).filter(e=>e!==t),this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh()},getFamilyNameById(t){const e=function t(e,n){for(const i of e){if(i.family_ids&&i.family_ids.includes(n)||i.family_ids_op&&i.family_ids_op.includes(n))return i;if(i.children&&i.children.length){const e=t(i.children,n);if(e)return e}}return null}(this.filterOptions.families||[],t);return e?e.name:t},removeEan(t){this.filters.eans=(this.filters.eans||[]).filter(e=>e!==t),this.loadProducts(),this.updateUrlWithoutRefresh()},flattenFamilies(t){let e=[];!function t(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const r of n){if(r&&r.key&&r.name){const t=[...i,r.name].join(" -> ");e.push(E0(E0({},r),{},{breadcrumb:t}))}r.children&&r.children.length&&t(r.children,[...i,r.name])}}(t);const n={};return e.forEach(t=>{n[t.breadcrumb]=t}),Object.values(n)},getSelectedFamilyNodes(){const t=[];return function e(n){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const r of n){const n=[...i,r.name].join(" -> ");!(r.family_ids&&r.family_ids.some(t=>(this.filters.family_id||[]).includes(t))||r.family_ids_op&&r.family_ids_op.some(t=>(this.filters.family_id_op||[]).includes(t)))||r.children&&0!==r.children.length||t.push(E0(E0({},r),{},{breadcrumb:n})),r.children&&r.children.length&&e.call(this,r.children,[...i,r.name])}}.call(this,this.filterOptions.families),t},removeFamilyByNode(t){const{ids:e,ids_op:n}=function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e.family_ids&&e.family_ids.length&&n.push(...e.family_ids),e.family_ids_op&&e.family_ids_op.length&&i.push(...e.family_ids_op),e.children&&e.children.length)for(const r of e.children)t(r,n,i);return{ids:n,ids_op:i}}(t);this.filters.family_id=(this.filters.family_id||[]).filter(t=>!e.includes(t)),this.filters.family_id_op=(this.filters.family_id_op||[]).filter(t=>!n.includes(t)),this.pagination.page=1,this.loadProducts(),this.updateUrlWithoutRefresh()},applyPriceFilter(){this.priceMinValue>this.priceMaxValue&&(this.priceMinValue=this.priceMaxValue),this.priceMaxValue<this.priceMinValue&&(this.priceMaxValue=this.priceMinValue),this.filters.price_min=this.priceMinValue,this.filters.price_max=this.priceMaxValue,this.pagination.page=1,this.loadProducts(),this.loadPriceRange(),this.updateUrlWithoutRefresh()},getActiveFilters(){const t=E0({},this.filters);return this.priceMinValue!==this.priceRange.min?t.price_min=this.priceMinValue:delete t.price_min,this.priceMaxValue!==this.priceRange.max?t.price_max=this.priceMaxValue:delete t.price_max,t},hasActiveFilters(){const t=this.getActiveFilters();return Object.keys(t).some(e=>{const n=t[e];return Array.isArray(n)?n.length>0:""!==n&&null!=n})},loadUserPreferences(){try{const t=JSON.parse(localStorage.getItem("ecommerce-preferences")||"{}");t.viewMode&&(this.viewMode=t.viewMode,console.log("📱 Preferência carregada: viewMode =",t.viewMode)),t.limit&&(this.pagination.limit=t.limit,this.limit=t.limit,console.log("📊 Preferência carregada: limit =",t.limit)),t.accordions&&(this.openBrands=t.accordions.brands||!1,this.openSuppliers=t.accordions.suppliers||!1,this.openCategories=t.accordions.categories||!1,console.log("🗂️ Estados dos accordions carregados"))}catch(t){console.warn("⚠️ Erro ao carregar preferências do localStorage:",t)}},saveUserPreferences(){try{const t={viewMode:this.viewMode,limit:this.pagination.limit,accordions:{brands:this.openBrands,suppliers:this.openSuppliers,categories:this.openCategories},lastUpdated:(new Date).toISOString()};localStorage.setItem("ecommerce-preferences",JSON.stringify(t)),console.log("💾 Preferências guardadas:",t)}catch(t){console.warn("⚠️ Erro ao guardar preferências no localStorage:",t)}},toggleAccordion(t){this.saveUserPreferences(),console.log("🗂️ Accordion ".concat(t," alterado"))},toggleViewMode(){this.viewMode="grid"===this.viewMode?"list":"grid",this.saveUserPreferences(),console.log("🔄 View mode alterado para:",this.viewMode)}}};function B0(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{productId:t.productId||0,ean:t.ean||"",loading:!1,loadingSuppliers:!0,loadingPriceHistory:!1,loadingImages:!1,otherSuppliers:[],priceHistoryData:[],priceHistoryStats:{},priceAlerts:[],productImages:[],historyPeriod:365,priceChart:null,get bestPrice(){return 0===this.otherSuppliers.length?null:Math.min(...this.otherSuppliers.map(t=>parseFloat(t.price)||0).filter(t=>t>0))},get secondBestPrice(){if(this.otherSuppliers.length<2)return null;const t=this.otherSuppliers.map(t=>parseFloat(t.price)||0).filter(t=>t>0);return t.length<2?null:(t.sort((t,e)=>t-e),t[1])},get avgPrice(){if(0===this.otherSuppliers.length)return null;const t=this.otherSuppliers.map(t=>parseFloat(t.price)||0).filter(t=>t>0);return 0===t.length?null:t.reduce((t,e)=>t+e,0)/t.length},get suppliersWithStock(){return this.otherSuppliers.filter(t=>(t.stock||0)>0).length},init(){console.log("Product Details initialized:",{productId:this.productId,ean:this.ean}),this.productId&&this.loadProductImages(),this.ean&&this.loadOtherSuppliers(),this.loadPriceHistory(),this.$nextTick(()=>{this.initializeSwiper()})},initializeSwiper(){try{const t=new Swiper(".product-main-swiper",{modules:[window.Swiper.Navigation,window.Swiper.Pagination,window.Swiper.Thumbs],loop:!0,spaceBetween:10,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},pagination:{el:".swiper-pagination",clickable:!0}}),e=new Swiper(".product-thumb-swiper",{modules:[window.Swiper.Navigation,window.Swiper.Pagination,window.Swiper.Thumbs],loop:!0,spaceBetween:10,slidesPerView:4,freeMode:!0,watchSlidesProgress:!0});t&&e&&(t.controller.control=e,e.controller.control=t),console.log("✅ Swiper initialized successfully")}catch(t){console.error("❌ Error initializing Swiper:",t)}},async loadOtherSuppliers(){if(this.ean)try{this.loadingSuppliers=!0;const t=await fetch("/modules/ecommerce/api/products?search=".concat(this.ean,"&limit=100")),e=await t.json();e.success&&e.data?(this.otherSuppliers=e.data,console.log("Found ".concat(this.otherSuppliers.length," suppliers for EAN ").concat(this.ean))):(console.error("Failed to load suppliers:",e.message),this.otherSuppliers=[])}catch(t){console.error("Error loading suppliers:",t),this.otherSuppliers=[]}finally{this.loadingSuppliers=!1}},async loadProductImages(){if(this.productId){this.loadingImages=!0;try{const t=await fetch("/modules/ecommerce/api/products/".concat(this.productId,"/images"));if(!t.ok)throw new Error("HTTP ".concat(t.status));const e=await t.json();e.success&&e.images&&(this.productImages=e.images,this.updateImageSlider())}catch(t){console.error("Error loading product images:",t)}finally{this.loadingImages=!1}}},updateImageSlider(){if(0===this.productImages.length){const t=document.querySelector(".product-img-slider");return void(t&&(t.innerHTML='\n <div class="p-4 rounded bg-light text-center">\n <div class="mb-3">\n <i class="ri-image-line" style="font-size: 4rem; color: #8c9097;"></i>\n </div>\n <h5 class="text-muted mb-2">Sem Imagens</h5>\n <p class="text-muted mb-0 small">\n Não foram encontradas imagens para este produto\n </p>\n </div>\n '))}const t=document.querySelector(".product-thumbnail-slider .swiper-wrapper");t&&(t.innerHTML=this.productImages.map(t=>'\n <div class="swiper-slide">\n <img src="'.concat(t.url||t,'" \n alt="').concat(t.alt||"Produto",'" \n class="img-fluid d-block" \n onerror="this.src=\'/assets/images/image-load-error.svg?v=').concat((new Date).getFullYear()).concat(String((new Date).getMonth()+1).padStart(2,"0")).concat(String((new Date).getDate()).padStart(2,"0")).concat(String((new Date).getHours()).padStart(2,"0"),"'\" />\n </div>\n ")).join(""));const e=document.querySelector(".product-nav-slider .swiper-wrapper");e&&(e.innerHTML=this.productImages.map(t=>'\n <div class="swiper-slide">\n <div class="nav-slide-item">\n <img src="'.concat(t.url||t,'" \n alt="Miniatura" \n class="img-fluid d-block" \n onerror="this.src=\'/assets/images/image-load-error.svg?v=').concat((new Date).getFullYear()).concat(String((new Date).getMonth()+1).padStart(2,"0")).concat(String((new Date).getDate()).padStart(2,"0")).concat(String((new Date).getHours()).padStart(2,"0"),"'\" />\n </div>\n </div>\n ")).join("")),window.Swiper&&this.$nextTick(()=>{var t,e;const n=null===(t=document.querySelector(".product-thumbnail-slider"))||void 0===t?void 0:t.swiper,i=null===(e=document.querySelector(".product-nav-slider"))||void 0===e?void 0:e.swiper;n&&n.destroy(),i&&i.destroy(),this.initializeSwiper()})},initializeSwiper(){if(!window.Swiper)return;const t=new window.Swiper(".product-nav-slider",{spaceBetween:10,slidesPerView:4,freeMode:!0,watchSlidesProgress:!0});new window.Swiper(".product-thumbnail-slider",{spaceBetween:10,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},thumbs:{swiper:t}})},formatDate(t){if(!t)return"-";try{return new Date(t).toLocaleDateString("pt-PT",{day:"2-digit",month:"2-digit",year:"numeric"})}catch(t){return"-"}},viewSupplierProduct(t){t.id!==this.productId&&(window.location.href="/apps/ecommerce/products/details/".concat(t.id))},editProduct(){alert("Funcionalidade de edição em desenvolvimento")},toggleSelection(){alert("Funcionalidade de alteração de seleção em desenvolvimento")},async viewHistory(){try{const t='\n <div class="modal fade" id="productHistoryModal" tabindex="-1">\n <div class="modal-dialog modal-xl">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title">\n <i class="ri-history-line me-2"></i>Histórico de Preços - EAN: '.concat(this.ean,'\n </h5>\n <button type="button" class="btn-close" data-bs-dismiss="modal"></button>\n </div>\n <div class="modal-body">\n <div id="historyModalContent">\n <div class="text-center py-4">\n <div class="spinner-border text-primary" role="status">\n <span class="visually-hidden">Carregando...</span>\n </div>\n <p class="mt-2 text-muted">Carregando histórico de preços de todos os fornecedores...</p>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fechar</button>\n </div>\n </div>\n </div>\n </div>\n '),e=document.getElementById("productHistoryModal");e&&e.remove(),document.body.insertAdjacentHTML("beforeend",t),new bootstrap.Modal(document.getElementById("productHistoryModal")).show(),await this.loadEanPriceHistory(),document.getElementById("productHistoryModal").addEventListener("hidden.bs.modal",function(){this.remove()})}catch(t){console.error("Error showing history modal:",t),alert("Erro ao carregar histórico do produto")}},async loadEanPriceHistory(){try{console.log("Loading price history for EAN: ".concat(this.ean));const t=await fetch("/modules/ecommerce/api/ean/".concat(this.ean,"/price-history?period=").concat(this.historyPeriod)),e=await t.json();e.success&&e.suppliers?(console.log("✅ Loaded price history for ".concat(e.suppliers.length," suppliers")),this.renderEanHistoryChart(e.suppliers)):(console.warn("No EAN price history data:",e.message),this.showNoDataMessage())}catch(t){console.error("Error loading EAN price history:",t),this.showNoDataMessage()}},renderEanHistoryChart(t){const e=document.getElementById("historyModalContent");if(!e)return;e.innerHTML='\n <div class="row mb-3">\n <div class="col-md-8">\n <h6 class="mb-0">Comparação de Preços entre Fornecedores</h6>\n <small class="text-muted">'.concat(t.length,' fornecedores encontrados</small>\n </div>\n <div class="col-md-4 text-end">\n <select class="form-select form-select-sm" id="historyPeriodSelect">\n <option value="7">Últimos 7 dias</option>\n <option value="30">Últimos 30 dias</option>\n <option value="90">Últimos 90 dias</option>\n <option value="365" selected>Último ano</option>\n </select>\n </div>\n </div>\n <div id="eanHistoryChart" style="height: 400px;"></div>\n <div class="mt-3">\n <h6>Fornecedores:</h6>\n <div class="d-flex flex-wrap gap-2" id="supplierLegend"></div>\n </div>\n '),document.getElementById("historyPeriodSelect").addEventListener("change",t=>{this.historyPeriod=parseInt(t.target.value),this.loadEanPriceHistory()});const n=[],i=["#0ab39c","#f7b84b","#405189","#e74c3c","#9b59b6","#34495e","#f39c12","#27ae60"];t.forEach((t,e)=>{if(t.data&&t.data.length>0){const r=t.data.map(t=>({x:new Date(t.date).getTime(),y:parseFloat(t.price)||0})).sort((t,e)=>t.x-e.x);n.push({name:t.supplier_name,data:r,color:i[e%i.length]})}});const r={series:n,chart:{type:"line",height:400,toolbar:{show:!0,tools:{download:!0,selection:!1,zoom:!0,pan:!0,reset:!0}}},stroke:{curve:"smooth",width:2},markers:{size:4,hover:{size:6}},xaxis:{type:"datetime",labels:{format:"dd/MM"}},yaxis:{labels:{formatter:function(t){return"€"+t.toFixed(2)}}},tooltip:{x:{format:"dd/MM/yyyy"},y:{formatter:function(t){return"€"+t.toFixed(2)}}},legend:{show:!0,position:"top"},colors:i};new ApexCharts(document.getElementById("eanHistoryChart"),r).render(),console.log("✅ EAN history chart rendered successfully")},showNoDataMessage(){const t=document.getElementById("historyModalContent");t&&(t.innerHTML='\n <div class="text-center py-5 text-muted">\n <i class="ri-line-chart-line fs-24 mb-3 d-block"></i>\n <h6>Nenhum histórico encontrado</h6>\n <p class="mb-0">Não foram encontrados dados históricos para este EAN no período selecionado.</p>\n </div>\n ')},async loadPriceHistory(){if(this.productId)try{this.loadingPriceHistory=!0,console.log("Loading price history for product ".concat(this.productId,", period: ").concat(this.historyPeriod," days"));try{const t=await fetch("/modules/ecommerce/api/products/".concat(this.productId,"/price-history-chart?period=").concat(this.historyPeriod)),e=await t.json();if(e.success&&e.data)return this.priceHistoryData=e.data,this.priceHistoryStats=e.statistics||{},this.priceAlerts=e.alerts||[],console.log("✅ Loaded ".concat(this.priceHistoryData.length," real price history records")),console.log("📊 Statistics:",this.priceHistoryStats),console.log("⚠️ Price alerts:",this.priceAlerts),void this.$nextTick(()=>{this.renderPriceChart(),this.showPriceAlerts()})}catch(t){console.warn("Real API failed, no fallback data available:",t.message)}this.priceHistoryData=[],this.priceAlerts=[],console.log("No data available - API failed"),this.$nextTick(()=>{this.renderPriceChart(),this.showPriceAlerts()})}catch(t){console.error("Error loading price history:",t),this.priceHistoryData=[],this.priceHistoryStats={},this.priceAlerts=[]}finally{this.loadingPriceHistory=!1}},generateEnhancedDemoData(){console.warn("Demo data generation is disabled - API only"),this.priceHistoryData=[],this.priceHistoryStats={},this.priceAlerts=[]},renderPriceChart(){try{this.priceChart&&(this.priceChart.destroy(),this.priceChart=null);const t=document.getElementById("priceHistoryChart");if(!t||0===this.priceHistoryData.length)return;const e=this.priceHistoryData.map(t=>({x:new Date(t.date).getTime(),y:parseFloat(t.price)||0})).sort((t,e)=>t.x-e.x),n=[];this.priceAlerts.forEach(t=>{const e=new Date(t.date).getTime();n.push({x:e,borderColor:"increase"===t.type?"#28a745":"#dc3545",label:{text:"".concat(t.change_percent>0?"+":"").concat(t.change_percent,"%"),style:{color:"#fff",background:"increase"===t.type?"#28a745":"#dc3545"}}})});let i=[];if(e.length>1){const t=e[0].y,n=e[e.length-1].y;i=[{x:e[0].x,y:t},{x:e[e.length-1].x,y:n}]}const r={series:[{name:"Preço",data:e,color:"#0ab39c"},{name:"Tendência",data:i,color:"#f7b84b",type:"line",stroke:{dashArray:5,width:2}}],chart:{type:"line",height:350,toolbar:{show:!0,tools:{download:!0,selection:!1,zoom:!0,zoomin:!0,zoomout:!0,pan:!0,reset:!0}},animations:{enabled:!0,easing:"easeinout",speed:800}},stroke:{curve:"smooth",width:[3,2]},markers:{size:[5,0],colors:["#0ab39c"],strokeColors:"#fff",strokeWidth:2,hover:{size:7}},xaxis:{type:"datetime",labels:{format:"dd/MM"},title:{text:"Data"}},yaxis:{labels:{formatter:function(t){return"€"+t.toFixed(2)}},title:{text:"Preço (€)"}},tooltip:{x:{format:"dd/MM/yyyy"},y:{formatter:function(t){return"€"+t.toFixed(2)}}},grid:{borderColor:"#f1f1f1",strokeDashArray:3},legend:{show:!0,position:"top"},annotations:{points:n},colors:["#0ab39c","#f7b84b"]};this.priceChart=new ApexCharts(t,r),this.priceChart.render(),console.log("✅ Enhanced price history chart rendered successfully")}catch(t){console.error("❌ Error rendering price chart:",t)}},showPriceAlerts(){0!==this.priceAlerts.length&&this.priceAlerts.forEach((t,e)=>{setTimeout(()=>{const n="increase"===t.type?"📈":"📉",i="increase"===t.type?"success":"danger",r=t.change_percent>0?"+".concat(t.change_percent,"%"):"".concat(t.change_percent,"%"),o='\n <div class="alert alert-'.concat(i,' alert-dismissible fade show position-fixed" \n style="top: ').concat(80+60*e,'px; right: 20px; z-index: 1060; min-width: 300px;">\n <div class="d-flex align-items-center">\n <span class="fs-20 me-2">').concat(n,'</span>\n <div class="flex-grow-1">\n <strong>Variação Significativa</strong><br>\n <small>').concat(t.date,": €").concat(t.old_price.toFixed(2)," → €").concat(t.new_price.toFixed(2)," (").concat(r,')</small>\n </div>\n <button type="button" class="btn-close" data-bs-dismiss="alert"></button>\n </div>\n </div>\n ');document.body.insertAdjacentHTML("beforeend",o),setTimeout(()=>{const t=document.querySelector('.alert[style*="'+(80+60*e)+'px"]');t&&t.remove()},8e3)},1e3*e)})},getSupplierRowClass:(t,e)=>t.id==e?"table-info":1===t.is_selected?"table-success":1===t.is_alternative?"table-warning":"",backToProducts(){this.ean?window.location.href="/apps/ecommerce/products?search=".concat(this.ean):window.location.href="/apps/ecommerce/products"}}}const N0=()=>({stats:{total_errors:"...",critical_errors:"...",resolved_errors:"...",monitored_projects:"..."},recentErrors:[],loading:!1,init(){setTimeout(()=>{this.checkBundleAndLoadData()},3e3)},checkBundleAndLoadData(){const t=document.getElementById("total-errors");t&&"..."===t.textContent&&(console.warn("Bundle JavaScript not working, loading data manually"),this.loadDashboardStats(),this.loadRecentErrors())},async loadDashboardStats(){try{const t=await fetch("/api/error-monitoring/dashboard"),e=await t.json();if(e.success){const t=document.getElementById("total-errors"),n=document.getElementById("critical-errors"),i=document.getElementById("resolved-errors"),r=document.getElementById("projects-count"),o=document.getElementById("project-errors");t&&(t.textContent=e.data.total_errors||0),n&&(n.textContent=e.data.critical_errors||0),i&&(i.textContent=e.data.resolved_errors||0),r&&(r.textContent=e.data.monitored_projects||0),o&&(o.textContent=e.data.total_errors||0),this.stats=e.data}}catch(t){console.error("Error loading dashboard stats:",t)}},async loadRecentErrors(){console.log("Loading recent errors...");try{const t=await fetch("/api/error-monitoring/recent-errors"),e=await t.json();console.log("Recent errors data:",e);const n=document.getElementById("recent-errors-container");if(!n)return void console.warn("Recent errors container not found");if(console.log("Container found:",n),e.success&&e.data.length>0){let t='<div class="table-responsive table-card"><table class="table table-borderless table-centered align-middle table-nowrap mb-0"><thead class="text-muted table-light"><tr><th>Error</th><th>File</th><th>Severity</th><th>Time</th><th>Action</th></tr></thead><tbody>';e.data.forEach(e=>{const n="critical"===e.severity?"danger":"warning"===e.severity?"warning":"secondary",i=e.file_path?e.file_path.split("/").pop():"unknown",r=e.message?e.message.substring(0,50)+"...":"No message";t+='<tr><td><div class="d-flex align-items-center"><div class="flex-shrink-0 me-2"><div class="avatar-xs"><div class="avatar-title bg-'.concat(n,"-subtle text-").concat(n,' rounded fs-16"><i class="ri-bug-line"></i></div></div></div><div class="flex-grow-1"><h6 class="fs-14 mb-1"><a href="/error-monitoring/error/').concat(e.id,'" class="text-dark">').concat(r,'</a></h6><p class="text-muted mb-0 fs-12">').concat(e.unique_id||"N/A",'</p></div></div></td><td><span class="text-muted fs-12">').concat(i,":").concat(e.line_number||"?",'</span></td><td><span class="badge bg-').concat(n,"-subtle text-").concat(n,'">').concat(e.severity.charAt(0).toUpperCase()+e.severity.slice(1),'</span></td><td><span class="text-muted fs-12">').concat(new Date(e.created_at).toLocaleString(),'</span></td><td><a href="/error-monitoring/error/').concat(e.id,'" class="text-primary"><i class="ri-eye-line"></i></a></td></tr>')}),t+="</tbody></table></div>";try{n&&n.parentNode&&(n.innerHTML=t,console.log("Recent errors updated successfully"))}catch(t){console.error("Error setting innerHTML:",t),n&&n.parentNode&&(n.textContent="Error loading recent errors")}this.recentErrors=e.data}else{try{n&&n.parentNode&&(n.innerHTML='<div class="text-center py-5"><div class="avatar-lg mx-auto mb-4"><div class="avatar-title bg-success-subtle text-success rounded-circle fs-1"><i class="ri-checkbox-circle-line"></i></div></div><h5 class="mb-1">Nenhum erro encontrado!</h5><p class="text-muted mb-0">O sistema está funcionando perfeitamente.</p></div>')}catch(t){console.error("Error setting innerHTML for empty state:",t),n&&n.parentNode&&(n.textContent="No errors found")}this.recentErrors=[]}}catch(t){console.error("Error loading recent errors:",t)}},async refreshRecentErrors(){console.log("Refresh button clicked!"),await this.loadRecentErrors()}}),z0=()=>({errorId:null,uniqueId:null,resolving:!1,init(){const t=this.$el.closest("[data-error-id]");t&&(this.errorId=t.dataset.errorId,this.uniqueId=t.dataset.uniqueId)},async copyToClipboard(t){try{await navigator.clipboard.writeText(t),this.showCopySuccess()}catch(e){console.error("Could not copy text: ",e),this.fallbackCopyToClipboard(t)}},fallbackCopyToClipboard(t){const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),this.showCopySuccess()}catch(t){console.error("Fallback: Could not copy text: ",t)}document.body.removeChild(e)},showCopySuccess(){const t=event.target.closest("button");if(t)try{const e=t.innerHTML;t.innerHTML='<i class="ri-check-line"></i> Copiado!',setTimeout(()=>{try{t.innerHTML=e}catch(e){console.error("Error restoring button text:",e),t.textContent="Copiar"}},2e3)}catch(e){console.error("Error updating button text:",e),t.textContent="Copiado!"}},async resolveError(){if(this.uniqueId&&!this.resolving){this.resolving=!0;try{const t=await fetch("/api/error-monitoring/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({unique_id:this.uniqueId})}),e=await t.json();if(!e.success)throw new Error(e.message||"Failed to resolve error");this.showResolveSuccess(),setTimeout(()=>{window.location.href="/error-monitoring/dashboard"},2e3)}catch(t){console.error("Error:",t),this.showResolveError(t.message)}finally{this.resolving=!1}}},showResolveSuccess(){const t=this.$refs.resolveButton;if(t)try{t.innerHTML='<i class="ri-check-line"></i> Resolvido!',t.classList.remove("btn-success"),t.classList.add("btn-outline-success"),t.disabled=!0}catch(e){console.error("Error updating resolve button:",e),t.textContent="Resolvido!",t.classList.remove("btn-success"),t.classList.add("btn-outline-success"),t.disabled=!0}console.log("Erro marcado como resolvido com sucesso!")},showResolveError(t){console.error("Erro ao resolver:",t)}}),F0=()=>({importing:!1,progress:0,message:"",init(){},async importFile(){const t=document.getElementById("errorFile"),e=null==t?void 0:t.files[0];if(!e)return void this.showError("Por favor, selecione um arquivo");this.importing=!0,this.progress=0,this.message="Iniciando importação...";const n=new FormData;n.append("errorFile",e);try{const t=await fetch("/error-monitoring/import",{method:"POST",body:n}),e=await t.json();if(!e.success)throw new Error(e.message||"Erro na importação");this.progress=100,this.message="Importação concluída com sucesso!",setTimeout(()=>{window.location.href="/error-monitoring/dashboard"},2e3)}catch(t){console.error("Import error:",t),this.showError("Erro ao importar arquivo: "+t.message)}finally{this.importing=!1}},showError(t){this.message=t,this.importing=!1,this.progress=0,setTimeout(()=>{this.message=""},5e3)},onFileSelect(){const t=document.getElementById("errorFile"),e=null==t?void 0:t.files[0];this.message=e?"Arquivo selecionado: ".concat(e.name):""}}),V0=()=>({totalContacts:null,activeLeads:null,newThisMonth:null,conversionRate:null,async init(){try{const t=await fetch("/api/dashboard/crm/summary");if(t.ok){const e=await t.json();this.totalContacts=e.total_contactos,this.activeLeads=e.leads_ativos,this.newThisMonth=e.novos_mes,this.conversionRate=e.taxa_conversao}}catch(t){}this.initSalesForecastChart(),this.initDealTypeChart(),this.initRevenueExpensesChart()},initSalesForecastChart(){const t={series:[{name:"Goal",data:[37]},{name:"Pending Forecast",data:[12]},{name:"Revenue",data:[18]}],chart:{type:"bar",height:341,toolbar:{show:!1}},plotOptions:{bar:{horizontal:!1,columnWidth:"65%"}},stroke:{show:!0,width:5,colors:["transparent"]},xaxis:{categories:[""],axisTicks:{show:!1,borderType:"solid",color:"#78909C",height:6,offsetX:0,offsetY:0},title:{text:"Total Forecasted Value",offsetX:0,offsetY:-30,style:{color:"#78909C",fontSize:"12px",fontWeight:400}}},yaxis:{labels:{formatter:t=>"$".concat(t,"k")},tickAmount:4,min:0},fill:{opacity:1},legend:{show:!0,position:"bottom",horizontalAlign:"center",fontWeight:500,offsetX:0,offsetY:-14,itemMargin:{horizontal:8,vertical:0},markers:{width:10,height:10}}};this.$nextTick(()=>{window.ApexCharts&&document.getElementById("sales-forecast-chart")&&new ApexCharts(document.getElementById("sales-forecast-chart"),t).render()})},initDealTypeChart(){const t={series:[{name:"Pending",data:[80,50,30,40,100,20]},{name:"Loss",data:[20,30,40,80,20,80]},{name:"Won",data:[44,76,78,13,43,10]}],chart:{height:341,type:"radar",dropShadow:{enabled:!0,blur:1,left:1,top:1},toolbar:{show:!1}},stroke:{width:2},fill:{opacity:.2},legend:{show:!0,fontWeight:500,offsetX:0,offsetY:-8,markers:{width:8,height:8,radius:6},itemMargin:{horizontal:10,vertical:0}},markers:{size:0},xaxis:{categories:["2016","2017","2018","2019","2020","2021"]}};this.$nextTick(()=>{window.ApexCharts&&document.getElementById("deal-type-charts")&&new ApexCharts(document.getElementById("deal-type-charts"),t).render()})},initRevenueExpensesChart(){const t={series:[{name:"Revenue",data:[20,25,30,35,40,55,70,110,150,180,210,250]},{name:"Expenses",data:[12,17,45,42,24,35,42,75,102,108,156,199]}],chart:{height:290,type:"area",toolbar:{show:!1}},stroke:{curve:"smooth",width:2},fill:{type:"gradient",gradient:{shadeIntensity:1,opacityFrom:.7,opacityTo:.2,stops:[0,90,100]}},xaxis:{categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},yaxis:{labels:{formatter:t=>"$".concat(t,"k")}},legend:{position:"top",horizontalAlign:"right"}};this.$nextTick(()=>{window.ApexCharts&&document.getElementById("revenue-expenses-charts")&&new ApexCharts(document.getElementById("revenue-expenses-charts"),t).render()})}});function H0(){return{campaigns:[],loading:!1,error:null,pagination:{current_page:1,per_page:20,total:0,total_pages:0,has_next_page:!1,has_prev_page:!1},stats:{total_campaigns:0,active_campaigns:0,paused_campaigns:0,no_end_date_campaigns:0},filters:{status:"",period:"",search:"",type:"",budget_type:"",date_range:"",has_end_date:"",created_by:"",min_budget:"",max_budget:""},init(){j0("campaignsManager init() called"),this.filters={status:"",period:"",search:""},this.loadCampaigns(),this.loadCampaignStats(),this.initTooltips()},async loadCampaigns(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.loading=!0,this.error=null;try{const e=new URLSearchParams({page:t,per_page:this.pagination.per_page});this.filters.search&&e.append("search",this.filters.search),this.filters.status&&e.append("status",this.filters.status),this.filters.type&&e.append("type",this.filters.type),this.filters.budget_type&&e.append("budget_type",this.filters.budget_type),this.filters.date_range&&e.append("date_range",this.filters.date_range),this.filters.has_end_date&&e.append("has_end_date",this.filters.has_end_date),this.filters.created_by&&e.append("created_by",this.filters.created_by),this.filters.min_budget&&e.append("min_budget",this.filters.min_budget),this.filters.max_budget&&e.append("max_budget",this.filters.max_budget);const n=await fetch("/api/advertising/campaigns?".concat(e.toString())),i=await n.json();i.success?(this.campaigns=(i.data||[]).map(t=>({id:t.campaign_id||t.id,name:t.campaign_name||t.name||"Sem nome",alias:t.campaign_cuid||t.cuid||"",description:t.campaign_description||t.description||"",status:this.mapStatus(t.campaign_status||t.status),type:t.campaign_category||t.type||"banner",region:this.getRegionFromTargeting(t.targeting_rules),start_date:t.start_date,end_date:t.end_date,budget:t.budget,budget_type:t.budget_type,created_at:t.created_at})),i.pagination&&(this.pagination={current_page:i.pagination.current_page,per_page:i.pagination.per_page,total:i.pagination.total,total_pages:i.pagination.total_pages,has_next_page:i.pagination.has_next_page,has_prev_page:i.pagination.has_prev_page}),j0("Campaigns loaded from API:",this.campaigns.length)):(this.error=i.message||"Erro ao carregar campanhas",j0("Error loading campaigns:",i.message))}catch(t){this.error="Erro de conexão ao carregar campanhas",j0("Network error loading campaigns:",t)}finally{this.loading=!1}},mapStatus:t=>({0:"draft",1:"active",2:"paused",3:"ended"}[t]||"draft"),getRegionFromTargeting(t){if(!t)return"";try{return JSON.parse(t).country||""}catch(t){return""}},t(t){return this.$t&&"function"==typeof this.$t?this.$t(t):window.Alpine&&Alpine.store&&Alpine.store("i18n")&&"function"==typeof Alpine.store("i18n").t?Alpine.store("i18n").t(t):window.t&&"function"==typeof window.t?window.t(t):(j0("Translation not found for key: ".concat(t)),t)},initTooltips(){if(j0("Initializing tooltips..."),"undefined"!=typeof bootstrap&&bootstrap.Tooltip){const t=[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));t.length>0?(t.map(function(t){return new bootstrap.Tooltip(t)}),j0("Initialized ".concat(t.length," tooltips"))):j0("No tooltip elements found on page")}else j0("Bootstrap not available, skipping tooltip initialization")},setupEventListeners(){j0("Setting up event listeners...");const t=document.querySelector("#campaigns-table");if(t){const e=t.querySelectorAll("thead th"),n=t.querySelectorAll("tbody tr:not(.noresult)");j0("Table structure: ".concat(e.length," headers, ").concat(n.length," rows")),j0(t.querySelector('th[data-key="actions"]')?"Action header found":"Action header NOT found"),n.forEach((t,e)=>{const n=t.querySelector("td:last-child");if(n){const t=n.querySelectorAll("button, a");j0("Row ".concat(e+1,": ").concat(t.length," action buttons found"))}else j0("Row ".concat(e+1,": No action cell found"))})}this.$nextTick(()=>{const t=document.querySelectorAll(".counter-value");t.length>0?(j0("Found ".concat(t.length," counter elements")),t.forEach(t=>{const e=+t.getAttribute("data-target");e>0?(j0("Animating counter with target: ".concat(e)),this.animateCounter(t,e)):j0("Counter element has invalid target: ".concat(e))})):j0("No counter elements found on page")});const e=document.querySelectorAll(".country-badges");e.length>0?(j0("Found ".concat(e.length," country badges")),e.forEach(t=>{t.addEventListener("click",()=>{const e=t.dataset.campaignId;e?(j0("Navigating to campaign edit: ".concat(e)),window.location.href="/advertising/campaigns/".concat(e,"/edit")):j0("Country badge clicked but no campaign ID found")})})):j0("No country badges found on page")},searchCampaigns(t){j0("Search campaigns called",{value:t.target.value}),this.filters.search=t.target.value.toLowerCase(),this.applyFilters()},applyFilters(){j0("Applying filters",this.filters);const t=document.querySelectorAll("#campaigns-table tbody tr:not(.noresult)");if(0===t.length)return void j0("No campaign rows found in table");let e=0;t.forEach(t=>{let n=!0;if(this.filters.status){const e=t.querySelector(".inline-status");e?e.value!==this.filters.status&&(n=!1):j0("Status select not found in row")}this.filters.search&&(t.textContent.toLowerCase().includes(this.filters.search)||(n=!1)),t.style.display=n?"":"none",n&&e++});const n=document.querySelector("#campaigns-table tbody tr.noresult");n?(n.style.display=0===e?"":"none",j0("No results row ".concat(0===e?"shown":"hidden"))):j0("No results row not found in table"),j0("Filter applied: ".concat(e," rows visible out of ").concat(t.length," total"))},async updateCampaignField(t,e,n){if(j0("Updating campaign field",{campaignId:t,field:e,value:n}),!t||!e)return j0("Invalid parameters for updateCampaignField",{campaignId:t,field:e}),void this.showNotification(this.t("advertising.common.invalid_parameters"),"error");const i={};i[e]=n;const r=document.querySelector('tr[data-campaign-id="'.concat(t,'"]'));if(!r)return j0("Campaign row not found for ID: ".concat(t)),void this.showNotification(this.t("advertising.campaigns.not_found"),"error");const o=r.querySelector(".".concat(e));o?(o.style.opacity="0.5",j0("Field element found and loading state applied")):j0("Field element not found for: ".concat(e));try{const a=await fetch("/api/advertising/campaigns/"+t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),s=await a.json();if(j0("Update campaign response",s),s.success){if(o&&(o.style.opacity="1",j0("Field opacity restored")),"status"===e){const t=r.querySelector(".inline-status");t?(t.className="form-select form-select-sm border-0 inline-status status-"+n,t.value=n,j0("Status select updated visually")):j0("Status select not found for visual update")}r.classList.add("saved-feedback"),setTimeout(()=>{r.classList.remove("saved-feedback")},1e3),this.showNotification(this.t("advertising.campaigns.update_success"),"success")}else o&&(o.style.opacity="1",j0("Field opacity restored after error")),this.showNotification(this.t("advertising.campaigns.update_error"),"error"),setTimeout(()=>location.reload(),1500)}catch(t){j0("Error updating campaign field",t),o&&(o.style.opacity="1",j0("Field opacity restored after exception")),this.showNotification(this.t("advertising.common.connection_error"),"error")}},showNotification(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";j0("Showing notification",{message:t,type:e});const n=document.createElement("div");n.className="alert alert-".concat("success"===e?"success":"danger"," alert-dismissible fade show position-fixed top-0 end-0 m-3"),n.style.zIndex="9999",n.innerHTML='\n <i class="ri-'.concat("success"===e?"check":"error-warning",'-line me-1"></i>\n ').concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert"></button>\n '),document.body.appendChild(n),setTimeout(()=>{n.remove()},3e3)},async deleteCampaign(t){if(j0("Delete campaign called",{id:t}),window.Alpine&&Alpine.store&&Alpine.store("i18n")&&"function"==typeof Alpine.store("i18n").loadTranslations&&await Alpine.store("i18n").loadTranslations(),!t)return void this.showNotification(this.t("advertising.common.invalid_campaign_id"),"error");const e={title:this.t("advertising.common.confirm_delete_title"),text:this.t("advertising.common.action_irreversible"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#f46a6a",cancelButtonColor:"#878a99",confirmButtonText:this.t("advertising.common.confirm_button"),cancelButtonText:this.t("advertising.common.cancel_button")};if((await Swal.fire(e)).isConfirmed){j0("User confirmed deletion");try{const e=await fetch("/api/advertising/campaigns/"+t,{method:"DELETE"}),n=await e.json();if(j0("Delete campaign response",n),n.success){await Swal.fire({title:this.t("advertising.common.deleted_title"),text:this.t("advertising.common.deleted_text"),icon:"success"});const e=document.querySelector('tr[data-campaign-id="'.concat(t,'"]'));e?(e.remove(),j0("Campaign row removed from DOM")):j0("Campaign row not found in DOM for removal");const n=document.querySelectorAll("#campaigns-table tbody tr:not(.noresult)");if(j0("Remaining visible rows: ".concat(n.length)),0===n.length){const t=document.querySelector("#campaigns-table tbody tr.noresult");t?(t.style.display="",j0("No results row shown after deletion")):j0("No results row not found to show")}this.loadCampaignStats()}else j0("Delete failed",n),Swal.fire("Erro!",n.message||this.t("advertising.common.delete_error"),"error")}catch(t){j0("Error deleting campaign",t),Swal.fire("Erro!",this.t("advertising.common.connection_error"),"error")}}else j0("User cancelled deletion")},async duplicateCampaign(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/campaigns/".concat(t,"/duplicate"),{method:"POST",headers:{"Content-Type":"application/json"}}),n=await e.json();n.success?(this.showNotification(this.t("advertising.campaigns.duplicate_success"),"success"),setTimeout(()=>{window.location.reload()},1e3)):this.showNotification(this.t("advertising.campaigns.duplicate_error")+": "+n.message,"error")}catch(t){j0("Error duplicating campaign:",t),this.showNotification(this.t("advertising.campaigns.duplicate_error"),"error")}},exportCampaigns(){j0("Export campaigns called"),alert("Funcionalidade em desenvolvimento")},toggleCheckAll(t){j0("Toggle check all called",{checked:t.target.checked}),document.querySelectorAll('input[name="checkAll"]').forEach(e=>e.checked=t.target.checked),this.updateBulkActions()},updateBulkActions(){j0("Update bulk actions called",{checked:document.querySelectorAll('input[name="checkAll"]:checked').length})},bulkAction(t){const e=Array.from(document.querySelectorAll('input[name="checkAll"]:checked')).map(t=>t.value);j0("Bulk action called",{action:t,selected:e}),0!==e.length?console.log("Bulk action:",t,e):alert("Selecione pelo menos uma campanha")},async loadCampaignStats(){try{const t=await fetch("/api/advertising/dashboard/stats"),e=await t.json();e.success&&(this.stats=e.data,j0("Campaign stats loaded:",this.stats),this.$nextTick(()=>{const t=document.getElementById("total-campaigns-count"),e=document.getElementById("active-campaigns-count"),n=document.getElementById("paused-campaigns-count"),i=document.getElementById("no-end-date-count");t&&(t.setAttribute("data-target",this.stats.total_campaigns),this.animateCounter(t,this.stats.total_campaigns)),e&&(e.setAttribute("data-target",this.stats.active_campaigns),this.animateCounter(e,this.stats.active_campaigns)),n&&(n.setAttribute("data-target",this.stats.paused_campaigns),this.animateCounter(n,this.stats.paused_campaigns)),i&&(i.setAttribute("data-target",this.stats.no_end_date_campaigns),this.animateCounter(i,this.stats.no_end_date_campaigns))}))}catch(t){j0("Error loading campaign stats:",t)}},viewCampaign(t){j0("Navigating to campaign:",t),window.location.href="/advertising/campaigns/".concat(t)},editCampaign(t){j0("Navigating to edit campaign:",t),window.location.href="/advertising/campaigns/".concat(t,"/edit")},formatDate(t){if(!t)return"-";try{const e=new Date(t);return isNaN(e.getTime())?"-":e.toLocaleDateString("pt-PT",{day:"2-digit",month:"2-digit",year:"numeric"})}catch(t){return j0("Error formatting date:",t),"-"}},goToPage(t){t>=1&&t<=this.pagination.total_pages&&this.loadCampaigns(t)},nextPage(){this.pagination.has_next_page&&this.goToPage(this.pagination.current_page+1)},prevPage(){this.pagination.has_prev_page&&this.goToPage(this.pagination.current_page-1)},applyFilters(){this.pagination.current_page=1,this.loadCampaigns(1)},clearFilters(){this.filters={status:"",period:"",search:"",type:"",budget_type:"",date_range:"",has_end_date:"",created_by:"",min_budget:"",max_budget:""},this.pagination.current_page=1,this.loadCampaigns(1)},getPageNumbers(){const t=this.pagination.current_page,e=this.pagination.total_pages,n=[];if(e<=7)for(let t=1;t<=e;t++)n.push(t);else if(t<=4){for(let t=1;t<=5;t++)n.push(t);n.push("..."),n.push(e)}else if(t>=e-3){n.push(1),n.push("...");for(let t=e-4;t<=e;t++)n.push(t)}else{n.push(1),n.push("...");for(let e=t-1;e<=t+1;e++)n.push(e);n.push("..."),n.push(e)}return n},animateCounter(t,e){j0("animateCounter called",{targetValue:e});const n=performance.now(),i=r=>{const o=r-n,a=Math.min(o/1e3,1),s=Math.floor(0+(e-0)*a);t.textContent=s,a<1?requestAnimationFrame(i):j0("Counter animation completed: ".concat(e))};requestAnimationFrame(i)},protectActionColumn(){j0("Setting up action column protection");const t=document.querySelector("#campaigns-table");if(!t)return;const e=new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&e.removedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE&&"TD"===e.tagName){const n=e.parentNode;if(n&&"TR"===n.tagName){const e=n.querySelectorAll("td"),i=t.querySelectorAll("thead th");e.length<i.length-1&&(j0("Action column was removed, restoring..."),this.restoreActionColumn(n))}}})})}),n=t.querySelector("tbody");n&&(e.observe(n,{childList:!0,subtree:!0}),j0("Action column protection active"))},restoreActionColumn(t){const e=t.getAttribute("data-campaign-id");if(!e)return;const n=document.createElement("td");n.innerHTML='\n <div class="d-flex gap-1">\n <a href="/advertising/campaigns/'.concat(e,'/edit" class="btn btn-sm btn-soft-primary" data-bs-toggle="tooltip" data-bs-placement="top" data-translate-title="edit-complete">\n <i class="ri-pencil-line"></i>\n </a>\n <button class="btn btn-sm btn-soft-danger" @click="deleteCampaign(').concat(e,')" data-bs-toggle="tooltip" data-bs-placement="top" data-translate-title="delete">\n <i class="ri-delete-bin-line"></i>\n </button>\n </div>\n '),t.appendChild(n),j0("Action column restored for campaign ".concat(e)),this.initTooltips()}}}function j0(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e?console.log("[DEBUG] ".concat(t),e):console.log("[DEBUG] ".concat(t))}function W0(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function G0(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?W0(Object(n),!0).forEach(function(e){q0(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):W0(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function U0(t){return U0="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U0(t)}function q0(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Y0(){return Y0=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Y0.apply(this,arguments)}function X0(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var $0=X0(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Z0=X0(/Edge/i),K0=X0(/firefox/i),J0=X0(/safari/i)&&!X0(/chrome/i)&&!X0(/android/i),Q0=X0(/iP(ad|od|hone)/i),t1=X0(/chrome/i)&&X0(/android/i),e1={capture:!1,passive:!1};function n1(t,e,n){t.addEventListener(e,n,!$0&&e1)}function i1(t,e,n){t.removeEventListener(e,n,!$0&&e1)}function r1(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function o1(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function a1(t,e,n,i){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&r1(t,e):r1(t,e))||i&&t===n)return t;if(t===n)break}while(t=o1(t))}return null}var s1,l1=/\s+/g;function c1(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(l1," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(l1," ")}}function u1(t,e,n){var i=t&&t.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in i||-1!==e.indexOf("webkit")||(e="-webkit-"+e),i[e]=n+("string"==typeof n?"":"px")}}function h1(t,e){var n="";if("string"==typeof t)n=t;else do{var i=u1(t,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function d1(t,e,n){if(t){var i=t.getElementsByTagName(e),r=0,o=i.length;if(n)for(;r<o;r++)n(i[r],r);return i}return[]}function p1(){return document.scrollingElement||document.documentElement}function f1(t,e,n,i,r){if(t.getBoundingClientRect||t===window){var o,a,s,l,c,u,h;if(t!==window&&t.parentNode&&t!==p1()?(a=(o=t.getBoundingClientRect()).top,s=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(a=0,s=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(e||n)&&t!==window&&(r=r||t.parentNode,!$0))do{if(r&&r.getBoundingClientRect&&("none"!==u1(r,"transform")||n&&"static"!==u1(r,"position"))){var d=r.getBoundingClientRect();a-=d.top+parseInt(u1(r,"border-top-width")),s-=d.left+parseInt(u1(r,"border-left-width")),l=a+o.height,c=s+o.width;break}}while(r=r.parentNode);if(i&&t!==window){var p=h1(r||t),f=p&&p.a,g=p&&p.d;p&&(l=(a/=g)+(u/=g),c=(s/=f)+(h/=f))}return{top:a,left:s,bottom:l,right:c,width:h,height:u}}}function g1(t,e,n){for(var i=x1(t,!0),r=f1(t)[e];i;){var o=f1(i)[n];if(!("top"===n||"left"===n?r>=o:r<=o))return i;if(i===p1())break;i=x1(i,!1)}return!1}function m1(t,e,n,i){for(var r=0,o=0,a=t.children;o<a.length;){if("none"!==a[o].style.display&&a[o]!==S2.ghost&&(i||a[o]!==S2.dragged)&&a1(a[o],n.draggable,t,!1)){if(r===e)return a[o];r++}o++}return null}function y1(t,e){for(var n=t.lastElementChild;n&&(n===S2.ghost||"none"===u1(n,"display")||e&&!r1(n,e));)n=n.previousElementSibling;return n||null}function v1(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===S2.clone||e&&!r1(t,e)||n++;return n}function _1(t){var e=0,n=0,i=p1();if(t)do{var r=h1(t),o=r.a,a=r.d;e+=t.scrollLeft*o,n+=t.scrollTop*a}while(t!==i&&(t=t.parentNode));return[e,n]}function x1(t,e){if(!t||!t.getBoundingClientRect)return p1();var n=t,i=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=u1(n);if(n.clientWidth<n.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!n.getBoundingClientRect||n===document.body)return p1();if(i||e)return n;i=!0}}}while(n=n.parentNode);return p1()}function b1(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function w1(t,e){return function(){if(!s1){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),s1=setTimeout(function(){s1=void 0},e)}}}function S1(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function M1(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function C1(t,e,n){var i={};return Array.from(t.children).forEach(function(r){var o,a,s,l;if(a1(r,e.draggable,t,!1)&&!r.animated&&r!==n){var c=f1(r);i.left=Math.min(null!==(o=i.left)&&void 0!==o?o:1/0,c.left),i.top=Math.min(null!==(a=i.top)&&void 0!==a?a:1/0,c.top),i.right=Math.max(null!==(s=i.right)&&void 0!==s?s:-1/0,c.right),i.bottom=Math.max(null!==(l=i.bottom)&&void 0!==l?l:-1/0,c.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var T1="Sortable"+(new Date).getTime();var I1=[],D1={initializeByDefault:!0},k1={mount:function(t){for(var e in D1)D1.hasOwnProperty(e)&&!(e in t)&&(t[e]=D1[e]);I1.forEach(function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),I1.push(t)},pluginEvent:function(t,e,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var r=t+"Global";I1.forEach(function(i){e[i.pluginName]&&(e[i.pluginName][r]&&e[i.pluginName][r](G0({sortable:e},n)),e.options[i.pluginName]&&e[i.pluginName][t]&&e[i.pluginName][t](G0({sortable:e},n)))})},initializePlugins:function(t,e,n,i){for(var r in I1.forEach(function(i){var r=i.pluginName;if(t.options[r]||i.initializeByDefault){var o=new i(t,e,t.options);o.sortable=t,o.options=t.options,t[r]=o,Y0(n,o.defaults)}}),t.options)if(t.options.hasOwnProperty(r)){var o=this.modifyOption(t,r,t.options[r]);void 0!==o&&(t.options[r]=o)}},getEventProperties:function(t,e){var n={};return I1.forEach(function(i){"function"==typeof i.eventProperties&&Y0(n,i.eventProperties.call(e[i.pluginName],t))}),n},modifyOption:function(t,e,n){var i;return I1.forEach(function(r){t[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[e]&&(i=r.optionListeners[e].call(t[r.pluginName],n))}),i}};var A1=["evt"],E1=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,r=function(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}(n,A1);k1.pluginEvent.bind(S2)(t,e,G0({dragEl:P1,parentEl:O1,ghostEl:R1,rootEl:B1,nextEl:N1,lastDownEl:z1,cloneEl:F1,cloneHidden:V1,dragStarted:Q1,putSortable:q1,activeSortable:S2.active,originalEvent:i,oldIndex:H1,oldDraggableIndex:W1,newIndex:j1,newDraggableIndex:G1,hideGhostForTarget:_2,unhideGhostForTarget:x2,cloneNowHidden:function(){V1=!0},cloneNowShown:function(){V1=!1},dispatchSortableEvent:function(t){L1({sortable:e,name:t,originalEvent:i})}},r))};function L1(t){!function(t){var e=t.sortable,n=t.rootEl,i=t.name,r=t.targetEl,o=t.cloneEl,a=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,h=t.newDraggableIndex,d=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[T1]){var g,m=e.options,y="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||$0||Z0?(g=document.createEvent("Event")).initEvent(i,!0,!0):g=new CustomEvent(i,{bubbles:!0,cancelable:!0}),g.to=a||n,g.from=s||n,g.item=r||n,g.clone=o,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=u,g.newDraggableIndex=h,g.originalEvent=d,g.pullMode=p?p.lastPutMode:void 0;var v=G0(G0({},f),k1.getEventProperties(i,e));for(var _ in v)g[_]=v[_];n&&n.dispatchEvent(g),m[y]&&m[y].call(e,g)}}(G0({putSortable:q1,cloneEl:F1,targetEl:P1,rootEl:B1,oldIndex:H1,oldDraggableIndex:W1,newIndex:j1,newDraggableIndex:G1},t))}var P1,O1,R1,B1,N1,z1,F1,V1,H1,j1,W1,G1,U1,q1,Y1,X1,$1,Z1,K1,J1,Q1,t2,e2,n2,i2,r2=!1,o2=!1,a2=[],s2=!1,l2=!1,c2=[],u2=!1,h2=[],d2="undefined"!=typeof document,p2=Q0,f2=Z0||$0?"cssFloat":"float",g2=d2&&!t1&&!Q0&&"draggable"in document.createElement("div"),m2=function(){if(d2){if($0)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),y2=function(t,e){var n=u1(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=m1(t,0,e),o=m1(t,1,e),a=r&&u1(r),s=o&&u1(o),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+f1(r).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+f1(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return r&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=i&&"none"===n[f2]||o&&"none"===n[f2]&&l+c>i)?"vertical":"horizontal"},v2=function(t){function e(t,n){return function(i,r,o,a){var s=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(i,r,o,a),n)(i,r,o,a);var l=(n?i:r).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},i=t.group;i&&"object"==U0(i)||(i={name:i}),n.name=i.name,n.checkPull=e(i.pull,!0),n.checkPut=e(i.put),n.revertClone=i.revertClone,t.group=n},_2=function(){!m2&&R1&&u1(R1,"display","none")},x2=function(){!m2&&R1&&u1(R1,"display","")};d2&&!t1&&document.addEventListener("click",function(t){if(o2)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),o2=!1,!1},!0);var b2=function(t){if(P1){var e=function(t,e){var n;return a2.some(function(i){var r=i[T1].options.emptyInsertThreshold;if(r&&!y1(i)){var o=f1(i),a=t>=o.left-r&&t<=o.right+r,s=e>=o.top-r&&e<=o.bottom+r;return a&&s?n=i:void 0}}),n}((t=t.touches?t.touches[0]:t).clientX,t.clientY);if(e){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[T1]._onDragOver(n)}}},w2=function(t){P1&&P1.parentNode[T1]._isOutsideThisEl(t.target)};function S2(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Y0({},e),t[T1]=this;var n,i,r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return y2(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==S2.supportPointer&&"PointerEvent"in window&&(!J0||Q0),emptyInsertThreshold:5};for(var o in k1.initializePlugins(this,t,r),r)!(o in e)&&(e[o]=r[o]);for(var a in v2(e),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!e.forceFallback&&g2,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?n1(t,"pointerdown",this._onTapStart):(n1(t,"mousedown",this._onTapStart),n1(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(n1(t,"dragover",this),n1(t,"dragenter",this)),a2.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Y0(this,(i=[],{captureAnimationState:function(){i=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if("none"!==u1(t,"display")&&t!==S2.ghost){i.push({target:t,rect:f1(t)});var e=G0({},i[i.length-1].rect);if(t.thisAnimationDuration){var n=h1(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}})},addAnimationState:function(t){i.push(t)},removeAnimationState:function(t){i.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var i in e)if(e.hasOwnProperty(i)&&e[i]===t[n][i])return Number(n);return-1}(i,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var r=!1,o=0;i.forEach(function(t){var n=0,i=t.target,a=i.fromRect,s=f1(i),l=i.prevFromRect,c=i.prevToRect,u=t.rect,h=h1(i,!0);h&&(s.top-=h.f,s.left-=h.e),i.toRect=s,i.thisAnimationDuration&&b1(l,s)&&!b1(a,s)&&(u.top-s.top)/(u.left-s.left)===(a.top-s.top)/(a.left-s.left)&&(n=function(t,e,n,i){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*i.animation}(u,l,c,e.options)),b1(s,a)||(i.prevFromRect=a,i.prevToRect=s,n||(n=e.options.animation),e.animate(i,u,s,n)),n&&(r=!0,o=Math.max(o,n),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout(function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null},n),i.thisAnimationDuration=n)}),clearTimeout(n),r?n=setTimeout(function(){"function"==typeof t&&t()},o):"function"==typeof t&&t(),i=[]},animate:function(t,e,n,i){if(i){u1(t,"transition",""),u1(t,"transform","");var r=h1(this.el),o=r&&r.a,a=r&&r.d,s=(e.left-n.left)/(o||1),l=(e.top-n.top)/(a||1);t.animatingX=!!s,t.animatingY=!!l,u1(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),u1(t,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),u1(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout(function(){u1(t,"transition",""),u1(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1},i)}}}))}function M2(t,e,n,i,r,o,a,s){var l,c,u=t[T1],h=u.options.onMove;return!window.CustomEvent||$0||Z0?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=i,l.related=r||e,l.relatedRect=o||f1(e),l.willInsertAfter=s,l.originalEvent=a,t.dispatchEvent(l),h&&(c=h.call(u,l,a)),c}function C2(t){t.draggable=!1}function T2(){u2=!1}function I2(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,i=0;n--;)i+=e.charCodeAt(n);return i.toString(36)}function D2(t){return setTimeout(t,0)}function k2(t){return clearTimeout(t)}S2.prototype={constructor:S2,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(t2=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,P1):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,i=this.options,r=i.preventOnFilter,o=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(a||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=i.filter;if(function(t){h2.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var i=e[n];i.checked&&h2.push(i)}}(n),!P1&&!(/mousedown|pointerdown/.test(o)&&0!==t.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!J0||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=a1(s,i.draggable,n,!1))&&s.animated||z1===s)){if(H1=v1(s),W1=v1(s,i.draggable),"function"==typeof c){if(c.call(this,t,s,this))return L1({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),E1("filter",e,{evt:t}),void(r&&t.preventDefault())}else if(c&&(c=c.split(",").some(function(i){if(i=a1(l,i.trim(),n,!1))return L1({sortable:e,rootEl:i,name:"filter",targetEl:s,fromEl:n,toEl:n}),E1("filter",e,{evt:t}),!0})))return void(r&&t.preventDefault());i.handle&&!a1(l,i.handle,n,!1)||this._prepareDragStart(t,a,s)}}},_prepareDragStart:function(t,e,n){var i,r=this,o=r.el,a=r.options,s=o.ownerDocument;if(n&&!P1&&n.parentNode===o){var l=f1(n);if(B1=o,O1=(P1=n).parentNode,N1=P1.nextSibling,z1=n,U1=a.group,S2.dragged=P1,Y1={target:P1,clientX:(e||t).clientX,clientY:(e||t).clientY},K1=Y1.clientX-l.left,J1=Y1.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,P1.style["will-change"]="all",i=function(){E1("delayEnded",r,{evt:t}),S2.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!K0&&r.nativeDraggable&&(P1.draggable=!0),r._triggerDragStart(t,e),L1({sortable:r,name:"choose",originalEvent:t}),c1(P1,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){d1(P1,t.trim(),C2)}),n1(s,"dragover",b2),n1(s,"mousemove",b2),n1(s,"touchmove",b2),a.supportPointer?(n1(s,"pointerup",r._onDrop),!this.nativeDraggable&&n1(s,"pointercancel",r._onDrop)):(n1(s,"mouseup",r._onDrop),n1(s,"touchend",r._onDrop),n1(s,"touchcancel",r._onDrop)),K0&&this.nativeDraggable&&(this.options.touchStartThreshold=4,P1.draggable=!0),E1("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(Z0||$0))i();else{if(S2.eventCanceled)return void this._onDrop();a.supportPointer?(n1(s,"pointerup",r._disableDelayedDrag),n1(s,"pointercancel",r._disableDelayedDrag)):(n1(s,"mouseup",r._disableDelayedDrag),n1(s,"touchend",r._disableDelayedDrag),n1(s,"touchcancel",r._disableDelayedDrag)),n1(s,"mousemove",r._delayedDragTouchMoveHandler),n1(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&n1(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(i,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){P1&&C2(P1),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;i1(t,"mouseup",this._disableDelayedDrag),i1(t,"touchend",this._disableDelayedDrag),i1(t,"touchcancel",this._disableDelayedDrag),i1(t,"pointerup",this._disableDelayedDrag),i1(t,"pointercancel",this._disableDelayedDrag),i1(t,"mousemove",this._delayedDragTouchMoveHandler),i1(t,"touchmove",this._delayedDragTouchMoveHandler),i1(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?n1(document,"pointermove",this._onTouchMove):n1(document,e?"touchmove":"mousemove",this._onTouchMove):(n1(P1,"dragend",this),n1(B1,"dragstart",this._onDragStart));try{document.selection?D2(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(r2=!1,B1&&P1){E1("dragStarted",this,{evt:e}),this.nativeDraggable&&n1(document,"dragover",w2);var n=this.options;!t&&c1(P1,n.dragClass,!1),c1(P1,n.ghostClass,!0),S2.active=this,t&&this._appendGhost(),L1({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(X1){this._lastX=X1.clientX,this._lastY=X1.clientY,_2();for(var t=document.elementFromPoint(X1.clientX,X1.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(X1.clientX,X1.clientY))!==e;)e=t;if(P1.parentNode[T1]._isOutsideThisEl(t),e)do{if(e[T1]&&e[T1]._onDragOver({clientX:X1.clientX,clientY:X1.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=o1(e));x2()}},_onTouchMove:function(t){if(Y1){var e=this.options,n=e.fallbackTolerance,i=e.fallbackOffset,r=t.touches?t.touches[0]:t,o=R1&&h1(R1,!0),a=R1&&o&&o.a,s=R1&&o&&o.d,l=p2&&i2&&_1(i2),c=(r.clientX-Y1.clientX+i.x)/(a||1)+(l?l[0]-c2[0]:0)/(a||1),u=(r.clientY-Y1.clientY+i.y)/(s||1)+(l?l[1]-c2[1]:0)/(s||1);if(!S2.active&&!r2){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(R1){o?(o.e+=c-($1||0),o.f+=u-(Z1||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var h="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");u1(R1,"webkitTransform",h),u1(R1,"mozTransform",h),u1(R1,"msTransform",h),u1(R1,"transform",h),$1=c,Z1=u,X1=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!R1){var t=this.options.fallbackOnBody?document.body:B1,e=f1(P1,!0,p2,!0,t),n=this.options;if(p2){for(i2=t;"static"===u1(i2,"position")&&"none"===u1(i2,"transform")&&i2!==document;)i2=i2.parentNode;i2!==document.body&&i2!==document.documentElement?(i2===document&&(i2=p1()),e.top+=i2.scrollTop,e.left+=i2.scrollLeft):i2=p1(),c2=_1(i2)}c1(R1=P1.cloneNode(!0),n.ghostClass,!1),c1(R1,n.fallbackClass,!0),c1(R1,n.dragClass,!0),u1(R1,"transition",""),u1(R1,"transform",""),u1(R1,"box-sizing","border-box"),u1(R1,"margin",0),u1(R1,"top",e.top),u1(R1,"left",e.left),u1(R1,"width",e.width),u1(R1,"height",e.height),u1(R1,"opacity","0.8"),u1(R1,"position",p2?"absolute":"fixed"),u1(R1,"zIndex","100000"),u1(R1,"pointerEvents","none"),S2.ghost=R1,t.appendChild(R1),u1(R1,"transform-origin",K1/parseInt(R1.style.width)*100+"% "+J1/parseInt(R1.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,i=t.dataTransfer,r=n.options;E1("dragStart",this,{evt:t}),S2.eventCanceled?this._onDrop():(E1("setupClone",this),S2.eventCanceled||((F1=M1(P1)).removeAttribute("id"),F1.draggable=!1,F1.style["will-change"]="",this._hideClone(),c1(F1,this.options.chosenClass,!1),S2.clone=F1),n.cloneId=D2(function(){E1("clone",n),S2.eventCanceled||(n.options.removeCloneOnHide||B1.insertBefore(F1,P1),n._hideClone(),L1({sortable:n,name:"clone"}))}),!e&&c1(P1,r.dragClass,!0),e?(o2=!0,n._loopId=setInterval(n._emulateDragOver,50)):(i1(document,"mouseup",n._onDrop),i1(document,"touchend",n._onDrop),i1(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(n,i,P1)),n1(document,"drop",n),u1(P1,"transform","translateZ(0)")),r2=!0,n._dragStartId=D2(n._dragStarted.bind(n,e,t)),n1(document,"selectstart",n),Q1=!0,window.getSelection().removeAllRanges(),J0&&u1(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,i,r,o=this.el,a=t.target,s=this.options,l=s.group,c=S2.active,u=U1===l,h=s.sort,d=q1||c,p=this,f=!1;if(!u2){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),a=a1(a,s.draggable,o,!0),k("dragOver"),S2.eventCanceled)return f;if(P1.contains(t.target)||a.animated&&a.animatingX&&a.animatingY||p._ignoreWhileAnimating===a)return E(!1);if(o2=!1,c&&!s.disabled&&(u?h||(i=O1!==B1):q1===this||(this.lastPutMode=U1.checkPull(this,c,P1,t))&&l.checkPut(this,c,P1,t))){if(r="vertical"===this._getDirection(t,a),e=f1(P1),k("dragOverValid"),S2.eventCanceled)return f;if(i)return O1=B1,A(),this._hideClone(),k("revert"),S2.eventCanceled||(N1?B1.insertBefore(P1,N1):B1.appendChild(P1)),E(!0);var g=y1(o,s.draggable);if(!g||function(t,e,n){var i=f1(y1(n.el,n.options.draggable)),r=C1(n.el,n.options,R1);return e?t.clientX>r.right+10||t.clientY>i.bottom&&t.clientX>i.left:t.clientY>r.bottom+10||t.clientX>i.right&&t.clientY>i.top}(t,r,this)&&!g.animated){if(g===P1)return E(!1);if(g&&o===t.target&&(a=g),a&&(n=f1(a)),!1!==M2(B1,o,P1,e,a,n,t,!!a))return A(),g&&g.nextSibling?o.insertBefore(P1,g.nextSibling):o.appendChild(P1),O1=o,L(),E(!0)}else if(g&&function(t,e,n){var i=f1(m1(n.el,0,n.options,!0)),r=C1(n.el,n.options,R1);return e?t.clientX<r.left-10||t.clientY<i.top&&t.clientX<i.right:t.clientY<r.top-10||t.clientY<i.bottom&&t.clientX<i.left}(t,r,this)){var m=m1(o,0,s,!0);if(m===P1)return E(!1);if(n=f1(a=m),!1!==M2(B1,o,P1,e,a,n,t,!1))return A(),o.insertBefore(P1,m),O1=o,L(),E(!0)}else if(a.parentNode===o){n=f1(a);var y,v,_,x=P1.parentNode!==o,b=!function(t,e,n){var i=n?t.left:t.top,r=n?t.right:t.bottom,o=n?t.width:t.height,a=n?e.left:e.top,s=n?e.right:e.bottom,l=n?e.width:e.height;return i===a||r===s||i+o/2===a+l/2}(P1.animated&&P1.toRect||e,a.animated&&a.toRect||n,r),w=r?"top":"left",S=g1(a,"top","top")||g1(P1,"top","top"),M=S?S.scrollTop:void 0;if(t2!==a&&(v=n[w],s2=!1,l2=!b&&s.invertSwap||x),y=function(t,e,n,i,r,o,a,s){var l=i?t.clientY:t.clientX,c=i?n.height:n.width,u=i?n.top:n.left,h=i?n.bottom:n.right,d=!1;if(!a)if(s&&n2<c*r){if(!s2&&(1===e2?l>u+c*o/2:l<h-c*o/2)&&(s2=!0),s2)d=!0;else if(1===e2?l<u+n2:l>h-n2)return-e2}else if(l>u+c*(1-r)/2&&l<h-c*(1-r)/2)return function(t){return v1(P1)<v1(t)?1:-1}(e);return(d=d||a)&&(l<u+c*o/2||l>h-c*o/2)?l>u+c/2?1:-1:0}(t,a,n,r,b?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,l2,t2===a),0!==y){var C=v1(P1);do{C-=y,_=O1.children[C]}while(_&&("none"===u1(_,"display")||_===R1))}if(0===y||_===a)return E(!1);t2=a,e2=y;var T=a.nextElementSibling,I=!1,D=M2(B1,o,P1,e,a,n,t,I=1===y);if(!1!==D)return 1!==D&&-1!==D||(I=1===D),u2=!0,setTimeout(T2,30),A(),I&&!T?o.appendChild(P1):a.parentNode.insertBefore(P1,I?T:a),S&&S1(S,0,M-S.scrollTop),O1=P1.parentNode,void 0===v||l2||(n2=Math.abs(v-f1(a)[w])),L(),E(!0)}if(o.contains(P1))return E(!1)}return!1}function k(s,l){E1(s,p,G0({evt:t,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:e,targetRect:n,canSort:h,fromSortable:d,target:a,completed:E,onMove:function(n,i){return M2(B1,o,P1,e,n,f1(n),t,i)},changed:L},l))}function A(){k("dragOverAnimationCapture"),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function E(e){return k("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(p),p!==d&&(c1(P1,q1?q1.options.ghostClass:c.options.ghostClass,!1),c1(P1,s.ghostClass,!0)),q1!==p&&p!==S2.active?q1=p:p===S2.active&&q1&&(q1=null),d===p&&(p._ignoreWhileAnimating=a),p.animateAll(function(){k("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a===P1&&!P1.animated||a===o&&!a.animated)&&(t2=null),s.dragoverBubble||t.rootEl||a===document||(P1.parentNode[T1]._isOutsideThisEl(t.target),!e&&b2(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function L(){j1=v1(P1),G1=v1(P1,s.draggable),L1({sortable:p,name:"change",toEl:o,newIndex:j1,newDraggableIndex:G1,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){i1(document,"mousemove",this._onTouchMove),i1(document,"touchmove",this._onTouchMove),i1(document,"pointermove",this._onTouchMove),i1(document,"dragover",b2),i1(document,"mousemove",b2),i1(document,"touchmove",b2)},_offUpEvents:function(){var t=this.el.ownerDocument;i1(t,"mouseup",this._onDrop),i1(t,"touchend",this._onDrop),i1(t,"pointerup",this._onDrop),i1(t,"pointercancel",this._onDrop),i1(t,"touchcancel",this._onDrop),i1(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;j1=v1(P1),G1=v1(P1,n.draggable),E1("drop",this,{evt:t}),O1=P1&&P1.parentNode,j1=v1(P1),G1=v1(P1,n.draggable),S2.eventCanceled||(r2=!1,l2=!1,s2=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),k2(this.cloneId),k2(this._dragStartId),this.nativeDraggable&&(i1(document,"drop",this),i1(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),J0&&u1(document.body,"user-select",""),u1(P1,"transform",""),t&&(Q1&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),R1&&R1.parentNode&&R1.parentNode.removeChild(R1),(B1===O1||q1&&"clone"!==q1.lastPutMode)&&F1&&F1.parentNode&&F1.parentNode.removeChild(F1),P1&&(this.nativeDraggable&&i1(P1,"dragend",this),C2(P1),P1.style["will-change"]="",Q1&&!r2&&c1(P1,q1?q1.options.ghostClass:this.options.ghostClass,!1),c1(P1,this.options.chosenClass,!1),L1({sortable:this,name:"unchoose",toEl:O1,newIndex:null,newDraggableIndex:null,originalEvent:t}),B1!==O1?(j1>=0&&(L1({rootEl:O1,name:"add",toEl:O1,fromEl:B1,originalEvent:t}),L1({sortable:this,name:"remove",toEl:O1,originalEvent:t}),L1({rootEl:O1,name:"sort",toEl:O1,fromEl:B1,originalEvent:t}),L1({sortable:this,name:"sort",toEl:O1,originalEvent:t})),q1&&q1.save()):j1!==H1&&j1>=0&&(L1({sortable:this,name:"update",toEl:O1,originalEvent:t}),L1({sortable:this,name:"sort",toEl:O1,originalEvent:t})),S2.active&&(null!=j1&&-1!==j1||(j1=H1,G1=W1),L1({sortable:this,name:"end",toEl:O1,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){E1("nulling",this),B1=P1=O1=R1=N1=F1=z1=V1=Y1=X1=Q1=j1=G1=H1=W1=t2=e2=q1=U1=S2.dragged=S2.ghost=S2.clone=S2.active=null,h2.forEach(function(t){t.checked=!0}),h2.length=$1=Z1=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":P1&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,i=0,r=n.length,o=this.options;i<r;i++)a1(t=n[i],o.draggable,this.el,!1)&&e.push(t.getAttribute(o.dataIdAttr)||I2(t));return e},sort:function(t,e){var n={},i=this.el;this.toArray().forEach(function(t,e){var r=i.children[e];a1(r,this.options.draggable,i,!1)&&(n[t]=r)},this),e&&this.captureAnimationState(),t.forEach(function(t){n[t]&&(i.removeChild(n[t]),i.appendChild(n[t]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return a1(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var i=k1.modifyOption(this,t,e);n[t]=void 0!==i?i:e,"group"===t&&v2(n)},destroy:function(){E1("destroy",this);var t=this.el;t[T1]=null,i1(t,"mousedown",this._onTapStart),i1(t,"touchstart",this._onTapStart),i1(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(i1(t,"dragover",this),i1(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),a2.splice(a2.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!V1){if(E1("hideClone",this),S2.eventCanceled)return;u1(F1,"display","none"),this.options.removeCloneOnHide&&F1.parentNode&&F1.parentNode.removeChild(F1),V1=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(V1){if(E1("showClone",this),S2.eventCanceled)return;P1.parentNode!=B1||this.options.group.revertClone?N1?B1.insertBefore(F1,N1):B1.appendChild(F1):B1.insertBefore(F1,P1),this.options.group.revertClone&&this.animate(P1,F1),u1(F1,"display",""),V1=!1}}else this._hideClone()}},d2&&n1(document,"touchmove",function(t){(S2.active||r2)&&t.cancelable&&t.preventDefault()}),S2.utils={on:n1,off:i1,css:u1,find:d1,is:function(t,e){return!!a1(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:w1,closest:a1,toggleClass:c1,clone:M1,index:v1,nextTick:D2,cancelNextTick:k2,detectDirection:y2,getChild:m1,expando:T1},S2.get=function(t){return t[T1]},S2.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach(function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(S2.utils=G0(G0({},S2.utils),t.utils)),k1.mount(t)})},S2.create=function(t,e){return new S2(t,e)},S2.version="1.15.6";var A2,E2,L2,P2,O2,R2,B2=[],N2=!1;function z2(){B2.forEach(function(t){clearInterval(t.pid)}),B2=[]}function F2(){clearInterval(R2)}var V2=w1(function(t,e,n,i){if(e.scroll){var r,o=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,s=e.scrollSensitivity,l=e.scrollSpeed,c=p1(),u=!1;E2!==n&&(E2=n,z2(),A2=e.scroll,r=e.scrollFn,!0===A2&&(A2=x1(n,!0)));var h=0,d=A2;do{var p=d,f=f1(p),g=f.top,m=f.bottom,y=f.left,v=f.right,_=f.width,x=f.height,b=void 0,w=void 0,S=p.scrollWidth,M=p.scrollHeight,C=u1(p),T=p.scrollLeft,I=p.scrollTop;p===c?(b=_<S&&("auto"===C.overflowX||"scroll"===C.overflowX||"visible"===C.overflowX),w=x<M&&("auto"===C.overflowY||"scroll"===C.overflowY||"visible"===C.overflowY)):(b=_<S&&("auto"===C.overflowX||"scroll"===C.overflowX),w=x<M&&("auto"===C.overflowY||"scroll"===C.overflowY));var D=b&&(Math.abs(v-o)<=s&&T+_<S)-(Math.abs(y-o)<=s&&!!T),k=w&&(Math.abs(m-a)<=s&&I+x<M)-(Math.abs(g-a)<=s&&!!I);if(!B2[h])for(var A=0;A<=h;A++)B2[A]||(B2[A]={});B2[h].vx==D&&B2[h].vy==k&&B2[h].el===p||(B2[h].el=p,B2[h].vx=D,B2[h].vy=k,clearInterval(B2[h].pid),0==D&&0==k||(u=!0,B2[h].pid=setInterval(function(){i&&0===this.layer&&S2.active._onTouchMove(O2);var e=B2[this.layer].vy?B2[this.layer].vy*l:0,n=B2[this.layer].vx?B2[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(S2.dragged.parentNode[T1],n,e,t,O2,B2[this.layer].el)||S1(B2[this.layer].el,n,e)}.bind({layer:h}),24))),h++}while(e.bubbleScroll&&d!==c&&(d=x1(d,!1)));N2=u}},30),H2=function(t){var e=t.originalEvent,n=t.putSortable,i=t.dragEl,r=t.activeSortable,o=t.dispatchSortableEvent,a=t.hideGhostForTarget,s=t.unhideGhostForTarget;if(e){var l=n||r;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(u)&&(o("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function j2(){}function W2(){}j2.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=m1(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(e,i):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:H2},Y0(j2,{pluginName:"revertOnSpill"}),W2.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:H2},Y0(W2,{pluginName:"removeOnSpill"}),S2.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?n1(document,"dragover",this._handleAutoScroll):this.options.supportPointer?n1(document,"pointermove",this._handleFallbackAutoScroll):e.touches?n1(document,"touchmove",this._handleFallbackAutoScroll):n1(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?i1(document,"dragover",this._handleAutoScroll):(i1(document,"pointermove",this._handleFallbackAutoScroll),i1(document,"touchmove",this._handleFallbackAutoScroll),i1(document,"mousemove",this._handleFallbackAutoScroll)),F2(),z2(),clearTimeout(s1),s1=void 0},nulling:function(){O2=E2=A2=N2=R2=L2=P2=null,B2.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,i=(t.touches?t.touches[0]:t).clientX,r=(t.touches?t.touches[0]:t).clientY,o=document.elementFromPoint(i,r);if(O2=t,e||this.options.forceAutoScrollFallback||Z0||$0||J0){V2(t,this.options,o,e);var a=x1(o,!0);!N2||R2&&i===L2&&r===P2||(R2&&F2(),R2=setInterval(function(){var o=x1(document.elementFromPoint(i,r),!0);o!==a&&(a=o,z2()),V2(t,n.options,o,e)},10),L2=i,P2=r)}else{if(!this.options.bubbleScroll||x1(o,!0)===p1())return void z2();V2(t,this.options,x1(o,!1),!1)}}},Y0(t,{pluginName:"scroll",initializeByDefault:!0})}),S2.mount(W2,j2);const G2=S2;console.log("🚀 campaign-edit.js carregado"),window.countrySelector=function(){return{loading:!0,topCountries:[],selectedCountries:["AA"],init(){this.loadCountries()},async loadCountries(){try{console.log("🌍 Alpine.js: Carregando países...");const t=await fetch("/api/countries"),e=await t.json();e.success&&(window.allCountries=e.data,this.topCountries=e.data.slice(0,7),this.loading=!1,console.log("✅ Alpine.js: Países carregados:",this.topCountries.length))}catch(t){console.error("❌ Alpine.js: Erro ao carregar países:",t),this.loading=!1}},isCountrySelected(t){return this.selectedCountries.includes(t)},toggleCountry(t,e){if(!e)return;const n=e.querySelector(".tracker-countries");let i=n.value.split(",").filter(Boolean);if(this.isCountrySelected(t)){if(i=i.filter(e=>e!==t),0===i.length)return void alert("Deve manter pelo menos um país");this.selectedCountries=this.selectedCountries.filter(e=>e!==t)}else i.includes(t)||i.push(t),this.selectedCountries.includes(t)||this.selectedCountries.push(t);n.value=i.join(","),p5(e),n5(e)}}};let U2=null,q2="",Y2=[],X2=null,$2=0,Z2=[],K2=null,J2=[],Q2={};async function t5(){try{const t=await fetch("/api/advertising/ad-formats"),e=await t.json();e.success&&e.data&&(J2=e.data,Q2={},J2.forEach(t=>{Q2[t.id]={format:t.format_key,name:t.name}}))}catch(t){const e=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_ad_formats"):"Erro ao carregar formatos de anúncio:";console.error(e,t),J2=[]}}function e5(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=document.getElementById("tracker-template").content.cloneNode(!0);$2++;const i=(null==t?void 0:t.id)||"new_"+Date.now(),r=String($2).padStart(2,"0"),o=n.querySelector(".tracker-item");o.dataset.trackerId=i,o.dataset.order=null!==e?e:$2-1,n.querySelector(".tracker-number").textContent=r;const a=o.querySelector("#format-buttons-container");a&&(a.innerHTML="",J2.forEach(t=>{const e=document.createElement("button");e.type="button",e.className="btn btn-sm btn-outline-info format-btn",e.dataset.format=t.format_key,e.dataset.name=t.name,e.textContent=t.name.replace(" Banner","").replace(" Format",""),t.description&&(e.setAttribute("title",t.description),e.setAttribute("data-bs-toggle","tooltip")),a.appendChild(e)}));const s=o.querySelector(".tracker-brand");console.log("🔍 Preenchendo dropdown de brands..."),console.log("window.availableBrands:",window.availableBrands),window.availableBrands&&window.availableBrands.length>0?(s.innerHTML='<option value="">Selecione...</option>'+window.availableBrands.map(e=>'<option value="'.concat(e.id,'" ').concat(String(null==t?void 0:t.brand_id)===String(e.id)?"selected":"",">").concat(e.name,"</option>")).join(""),console.log("✅ Dropdown de brands preenchido com",window.availableBrands.length,"opções"),null!=t&&t.brand_id&&(s.value=String(t.brand_id),console.log("✅ Brand selecionada:",t.brand_id),setTimeout(()=>{d5(s)},100))):(console.error("❌ Nenhuma brand disponível para preencher dropdown"),s.innerHTML='<option value="">Carregando brands...</option>'),null!=t&&t.brand_id&&h5(t.brand_id).then(e=>{const n=o.querySelector(".tracker-landing-type");e.length>0&&(n.innerHTML='<option value="">Selecione um tipo...</option>'+e.map(e=>'<option value="'.concat(e.id,'" data-template="').concat(e.template_url||"",'" ').concat((null==t?void 0:t.landing_type_id)==e.id?"selected":"",">").concat(e.name,"</option>")).join(""),n.disabled=!1,null!=t&&t.landing_type_id&&(n.value=String(t.landing_type_id)))});const l=null!=t&&t.countries?t.countries.split(","):["AA"];o.querySelector(".tracker-countries").value=l.join(","),o.querySelectorAll(".country-btn").forEach(t=>{l.includes(t.dataset.country)?t.classList.add("active"):t.classList.remove("active"),t.addEventListener("click",function(){const t=o.querySelector(".tracker-countries");let e=t.value.split(",").filter(Boolean);if(this.classList.contains("active")){if(e=e.filter(t=>t!==this.dataset.country),0===e.length)return void alert("Deve manter pelo menos um país");this.classList.remove("active")}else e.includes(this.dataset.country)||e.push(this.dataset.country),this.classList.add("active");t.value=e.join(","),p5(o),n5(o)})}),p5(o);let c=(null==t?void 0:t.format)||"sticky-bottom",u=(null==t?void 0:t.format_name)||"Sticky Bottom Banner";if(null!=t&&t.format_id&&(null==t||!t.format)){const e=Q2[t.format_id];e&&(c=e.format,u=e.name)}o.querySelector(".tracker-format").value=c,o.querySelector(".tracker-format-name").value=u,o.querySelectorAll(".format-btn").forEach(t=>{t.dataset.format===c?t.classList.add("active"):t.classList.remove("active"),t.addEventListener("click",function(){o.querySelectorAll(".format-btn").forEach(t=>t.classList.remove("active")),this.classList.add("active"),o.querySelector(".tracker-format").value=this.dataset.format,o.querySelector(".tracker-format-name").value=this.dataset.name,i5(o)})}),o.querySelector(".tracker-active").checked=0!==(null==t?void 0:t.is_active),document.getElementById("trackers-container").appendChild(n);const h=document.querySelector('[data-tracker-id="'.concat(i,'"]'));h&&n5(h),setTimeout(()=>{const t=document.querySelectorAll(".tracker-item");t.forEach(e=>{const n=e.querySelector(".btn-soft-danger");n&&(n.style.display=t.length>1?"":"none")})},10)}function n5(t){const e=t.querySelector(".tracker-number").textContent,n=t.querySelector(".tracker-countries").value.split(",").filter(Boolean)[0]||"AA",i=q2?"".concat(q2,"-").concat(n,"-").concat(e):"XX-XX-000-".concat(n,"-").concat(e);t.querySelector(".tracker-display-name").textContent=i,i5(t)}function i5(t){const e=t.querySelector(".format-btn.active"),n=(null==e?void 0:e.dataset.name)||"Sticky Bottom Banner";t.querySelector(".tracker-info").textContent=n}function r5(){e5(),a5()}function o5(){$2=0,document.querySelectorAll(".tracker-item").forEach(t=>{$2++;const e=String($2).padStart(2,"0");t.querySelector(".tracker-number").textContent=e,n5(t)})}function a5(){document.querySelectorAll(".tracker-item").forEach((t,e)=>{t.dataset.order=e})}function s5(t){t.preventDefault();const e={name:document.getElementById("campaign-name").value,status:parseInt(document.getElementById("campaign-status").value),start_date:document.getElementById("start-date").value,end_date:document.getElementById("no-end-date").checked?null:document.getElementById("end-date").value,has_end_date:!document.getElementById("no-end-date").checked};fetch("/api/advertising/campaigns/".concat(U2),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.message||"Erro ao guardar campanha");!function(){const t=document.querySelectorAll(".tracker-item"),e=[];t.forEach((t,n)=>{const i={id:t.dataset.trackerId.startsWith("new_")?null:t.dataset.trackerId,name:t.querySelector(".tracker-display-name").textContent,countries:t.querySelector(".tracker-countries").value.split(",").filter(Boolean),format_id:l5(t.querySelector(".tracker-format").value),format_name:t.querySelector(".tracker-format-name").value,is_active:t.querySelector(".tracker-active").checked?1:0,order:n,brand_id:t.querySelector(".tracker-brand").value?parseInt(t.querySelector(".tracker-brand").value):null,landing_type_id:t.querySelector(".tracker-landing-type").value?parseInt(t.querySelector(".tracker-landing-type").value):null};e.push(i)}),fetch("/api/advertising/campaigns/".concat(U2,"/trackers"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({trackers:e})}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.message||"Erro ao guardar trackers");alert("Campanha e trackers guardados com sucesso!"),window.location.href="/advertising/campaigns"}).catch(t=>{console.error("Error saving trackers:",t),alert("Erro ao guardar trackers: "+t.message)})}()}).catch(t=>{console.error("Error saving campaign:",t),alert("Erro ao guardar campanha: "+t.message)})}function l5(t){const e=J2.find(e=>e.format_key===t);return e?e.id:1}async function c5(){console.log("🌍 loadCountries chamada (legacy - mantido para compatibilidade)")}async function u5(){try{console.log("🔍 Carregando brands...");const t=await fetch("/api/advertising/brands"),e=await t.json();e.success&&e.data?(window.availableBrands=e.data,console.log("✅ Brands carregadas:",window.availableBrands.length,"marcas"),console.log("Marcas:",window.availableBrands.map(t=>t.name))):console.error("❌ API retornou sucesso mas sem dados")}catch(t){const e=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_brands"):"Erro ao carregar brands:";console.error(e,t)}}async function h5(t){if(!t)return[];try{let e=await fetch("/api/advertising/campaigns/37/brand/".concat(t,"/landing-types"));e.ok||(e=await fetch("/api/advertising/brand/".concat(t,"/landingtypes"))),e.ok||(e=await fetch("/api/advertising/brand/".concat(t,"/landing-types"))),e.ok||(e=await fetch("/api/advertising/landing-types/brand/".concat(t))),e.ok||(e=await fetch("/api/advertising/landing-types/brand-id/".concat(t)));const n=await e.json();if(n.success&&n.data)return n.data}catch(t){const e=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_landing_types"):"Erro ao carregar landing types:";console.error(e,t)}return[]}async function d5(t){const e=t.closest(".tracker-item"),n=t.value,i=e.querySelector(".tracker-landing-type"),r=i.closest(".col-md-4");if(i.innerHTML='<option value="">A carregar...</option>',i.disabled=!0,!n){const t=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.select_brand_first"):"Selecione a marca primeiro";return void(i.innerHTML='<option value="">'+t+"</option>")}const o=await h5(n);if(0===o.length){const t=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.no_landing_types"):"Nenhum tipo disponível";return void(i.innerHTML='<option value="">'+t+"</option>")}if(1===o.length){r.style.display="none",i.value=o[0].id,i.disabled=!1;let t=e.querySelector(".tracker-landing-type-hidden");t||(t=document.createElement("input"),t.type="hidden",t.className="tracker-landing-type-hidden",i.parentNode.appendChild(t)),t.value=o[0].id,console.log("✅ Landing type única selecionada automaticamente:",o[0].name)}else r.style.display="",i.innerHTML='<option value="">Selecione um tipo...</option>'+o.map(t=>'<option value="'.concat(t.id,'" data-template="').concat(t.template_url||"",'">').concat(t.name,"</option>")).join(""),i.disabled=!1,console.log("📋 Múltiplas landing types disponíveis:",o.length)}function p5(t){const e=t.querySelector(".tracker-countries").value.split(",").filter(Boolean);t.querySelector(".selected-countries").innerHTML=e.map(t=>'<span class="badge bg-primary" onclick="removeCountry(this, \''.concat(t,"')\">").concat(t,"</span>")).join("")}function f5(){return{init(){console.log("🚀 Campaign Create page initialized"),this.initializeForm(),this.initializeTooltips()},initializeForm(){const t=document.getElementById("no_end_date"),e=document.getElementById("end_date");t&&e&&(t.addEventListener("change",()=>{t.checked?(e.value="",e.disabled=!0,e.removeAttribute("required")):(e.disabled=!1,e.setAttribute("required","required"))}),t.dispatchEvent(new Event("change")));const n=document.getElementById("campaignCreateForm");n&&n.addEventListener("submit",this.handleFormSubmit.bind(this))},initializeTooltips(){"undefined"!=typeof bootstrap&&[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(t){return new bootstrap.Tooltip(t)})},handleFormSubmit(t){t.preventDefault();const e=t.target,n=Object.fromEntries(new FormData(e));n.has_end_date=!document.getElementById("no_end_date").checked,n.has_end_date||(n.end_date=null),n.name&&n.status&&n.budget&&n.start_date?this.submitCampaign(n,e):this.showError("Preencha todos os campos obrigatórios.")},async submitCampaign(t,e){try{const n=await fetch(e.action,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await n.json();i.success?(this.showSuccess("Campanha criada com sucesso!"),setTimeout(()=>{window.location.href="/advertising/campaigns"},1500)):this.showError(i.message||"Erro ao criar campanha")}catch(t){console.error("Erro ao submeter campanha:",t),this.showError("Erro de comunicação. Tente novamente.")}},showSuccess(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-success alert-dismissible fade show",e.innerHTML='\n <i class="ri-check-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},showError(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-danger alert-dismissible fade show",e.innerHTML='\n <i class="ri-error-warning-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},removeExistingAlerts(){document.querySelectorAll(".alert").forEach(t=>t.remove())},insertAlert(t){const e=document.getElementById("campaignCreateForm");e&&e.parentNode&&e.parentNode.insertBefore(t,e)}}}function g5(){return{formats:[],mimeTypes:[],init(){console.log("🚀 Creative Create page initialized"),this.loadFormData(),this.initializeForm()},async loadFormData(){try{const t=await fetch("/api/advertising/creative-formats"),e=await t.json();e.success&&(this.formats=e.data,this.populateFormats());const n=await fetch("/api/advertising/mime-types"),i=await n.json();i.success&&(this.mimeTypes=i.data,this.populateMimeTypes())}catch(t){console.error("Erro ao carregar dados do formulário:",t)}},populateFormats(){const t=document.getElementById("format_id");t&&(t.innerHTML='<option value="">Selecione...</option>',this.formats.forEach(e=>{const n=document.createElement("option");n.value=e.id,n.textContent=e.name,t.appendChild(n)}))},populateMimeTypes(){const t=document.getElementById("mime_type");t&&(t.innerHTML="",this.mimeTypes.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},initializeForm(){const t=document.getElementById("creativeCreateForm");t&&t.addEventListener("submit",this.handleFormSubmit.bind(this))},handleFormSubmit(t){t.preventDefault();const e=t.target,n=Object.fromEntries(new FormData(e));n.name&&n.format_id?this.submitCreative(n,e):this.showError("Preencha todos os campos obrigatórios.")},async submitCreative(t,e){try{const n=await fetch(e.action,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await n.json();i.success?(this.showSuccess("Criativo criado com sucesso!"),setTimeout(()=>{window.location.href="/advertising/creatives"},1500)):this.showError(i.message||"Erro ao criar criativo")}catch(t){console.error("Erro ao submeter criativo:",t),this.showError("Erro de comunicação. Tente novamente.")}},showSuccess(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-success alert-dismissible fade show",e.innerHTML='\n <i class="ri-check-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},showError(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-danger alert-dismissible fade show",e.innerHTML='\n <i class="ri-error-warning-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},removeExistingAlerts(){document.querySelectorAll(".alert").forEach(t=>t.remove())},insertAlert(t){const e=document.getElementById("creativeCreateForm");e&&e.parentNode&&e.parentNode.insertBefore(t,e)}}}function m5(){return{domainIndex:1,statuses:[],themes:[],init(){console.log("🚀 Site Group Create page initialized"),this.loadFormData(),this.initializeDomainManagement(),this.initializeForm()},async loadFormData(){try{const t=await fetch("/api/advertising/site-group-statuses"),e=await t.json();e.success&&(this.statuses=e.data,this.populateStatuses());const n=await fetch("/api/advertising/theme-options"),i=await n.json();i.success&&(this.themes=i.data,this.populateThemes())}catch(t){console.error("Erro ao carregar dados do formulário:",t)}},populateStatuses(){const t=document.getElementById("status");t&&(t.innerHTML="",this.statuses.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},populateThemes(){const t=document.getElementById("settings_theme");t&&(t.innerHTML="",this.themes.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},initializeDomainManagement(){const t=document.getElementById("add-domain");t&&t.addEventListener("click",this.addDomain.bind(this)),document.addEventListener("click",t=>{t.target.classList.contains("remove-domain")&&this.removeDomain(t.target)})},initializeForm(){const t=document.getElementById("siteGroupCreateForm");t&&t.addEventListener("submit",this.handleFormSubmit.bind(this))},addDomain(){const t=document.getElementById("domains-container");if(!t)return;const e=document.createElement("div");e.className="row g-2 mb-2 domain-row",e.innerHTML='\n <div class="col-md-4">\n <input type="text" class="form-control" name="domains[]" placeholder="exemplo.com" required>\n </div>\n <div class="col-md-3">\n <input type="text" class="form-control" name="subdomains[]" placeholder="www (opcional)">\n </div>\n <div class="col-md-3">\n <div class="form-check">\n <input class="form-check-input" type="radio" name="primary_domain" value="'.concat(this.domainIndex,'">\n <label class="form-check-label">Domínio Principal</label>\n </div>\n </div>\n <div class="col-md-2">\n <button type="button" class="btn btn-outline-danger btn-sm remove-domain">\n <i class="ri-delete-bin-line"></i>\n </button>\n </div>\n '),t.appendChild(e),this.domainIndex++},removeDomain(t){const e=t.closest(".domain-row");e&&e.remove()},handleFormSubmit(t){t.preventDefault();const e=t.target,n=Object.fromEntries(new FormData(e));n.name&&n.domains&&0!==n.domains.length?this.submitSiteGroup(n,e):this.showError("Preencha todos os campos obrigatórios.")},async submitSiteGroup(t,e){try{const n=await fetch(e.action,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await n.json();i.success?(this.showSuccess("Site Group criado com sucesso!"),setTimeout(()=>{window.location.href="/advertising/site-groups"},1500)):this.showError(i.message||"Erro ao criar site group")}catch(t){console.error("Erro ao submeter site group:",t),this.showError("Erro de comunicação. Tente novamente.")}},showSuccess(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-success alert-dismissible fade show",e.innerHTML='\n <i class="ri-check-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},showError(t){this.removeExistingAlerts();const e=document.createElement("div");e.className="alert alert-danger alert-dismissible fade show",e.innerHTML='\n <i class="ri-error-warning-line me-1"></i> '.concat(t,'\n <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>\n '),this.insertAlert(e)},removeExistingAlerts(){document.querySelectorAll(".alert").forEach(t=>t.remove())},insertAlert(t){const e=document.getElementById("siteGroupCreateForm");e&&e.parentNode&&e.parentNode.insertBefore(t,e)}}}function y5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function v5(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y5(Object(n),!0).forEach(function(e){_5(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y5(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function _5(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}document.addEventListener("DOMContentLoaded",async function(){const t=document.getElementById("campaign-id");var e,n,i;t&&(U2=t.value,q2=t.dataset.alias||"XX"),await Promise.all([t5(),c5(),u5()]),U2&&(console.log("Loading campaign data for ID:",U2),fetch("/api/advertising/campaigns/".concat(U2,"/trackers")).then(t=>(console.log("Response status:",t.status),t.json())).then(t=>{console.log("Trackers data:",t),t.success&&t.data&&(Y2=t.data,document.getElementById("trackers-container").innerHTML="",$2=0,0!==Y2.length?Y2.forEach((t,e)=>{e5(t,e)}):r5())}).catch(t=>{console.error("Error loading trackers:",t)})),function(){const t=document.getElementById("trackers-container");t&&(X2=G2.create(t,{handle:".drag-handle",animation:150,ghostClass:"dragging",onEnd:function(t){a5(),o5()}}))}(),null===(e=document.getElementById("no-end-date"))||void 0===e||e.addEventListener("change",function(){const t=document.getElementById("end-date");this.checked?(t.value="",t.disabled=!0):t.disabled=!1}),null===(n=document.getElementById("campaign-edit-form"))||void 0===n||n.addEventListener("submit",s5),null===(i=document.getElementById("country-search"))||void 0===i||i.addEventListener("input",function(t){const e=t.target.value.toLowerCase();document.querySelectorAll("#countries-grid .col-md-4").forEach(t=>{const n=t.textContent.toLowerCase();t.style.display=n.includes(e)?"":"none"})})}),window.addNewTracker=r5,window.removeTracker=async function(t){document.querySelectorAll(".tracker-item").length<=1?Swal.fire({icon:"warning",title:"Atenção",text:"Deve manter pelo menos um tracker"}):(window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")&&Alpine.store("i18n").t("advertising.common.confirm_remove"),(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#6c757d",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-primary w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&(t.closest(".tracker-item").remove(),a5(),o5()))},window.updateLandingTypes=d5,window.updateTrackerUrl=function(t){var e;const n=t.options[t.selectedIndex],i=(null==n||null===(e=n.dataset)||void 0===e?void 0:e.template)||"";i&&console.log("Template URL:",i)},window.openCountryModal=function(t){K2=t.closest(".tracker-item");const e=K2.querySelector(".tracker-countries").value.split(",").filter(Boolean),n=document.getElementById("countries-grid");n.innerHTML=Z2.map(t=>'\n <div class="col-md-4">\n <label class="country-checkbox '.concat(e.includes(t.code)?"selected":"",'">\n <input type="checkbox" value="').concat(t.code,'" ').concat(e.includes(t.code)?"checked":"",">\n <strong>").concat(t.code,"</strong> - ").concat(t.name,"\n </label>\n </div>\n ")).join(""),n.querySelectorAll(".country-checkbox").forEach(t=>{t.addEventListener("click",function(t){if("checkbox"!==t.target.type){const t=this.querySelector("input");t.checked=!t.checked}this.classList.toggle("selected")})}),new bootstrap.Modal(document.getElementById("countryModal")).show()},window.applyCountrySelection=function(){if(!K2)return;const t=Array.from(document.querySelectorAll("#countries-grid input:checked")).map(t=>t.value);0!==t.length?(K2.querySelector(".tracker-countries").value=t.join(","),K2.querySelectorAll(".country-btn").forEach(e=>{e.classList.toggle("active",t.includes(e.dataset.country))}),p5(K2),n5(K2),bootstrap.Modal.getInstance(document.getElementById("countryModal")).hide()):alert("Selecione pelo menos um país")},window.removeCountry=function(t,e){var n;const i=t.closest(".tracker-item"),r=i.querySelector(".tracker-countries");let o=r.value.split(",").filter(Boolean);o=o.filter(t=>t!==e),0!==o.length?(r.value=o.join(","),t.remove(),null===(n=i.querySelector('.country-btn[data-country="'.concat(e,'"]')))||void 0===n||n.classList.remove("active"),n5(i)):alert("Deve manter pelo menos um país")},n(3921);const x5=()=>({siteGroups:[],loading:!1,error:null,filters:{search:"",status:"all"},pagination:{page:1,limit:20,total:0,pages:0},init(){this.checkUrlErrors(),this.loadSiteGroups()},checkUrlErrors(){const t=new URLSearchParams(window.location.search),e=t.get("error"),n=t.get("id");if("not_found"===e){this.error={type:"warning",title:"Site Group não encontrado",message:"O site group com ID ".concat(n||"especificado"," não existe ou foi removido."),show:!0};const t=window.location.pathname;window.history.replaceState({},document.title,t),setTimeout(()=>{this.error&&(this.error.show=!1)},5e3)}},dismissError(){this.error&&(this.error.show=!1)},async loadSiteGroups(){this.loading=!0;try{const t=new URLSearchParams({page:this.pagination.page,limit:this.pagination.limit,search:this.filters.search,status:this.filters.status}),e=await fetch("/api/advertising/site-groups?".concat(t)),n=await e.json();n.success?(this.siteGroups=n.data||[],this.pagination=v5(v5({},this.pagination),{},{total:n.total||0,pages:Math.ceil((n.total||0)/this.pagination.limit)})):(console.error("Failed to load site groups:",n.message),this.showToast("Erro ao carregar site groups","danger"))}catch(t){console.error("Error loading site groups:",t),this.showToast("Erro ao carregar site groups","danger")}finally{this.loading=!1}},searchSiteGroups(){this.pagination.page=1,this.loadSiteGroups()},async deleteSiteGroup(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/site-groups/".concat(t),{method:"DELETE"}),n=await e.json();n.success?(this.showToast("Site group eliminado com sucesso","success"),this.loadSiteGroups()):this.showToast("Erro ao eliminar site group: "+n.message,"danger")}catch(t){console.error("Error deleting site group:",t),this.showToast("Erro ao eliminar site group","danger")}},getStatusClass:t=>({active:"bg-success",inactive:"bg-secondary",pending:"bg-warning",in_preparation:"bg-info",ready:"bg-success",live:"bg-success",to_do:"bg-danger",awaiting_creatives:"bg-info",created_but_error:"bg-danger",n_a:"bg-secondary",to_be_retired:"bg-warning",retired:"bg-dark",requires_brand_change:"bg-info",requires_url_change:"bg-info",requires_format_change:"bg-info",requires_cap_change:"bg-dark",paused:"bg-warning",format_needs_coding:"bg-info"}[t]||"bg-secondary"),getStatusText:t=>({active:"Ativo",inactive:"Inativo",pending:"Pendente",in_preparation:"Em Preparação",ready:"Pronto",live:"Live",to_do:"Por Fazer",awaiting_creatives:"Aguarda Criativos",created_but_error:"Criado mas Erro",n_a:"N/A",to_be_retired:"Para Retirar",retired:"Retirado",requires_brand_change:"Requer Mudança de Marca",requires_url_change:"Requer Mudança de URL",requires_format_change:"Requer Mudança de Formato",requires_cap_change:"Requer Mudança de Cap",paused:"Pausado",format_needs_coding:"Formato Precisa Codificação"}[t]||"Desconhecido"),formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{day:"2-digit",month:"2-digit",year:"numeric"}):"N/A",changePage(t){t>=1&&t<=this.pagination.pages&&(this.pagination.page=t,this.loadSiteGroups())},showToast(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";"success"===e?alert("✅ "+t):"danger"===e?alert("❌ "+t):alert(t)}});function b5(){fetch("/api/advertising/dashboard/stats").then(t=>t.json()).then(t=>{if(t.success){const e=t.data,n=document.getElementById("total-campaigns-count");n&&(n.setAttribute("data-target",e.total_campaigns),w5(n,e.total_campaigns));const i=document.getElementById("active-campaigns-count");i&&(i.setAttribute("data-target",e.active_campaigns),w5(i,e.active_campaigns));const r=document.getElementById("paused-campaigns-count");r&&(r.setAttribute("data-target",e.paused_campaigns),w5(r,e.paused_campaigns));const o=document.getElementById("no-end-date-count");o&&(o.setAttribute("data-target",e.no_end_date_campaigns),w5(o,e.no_end_date_campaigns))}}).catch(t=>{const e=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_statistics"):"Erro ao carregar estatísticas:";console.error(e,t)})}function w5(t,e){let n=0;const i=e/100,r=setInterval(()=>{n+=i,t.textContent=Math.floor(n),n>=e&&(t.textContent=e,clearInterval(r))},20)}"undefined"!=typeof Alpine?Alpine.data("siteGroupsManager",x5):document.addEventListener("alpine:init",()=>{Alpine.data("siteGroupsManager",x5)}),document.addEventListener("DOMContentLoaded",function(){b5(),function(){const t=document.querySelector("#ad-stats-chart");t?fetch("/api/advertising/dashboard/daily-performance").then(t=>t.json()).then(e=>{if(e.success){const n=e.data,i=n.map(t=>t.date),r={chart:{type:"line",height:300,toolbar:{show:!1}},series:[{name:"Visualizações",data:n.map(t=>t.views)},{name:"Cliques",data:n.map(t=>t.clicks)}],xaxis:{categories:i,labels:{rotate:-45}},yaxis:{min:0},colors:["#3577f1","#f06548"],stroke:{width:3},markers:{size:4},legend:{position:"top"}};window.ApexCharts?(new ApexCharts(t,r).render(),console.log("[DEBUG] Daily performance chart rendered successfully")):console.log("[DEBUG] ApexCharts not available, skipping chart render")}else console.log("[DEBUG] API returned success=false for daily performance")}).catch(e=>{const n=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_chart"):"Erro ao carregar gráfico";t.innerHTML='<div class="text-danger">'+n+"</div>",console.log("[DEBUG] Error loading daily performance chart:",e)}):console.log("[DEBUG] Chart element #ad-stats-chart not found, skipping chart initialization")}(),function(){if(window.location.pathname.includes("/campaigns"))return void console.log("[DEBUG] On campaigns page, skipping top campaigns load");const t=document.getElementById("top-campaigns-table");if(!t)return void console.log("[DEBUG] #top-campaigns-table not found, skipping top campaigns load");const e=t.querySelector("tbody");e?fetch("/api/advertising/dashboard/top-campaigns").then(t=>t.json()).then(t=>{t.success&&t.data.length>0?(e.innerHTML="",console.log("[DEBUG] Loading ".concat(t.data.length," top campaigns")),t.data.forEach(t=>{const n=1===t.status?"bg-soft-success text-success":"bg-soft-warning text-warning",i='\n <tr>\n <td>\n <div class="d-flex align-items-center">\n <div class="flex-grow-1">\n <h6 class="mb-0">'.concat(t.name,'</h6>\n <small class="text-muted">ID: ').concat(t.id,'</small>\n </div>\n </div>\n </td>\n <td><span class="badge bg-soft-info text-info">').concat(t.type,'</span></td>\n <td><span class="badge ').concat(n,'">').concat(t.status,'</span></td>\n <td><span class="counter-value">').concat(t.views||0,'</span></td>\n <td><span class="text-success">').concat(t.ctr||0,"%</span></td>\n <td>").concat(t.period||"Sem fim","</td>\n </tr>\n ");e.innerHTML+=i}),console.log("[DEBUG] Top campaigns loaded successfully")):(console.log("[DEBUG] No top campaigns data available"),e.innerHTML='<tr><td colspan="6" class="text-center">Nenhuma campanha encontrada</td></tr>')}).catch(t=>{const n=window.Alpine&&window.Alpine.store&&window.Alpine.store("i18n")?Alpine.store("i18n").t("advertising.common.error_loading_campaigns"):"Erro ao carregar campanhas:";console.error("[DEBUG] "+n,t),e.innerHTML='<tr><td colspan="6" class="text-center text-danger">Erro ao carregar campanhas</td></tr>'}):console.log("[DEBUG] Table tbody not found, skipping top campaigns load")}(),function(){const t=document.getElementById("activity-timeline");t?fetch("/api/advertising/activity-log").then(t=>t.json()).then(e=>{if(!e.success||!e.data||0===e.data.length)return t.innerHTML='<div class="timeline-item"><div class="timeline-marker bg-secondary"></div><div class="timeline-content"><h6 class="mb-1">Sem eventos recentes</h6></div></div>',void console.log("[DEBUG] No activity data available, showing empty state");console.log("[DEBUG] Loading ".concat(e.data.length," activity events")),t.innerHTML=e.data.map(t=>'\n <div class="timeline-item">\n <div class="timeline-marker bg-primary"></div>\n <div class="timeline-content">\n <h6 class="mb-1">'.concat("create"===t.event_type?"Campanha criada":"Campanha atualizada",'</h6>\n <p class="text-muted mb-0">').concat(t.description||"",'</p>\n <small class="text-muted">').concat(new Date(t.created_at).toLocaleString("pt-PT"),"</small>\n </div>\n </div>\n ")).join(""),console.log("[DEBUG] Activity timeline loaded successfully")}).catch(e=>{console.error("[DEBUG] Error loading activity timeline:",e),t.innerHTML='<div class="timeline-item"><div class="timeline-marker bg-danger"></div><div class="timeline-content"><h6 class="mb-1 text-danger">Erro ao carregar timeline</h6></div></div>'}):console.log("[DEBUG] Activity timeline container not found, skipping timeline load")}(),document.querySelectorAll(".counter-value").forEach(t=>{const e=parseInt(t.getAttribute("data-target"));e>0&&w5(t,e)}),function(){const t=document.getElementById("campaign-types-data");if(!t)return void console.log("[DEBUG] Campaign types data element not found, skipping chart initialization");const e=document.querySelector("#campaignTypeChart");if(e)try{const n=JSON.parse(t.textContent);if(!n||"object"!=typeof n)return void console.log("[DEBUG] No campaign types data available");const i=Object.keys(n),r=Object.values(n);if(0===i.length)return void console.log("[DEBUG] No campaign types data available");console.log("[DEBUG] Initializing campaign type chart with ".concat(i.length," types"));const o={series:r,chart:{type:"donut",height:300},labels:i,colors:["#3577f1","#0ab39c","#f7b84b","#f06548"],legend:{position:"bottom"},responsive:[{breakpoint:480,options:{chart:{width:200},legend:{position:"bottom"}}}]};window.ApexCharts?(new ApexCharts(e,o).render(),console.log("[DEBUG] Campaign type chart rendered successfully")):console.log("[DEBUG] ApexCharts not available, skipping campaign type chart render")}catch(t){console.error("[DEBUG] Error initializing campaign type chart:",t)}else console.log("[DEBUG] Campaign type chart element not found, skipping chart initialization")}()}),window.loadDashboardStats=b5,window.animateCounter=w5,n(4864);let S5=[],M5={};async function C5(){try{const t=await fetch("/api/advertising/brands"),e=await t.json();e.success&&(S5=e.data,console.log("Brands loaded:",S5))}catch(t){console.error("Erro ao carregar marcas:",t)}}async function T5(t){if(!t)return[];try{const e=await fetch("/api/advertising/brand/".concat(t,"/landing-types")),n=await e.json();return n.success?(M5[t]=n.data,n.data):(console.error("Erro ao carregar landing types:",n.message),[])}catch(t){return console.error("Erro ao carregar landing types:",t),[]}}async function I5(t){const e=t.closest(".tracker-item").querySelector(".tracker-landing-type"),n=t.value;if(!n)return e.innerHTML='<option value="">Selecione a marca primeiro</option>',void(e.disabled=!0);e.innerHTML='<option value="">Carregando...</option>',e.disabled=!0;const i=await T5(n);e.innerHTML='<option value="">Selecione...</option>',i.forEach(t=>{const n=document.createElement("option");n.value=t.id,n.textContent=t.name,n.dataset.templateUrl=t.template_url,n.dataset.variables=JSON.stringify(t.template_variables||{}),e.appendChild(n)}),e.disabled=!1}function D5(t){const e=t.closest(".tracker-item"),n=t.selectedOptions[0];if(!n||!n.value)return;const i=n.dataset.templateUrl,r=(JSON.parse(n.dataset.variables||"{}"),e.querySelector(".tracker-number").textContent),o=e.querySelector(".tracker-countries").value.split(",").filter(Boolean)[0]||"AA",a=window.campaignAlias||"XX",s="".concat(a,"-").concat(o,"-").concat(r);let l=i;const c={tracker_id:e.dataset.trackerId,code:s,campaign_alias:a,source:"bitreport",click_id:"{click_id}",utm_source:"bitreport",utm_medium:"cpc",utm_campaign:a,tracker_code:s,target_url:"{target_url}",ref_id:campaignId,campaign_id:campaignId,partner_id:"{partner_id}",subid:"{subid}",email:"{email}"};Object.keys(c).forEach(t=>{l=l.replace(new RegExp("\\{".concat(t,"\\}"),"g"),c[t])}),e.dataset.finalUrl=l,function(t,e){let n=t.querySelector(".url-preview");if(!n){n=document.createElement("div"),n.className="url-preview alert alert-info mt-2 p-2 small";const e=t.querySelector(".col-md-8");e&&e.appendChild(n)}n.innerHTML='\n <strong>URL do Tracker:</strong><br>\n <code class="text-break">'.concat(e,"</code>\n ")}(e,l)}window.campaignBrands={loadBrands:C5,loadLandingTypes:T5,updateLandingTypes:I5,updateTrackerUrl:D5,enhanceTrackerElement:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=document.createElement("input");n.type="hidden",n.className="tracker-brand-id",n.value=(null==e?void 0:e.brand_id)||"",t.appendChild(n);const i=document.createElement("input");if(i.type="hidden",i.className="tracker-landing-type-id",i.value=(null==e?void 0:e.landing_type_id)||"",t.appendChild(i),function(t){const e=t.querySelector(".tracker-brand");e&&(e.innerHTML='<option value="">Selecione...</option>',S5.forEach(t=>{const n=document.createElement("option");n.value=t.id,n.textContent=t.name,e.appendChild(n)}))}(t),null!=e&&e.brand_id){const n=t.querySelector(".tracker-brand");n&&(n.value=e.brand_id,I5(n).then(()=>{if(e.landing_type_id){const n=t.querySelector(".tracker-landing-type");n&&(n.value=e.landing_type_id,D5(n))}}))}},collectBrandData:function(t){const e=t.querySelector(".tracker-brand"),n=t.querySelector(".tracker-landing-type");return{brand_id:(null==e?void 0:e.value)||null,landing_type_id:(null==n?void 0:n.value)||null,final_tracking_url:t.dataset.finalUrl||null}}},document.addEventListener("DOMContentLoaded",function(){window.location.pathname.includes("/advertising/campaigns/")&&window.location.pathname.includes("/edit")&&C5()});const k5=()=>({brands:[],landingTypes:[],currentBrandId:null,currentBrandName:"",currentLandingTypes:[],isLoading:!1,showCreateModal:!1,showEditModal:!1,showPreviewModal:!1,currentLandingType:null,formData:{id:"",brand_id:"",name:"",type:"",template_url:"",tracking_script_template:"",is_active:!0},previewData:{template_url:"",template_variables:"",tracking_script:"",processed_url:""},testVariables:{tracker_id:"12345",code:"AFF001",campaign_alias:"summer2024"},async loadBrands(){this.isLoading=!0;try{const t=await fetch("/api/advertising/brands"),e=await t.json();e.success?this.brands=e.data:this.showToast("Erro ao carregar marcas","danger")}catch(t){console.error("Erro ao carregar marcas:",t),this.showToast("Erro ao carregar marcas","danger")}finally{this.isLoading=!1}},async loadBrandLandingTypes(t,e){try{const n=await fetch("/api/advertising/brand/".concat(t,"/landing-types")),i=await n.json();i.success?(this.currentBrandId=t,this.currentBrandName=e,this.currentLandingTypes=i.data):this.showToast("Erro ao carregar landing types: "+i.message,"danger")}catch(t){console.error("Erro:",t),this.showToast("Erro ao carregar landing types","danger")}},hideBrandLandingTypes(){this.currentBrandId=null,this.currentBrandName="",this.currentLandingTypes=[]},openCreateModal(){this.currentLandingType=null,this.formData={id:"",brand_id:"",name:"",type:"",template_url:"",tracking_script_template:"",is_active:!0},this.showCreateModal=!0},openEditModal(t){this.currentLandingType=t,this.formData={id:t.id,brand_id:t.brand_id,name:t.name,type:t.type,template_url:t.template_url||"",tracking_script_template:t.tracking_script_template||"",is_active:t.is_active},this.showEditModal=!0},async saveLandingType(){try{const t=this.currentLandingType?"/api/advertising/landing-types/".concat(this.currentLandingType.id):"/api/advertising/landing-types",e=this.currentLandingType?"PUT":"POST",n=await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(this.formData)}),i=await n.json();i.success?(this.showToast(i.message||"Landing type guardado com sucesso!","success"),this.showCreateModal=!1,this.showEditModal=!1,this.currentBrandId&&await this.loadBrandLandingTypes(this.currentBrandId,this.currentBrandName)):this.showToast(i.message||"Erro ao guardar landing type","danger")}catch(t){console.error("Erro ao guardar landing type:",t),this.showToast("Erro ao guardar landing type","danger")}},async previewTemplate(t){this.currentLandingType=t,this.previewData={template_url:t.template_url||"N/A",template_variables:this.formatTemplateVariables(t.template_variables),tracking_script:t.tracking_script_template||"Nenhum script configurado",processed_url:""},this.showPreviewModal=!0},formatTemplateVariables(t){if(!t)return"Nenhuma variável configurada";try{const e="string"==typeof t?JSON.parse(t):t;return Object.entries(e).map(t=>{let[e,n]=t;return"".concat(e,": ").concat(n)}).join("\n")}catch(e){return t}},async testTemplate(){try{const t=await fetch("/api/advertising/landing-types/1/process-url",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({variables:this.testVariables})}),e=await t.json();e.success?this.previewData.processed_url=e.data.processed_url:this.showToast("Erro ao processar URL: "+e.message,"danger")}catch(t){console.error("Erro:",t),this.showToast("Erro ao testar template","danger")}},openProcessedUrl(){this.previewData.processed_url&&"N/A"!==this.previewData.processed_url&&window.open(this.previewData.processed_url,"_blank")},async deleteLandingType(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/landing-types/".concat(t),{method:"DELETE"}),n=await e.json();n.success?(this.showToast("Landing type excluído com sucesso!","success"),this.currentBrandId&&await this.loadBrandLandingTypes(this.currentBrandId,this.currentBrandName)):this.showToast("Erro ao excluir: "+n.message,"danger")}catch(t){console.error("Erro:",t),this.showToast("Erro ao excluir landing type","danger")}},showToast(t){alert(t)},init(){this.loadBrands()}}),A5=k5;function E5(){return{tracker:null,loading:!0,error:null,trackerId:null,init(){const t=window.location.pathname.split("/");this.trackerId=t[t.length-1],this.trackerId&&!isNaN(this.trackerId)?this.loadTracker():(this.error="ID do tracker não especificado",this.loading=!1)},async loadTracker(){try{this.loading=!0,this.error=null;const t=await fetch("/api/advertising/trackers/".concat(this.trackerId)),e=await t.json();e.success?this.tracker=e.data:this.error=e.message||"Erro ao carregar tracker"}catch(t){console.error("Erro ao carregar tracker:",t),this.error="Erro de conexão"}finally{this.loading=!1}},copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this.$dispatch("show-toast",{type:"success",message:"URL copiada para a área de transferência!"})}).catch(()=>{const e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this.$dispatch("show-toast",{type:"success",message:"URL copiada para a área de transferência!"})})},getStatusBadgeClass:t=>t?"bg-success":"bg-danger",getStatusText:t=>t?"Ativo":"Inativo",formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"N/A"}}function L5(){return{creative:null,loading:!0,error:null,success:null,formatOptions:[],mimeTypeOptions:[],formData:{name:"",format_id:"",file_name:"",file_path:"",width:"",height:"",click_url:"",alt_text:"",mime_type:"",is_active:"1"},creativeId:null,async init(){const t=window.location.pathname.split("/");this.creativeId=t[t.length-2],this.creativeId&&"edit"!==this.creativeId&&!isNaN(this.creativeId)?(await this.loadOptions(),await this.loadCreative()):(this.error="ID do criativo não especificado",this.loading=!1)},async loadOptions(){try{const t=await fetch("/api/advertising/ad-formats"),e=await t.json();this.formatOptions=e.success?e.data:[];const n=await fetch("/api/advertising/mime-types"),i=await n.json();this.mimeTypeOptions=i.success?i.data:[]}catch(t){console.error("Erro ao carregar opções:",t)}},async loadCreative(){try{this.loading=!0,this.error=null;const t=await fetch("/api/advertising/creatives/".concat(this.creativeId)),e=await t.json();e.success?(this.creative=e.data,this.populateFormData()):this.error=e.message||"Erro ao carregar criativo"}catch(t){console.error("Erro ao carregar criativo:",t),this.error="Erro de conexão"}finally{this.loading=!1}},populateFormData(){this.creative&&(this.formData={name:this.creative.creative_name||"",format_id:this.creative.format_id||"",file_name:this.creative.file_name||"",file_path:this.creative.file_path||"",width:this.creative.width||"",height:this.creative.height||"",click_url:this.creative.click_url||"",alt_text:this.creative.alt_text||"",mime_type:this.creative.mime_type||"",is_active:this.creative.is_active||"1"})},async submitForm(){try{this.loading=!0,this.error=null,this.success=null;const t=await fetch("/api/advertising/creatives/".concat(this.creativeId),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.formData)}),e=await t.json();e.success?(this.success=e.message||"Criativo atualizado com sucesso!",await this.loadCreative()):this.error=e.message||"Erro ao atualizar criativo"}catch(t){console.error("Erro ao atualizar criativo:",t),this.error="Erro de conexão"}finally{this.loading=!1}},getStatusOptions:()=>[{value:"1",label:"Ativo"},{value:"0",label:"Pausado"}]}}"undefined"!=typeof Alpine?Alpine.data("landingTypesManager",k5):document.addEventListener("alpine:init",()=>{Alpine.data("landingTypesManager",k5)}),document.addEventListener("alpine:init",()=>{Alpine.data("detectionRulesManager",()=>({rules:[],currentRule:null,isLoading:!1,showCreateModal:!1,showTestModal:!1,showRuleTestModal:!1,formData:{id:"",brand_id:0,name:"",description:"",rule_type:"",rule_pattern:"",priority:0,is_active:!0,rule_conditions:{},extraction_rules:{},fallback_data:{}},ruleTypes:{},testUrl:"",testResult:null,ruleTestUrl:"",ruleTestResult:null,currentRuleId:null,conditionsJson:"",extractionJson:"",async loadRules(){this.isLoading=!0;try{const t=await fetch("/api/advertising/detection-rules?brand=".concat(this.formData.brand_id)),e=await t.json();e.success?this.rules=e.data:this.showToast("Erro ao carregar regras","danger")}catch(t){console.error("Erro ao carregar regras:",t),this.showToast("Erro ao carregar regras","danger")}finally{this.isLoading=!1}},async loadRuleTypes(){try{const t=await fetch("/api/advertising/detection-rules/rule-types"),e=await t.json();e.success&&(this.ruleTypes=e.data)}catch(t){console.error("Erro ao carregar tipos de regras:",t)}},openCreateModal(){this.currentRule=null,this.formData={id:"",brand_id:0,name:"",description:"",rule_type:"",rule_pattern:"",priority:0,is_active:!0,rule_conditions:{},extraction_rules:{},fallback_data:{}},this.conditionsJson="",this.extractionJson="",this.showCreateModal=!0},editRule(t){this.currentRule=t,this.formData={id:t.id,brand_id:t.brand_id,name:t.name,description:t.description||"",rule_type:t.rule_type,rule_pattern:t.rule_pattern,priority:t.priority,is_active:t.is_active,rule_conditions:t.rule_conditions?JSON.parse(t.rule_conditions):{},extraction_rules:t.extraction_rules?JSON.parse(t.extraction_rules):{},fallback_data:t.fallback_data?JSON.parse(t.fallback_data):{}},this.conditionsJson=JSON.stringify(this.formData.rule_conditions,null,2),this.extractionJson=JSON.stringify(this.formData.extraction_rules,null,2),this.showCreateModal=!0},async saveRule(){try{try{this.formData.rule_conditions=this.conditionsJson?JSON.parse(this.conditionsJson):{},this.formData.extraction_rules=this.extractionJson?JSON.parse(this.extractionJson):{}}catch(t){return void this.showToast("JSON inválido nas condições ou extrações","danger")}const t=this.currentRule?"/api/advertising/detection-rules/".concat(this.currentRule.id):"/api/advertising/detection-rules",e=this.currentRule?"PUT":"POST",n=await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(this.formData)}),i=await n.json();i.success?(this.showToast(i.message||"Regra guardada com sucesso!","success"),this.showCreateModal=!1,this.loadRules()):this.showToast(i.message||"Erro ao guardar regra","danger")}catch(t){console.error("Erro ao guardar regra:",t),this.showToast("Erro ao guardar regra","danger")}},async deleteRule(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/detection-rules/".concat(t),{method:"DELETE"}),n=await e.json();n.success?(this.showToast("Regra eliminada com sucesso!","success"),this.loadRules()):this.showToast("Erro ao eliminar regra: "+n.message,"danger")}catch(t){console.error("Erro ao eliminar regra:",t),this.showToast("Erro ao eliminar regra","danger")}},openTestModal(){this.testUrl="",this.testResult=null,this.showTestModal=!0},async testDetection(){if(this.testUrl)try{const t=await fetch("/api/advertising/detection-rules/detect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:this.testUrl})}),e=await t.json();e.success?this.testResult=e.data:this.showToast("Erro ao testar deteção: "+e.message,"danger")}catch(t){console.error("Erro ao testar deteção:",t),this.showToast("Erro ao testar deteção","danger")}else this.showToast("URL é obrigatória","warning")},async testRule(t){this.currentRuleId=t,this.ruleTestUrl="",this.ruleTestResult=null,this.showRuleTestModal=!0},async testSpecificRule(){if(this.ruleTestUrl)try{const t=await fetch("/api/advertising/detection-rules/".concat(this.currentRuleId,"/test"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:this.ruleTestUrl})}),e=await t.json();e.success?this.ruleTestResult=e.data:this.showToast("Erro ao testar regra: "+e.message,"danger")}catch(t){console.error("Erro ao testar regra:",t),this.showToast("Erro ao testar regra","danger")}else this.showToast("URL é obrigatória","warning")},onRuleTypeChange(){const t=this.ruleTypes[this.formData.rule_type];t&&(this.formData.rule_pattern=t.example)},getRuleTypeName(t){const e=this.ruleTypes[t];return e?e.name:t},getPatternHelp(){const t=this.ruleTypes[this.formData.rule_type];return t?"".concat(t.description," | Exemplo: ").concat(t.example):""},showToast(t){alert(t)},init(){this.loadRules(),this.loadRuleTypes()}}))});const P5=function(){return{currentPage:1,totalPages:1,loading:!1,error:null,reportData:null,campaigns:[],types:[],filters:{period:"last30days",startDate:"",endDate:"",campaignId:"",type:""},get showCustomDates(){return"custom"===this.filters.period},async init(){try{await Promise.all([this.fetchCampaigns(),this.fetchTypes()])}catch(t){console.error("Init error:",t)}await this.generateReport(1)},async fetchCampaigns(){try{const t=await fetch("/api/advertising/campaigns?per_page=999"),e=await t.json();e&&e.success&&Array.isArray(e.data)?this.campaigns=e.data.map(t=>{var e,n;return{id:null!==(e=t.campaign_id)&&void 0!==e?e:t.id,name:null!==(n=t.campaign_name)&&void 0!==n?n:t.name}}):Array.isArray(e)&&(this.campaigns=e.map(t=>({id:t.id,name:t.name})))}catch(t){console.error("Erro ao carregar campanhas:",t)}},async fetchTypes(){try{const t=await fetch("/api/advertising/campaign-types"),e=await t.json();e&&e.success&&Array.isArray(e.data)?this.types=e.data.map(t=>t.campaign_type||t.type).filter(Boolean):Array.isArray(e)&&(this.types=e.filter(Boolean))}catch(t){console.error("Erro ao carregar tipos de campanha:",t)}},async generateReport(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{var e,n,i;this.loading=!0,this.error=null;let r="/api/advertising/reports/stats";this.filters.campaignId&&(r+="/".concat(this.filters.campaignId));const o=new URLSearchParams;this.filters.period&&o.append("period",this.filters.period),this.filters.type&&o.append("type",this.filters.type),this.showCustomDates&&(this.filters.startDate&&o.append("start_date",this.filters.startDate),this.filters.endDate&&o.append("end_date",this.filters.endDate)),o.append("page",t),o.append("limit",10),o.toString()&&(r+="?".concat(o.toString()));const a=await fetch(r),s=await a.json();if(!s.success)return void(this.error=s.message||"Erro ao carregar relatório");this.reportData=s.data,this.currentPage=t,this.updateMetrics(),null!==(e=this.reportData)&&void 0!==e&&e.performanceData&&this.updatePerformanceChart(),null!==(n=this.reportData)&&void 0!==n&&n.typeDistribution&&this.updateDistributionChart(),null!==(i=this.reportData)&&void 0!==i&&i.campaignDetails&&this.updateCampaignDetails()}catch(t){console.error("Erro ao gerar relatório:",t),this.error="Erro ao carregar dados do relatório. Tente novamente."}finally{this.loading=!1}},updateMetrics(){var t,e,n,i;if(!this.reportData)return;const r={"total-impressions":(null===(t=this.reportData.totalImpressions)||void 0===t?void 0:t.toLocaleString("pt-PT"))||"0","total-clicks":(null===(e=this.reportData.totalClicks)||void 0===e?void 0:e.toLocaleString("pt-PT"))||"0","average-ctr":(null!==(n=this.reportData.averageCtr)&&void 0!==n?n:0).toFixed(2)+"%","total-conversions":(null===(i=this.reportData.totalConversions)||void 0===i?void 0:i.toLocaleString("pt-PT"))||"0"};Object.keys(r).forEach(t=>{const e=document.getElementById(t);e&&(e.textContent=r[t])})},updatePerformanceChart(){var t;if(null===(t=this.reportData)||void 0===t||!t.performanceData)return;const e=document.getElementById("performance-chart");e&&(window.performanceChart&&window.performanceChart.destroy(),window.performanceChart=new Chart(e,{type:"line",data:{labels:this.reportData.performanceData.labels,datasets:[{label:"Impressões",data:this.reportData.performanceData.impressions,borderColor:"#405189",backgroundColor:"rgba(64,81,137,0.1)",tension:.4},{label:"Cliques",data:this.reportData.performanceData.clicks,borderColor:"#0ab39c",backgroundColor:"rgba(10,179,156,0.1)",tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1}}))},updateDistributionChart(){var t;if(null===(t=this.reportData)||void 0===t||!t.typeDistribution)return;const e=document.getElementById("distribution-chart");e&&(window.distributionChart&&window.distributionChart.destroy(),window.distributionChart=new Chart(e,{type:"doughnut",data:{labels:this.reportData.typeDistribution.labels,datasets:[{data:this.reportData.typeDistribution.data,backgroundColor:["#405189","#0ab39c","#f7b84b","#f06548","#6a4fb6"]}]},options:{responsive:!0,maintainAspectRatio:!1}}))},updateCampaignDetails(){var t;if(null===(t=this.reportData)||void 0===t||!t.campaignDetails)return;const e=document.getElementById("campaign-details-container");if(!e)return;let n='\n <div class="table-responsive">\n <table class="table table-hover">\n <thead>\n <tr>\n <th>Campanha</th>\n <th>Impressões</th>\n <th>Cliques</th>\n <th>CTR</th>\n <th>Gasto</th>\n <th>Estado</th>\n </tr>\n </thead>\n <tbody>\n ';this.reportData.campaignDetails.forEach(t=>{n+="\n <tr>\n <td>".concat(t.name,"</td>\n <td>").concat((t.impressions||0).toLocaleString("pt-PT"),"</td>\n <td>").concat((t.clicks||0).toLocaleString("pt-PT"),"</td>\n <td>").concat(parseFloat(t.ctr||0).toFixed(2),"%</td>\n <td>€").concat(parseFloat(t.spend||0).toFixed(2),'</td>\n <td><span class="badge bg-').concat("active"===t.status?"success":"warning",'">').concat(t.status,"</span></td>\n </tr>")}),n+="</tbody></table></div>",e.innerHTML=n,this.reportData.pagination&&this.updatePagination()},updatePagination(){var t;if(null===(t=this.reportData)||void 0===t||!t.pagination)return;const e=document.getElementById("pagination-container");if(!e)return;const n=this.reportData.pagination;if(n.total_pages<=1)return void(e.innerHTML="");let i='<nav aria-label="Pagination"><ul class="pagination justify-content-center mb-0">';n.has_prev_page&&(i+='<li class="page-item"><a class="page-link" href="#" onclick="return false;" data-page="'.concat(n.current_page-1,'">Anterior</a></li>'));for(let t=1;t<=n.total_pages;t++)i+='<li class="page-item '.concat(t===n.current_page?"active":"",'"><a class="page-link" href="#" onclick="return false;" data-page="').concat(t,'">').concat(t,"</a></li>");n.has_next_page&&(i+='<li class="page-item"><a class="page-link" href="#" onclick="return false;" data-page="'.concat(n.current_page+1,'">Próximo</a></li>')),i+="</ul></nav>",e.innerHTML=i,e.querySelectorAll("a.page-link").forEach(t=>{t.addEventListener("click",()=>{const e=parseInt(t.getAttribute("data-page"),10);this.generateReport(e)})})},exportReport(){alert("Funcionalidade de exportação em desenvolvimento")}}};function O5(){const t=document.getElementById("copy-btn");if(!t)return;const e=t.innerHTML;t.innerHTML='<i class="ri-check-line me-1"></i> Copiado!',t.classList.remove("btn-outline-primary"),t.classList.add("btn-success"),setTimeout(()=>{t.innerHTML=e,t.classList.remove("btn-success"),t.classList.add("btn-outline-primary")},2e3)}function R5(t){const e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),O5()}catch(t){console.error("Erro ao copiar:",t),alert("Erro ao copiar o código. Por favor, selecione e copie manualmente.")}document.body.removeChild(e)}function B5(){const t=new URLSearchParams(window.location.search).get("campaign");let e="/api/advertising/trackers";t&&(e+="?campaign=".concat(t)),fetch(e).then(t=>t.json()).then(t=>{if(t.success&&t.data.length>0){const e=document.getElementById("trackers-list");if(!e)return;e.innerHTML="",t.data.forEach(t=>{const n=1==t.is_active?'<span class="badge bg-soft-success text-success">Ativo</span>':'<span class="badge bg-soft-warning text-warning">Pausado</span>',i={click:'<span class="badge bg-soft-info text-info">Click</span>',view:'<span class="badge bg-soft-primary text-primary">View</span>',conversion:'<span class="badge bg-soft-success text-success">Conversion</span>',custom:'<span class="badge bg-soft-warning text-warning">Custom</span>'}[t.tracking_type]||'<span class="badge bg-soft-secondary text-secondary">Unknown</span>',r='\n <tr>\n <td>\n <div class="d-flex align-items-center">\n <div class="avatar-xs me-3">\n <div class="avatar-title rounded-circle bg-soft-primary text-primary">\n <i class="ri-focus-3-line"></i>\n </div>\n </div>\n <div>\n <h6 class="mb-0">'.concat(t.name||"Sem nome",'</h6>\n <p class="text-muted mb-0 fs-12">').concat(t.description||"","</p>\n </div>\n </div>\n </td>\n <td>").concat(t.campaign_name||"N/A","</td>\n <td>").concat(i,"</td>\n <td>").concat(n,'</td>\n <td>\n <span class="fw-medium">').concat((t.clicks||0).toLocaleString("pt-PT"),'</span>\n </td>\n <td>\n <span class="fw-medium">').concat((t.conversions||0).toLocaleString("pt-PT"),'</span>\n </td>\n <td>\n <span class="fw-medium">').concat(t.conversion_rate||"0.00",'%</span>\n </td>\n <td>\n <div class="dropdown">\n <button class="btn btn-soft-secondary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown">\n <i class="ri-more-fill align-middle"></i>\n </button>\n <ul class="dropdown-menu dropdown-menu-end">\n <li><a class="dropdown-item" href="/advertising/trackers/').concat(t.id,'"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> Ver</a></li>\n <li><a class="dropdown-item" href="/advertising/trackers/').concat(t.id,'/edit"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> Editar</a></li>\n <li class="dropdown-divider"></li>\n <li><a class="dropdown-item text-danger" href="#" onclick="deleteTracker(').concat(t.id,')"><i class="ri-delete-bin-fill align-bottom me-2 text-danger"></i> Eliminar</a></li>\n </ul>\n </div>\n </td>\n </tr>\n ');e.innerHTML+=r})}else{const t=document.getElementById("trackers-list");t&&(t.innerHTML='\n <tr>\n <td colspan="8" class="text-center py-4">\n <div class="text-muted">\n <i class="ri-focus-3-line fs-1 mb-3 d-block"></i>\n <p class="mb-0">Nenhum tracker encontrado</p>\n <small>Crie um novo tracker para começar</small>\n </div>\n </td>\n </tr>\n ')}}).catch(t=>{console.error("Erro ao carregar trackers:",t);const e=document.getElementById("trackers-list");e&&(e.innerHTML='\n <tr>\n <td colspan="8" class="text-center py-4 text-danger">\n <i class="ri-error-warning-line fs-1 mb-3 d-block"></i>\n <p class="mb-0">Erro ao carregar trackers</p>\n </td>\n </tr>\n ')})}function N5(){var t,e,n;const i=null===(t=document.getElementById("campaign-filter"))||void 0===t?void 0:t.value,r=null===(e=document.getElementById("status-filter"))||void 0===e?void 0:e.value,o=null===(n=document.getElementById("type-filter"))||void 0===n?void 0:n.value,a=new URLSearchParams;i&&a.append("campaign",i),r&&a.append("status",r),o&&a.append("type",o);const s=window.location.pathname+(a.toString()?"?"+a.toString():"");window.history.pushState({},"",s),B5()}window.generateScript=function(){var t,e,n,i,r,o,a,s,l;const c=null===(t=document.getElementById("script-type"))||void 0===t?void 0:t.value,u=null===(e=document.getElementById("placement"))||void 0===e?void 0:e.value,h=null===(n=document.getElementById("ad-format"))||void 0===n?void 0:n.value,d=null===(i=document.getElementById("campaign-id"))||void 0===i?void 0:i.value,p=null===(r=document.getElementById("lazy-load"))||void 0===r?void 0:r.checked,f=null===(o=document.getElementById("mobile-only"))||void 0===o?void 0:o.checked,g=null===(a=document.getElementById("desktop-only"))||void 0===a?void 0:a.checked,m=null===(s=document.getElementById("gdpr-consent"))||void 0===s?void 0:s.checked,y=null===(l=document.getElementById("frequency"))||void 0===l?void 0:l.value;if(!d)return void alert("Por favor, selecione uma campanha");const v={campaignId:d,format:h,placement:u,lazyLoad:p,mobileOnly:f,desktopOnly:g,gdprConsent:m,frequency:y,containerId:"bitreport-ad-".concat(d,"-").concat(Date.now())};let _="";"inline"===c?_=function(t){return'\x3c!-- BitReport Advertising Script --\x3e\n<div id="'.concat(t.containerId,'"></div>\n<script>\n(function() {\n const config = ').concat(JSON.stringify(t,null,2),";\n \n // Verificações de dispositivo\n ").concat(t.mobileOnly?"\n if (!/Mobi|Android/i.test(navigator.userAgent)) {\n return; // Só mobile\n }":"","\n ").concat(t.desktopOnly?"\n if (/Mobi|Android/i.test(navigator.userAgent)) {\n return; // Só desktop\n }":"","\n \n // Verificação GDPR\n ").concat(t.gdprConsent?"\n if (!localStorage.getItem('gdpr-consent')) {\n console.log('GDPR consent required');\n return;\n }":"","\n \n // Verificação de frequência\n ").concat(t.frequency&&"unlimited"!==t.frequency?"\n const lastShown = localStorage.getItem('bitreport-ad-".concat(t.campaignId,"');\n const now = Date.now();\n const frequency = ").concat("once-per-day"===t.frequency?"86400000":"once-per-hour"===t.frequency?"3600000":"0",";\n \n if (lastShown && (now - parseInt(lastShown)) < frequency) {\n return; // Ainda dentro do período de frequência\n }"):"","\n \n function loadAd() {\n fetch('/api/advertising/serve?campaign=' + config.campaignId + '&format=' + config.format + '&placement=' + config.placement)\n .then(r => r.json())\n .then(data => {\n if (data.success && data.html) {\n document.getElementById(config.containerId).innerHTML = data.html;\n ").concat(t.frequency&&"unlimited"!==t.frequency?"localStorage.setItem('bitreport-ad-".concat(t.campaignId,"', Date.now().toString());"):"","\n }\n })\n .catch(err => console.error('Erro ao carregar anúncio:', err));\n }\n \n ").concat(t.lazyLoad?"\n // Lazy loading com Intersection Observer\n const observer = new IntersectionObserver(function(entries) {\n entries.forEach(function(entry) {\n if (entry.isIntersecting) {\n loadAd();\n observer.disconnect();\n }\n });\n });\n observer.observe(document.getElementById(config.containerId));":"loadAd();","\n})();\n<\/script>\n\x3c!-- End BitReport Advertising Script --\x3e")}(v):"async"===c?_=function(t){return'\x3c!-- BitReport Advertising Script (Async) --\x3e\n<div id="'.concat(t.containerId,'"></div>\n<script async src="/assets/js/bitreport-ads.js" \n data-campaign="').concat(t.campaignId,'"\n data-format="').concat(t.format,'"\n data-placement="').concat(t.placement,'"\n data-container="').concat(t.containerId,'"\n ').concat(t.lazyLoad?'data-lazy="true"':"","\n ").concat(t.mobileOnly?'data-mobile-only="true"':"","\n ").concat(t.desktopOnly?'data-desktop-only="true"':"","\n ").concat(t.gdprConsent?'data-gdpr-consent="true"':"","\n ").concat(t.frequency?'data-frequency="'.concat(t.frequency,'"'):"","><\/script>\n\x3c!-- End BitReport Advertising Script --\x3e")}(v):"iframe"===c&&(_=function(t){const e=new URLSearchParams({campaign:t.campaignId,format:t.format,placement:t.placement,lazy:t.lazyLoad?"1":"0",mobile_only:t.mobileOnly?"1":"0",desktop_only:t.desktopOnly?"1":"0",gdpr_consent:t.gdprConsent?"1":"0",frequency:t.frequency||"unlimited"});return'\x3c!-- BitReport Advertising Script (iFrame) --\x3e\n<iframe src="/advertising/serve/iframe?'.concat(e.toString(),'" \n width="100%" \n height="250" \n frameborder="0" \n scrolling="no"\n id="').concat(t.containerId,'"></iframe>\n\x3c!-- End BitReport Advertising Script --\x3e')}(v));const x=document.getElementById("script-preview");x&&(x.innerHTML="<pre><code>"+function(t){const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return t.replace(/[&<>"']/g,t=>e[t])}(_)+"</code></pre>");const b=document.getElementById("copy-btn");b&&(b.style.display="inline-block")},window.copyScript=function(){const t=document.querySelector("#script-preview code");if(!t)return;const e=t.textContent;navigator.clipboard?navigator.clipboard.writeText(e).then(()=>{O5()}).catch(t=>{console.error("Erro ao copiar:",t),R5(e)}):R5(e)},document.addEventListener("DOMContentLoaded",function(){document.querySelector("#campaign-id")&&(console.log("Inicializando página de scripts do Advertising"),fetch("/api/advertising/campaigns").then(t=>t.json()).then(t=>{if(t.success&&t.data){const e=document.getElementById("campaign-id");if(!e)return;e.innerHTML='<option value="">Selecione uma campanha...</option>',t.data.forEach(t=>{if(1===t.status){const n=document.createElement("option");n.value=t.id,n.textContent=t.name,e.appendChild(n)}})}}).catch(t=>{console.error("Erro ao carregar campanhas:",t)}))}),window.loadTrackers=B5,window.filterTrackers=N5,window.deleteTracker=async function(t){(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&fetch("/api/advertising/trackers/".concat(t),{method:"DELETE"}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.message||"Erro ao eliminar tracker");B5(),window.Swal?Swal.fire({title:"Sucesso!",text:"Tracker eliminado com sucesso.",icon:"success",timer:2e3,showConfirmButton:!1}):alert("Tracker eliminado com sucesso.")}).catch(t=>{console.error("Erro ao eliminar tracker:",t),window.Swal?Swal.fire({title:"Erro!",text:"Erro ao eliminar tracker: "+t.message,icon:"error"}):alert("Erro ao eliminar tracker: "+t.message)})},window.exportTrackers=function(){var t,e,n;const i=null===(t=document.getElementById("campaign-filter"))||void 0===t?void 0:t.value,r=null===(e=document.getElementById("status-filter"))||void 0===e?void 0:e.value,o=null===(n=document.getElementById("type-filter"))||void 0===n?void 0:n.value,a=new URLSearchParams;i&&a.append("campaign",i),r&&a.append("status",r),o&&a.append("type",o),a.append("export","csv"),window.open("/api/advertising/trackers?"+a.toString(),"_blank")},document.addEventListener("DOMContentLoaded",function(){if(!document.querySelector("#trackers-list"))return;console.log("Inicializando página de tracking do Advertising"),fetch("/api/advertising/campaigns").then(t=>t.json()).then(t=>{if(t.success&&t.data){const e=document.getElementById("campaign-filter");if(!e)return;e.innerHTML='<option value="">Todas as campanhas</option>',t.data.forEach(t=>{const n=document.createElement("option");n.value=t.id,n.textContent=t.name,e.appendChild(n)});const n=new URLSearchParams(window.location.search).get("campaign");n&&(e.value=n)}}).catch(t=>{console.error("Erro ao carregar campanhas:",t)}),B5();const t=document.getElementById("campaign-filter"),e=document.getElementById("status-filter"),n=document.getElementById("type-filter");t&&t.addEventListener("change",N5),e&&e.addEventListener("change",N5),n&&n.addEventListener("change",N5)});const z5=()=>({loading:!1,saving:!1,contacts:[],selectedContacts:[],stats:{total:0,leads:0,customers:0,prospects:0},showModal:!1,selectedContact:{id:null,name:"",email:"",phone:"",company:"",position:"",lead_score:0,tags:[],notes:"",status:"active"},searchQuery:"",searchTimeout:null,sortBy:"name",sortDirection:"asc",currentPage:1,itemsPerPage:15,totalItems:0,totalPages:0,init(){this.loadContacts(),this.loadStats()},async loadContacts(){try{this.loading=!0;const t=new URLSearchParams({page:this.currentPage,limit:this.itemsPerPage,search:this.searchQuery,sort:this.sortBy,direction:this.sortDirection}),e=await fetch("/api/crm/contacts?".concat(t));if(!e.ok)throw new Error("HTTP error! status: ".concat(e.status));const n=await e.json();n.success?(this.contacts=n.data.contacts||[],this.totalItems=n.data.total||0,this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)):(console.error("API Error:",n.message),this.showError("Erro ao carregar contactos: "+(n.message||"Erro desconhecido")))}catch(t){console.error("Error loading contacts:",t),this.showError("Erro ao carregar contactos")}finally{this.loading=!1}},async loadStats(){try{const t=await fetch("/api/crm/contacts/stats");if(t.ok){const e=await t.json();e.success&&(this.stats=e.data)}}catch(t){console.error("Error loading stats:",t)}},debouncedSearch(){clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.currentPage=1,this.loadContacts()},300)},toggleAllContacts(t){this.selectedContacts=t?this.contacts.map(t=>t.id):[]},toggleContactSelection(t,e){e?this.selectedContacts.includes(t)||this.selectedContacts.push(t):this.selectedContacts=this.selectedContacts.filter(e=>e!==t)},showAddContactModal(){this.selectedContact={id:null,name:"",email:"",phone:"",company:"",position:"",lead_score:0,tags:[],notes:"",status:"active"},this.showModal=!0,this.$nextTick(()=>{new bootstrap.Modal(document.getElementById("contactModal")).show()})},editContact(t){this.selectedContact={id:t.id,name:t.name||"",email:t.email||"",phone:t.phone||"",company:t.company||"",position:t.position||"",lead_score:t.lead_score||0,tags:t.tags||[],notes:t.notes||"",status:t.status||"active"},this.showModal=!0,this.$nextTick(()=>{new bootstrap.Modal(document.getElementById("contactModal")).show()})},closeModal(){this.showModal=!1;const t=bootstrap.Modal.getInstance(document.getElementById("contactModal"));t&&t.hide()},async saveContact(){try{this.saving=!0;const t=this.selectedContact.id?"/api/crm/contacts/".concat(this.selectedContact.id):"/api/crm/contacts",e=this.selectedContact.id?"PUT":"POST",n=await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(this.selectedContact)}),i=await n.json();i.success?(this.showSuccess(this.selectedContact.id?"Contacto atualizado com sucesso!":"Contacto criado com sucesso!"),this.closeModal(),this.loadContacts(),this.loadStats()):this.showError("Erro: "+(i.message||"Erro desconhecido"))}catch(t){console.error("Error saving contact:",t),this.showError("Erro ao guardar contacto")}finally{this.saving=!1}},async deleteContact(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/crm/contacts/".concat(t.id),{method:"DELETE"}),n=await e.json();n.success?(this.showSuccess("Contacto eliminado com sucesso!"),this.loadContacts(),this.loadStats()):this.showError("Erro ao eliminar contacto: "+(n.message||"Erro desconhecido"))}catch(t){console.error("Error deleting contact:",t),this.showError("Erro ao eliminar contacto")}},async deleteMultiple(){if(0!==this.selectedContacts.length){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const t=await fetch("/api/crm/contacts/bulk-delete",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:this.selectedContacts})}),e=await t.json();e.success?(this.showSuccess("".concat(this.selectedContacts.length," contacto(s) eliminado(s) com sucesso!")),this.selectedContacts=[],this.loadContacts(),this.loadStats()):this.showError("Erro ao eliminar contactos: "+(e.message||"Erro desconhecido"))}catch(t){console.error("Error deleting contacts:",t),this.showError("Erro ao eliminar contactos")}}else this.showError("Selecione pelo menos um contacto para eliminar")},goToPage(t){t>=1&&t<=this.totalPages&&t!==this.currentPage&&(this.currentPage=t,this.loadContacts())},get visiblePages(){const t=[],e=Math.max(1,this.currentPage-2),n=Math.min(this.totalPages,this.currentPage+2);for(let i=e;i<=n;i++)t.push(i);return t},viewContact(t){console.log("View contact:",t)},sendMessage(t){console.log("Send message to contact:",t)},async convertToCustomer(t){(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&(console.log("Convert to customer:",t),this.showSuccess("".concat(t.name," foi convertido em cliente!")))},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{day:"2-digit",month:"2-digit",year:"numeric"}):"",formatTime:t=>t?new Date(t).toLocaleTimeString("pt-PT",{hour:"2-digit",minute:"2-digit"}):"",showSuccess(t){"undefined"!=typeof Swal?Swal.fire({icon:"success",title:"Sucesso!",text:t,timer:3e3,showConfirmButton:!1}):alert(t)},showError(t){"undefined"!=typeof Swal?Swal.fire({icon:"error",title:"Erro!",text:t}):alert(t)}});function F5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function V5(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F5(Object(n),!0).forEach(function(e){H5(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F5(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function H5(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}window.creativesFilter=function(){return{filters:{search:"",format:"",campaign:""},formats:[],campaigns:[],init(){this.loadCampaigns(),this.loadFormats()},async loadCampaigns(){try{const t=await fetch("/api/advertising/campaigns");if(t.ok){const e=await t.json();this.campaigns=e.data||[]}else console.error("Error loading campaigns:",t.statusText),this.campaigns=[]}catch(t){console.error("Error loading campaigns:",t),this.campaigns=[]}},async loadFormats(){try{const t=await fetch("/api/advertising/formats");if(t.ok){const e=await t.json(),n=(e.data||e.formats||[]).map(t=>({value:String(t.id),label:t.name}));this.formats=n}}catch(t){console.error("Error loading formats:",t),this.formats=[]}},applyFilters(){this.$el.dispatchEvent(new CustomEvent("filters-changed",{detail:V5({},this.filters)}))},clearFilters(){this.filters={search:"",format:"",campaign:""},this.applyFilters()}}},window.creativesTable=function(){return{creatives:[],loading:!0,error:null,filters:{search:"",format:"",campaign:""},pagination:{current_page:1,per_page:20,total:0,total_pages:0,has_next_page:!1,has_prev_page:!1},init(){this.$watch("filters",()=>{this.pagination.current_page=1,this.loadCreatives()}),this.$el.addEventListener("filters-changed",t=>{this.filters=V5({},t.detail)})},async loadCreatives(){this.loading=!0,this.error=null;try{const t=new URLSearchParams;this.filters.search&&t.append("search",this.filters.search),this.filters.format&&t.append("format",this.filters.format),this.filters.campaign&&t.append("campaign",this.filters.campaign),t.append("page",this.pagination.current_page),t.append("limit",this.pagination.per_page);const e=await fetch("/api/advertising/creatives?".concat(t.toString()));if(e.ok){const t=await e.json();this.creatives=t.data||[],this.pagination=t.pagination||this.pagination}else this.error="Error loading creatives",this.creatives=[]}catch(t){console.error("Error loading creatives:",t),this.error="Error loading creatives",this.creatives=[]}finally{this.loading=!1}},changePage(t){t>=1&&t<=this.pagination.total_pages&&(this.pagination.current_page=t,this.loadCreatives())},getPageNumbers(){const t=[],e=this.pagination.current_page,n=this.pagination.total_pages;e>3&&(t.push(1),e>4&&t.push("..."));for(let i=Math.max(1,e-2);i<=Math.min(n,e+2);i++)t.push(i);return e<n-2&&(e<n-3&&t.push("..."),t.push(n)),t},getTypeBadgeClass:t=>({banner:"bg-soft-primary text-primary",video:"bg-soft-info text-info",native:"bg-soft-success text-success",interstitial:"bg-soft-warning text-warning",popup:"bg-soft-danger text-danger"}[t]||"bg-soft-secondary text-secondary"),getTypeLabel(t){return{banner:this.$t("advertising.creatives.type_banner"),video:this.$t("advertising.creatives.type_video"),native:this.$t("advertising.creatives.type_native"),interstitial:this.$t("advertising.creatives.type_interstitial"),popup:this.$t("advertising.creatives.type_popup"),rotator:this.$t("advertising.creatives.type_rotator")}[t]||t},async previewCreative(t){try{const e=await fetch("/api/advertising/creatives/".concat(t,"/preview"));if(e.ok){const t=await e.json();t.preview_url&&window.open(t.preview_url,"_blank")}else console.error("Error loading preview:",e.statusText)}catch(t){console.error("Error loading preview:",t)}},async deleteCreative(t){if((await Swal.fire({title:this.$t("common.confirm_delete_title"),text:this.$t("common.confirm_delete_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel_button"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/creatives/".concat(t),{method:"DELETE",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}});e.ok?(this.creatives=this.creatives.filter(e=>e.id!==t),window.Swal&&Swal.fire({title:this.$t("advertising.creatives.deleted_title"),text:this.$t("advertising.creatives.deleted_text"),icon:"success",timer:3e3,showConfirmButton:!1})):(console.error("Error deleting creative:",e.statusText),window.Swal&&Swal.fire({title:this.$t("advertising.creatives.error_title"),text:this.$t("advertising.creatives.error_deleting"),icon:"error"}))}catch(t){console.error("Error deleting creative:",t),window.Swal&&Swal.fire({title:this.$t("advertising.creatives.error_title"),text:this.$t("advertising.creatives.error_deleting"),icon:"error"})}}}},document.addEventListener("DOMContentLoaded",function(){console.log("✅ Advertising Creatives page loaded with Alpine.js components")});let j5=null,W5=null,G5=null,U5=null;function q5(t){const e=document.getElementById("leadsBySourceChart");if(!e||!t)return;j5=echarts.init(e);const n={tooltip:{trigger:"item",formatter:"{a} <br/>{b}: {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:"Leads",type:"pie",radius:"50%",data:t.map(t=>({name:t.lead_source||"Desconhecido",value:t.count||0})),emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};j5.setOption(n)}function Y5(t){const e=document.getElementById("dealsByStageChart");if(!e||!t)return;W5=echarts.init(e);const n={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:Object.keys(t),axisTick:{alignWithLabel:!0}},yAxis:{type:"value"},series:[{name:"Deals",type:"bar",data:Object.values(t).map(t=>Array.isArray(t)?t.length:t),itemStyle:{color:"#5b73e8"}}]};W5.setOption(n)}function X5(t){const e=document.getElementById("tasksByStatusChart");if(!e||!t)return;G5=echarts.init(e);const n={tooltip:{trigger:"item",formatter:"{a} <br/>{b}: {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:"Tarefas",type:"pie",radius:"50%",data:t.map(t=>({name:t.status||"Desconhecido",value:t.count||0})),emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};G5.setOption(n)}function $5(t){const e=document.getElementById("monthlyRevenueChart");if(!e||!t)return;U5=echarts.init(e);const n={tooltip:{trigger:"axis",formatter:function(t){return"".concat(t[0].name,"<br/>Receita: €").concat(t[0].value.toLocaleString("pt-PT"))}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:t.map(t=>t.month||""),boundaryGap:!1},yAxis:{type:"value",axisLabel:{formatter:"€{value}"}},series:[{name:"Receita",type:"line",data:t.map(t=>t.revenue||0),smooth:!0,itemStyle:{color:"#34c38f"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(52, 195, 143, 0.2)"},{offset:1,color:"rgba(52, 195, 143, 0.05)"}]}}}]};U5.setOption(n)}function Z5(){j5&&j5.resize(),W5&&W5.resize(),G5&&G5.resize(),U5&&U5.resize()}async function K5(){try{const t=await fetch("/api/crm/reports/dashboard"),e=await t.json();if(!e.success)throw new Error(e.message||"Erro ao atualizar dados dos gráficos");window.leadsBySourceData=e.leadsBySource||[],window.dealsByStageData=e.dealsByStage||{},window.tasksByStatusData=e.tasksByStatus||[],window.monthlyRevenueData=e.monthlyRevenue||[],q5(window.leadsBySourceData),Y5(window.dealsByStageData),X5(window.tasksByStatusData),$5(window.monthlyRevenueData),console.log("Chart data refreshed successfully")}catch(t){console.error("Error refreshing chart data:",t),window.Swal&&Swal.fire({title:"Erro!",text:"Erro ao atualizar dados dos gráficos: "+t.message,icon:"error"})}}function J5(t){if(!t)return void console.error("No data provided to updateAnalyticsDisplay");const e=document.getElementById("users-value"),n=document.getElementById("users-change"),i=document.getElementById("sessions-value"),r=document.getElementById("sessions-change"),o=document.getElementById("duration-min"),a=document.getElementById("duration-sec"),s=document.getElementById("bounce-rate-value");t.stats&&(e&&t.stats.users&&(e.textContent=t.stats.users.value||"0"),n&&t.stats.users&&(n.textContent=(t.stats.users.change||0)+"%"),i&&t.stats.sessions&&(i.textContent=t.stats.sessions.value||"0"),r&&t.stats.sessions&&(r.textContent=(t.stats.sessions.change||0)+"%"),o&&t.stats.avg_duration&&(o.textContent=t.stats.avg_duration.min||"0"),a&&t.stats.avg_duration&&(a.textContent=t.stats.avg_duration.sec||"0"),s&&t.stats.bounce_rate&&(s.textContent=(t.stats.bounce_rate.value||0)+"%")),t.kpis&&(document.querySelectorAll('[x-text*="kpis.impressions.value"]').forEach(e=>{var n;e.textContent=(null===(n=t.kpis.impressions)||void 0===n?void 0:n.value)||"0"}),document.querySelectorAll('[x-text*="kpis.clicks.value"]').forEach(e=>{var n;e.textContent=(null===(n=t.kpis.clicks)||void 0===n?void 0:n.value)||"0"}),document.querySelectorAll('[x-text*="kpis.ctr.value"]').forEach(e=>{var n;e.textContent=((null===(n=t.kpis.ctr)||void 0===n?void 0:n.value)||0)+"%"})),t.scriptInfo&&(document.querySelectorAll('[x-text*="scriptInfo.scriptId"]').forEach(e=>{e.textContent=t.scriptInfo.scriptId||"script_inactive"}),document.querySelectorAll('[x-text*="scriptInfo.estimatedRevenue"]').forEach(e=>{e.textContent="€"+(t.scriptInfo.estimatedRevenue||"0")}),document.querySelectorAll('[x-text*="scriptInfo.totalViewsAllTime"]').forEach(e=>{e.textContent=t.scriptInfo.totalViewsAllTime||"0"}),document.querySelectorAll('[x-text*="scriptInfo.firstHit"]').forEach(e=>{e.textContent=t.scriptInfo.firstHit||"2025-07-23"}),document.querySelectorAll('[x-text*="scriptInfo.scriptStatusDisplay"]').forEach(e=>{e.textContent=t.scriptInfo.scriptStatusDisplay||"Inativo"}),document.querySelectorAll('[x-bind\\:class*="scriptInfo.scriptStatusClass"]').forEach(e=>{e.className="badge "+(t.scriptInfo.scriptStatusClass||"bg-secondary")})),function(t){var e;const n=document.querySelector('template[x-for*="referral in topReferrals"]');if(!n)return;const i=null===(e=n.closest("table"))||void 0===e?void 0:e.querySelector("tbody");if(i){if(i.innerHTML="",0===t.length){const t=document.createElement("tr");return t.innerHTML='\n <td colspan="2" class="text-center text-muted">\n <i class="ri-information-line me-1"></i>\n Nenhum referral encontrado\n </td>\n ',void i.appendChild(t)}t.forEach(t=>{const e=document.createElement("tr");e.innerHTML='\n <td>\n <h5 class="fs-14 mb-1">'.concat(Q5(t.domain||"Direct"),'</h5>\n </td>\n <td>\n <span class="badge bg-light text-body">').concat(t.visits||0,"</span>\n </td>\n "),i.appendChild(e)})}}(t.topReferrals||[]),function(t){var e;const n=document.querySelector('template[x-for*="page in topPages"]');if(!n)return;const i=null===(e=n.closest("table"))||void 0===e?void 0:e.querySelector("tbody");if(i){if(i.innerHTML="",0===t.length){const t=document.createElement("tr");return t.innerHTML='\n <td colspan="2" class="text-center text-muted">\n <i class="ri-information-line me-1"></i>\n Nenhuma página encontrada\n </td>\n ',void i.appendChild(t)}t.forEach(t=>{const e=document.createElement("tr");e.innerHTML='\n <td>\n <h5 class="fs-14 mb-1">'.concat(Q5(t.page||"/"),'</h5>\n </td>\n <td>\n <span class="badge bg-light text-body">').concat(t.views||0,"</span>\n </td>\n "),i.appendChild(e)})}}(t.topPages||[])}function Q5(t){const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return t.replace(/[&<>"']/g,function(t){return e[t]})}async function t3(){try{const t=await fetch("/api/analytics/dashboard");if(!t.ok)throw new Error("HTTP error! status: ".concat(t.status));const e=await t.json();if(console.log("Analytics data loaded:",e),!1===e.success)throw new Error(e.message||"Erro ao carregar dados de analytics");J5(e)}catch(t){console.error("Erro ao carregar dados de analytics:",t),["users-value","sessions-value","duration-min","duration-sec","bounce-rate-value"].forEach(t=>{const e=document.getElementById(t);e&&(e.textContent="0",e.classList.add("text-muted"))}),["users-change","sessions-change"].forEach(t=>{const e=document.getElementById(t);e&&(e.textContent="0%",e.classList.add("text-muted"))}),window.Swal&&Swal.fire({title:"Erro!",text:"Erro ao carregar dados de analytics: "+t.message,icon:"error",timer:5e3,showConfirmButton:!1})}}function e3(){console.log("Refreshing analytics data..."),t3()}function n3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"csv";const e=new URLSearchParams;e.append("export",t),e.append("period","30d"),window.open("/api/analytics/export?"+e.toString(),"_blank")}function i3(){return{dateFilters:[],categories:[],statuses:[],selectedDateFilter:"Yesterday",selectedCategory:"",selectedStatus:"",init(){console.log("🚀 Blog Filters component initialized"),this.loadFilterData(),this.initializeFilters()},async loadFilterData(){try{const t=await fetch("/api/blog/date-filters"),e=await t.json();e.success&&(this.dateFilters=e.data,this.populateDateFilters());const n=await fetch("/api/blog/categories"),i=await n.json();i.success&&(this.categories=i.data,this.populateCategories());const r=await fetch("/api/blog/statuses"),o=await r.json();o.success&&(this.statuses=o.data,this.populateStatuses())}catch(t){console.error("Erro ao carregar dados dos filtros:",t)}},populateDateFilters(){const t=document.querySelector("select[data-choices]");if(t&&(t.innerHTML="",this.dateFilters.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,"Yesterday"===e.value&&(n.selected=!0),t.appendChild(n)}),"undefined"!=typeof Choices)){const e=Choices.getInstance(t);e&&e.destroy(),new Choices(t,{searchEnabled:!1,itemSelectText:""})}},populateCategories(){const t=document.getElementById("categoryFilter");t&&(t.innerHTML='<option value="">Todas as categorias</option>',this.categories.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},populateStatuses(){const t=document.getElementById("statusFilter");t&&(t.innerHTML='<option value="">Todos os status</option>',this.statuses.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},initializeFilters(){"undefined"!=typeof Choices&&document.querySelectorAll("[data-choices]").forEach(t=>{new Choices(t,{searchEnabled:!1,itemSelectText:""})}),this.setupFilterListeners()},setupFilterListeners(){const t=document.querySelector("select[data-choices]");t&&t.addEventListener("change",t=>{this.selectedDateFilter=t.target.value,this.applyFilters()});const e=document.getElementById("categoryFilter");e&&e.addEventListener("change",t=>{this.selectedCategory=t.target.value,this.applyFilters()});const n=document.getElementById("statusFilter");n&&n.addEventListener("change",t=>{this.selectedStatus=t.target.value,this.applyFilters()});const i=document.querySelector('input[placeholder="Search..."]');i&&i.addEventListener("input",t=>{this.applyFilters()})},applyFilters(){console.log("Aplicando filtros:",{dateFilter:this.selectedDateFilter,category:this.selectedCategory,status:this.selectedStatus}),this.loadFilteredPosts()},async loadFilteredPosts(){try{const t=new URLSearchParams({date_filter:this.selectedDateFilter,category:this.selectedCategory,status:this.selectedStatus}),e=await fetch("/api/blog/posts?".concat(t)),n=await e.json();n.success&&this.updatePostsList(n.data)}catch(t){console.error("Erro ao carregar posts filtrados:",t)}},updatePostsList(t){const e=document.getElementById("postsList");e&&(e.innerHTML="",t.forEach(t=>{const n=this.createPostElement(t);e.appendChild(n)}))},createPostElement(t){const e=document.createElement("div");return e.className="col-lg-4 col-md-6",e.innerHTML='\n <div class="card">\n <div class="card-body">\n <h5 class="card-title">'.concat(t.title,'</h5>\n <p class="card-text">').concat(t.excerpt,'</p>\n <div class="d-flex justify-content-between align-items-center">\n <span class="badge bg-primary">').concat(t.category,'</span>\n <small class="text-muted">').concat(t.date,"</small>\n </div>\n </div>\n </div>\n "),e}}}function r3(){return{redirectTypes:[],statuses:[],filterTypes:[],filterOperators:[],filterIndex:1,init(){console.log("🚀 Redirect Create page initialized"),this.loadFormData(),this.initializeForm()},async loadFormData(){try{const t=await fetch("/api/redirects/types"),e=await t.json();e.success&&(this.redirectTypes=e.data,this.populateRedirectTypes());const n=await fetch("/api/redirects/statuses"),i=await n.json();i.success&&(this.statuses=i.data,this.populateStatuses());const r=await fetch("/api/redirects/filter-types"),o=await r.json();o.success&&(this.filterTypes=o.data);const a=await fetch("/api/redirects/filter-operators"),s=await a.json();s.success&&(this.filterOperators=s.data)}catch(t){console.error("Erro ao carregar dados do formulário:",t)}},populateRedirectTypes(){const t=document.getElementById("redirect_type");t&&(t.innerHTML="",this.redirectTypes.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},populateStatuses(){const t=document.getElementById("status");t&&(t.innerHTML="",this.statuses.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,"1"===e.value&&(n.selected=!0),t.appendChild(n)}))},initializeForm(){"undefined"!=typeof bootstrap&&bootstrap.Tooltip&&[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(t){return new bootstrap.Tooltip(t)}),this.setupEventListeners()},setupEventListeners(){const t=document.getElementById("addFilterBtn");t&&t.addEventListener("click",()=>{this.addFilter()}),document.addEventListener("click",t=>{t.target.classList.contains("remove-filter")&&this.removeFilter(t.target)})},addFilter(){const t=document.getElementById("filtersContainer");if(!t)return;const e=this.createFilterHtml(this.filterIndex);t.insertAdjacentHTML("beforeend",e),this.populateFilterDropdowns(this.filterIndex),this.filterIndex++},removeFilter(t){const e=t.closest(".filter-row");e&&e.remove()},createFilterHtml(t){const e=document.getElementById("filter-row-template");return e?e.content.cloneNode(!0).querySelector(".filter-row").outerHTML.replace(/\{\{INDEX\}\}/g,t):(console.error("Filter template not found"),"")},populateFilterDropdowns(t){const e=document.getElementById("filter_type_".concat(t));e&&(e.innerHTML='<option value="">Select filter type...</option>',this.filterTypes.forEach(t=>{const n=document.createElement("option");n.value=t.value,n.textContent=t.label,e.appendChild(n)}));const n=document.getElementById("filter_operator_".concat(t));n&&(n.innerHTML='<option value="">Select operator...</option>',this.filterOperators.forEach(t=>{const e=document.createElement("option");e.value=t.value,e.textContent=t.label,n.appendChild(e)}))},async submitForm(){try{const t=document.getElementById("redirectForm");if(!t)return;const e=new FormData(t),n=await fetch("/api/redirects",{method:"POST",body:e}),i=await n.json();i.success?(this.showAlert("success","Redirect criado com sucesso!"),t.reset(),this.resetFilters()):this.showAlert("error",i.message||"Erro ao criar redirect")}catch(t){console.error("Erro ao submeter formulário:",t),this.showAlert("error","Erro interno do servidor")}},resetFilters(){const t=document.getElementById("filtersContainer");t&&(t.innerHTML=""),this.filterIndex=1},showAlert(t,e){"success"===t?"undefined"!=typeof Swal?Swal.fire({icon:"success",title:"Sucesso!",text:e}):alert(e):"undefined"!=typeof Swal?Swal.fire({icon:"error",title:"Erro!",text:e}):alert("Erro: "+e)}}}function o3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function a3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o3(Object(n),!0).forEach(function(e){s3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function s3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function l3(){const t=new URLSearchParams(window.location.search),e=document.getElementById("active-filters"),n=[];t.get("severity")&&n.push('<span class="badge bg-warning-subtle text-warning me-1">Severity: '.concat(t.get("severity"),"</span>")),t.get("status")&&n.push('<span class="badge bg-info-subtle text-info me-1">Status: '.concat(t.get("status"),"</span>")),t.get("file")&&n.push('<span class="badge bg-secondary-subtle text-secondary me-1">File: '.concat(t.get("file"),"</span>")),t.get("project")&&n.push('<span class="badge bg-primary-subtle text-primary me-1">Project: '.concat(t.get("project"),"</span>")),e&&e.parentNode&&(e.innerHTML=n.length>0?n.join(""):"")}function c3(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=document.getElementById("errors-container");e&&e.parentNode&&(e.innerHTML='\n <div class="text-center py-4">\n <div class="spinner-border text-primary" role="status">\n <span class="visually-hidden">Loading...</span>\n </div>\n <p class="mt-2">Loading errors...</p>\n </div>\n ');const n=new URLSearchParams(window.location.search),i=[];n.get("severity")&&i.push("severity=".concat(encodeURIComponent(n.get("severity")))),n.get("status")&&i.push("status=".concat(encodeURIComponent(n.get("status")))),n.get("file")&&i.push("file=".concat(encodeURIComponent(n.get("file")))),n.get("project")&&i.push("project=".concat(encodeURIComponent(n.get("project"))));const r=["page=".concat(t),...i].join("&");fetch("/api/error-monitoring/errors?".concat(r)).then(t=>t.json()).then(t=>{if(t.success&&t.data.errors.length>0){let n='\n <div class="table-responsive">\n <table class="table table-hover">\n <thead>\n <tr>\n <th style="width: 50%;">Error Details</th>\n <th style="width: 15%;">Severity</th>\n <th style="width: 20%;">Environment Info</th>\n <th style="width: 15%;">Actions</th>\n </tr>\n </thead>\n <tbody>\n ';if(t.data.errors.forEach(t=>{const e="critical"===t.severity?"bg-danger":"error"===t.severity?"bg-warning":"warning"===t.severity?"bg-info":"bg-secondary",i=t.file_path?t.file_path.split("/").pop():"unknown";let r={};try{r=JSON.parse(t.context_data||"{}")}catch(t){r={}}n+='\n <tr>\n <td>\n <div class="d-flex align-items-start">\n <div class="avatar-xs me-3 mt-1">\n <span class="avatar-title rounded-circle '.concat(e.replace("bg-","bg-"),"-subtle text-").concat(e.replace("bg-",""),'">\n <i class="ri-bug-line"></i>\n </span>\n </div>\n <div class="flex-grow-1">\n <h6 class="mb-1 fw-medium">\n <a href="/error-monitoring/error/').concat(t.id,'" class="text-reset text-decoration-none">\n ').concat(t.message,'\n </a>\n </h6>\n <p class="text-muted mb-1 fs-12">\n <i class="ri-file-line me-1"></i>\n <code>').concat(i,":").concat(t.line_number||"?",'</code>\n </p>\n <div class="d-flex flex-wrap gap-1">\n ').concat(t.url?'<span class="badge bg-info-subtle text-info fs-11" title="Request URL">\n <i class="ri-global-line me-1"></i>'.concat(t.url.length>40?t.url.substring(0,40)+"...":t.url,"\n </span>"):"","\n ").concat(t.http_method?'<span class="badge bg-secondary-subtle text-secondary fs-11">\n '.concat(t.http_method,"\n </span>"):"","\n ").concat(t.occurrences>1?'<span class="badge bg-danger-subtle text-danger fs-11" title="Number of occurrences">\n <i class="ri-repeat-line me-1"></i>'.concat(t.occurrences,"x\n </span>"):"",'\n </div>\n </div>\n </div>\n </td>\n <td>\n <span class="badge ').concat(e,'">').concat(t.severity,"</span>\n ").concat(t.project_name?'<br><small class="text-muted mt-1">'.concat(t.project_name,"</small>"):"",'\n </td>\n <td>\n <div class="fs-12">\n <div class="mb-1">\n <i class="ri-time-line me-1"></i>\n <span class="text-muted">').concat(new Date(t.created_at).toLocaleString(),"</span>\n </div>\n ").concat(t.ip_address?'<div class="mb-1">\n <i class="ri-map-pin-line me-1"></i>\n <span class="text-muted">'.concat(t.ip_address,"</span>\n </div>"):"","\n ").concat(t.environment?'<div class="mb-1">\n <i class="ri-settings-line me-1"></i>\n <span class="badge bg-warning-subtle text-warning fs-11">'.concat(t.environment,"</span>\n </div>"):"","\n ").concat(t.user_agent?'<div class="mb-1" title="'.concat(t.user_agent,'">\n <i class="ri-computer-line me-1"></i>\n <span class="text-muted">').concat(t.user_agent.includes("Chrome")?"Chrome":t.user_agent.includes("Firefox")?"Firefox":t.user_agent.includes("Safari")?"Safari":"Other","</span>\n </div>"):"",'\n </div>\n </td>\n <td>\n <div class="d-flex flex-column gap-1">\n <a href="/error-monitoring/error/').concat(t.id,'" class="btn btn-sm btn-outline-primary">\n <i class="ri-eye-line me-1"></i>Details\n </a>\n ').concat("open"===t.status?'<button class="btn btn-sm btn-outline-success" onclick="markAsResolved(\''.concat(t.unique_id,'\')">\n <i class="ri-check-line me-1"></i>Resolve\n </button>'):"","\n </div>\n </td>\n </tr>\n ")}),n+="\n </tbody>\n </table>\n </div>\n ",t.data.pagination.total_pages>1){n+='\n <nav aria-label="Error logs pagination">\n <ul class="pagination justify-content-center">\n ';for(let e=1;e<=t.data.pagination.total_pages;e++){const i=e===t.data.pagination.current_page?"active":"";n+='\n <li class="page-item '.concat(i,'">\n <a class="page-link" href="#" onclick="loadErrors(').concat(e,'); return false;">').concat(e,"</a>\n </li>\n ")}n+="\n </ul>\n </nav>\n "}e&&e.parentNode&&(e.innerHTML=n)}else e&&e.parentNode&&(e.innerHTML='\n <div class="text-center py-4">\n <div class="avatar-md mx-auto mb-4">\n <div class="avatar-title bg-primary-subtle text-primary rounded-circle fs-24">\n <i class="ri-check-line"></i>\n </div>\n </div>\n <h5>No errors found</h5>\n <p class="text-muted">Great! No errors have been logged recently.</p>\n </div>\n ')}).catch(t=>{console.error("Error loading errors:",t),e&&e.parentNode&&(e.innerHTML='\n <div class="text-center py-4">\n <div class="avatar-md mx-auto mb-4">\n <div class="avatar-title bg-danger-subtle text-danger rounded-circle fs-24">\n <i class="ri-error-warning-line"></i>\n </div>\n </div>\n <h5>Erro ao carregar dados</h5>\n <p class="text-muted">Não foi possível carregar os erros.</p>\n <button class="btn btn-outline-primary btn-sm" onclick="loadErrors()">\n <i class="ri-refresh-line me-1"></i> Tentar Novamente\n </button>\n </div>\n ')})}window.exportChart=function(t){let e=null,n="chart";switch(t){case"leadsBySource":e=j5,n="leads-por-origem";break;case"dealsByStage":e=W5,n="deals-por-estagio";break;case"tasksByStatus":e=G5,n="tarefas-por-status";break;case"monthlyRevenue":e=U5,n="receita-mensal";break;default:return void console.error("Tipo de gráfico desconhecido:",t)}if(!e)return void console.error("Gráfico não encontrado:",t);const i=e.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#fff"}),r=document.createElement("a");r.href=i,r.download="".concat(n,".png"),document.body.appendChild(r),r.click(),document.body.removeChild(r)},window.refreshChartData=K5,document.addEventListener("DOMContentLoaded",function(){if(!(document.querySelector("#leadsBySourceChart")||document.querySelector("#dealsByStageChart")||document.querySelector("#tasksByStatusChart")||document.querySelector("#monthlyRevenueChart")))return;console.log("Inicializando CRM Reports Dashboard"),async function(){try{await new Promise(t=>{if("undefined"!=typeof echarts)return void t();const e=()=>{"undefined"!=typeof echarts?t():setTimeout(e,100)};e()});const t=window.leadsBySourceData||[],e=window.dealsByStageData||{},n=window.tasksByStatusData||[],i=window.monthlyRevenueData||[];q5(t),Y5(e),X5(n),$5(i),console.log("CRM Reports Dashboard charts initialized successfully")}catch(t){console.error("Error initializing CRM reports charts:",t)}}(),window.addEventListener("resize",Z5);const t=document.querySelector("#refresh-charts");t&&t.addEventListener("click",K5)}),window.loadAnalyticsData=t3,window.refreshAnalyticsData=e3,window.exportAnalyticsData=n3,window.updateAnalyticsDisplay=J5,document.addEventListener("DOMContentLoaded",function(){if(!document.querySelector("#users-value")&&!document.querySelector("#sessions-value"))return;console.log("Inicializando Analytics Dashboard"),t3();const t=document.querySelector("#refresh-analytics");t&&t.addEventListener("click",e3);const e=document.querySelector("#export-analytics");e&&e.addEventListener("click",()=>n3("csv")),setInterval(t3,3e5)}),document.addEventListener("DOMContentLoaded",function(){l3(),c3()}),window.refreshErrors=function(){c3()},window.clearFilters=function(){window.location.href="/error-monitoring/errors"},window.clearAllErrors=async function(){if((await Swal.fire({title:"Confirmar Ação",text:"Tem certeza que deseja apagar TODOS os erros? Esta ação não pode ser desfeita.",icon:"warning",showCancelButton:!0,confirmButtonColor:"#d33",cancelButtonColor:"#3085d6",confirmButtonText:"Sim, apagar tudo!",cancelButtonText:"Cancelar",customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const t=await fetch("/api/error-monitoring/clear-all",{method:"POST",headers:{"Content-Type":"application/json"}}),e=await t.json();e.success?(await Swal.fire({title:"Sucesso!",text:e.message,icon:"success",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-success w-xs mt-2"},buttonsStyling:!1}),c3()):await Swal.fire({title:"Erro!",text:e.message,icon:"error",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-danger w-xs mt-2"},buttonsStyling:!1})}catch(t){console.error("Error:",t),await Swal.fire({title:"Erro!",text:"Falha ao apagar erros",icon:"error",confirmButtonText:"OK",customClass:{confirmButton:"btn btn-danger w-xs mt-2"},buttonsStyling:!1})}},window.markAsResolved=async function(t){(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&fetch("/api/error-monitoring/resolve",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({unique_id:t})}).then(t=>t.json()).then(t=>{t.success?(alert("Error marked as resolved"),c3()):alert("Error: "+t.message)}).catch(t=>{console.error("Error:",t),alert("Failed to mark error as resolved")})},window.loadErrors=c3,window.showActiveFilters=l3,window.editDeal=function(t){var e;console.log("Global editDeal called:",t),null===(e=window.dealsKanban)||void 0===e||e.editDeal(t)},window.deleteDeal=function(t){var e;console.log("Global deleteDeal called:",t),null===(e=window.dealsKanban)||void 0===e||e.showDeleteModal(t)};const u3=()=>({tasks:[],loading:!1,showAddModal:!1,showEditModal:!1,showDeleteModal:!1,selectedTask:null,newTask:{title:"",description:"",type:"task",priority:"medium",status:"pending",due_date:"",assigned_to:"",related_to:"",related_type:""},init(){console.log("Tasks List component initialized"),this.loadTasks()},$t:t=>Alpine.store("i18n").t(t),showAddTaskModal(){this.showAddModal=!0,this.resetNewTask()},async loadTasks(){this.loading=!0;try{const t=await fetch("/api/crm/tasks");if(t.ok){const e=await t.json();this.tasks=e.tasks||[]}else console.error("Error loading tasks, status:",t.status),this.showAlert("Erro ao carregar tarefas","error")}catch(t){console.error("Error loading tasks:",t),this.showAlert("Erro ao carregar tarefas","error")}finally{this.loading=!1}},async completeTask(t){try{const e=await fetch("/api/crm/tasks/".concat(t,"/complete"),{method:"POST",headers:{"Content-Type":"application/json"}});e.ok?(this.showAlert("Tarefa concluída com sucesso","success"),this.loadTasks()):(console.error("Error completing task, status:",e.status),this.showAlert("Erro ao concluir tarefa","error"))}catch(t){console.error("Error completing task:",t),this.showAlert("Erro ao concluir tarefa","error")}},async editTask(t){try{const e=await fetch("/api/crm/tasks/".concat(t));if(e.ok){const t=await e.json();this.selectedTask=t.task||t,this.showEditModal=!0}else console.error("Error loading task for edit, status:",e.status),this.showAlert("Erro ao carregar tarefa","error")}catch(t){console.error("Error loading task for edit:",t),this.showAlert("Erro ao carregar tarefa","error")}},async updateTask(){if(this.selectedTask)try{const t=await fetch("/api/crm/tasks/".concat(this.selectedTask.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.selectedTask)});t.ok?(this.showAlert("Tarefa actualizada com sucesso","success"),this.showEditModal=!1,this.selectedTask=null,this.loadTasks()):(console.error("Error updating task, status:",t.status),this.showAlert("Erro ao actualizar tarefa","error"))}catch(t){console.error("Error updating task:",t),this.showAlert("Erro ao actualizar tarefa","error")}},showDeleteTaskModal(t){this.selectedTask=t,this.showDeleteModal=!0},async deleteTask(){if(this.selectedTask)try{const t=await fetch("/api/crm/tasks/".concat(this.selectedTask),{method:"DELETE"});t.ok?(this.showAlert("Tarefa eliminada com sucesso","success"),this.showDeleteModal=!1,this.selectedTask=null,this.loadTasks()):(console.error("Error deleting task, status:",t.status),this.showAlert("Erro ao eliminar tarefa","error"))}catch(t){console.error("Error deleting task:",t),this.showAlert("Erro ao eliminar tarefa","error")}},async createTask(){try{const t=await fetch("/api/crm/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.newTask)});t.ok?(this.showAlert("Tarefa criada com sucesso","success"),this.showAddModal=!1,this.resetNewTask(),this.loadTasks()):(console.error("Error creating task, status:",t.status),this.showAlert("Erro ao criar tarefa","error"))}catch(t){console.error("Error creating task:",t),this.showAlert("Erro ao criar tarefa","error")}},resetNewTask(){this.newTask={title:"",description:"",type:"task",priority:"medium",status:"pending",due_date:"",assigned_to:"",related_to:"",related_type:""}},getPriorityClass:t=>({low:"bg-success",medium:"bg-info",high:"bg-warning",urgent:"bg-danger"}[t]||"bg-info"),getStatusClass:t=>({pending:"bg-warning",in_progress:"bg-info",completed:"bg-success",cancelled:"bg-danger"}[t]||"bg-warning"),getPriorityText:t=>({low:"Baixa",medium:"Média",high:"Alta",urgent:"Urgente"}[t]||t),getStatusText:t=>({pending:"Pendente",in_progress:"Em Progresso",completed:"Concluída",cancelled:"Cancelada"}[t]||t),getTypeText:t=>({task:"Tarefa",meeting:"Reunião",call:"Chamada",email:"Email",proposal:"Proposta",general:"Geral",follow_up:"Follow-up"}[t]||t),showAlert(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";window.Swal?window.Swal.fire({title:"success"===e?"Sucesso!":"Aviso",text:t,icon:e,confirmButtonText:"OK",timer:3e3,timerProgressBar:!0}):alert(t)}});function h3(){return{salesData:{total_sales:0,monthly_growth:0,top_products:[],sales_by_region:{}},loading:!0,error:!1,lastUpdated:null,init(){this.loadSalesData()},async loadSalesData(){try{this.loading=!0,this.error=!1;const t=await fetch("/reports/sales/api/data",{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("HTTP ".concat(t.status));const e=await t.json();if(!e.success)throw new Error(e.error||"Erro ao carregar dados");this.salesData=e.data,this.lastUpdated=e.timestamp}catch(t){console.error("Erro ao carregar dados de vendas:",t),this.error=!0,this.salesData={total_sales:0,monthly_growth:0,top_products:[{name:"Erro ao carregar",sales:0},{name:"Erro ao carregar",sales:0},{name:"Erro ao carregar",sales:0}],sales_by_region:{Erro:0}}}finally{this.loading=!1}},get formattedTotalSales(){return new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(this.salesData.total_sales)},get formattedGrowth(){return"".concat(this.salesData.monthly_growth,"%")},get growthColor(){return this.salesData.monthly_growth>=0?"text-success":"text-danger"},get growthIcon(){return this.salesData.monthly_growth>=0?"bx-trend-up":"bx-trend-down"},get regionChartData(){return Object.entries(this.salesData.sales_by_region).map(t=>{let[e,n]=t;return{region:e,value:parseFloat(n)}})},formatCurrency:t=>new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),refreshData(){this.loadSalesData()}}}function d3(){return{widgets:{campaigns:null,analytics:null,users:null,revenue:null},loading:{campaigns:!1,analytics:!1,users:!1,revenue:!1},error:{campaigns:!1,analytics:!1,users:!1,revenue:!1},lastUpdated:null,init(){this.loadAllWidgets()},async loadAllWidgets(){await Promise.all([this.loadWidget("campaigns"),this.loadWidget("analytics"),this.loadWidget("users"),this.loadWidget("revenue")])},async loadWidget(t){try{this.loading[t]=!0,this.error[t]=!1;const e=await fetch("/dashboard/api/widget/".concat(t),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("HTTP ".concat(e.status));const n=await e.json();if(!n.success)throw new Error(n.error||"Erro ao carregar dados");this.widgets[t]=n.data,this.lastUpdated=n.timestamp}catch(e){console.error("Erro ao carregar widget ".concat(t,":"),e),this.error[t]=!0,this.widgets[t]=this.getDefaultWidgetData(t)}finally{this.loading[t]=!1}},getDefaultWidgetData:t=>({campaigns:{total_campaigns:0,active_campaigns:0,paused_campaigns:0,performance:{clicks:0,impressions:0,ctr:0}},analytics:{page_views:0,unique_visitors:0,bounce_rate:0,avg_session_duration:"0m 0s"},users:{total_users:0,active_users:0,new_users_today:0,online_now:0},revenue:{monthly_revenue:0,yearly_revenue:0,growth_percentage:0,top_sources:[]}}[t]||{}),get hasAnyError(){return Object.values(this.error).some(t=>t)},get hasAnyLoading(){return Object.values(this.loading).some(t=>t)},formatCurrency:t=>new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),formatNumber:t=>new Intl.NumberFormat("pt-PT").format(t),formatPercentage:t=>"".concat(t,"%"),refreshWidget(t){this.loadWidget(t)},refreshAllWidgets(){this.loadAllWidgets()}}}function p3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function f3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p3(Object(n),!0).forEach(function(e){g3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function g3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m3(){return{contacts:[],stats:{total:0,active:0,leads:0,new_this_month:0},pagination:{page:1,limit:20,total:0,pages:0},filters:{search:"",status:""},loading:!1,error:!1,lastUpdated:null,init(){this.loadContacts()},async loadContacts(){try{this.loading=!0,this.error=!1;const t=new URLSearchParams(f3(f3({page:this.pagination.page,limit:this.pagination.limit},this.filters.search&&{search:this.filters.search}),this.filters.status&&{status:this.filters.status})),e=await fetch("/apps/crm/contacts/api?".concat(t),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("HTTP ".concat(e.status));const n=await e.json();if(!n.success)throw new Error(n.error||"Erro ao carregar contactos");this.contacts=n.data.contacts,this.stats=n.data.stats,this.pagination=n.data.pagination,this.lastUpdated=n.timestamp}catch(t){console.error("Erro ao carregar contactos:",t),this.error=!0,this.contacts=[],this.stats={total:0,active:0,leads:0,new_this_month:0}}finally{this.loading=!1}},get hasContacts(){return this.contacts.length>0},get filteredContacts(){return this.contacts},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"-",getStatusBadgeClass:t=>({active:"badge bg-success",lead:"badge bg-warning",inactive:"badge bg-secondary",deleted:"badge bg-danger"}[t]||"badge bg-secondary"),getStatusText:t=>({active:"Ativo",lead:"Lead",inactive:"Inativo",deleted:"Eliminado"}[t]||t),searchContacts(){this.pagination.page=1,this.loadContacts()},clearFilters(){this.filters.search="",this.filters.status="",this.pagination.page=1,this.loadContacts()},changePage(t){this.pagination.page=t,this.loadContacts()},changeStatus(t){this.filters.status=t,this.pagination.page=1,this.loadContacts()},refreshContacts(){this.loadContacts()}}}function y3(){return{analytics:{sessions:{today:0,yesterday:0,growth:0,avg_duration:"0m 0s"},page_views:{total:0,first_hit:null},referrals:[],top_pages:[]},loading:!1,error:!1,lastUpdated:null,init(){this.loadAnalytics()},async loadAnalytics(){try{this.loading=!0,this.error=!1;const t=await fetch("/api/analytics",{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw new Error("HTTP ".concat(t.status));const e=await t.json();if(!e.success)throw new Error(e.error||"Erro ao carregar dados de analytics");this.analytics=e.data,this.lastUpdated=e.timestamp}catch(t){console.error("Erro ao carregar analytics:",t),this.error=!0,this.analytics={sessions:{today:0,yesterday:0,growth:0,avg_duration:"0m 0s"},page_views:{total:0,first_hit:null},referrals:[],top_pages:[]}}finally{this.loading=!1}},get sessionsGrowthColor(){return this.analytics.sessions.growth>=0?"text-success":"text-danger"},get sessionsGrowthIcon(){return this.analytics.sessions.growth>=0?"bx-up-arrow-alt":"bx-down-arrow-alt"},get hasReferrals(){return this.analytics.referrals.length>0},get hasTopPages(){return this.analytics.top_pages.length>0},formatNumber:t=>new Intl.NumberFormat("pt-PT").format(t),formatPercentage:t=>"".concat(t,"%"),formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"-",getDomainFromUrl(t){try{return new URL(t).hostname.replace("www.","")}catch(e){return t}},refreshAnalytics(){this.loadAnalytics()}}}function v3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function _3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?v3(Object(n),!0).forEach(function(e){x3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function x3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b3(){return{redirects:[],stats:{total:0,active:0,inactive:0,total_clicks:0},pagination:{page:1,limit:20,total:0,pages:0},filters:{search:"",status:""},loading:!1,error:!1,lastUpdated:null,init(){this.loadRedirects()},async loadRedirects(){try{this.loading=!0,this.error=!1;const t=new URLSearchParams(_3(_3({page:this.pagination.page,limit:this.pagination.limit},this.filters.search&&{search:this.filters.search}),this.filters.status&&{status:this.filters.status})),e=await fetch("/redirects/api?".concat(t),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error("HTTP ".concat(e.status));const n=await e.json();if(!n.success)throw new Error(n.error||"Erro ao carregar redirects");this.redirects=n.data.redirects,this.stats=n.data.stats,this.pagination=n.data.pagination,this.lastUpdated=n.timestamp}catch(t){console.error("Erro ao carregar redirects:",t),this.error=!0,this.redirects=[],this.stats={total:0,active:0,inactive:0,total_clicks:0}}finally{this.loading=!1}},get hasRedirects(){return this.redirects.length>0},get filteredRedirects(){return this.redirects},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"-",getStatusBadgeClass:t=>({active:"badge bg-success",inactive:"badge bg-secondary",deleted:"badge bg-danger"}[t]||"badge bg-secondary"),getStatusText:t=>({active:"Ativo",inactive:"Inativo",deleted:"Eliminado"}[t]||t),formatNumber:t=>new Intl.NumberFormat("pt-PT").format(t||0),truncateUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return t?t.length>e?t.substring(0,e)+"...":t:"-"},searchRedirects(){this.pagination.page=1,this.loadRedirects()},clearFilters(){this.filters.search="",this.filters.status="",this.pagination.page=1,this.loadRedirects()},changePage(t){this.pagination.page=t,this.loadRedirects()},changeStatus(t){this.filters.status=t,this.pagination.page=1,this.loadRedirects()},refreshRedirects(){this.loadRedirects()},copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{console.log("URL copied to clipboard")})}}}function w3(){return{campaigns:[],stats:{},pagination:{},loading:!0,error:!1,errorMessage:"",search:"",status:"",region:"",currentPage:1,limit:20,init(){this.loadCampaigns()},async loadCampaigns(){try{this.loading=!0,this.error=!1;const t=new URLSearchParams({page:this.currentPage,limit:this.limit});this.search&&t.append("search",this.search),this.status&&t.append("status",this.status),this.region&&t.append("region",this.region);const e=await fetch("/advertising/api/campaigns?".concat(t)),n=await e.json();n.success?(this.campaigns=n.data.campaigns,this.stats=n.data.stats,this.pagination=n.data.pagination):(this.error=!0,this.errorMessage=n.error||"Erro ao carregar campanhas")}catch(t){console.error("Error loading campaigns:",t),this.error=!0,this.errorMessage="Erro de conexão"}finally{this.loading=!1}},async refresh(){this.currentPage=1,await this.loadCampaigns()},async changePage(t){this.currentPage=t,await this.loadCampaigns()},async applyFilters(){this.currentPage=1,await this.loadCampaigns()},clearFilters(){this.search="",this.status="",this.region="",this.applyFilters()},async updateCampaignField(t,e,n){try{const i=await fetch("/advertising/api/campaigns/".concat(t),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[e]:n})}),r=await i.json();if(r.success){const i=this.campaigns.find(e=>e.id===t);i&&(i[e]=n),this.showNotification("Campanha atualizada com sucesso","success")}else this.showNotification(r.error||"Erro ao atualizar campanha","error")}catch(t){console.error("Error updating campaign:",t),this.showNotification("Erro de conexão","error")}},async deleteCampaign(t){if((await Swal.fire({title:this.$t("advertising.campaigns.delete.confirm_title"),text:this.$t("advertising.campaigns.delete.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("advertising.campaigns.delete.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/advertising/api/campaigns/".concat(t),{method:"DELETE"}),n=await e.json();n.success?(this.campaigns=this.campaigns.filter(e=>e.id!==t),Swal.fire({title:this.$t("advertising.campaigns.delete.success_title"),text:this.$t("advertising.campaigns.delete.success_text"),icon:"success",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})):Swal.fire({title:this.$t("common.error"),text:n.error||this.$t("advertising.campaigns.delete.error_text"),icon:"error",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})}catch(t){console.error("Error deleting campaign:",t),Swal.fire({title:this.$t("common.error"),text:this.$t("advertising.campaigns.delete.error_text"),icon:"error",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})}},async duplicateCampaign(t){if((await Swal.fire({title:this.$t("advertising.campaigns.duplicate.confirm_title"),text:this.$t("advertising.campaigns.duplicate.confirm_text"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#6c757d",confirmButtonText:this.$t("advertising.campaigns.duplicate.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-primary w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/advertising/api/campaigns/".concat(t,"/duplicate"),{method:"POST"}),n=await e.json();n.success?(Swal.fire({title:this.$t("advertising.campaigns.duplicate.success_title"),text:this.$t("advertising.campaigns.duplicate.success_text"),icon:"success",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0}),await this.loadCampaigns()):Swal.fire({title:this.$t("common.error"),text:n.error||this.$t("advertising.campaigns.duplicate.error_text"),icon:"error",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})}catch(t){console.error("Error duplicating campaign:",t),Swal.fire({title:this.$t("common.error"),text:this.$t("advertising.campaigns.duplicate.error_text"),icon:"error",customClass:{confirmButton:"btn btn-primary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})}},viewCampaign(t){window.location.href="/advertising/campaigns/".concat(t)},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"N/A",getStatusClass:t=>({active:"bg-soft-success text-success",paused:"bg-soft-warning text-warning",draft:"bg-soft-info text-info",ended:"bg-soft-danger text-danger"}[t]||"bg-soft-secondary text-secondary"),getStatusDisplay:t=>({active:"Ativa",paused:"Pausada",draft:"Rascunho",ended:"Terminada"}[t]||t),showNotification(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";window.Swal?Swal.fire({title:"success"===e?"Sucesso!":"Aviso",text:t,icon:e,timer:"success"===e?2e3:void 0,showConfirmButton:"success"!==e}):alert(t)},get filteredCampaigns(){return this.campaigns},get hasFilters(){return this.search||this.status||this.region},get totalPages(){return this.pagination.pages||1},get pageNumbers(){const t=[],e=this.currentPage,n=this.totalPages;t.push(1);for(let i=Math.max(2,e-2);i<=Math.min(n-1,e+2);i++)i>1&&i<n&&t.push(i);return n>1&&t.push(n),[...new Set(t)].sort((t,e)=>t-e)}}}function S3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function M3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function C3(){return{trackers:[],campaigns:[],filters:{search:"",type:"",status:"",campaign:""},pagination:{page:1,limit:50,total:0,pages:0,has_more:!1},loading:!0,error:null,init(){this.loadCampaigns(),this.loadTrackers(1)},async loadTrackers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{this.loading=!0,this.error=null;const e=new URLSearchParams(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S3(Object(n),!0).forEach(function(e){M3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({page:t,limit:this.pagination.limit},this.filters)),n=await fetch("/api/advertising/trackers?".concat(e)),i=await n.json();i.success?(this.trackers=i.data,this.pagination=i.pagination,this.pagination.page=t):this.error=i.message||"Erro ao carregar trackers"}catch(t){console.error("Erro ao carregar trackers:",t),this.error="Erro de conexão"}finally{this.loading=!1}},async loadCampaigns(){try{const t=await fetch("/api/advertising/campaigns?limit=100"),e=await t.json();e.success&&(this.campaigns=e.data)}catch(t){console.error("Erro ao carregar campanhas:",t)}},async deleteTracker(t){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/trackers/".concat(t),{method:"DELETE"}),n=await e.json();n.success?await this.loadTrackers(this.pagination.page):alert(n.message||"Erro ao eliminar tracker")}catch(t){console.error("Erro ao eliminar tracker:",t),alert("Erro de conexão")}},getTypeBadgeClass:t=>({view:"bg-info",click:"bg-success",register:"bg-warning",purchase:"bg-primary",custom:"bg-secondary"}[t]||"bg-secondary"),getTypeDisplay:t=>({view:"Visualização",click:"Clique",register:"Registo",purchase:"Compra",custom:"Personalizado"}[t]||t),getStatusBadgeClass:t=>({active:"bg-success",inactive:"bg-secondary",paused:"bg-warning"}[t]||"bg-secondary"),getStatusDisplay:t=>({active:"Ativo",inactive:"Inativo",paused:"Pausado"}[t]||t),formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"--",getPageNumbers(){const t=[],e=this.pagination.page,n=this.pagination.pages;let i=Math.max(1,e-2),r=Math.min(n,e+2);r-i<4&&(1===i?r=Math.min(n,i+4):i=Math.max(1,r-4));for(let e=i;e<=r;e++)t.push(e);return t}}}function T3(){return{stats:{},campaigns:[],topCampaigns:[],recentActivity:[],loading:!0,error:null,init(){this.loadDashboardData()},async loadDashboardData(){try{this.loading=!0,this.error=null;const[t,e,n,i]=await Promise.all([fetch("/api/advertising/dashboard-stats"),fetch("/api/advertising/campaigns?limit=10"),fetch("/api/advertising/top-campaigns"),fetch("/api/advertising/recent-activity")]);if(t.ok){const e=await t.json();e.success&&(this.stats=e.data)}if(e.ok){const t=await e.json();t.success&&(this.campaigns=t.data)}if(n.ok){const t=await n.json();t.success&&(this.topCampaigns=t.data)}if(i.ok){const t=await i.json();t.success&&(this.recentActivity=t.data)}}catch(t){console.error("Erro ao carregar dados do dashboard:",t),this.error="Erro de conexão ao carregar dados"}finally{this.loading=!1}},getStatusBadgeClass:t=>({1:"bg-soft-success text-success",0:"bg-soft-warning text-warning",active:"bg-soft-success text-success",paused:"bg-soft-warning text-warning",inactive:"bg-soft-danger text-danger"}[t]||"bg-soft-secondary text-secondary"),getStatusDisplay:t=>({1:"Ativa",0:"Pausada",active:"Ativa",paused:"Pausada",inactive:"Inativa"}[t]||"Desconhecido"),getCategoryDisplay:t=>t?t.charAt(0).toUpperCase()+t.slice(1):"N/A",getActivityMarkerClass:t=>({campaign_created:"bg-success",campaign_updated:"bg-info",campaign_paused:"bg-warning",campaign_activated:"bg-success",creative_uploaded:"bg-primary",tracker_created:"bg-info",report_generated:"bg-secondary"}[t]||"bg-secondary"),formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"2-digit",day:"2-digit"}):"--",formatPercentage:t=>!t||isNaN(t)?"0.00%":parseFloat(t).toFixed(2)+"%",formatNumber:t=>!t||isNaN(t)?"0":parseInt(t).toLocaleString("pt-PT")}}function I3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function D3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I3(Object(n),!0).forEach(function(e){k3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function k3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A3(){return{tracker:{},brands:[],landingTypes:[],creatives:[],formData:{name:"",brand_id:"",landing_type_id:"",final_tracking_url:"",creative_id:"",is_active:!0},loading:!0,saving:!1,error:null,get selectedLandingType(){return this.landingTypes.find(t=>t.id==this.formData.landing_type_id)},get selectedCreative(){return this.creatives.find(t=>t.id==this.formData.creative_id)},init(){this.loadTrackerData()},async loadTrackerData(){try{this.loading=!0,this.error=null;const t=window.location.pathname.split("/"),e=t[t.length-2],[n,i]=await Promise.all([fetch("/api/advertising/trackers/".concat(e)),fetch("/api/advertising/brands")]);if(n.ok){const t=await n.json();t.success&&(this.tracker=t.data,this.formData={name:this.tracker.tracker_name||"",brand_id:this.tracker.brand_id||"",landing_type_id:this.tracker.landing_type_id||"",final_tracking_url:this.tracker.final_tracking_url||"",creative_id:this.tracker.creative_id||"",is_active:1==this.tracker.is_active},this.formData.brand_id&&(await this.loadLandingTypes(this.formData.brand_id,this.formData.landing_type_id),await this.loadCreatives(this.formData.brand_id,this.formData.landing_type_id,this.formData.creative_id)))}if(i.ok){const t=await i.json();t.success&&(this.brands=t.data)}}catch(t){console.error("Erro ao carregar dados do tracker:",t),this.error="Erro de conexão ao carregar dados"}finally{this.loading=!1}},async onBrandChange(){const t=this.formData.brand_id;this.formData.landing_type_id="",this.formData.creative_id="",this.landingTypes=[],this.creatives=[],t&&(await this.loadLandingTypes(t),await this.loadCreatives(t))},async onLandingTypeChange(){const t=this.formData.landing_type_id,e=this.formData.brand_id;t&&this.selectedLandingType?(this.processTemplateUrl(this.selectedLandingType.template_url),e&&await this.loadCreatives(e,t)):(this.formData.final_tracking_url="",e&&await this.loadCreatives(e))},onCreativeChange(){},async loadLandingTypes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{const n=await fetch("/api/advertising/brand/".concat(t,"/landing-types")),i=await n.json();i.success&&(this.landingTypes=i.data||[],e&&this.landingTypes.find(t=>t.id==e)&&(this.formData.landing_type_id=e,this.selectedLandingType&&this.processTemplateUrl(this.selectedLandingType.template_url)))}catch(t){console.error("Erro ao carregar landing types:",t)}},async loadCreatives(t){let e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{const t=await fetch("/api/advertising/creatives"),n=await t.json();if(n.success){if(this.creatives=n.data||[],e){const t=this.creatives.find(t=>t.id==e);t&&(this.formData.creative_id=e)}}else this.creatives=[],this.formData.creative_id=""}catch(t){console.error("Erro ao carregar criativos:",t),this.creatives=[],this.formData.creative_id=""}},processTemplateUrl(t){if(!t)return;let e=t;const n={"{tracker_id}":this.tracker.id||"","{campaign_id}":this.tracker.campaign_id||"","{campaign_alias}":this.tracker.campaign_alias||"","{code}":this.generateCode(),"{timestamp}":Date.now(),"{random}":Math.random().toString(36).substring(7)};Object.entries(n).forEach(t=>{let[n,i]=t;e=e.replace(new RegExp(n,"g"),i)}),this.formData.final_tracking_url=e},generateCode:()=>"tr_"+Date.now().toString(36)+Math.random().toString(36).substring(2,7),copyToClipboard(t){t.select(),document.execCommand("copy");const e=t.nextElementSibling,n=e.innerHTML;e.innerHTML='<i class="ri-check-line"></i> Copiado!',e.classList.add("btn-success"),e.classList.remove("btn-outline-secondary"),setTimeout(()=>{e.innerHTML=n,e.classList.remove("btn-success"),e.classList.add("btn-outline-secondary")},2e3)},async saveTracker(){try{this.saving=!0;const t=window.location.pathname.split("/"),e=t[t.length-2],n=await fetch("/api/advertising/trackers/".concat(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D3(D3({},this.formData),{},{is_active:this.formData.is_active?1:0}))}),i=await n.json();i.success?window.Swal?window.Swal.fire({icon:"success",title:"Sucesso!",text:"Tracker atualizado com sucesso.",timer:2e3}).then(()=>{window.location.href="/advertising/tracking"}):(alert("Tracker atualizado com sucesso!"),window.location.href="/advertising/tracking"):this.error=i.message||"Erro ao atualizar tracker"}catch(t){console.error("Erro:",t),this.error="Erro ao processar a solicitação"}finally{this.saving=!1}},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"--"}}function E3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function L3(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E3(Object(n),!0).forEach(function(e){P3(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E3(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function P3(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function O3(){return{campaign:{},trackers:[],brands:[],formats:[],topCountries:[],allCountries:[],countrySearch:"",currentTracker:null,formData:{name:"",status:"1",start_date:"",end_date:"",no_end_date:!1},loading:!0,saving:!1,error:null,get filteredCountries(){if(!this.countrySearch)return this.allCountries;const t=this.countrySearch.toLowerCase();return this.allCountries.filter(e=>{var n,i;return(null===(n=e.name)||void 0===n?void 0:n.toLowerCase().includes(t))||(null===(i=e.full_name)||void 0===i?void 0:i.toLowerCase().includes(t))||e.code.toLowerCase().includes(t)})},init(){this.loadCampaignData(),this.loadFormats(),this.loadCountries()},async loadCampaignData(){try{this.loading=!0,this.error=null;const e=window.location.pathname.split("/"),n=e[e.length-2],[i,r,o]=await Promise.all([fetch("/api/advertising/campaigns/".concat(n)),fetch("/api/advertising/brands"),fetch("/api/advertising/campaigns/".concat(n,"/trackers"))]);if(i.ok){const e=await i.json();var t;e.success&&(this.campaign=e.data,this.formData={name:this.campaign.name||"",status:(null===(t=this.campaign.status)||void 0===t?void 0:t.toString())||"1",start_date:this.campaign.start_date||"",end_date:this.campaign.end_date||"",no_end_date:!this.campaign.end_date})}if(r.ok){const t=await r.json();t.success&&(this.brands=t.data)}if(o.ok){const t=await o.json();if(t.success){this.trackers=t.data.map(t=>L3(L3({},t),{},{landingTypes:[],countries:t.countries?t.countries.split(","):["PT"],format:t.format||"sticky-bottom"}));for(let t=0;t<this.trackers.length;t++)this.trackers[t].brand_id&&await this.updateLandingTypes(t)}}}catch(t){console.error("Erro ao carregar dados da campanha:",t),this.error="Erro de conexão ao carregar dados"}finally{this.loading=!1}},async loadFormats(){try{const t=await fetch("/api/advertising/formats"),e=await t.json();e.success&&(this.formats=e.data||[])}catch(t){console.error("Erro ao carregar formatos:",t)}},async loadCountries(){try{const t=await fetch("/api/advertising/countries"),e=await t.json();e.success&&(this.allCountries=e.data||[],this.topCountries=this.allCountries.slice(0,8))}catch(t){console.error("Erro ao carregar países:",t)}},addNewTracker(){const t={id:"temp_"+Date.now(),name:"",brand_id:"",landing_type_id:"",landingTypes:[],countries:["PT"],format:this.formats.length>0?this.formats[0].id:"",is_active:!0};this.trackers.push(t)},async removeTracker(t){(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#6c757d",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-primary w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed&&this.trackers.splice(t,1)},async updateLandingTypes(t){const e=this.trackers[t],n=e.brand_id;if(!n)return e.landingTypes=[],void(e.landing_type_id="");try{const t=await fetch("/api/advertising/brands-landing/".concat(n)),i=await t.json();i.success&&(e.landingTypes=i.data||[],e.landing_type_id="")}catch(t){console.error("Erro ao carregar landing types:",t),e.landingTypes=[]}},updateTrackerUrl(t){const e=this.trackers[t],n=e.landing_type_id;if(n){const t=e.landingTypes.find(t=>t.id==n);if(t){let n=t.template_url||"";const i={"{tracker_id}":e.id,"{campaign_id}":this.campaign.id,"{campaign_alias}":this.campaign.alias||"","{code}":this.generateCode(),"{timestamp}":Date.now(),"{random}":Math.random().toString(36).substring(7)};Object.entries(i).forEach(t=>{let[e,i]=t;n=n.replace(new RegExp(e,"g"),i)}),e.final_tracking_url=n}}else e.final_tracking_url=""},generateCode:()=>"tr_"+Date.now().toString(36)+Math.random().toString(36).substring(2,7),isCountrySelected:(t,e)=>e.countries.includes(t),toggleCountry(t,e){const n=e.countries.indexOf(t);n>-1?e.countries.splice(n,1):e.countries.push(t)},openCountryModal(t){this.currentTracker=t,this.countrySearch="",new bootstrap.Modal(document.getElementById("countryModal")).show()},selectFormat(t,e){t.format=e},async saveCampaign(){try{this.saving=!0;const t=window.location.pathname.split("/"),e=t[t.length-2],n=L3(L3({},this.formData),{},{end_date:this.formData.no_end_date?null:this.formData.end_date,trackers:this.trackers.map(t=>({id:t.id,name:t.name,brand_id:t.brand_id,landing_type_id:t.landing_type_id,final_tracking_url:t.final_tracking_url,countries:t.countries.join(","),format:t.format,is_active:t.is_active?1:0}))}),i=await fetch("/api/advertising/campaigns/".concat(e),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),r=await i.json();r.success?window.Swal?window.Swal.fire({icon:"success",title:"Sucesso!",text:"Campanha atualizada com sucesso.",timer:2e3}).then(()=>{window.location.href="/advertising/campaigns"}):(alert("Campanha atualizada com sucesso!"),window.location.href="/advertising/campaigns"):this.error=r.message||"Erro ao atualizar campanha"}catch(t){console.error("Erro:",t),this.error="Erro ao processar a solicitação"}finally{this.saving=!1}}}}function R3(){return{formats:[],async init(){try{const t=await fetch("/api/advertising/formats"),e=await t.json();this.formats=(e.data||e.formats||[]).map(t=>({id:t.id,name:t.name}))}catch(t){console.error("Erro a carregar formatos",t),this.formats=[]}}}}n(7801),"undefined"!=typeof window&&(window.Alpine?(console.log("✅ Alpine available, registering salesDashboard"),window.Alpine.data("salesDashboard",h3)):(console.log("⏳ Alpine not available yet, waiting..."),window.addEventListener("alpine:init",()=>{console.log("✅ Alpine init event, registering salesDashboard"),window.Alpine.data("salesDashboard",h3)}),window.addEventListener("alpine-ready",()=>{console.log("✅ Alpine ready event, registering salesDashboard"),window.Alpine.data("salesDashboard",h3)}))),"undefined"!=typeof window&&(window.Alpine?(console.log("✅ Alpine available, registering dashboardWidgets"),window.Alpine.data("dashboardWidgets",d3)):(console.log("⏳ Alpine not available yet, waiting..."),window.addEventListener("alpine:init",()=>{console.log("✅ Alpine init event, registering dashboardWidgets"),window.Alpine.data("dashboardWidgets",d3)}),window.addEventListener("alpine-ready",()=>{console.log("✅ Alpine ready event, registering dashboardWidgets"),window.Alpine.data("dashboardWidgets",d3)}))),n(6704),"undefined"!=typeof window&&(window.Alpine?(console.log("✅ Alpine available, registering crmContacts"),window.Alpine.data("crmContacts",m3)):(console.log("⏳ Alpine not available yet, waiting..."),window.addEventListener("alpine:init",()=>{console.log("✅ Alpine init event, registering crmContacts"),window.Alpine.data("crmContacts",m3)}),window.addEventListener("alpine-ready",()=>{console.log("✅ Alpine ready event, registering crmContacts"),window.Alpine.data("crmContacts",m3)}))),"undefined"!=typeof window&&(window.Alpine?(console.log("✅ Alpine available, registering analyticsDashboard"),window.Alpine.data("analyticsDashboard",y3)):(console.log("⏳ Alpine not available yet, waiting..."),window.addEventListener("alpine:init",()=>{console.log("✅ Alpine init event, registering analyticsDashboard"),window.Alpine.data("analyticsDashboard",y3)}),window.addEventListener("alpine-ready",()=>{console.log("✅ Alpine ready event, registering analyticsDashboard"),window.Alpine.data("analyticsDashboard",y3)}))),"undefined"!=typeof window&&(window.Alpine?(console.log("✅ Alpine available, registering redirectsManager"),window.Alpine.data("redirectsManager",b3)):(console.log("⏳ Alpine not available yet, waiting..."),window.addEventListener("alpine:init",()=>{console.log("✅ Alpine init event, registering redirectsManager"),window.Alpine.data("redirectsManager",b3)}),window.addEventListener("alpine-ready",()=>{console.log("✅ Alpine ready event, registering redirectsManager"),window.Alpine.data("redirectsManager",b3)}))),"undefined"!=typeof window&&(window.Alpine?window.Alpine.data("advertisingCampaigns",w3):document.addEventListener("alpine:init",()=>{window.Alpine.data("advertisingCampaigns",w3)})),document.addEventListener("alpine-ready",()=>{window.Alpine&&!window.Alpine.data("advertisingCampaigns")&&window.Alpine.data("advertisingCampaigns",w3)}),n(4450);const B3=()=>({brands:[],currentBrand:null,isLoading:!1,showCreateModal:!1,showDeleteModal:!1,brandToDelete:null,formData:{id:"",name:"",slug:"",status:1},async loadBrands(){this.isLoading=!0;try{const t=await fetch("/api/advertising/brands"),e=await t.json();e.success?this.brands=e.data:this.showToast("Erro ao carregar marcas","danger")}catch(t){console.error("Erro ao carregar marcas:",t),this.showToast("Erro ao carregar marcas","danger")}finally{this.isLoading=!1}},openCreateModal(){this.currentBrand=null,this.formData={id:"",name:"",slug:"",status:1},this.showCreateModal=!0},openEditModal(t){this.currentBrand=t,this.formData={id:t.id,name:t.name||"",slug:t.slug||"",status:t.status||1},this.showCreateModal=!0},async saveBrand(){try{const t=this.currentBrand?"/api/advertising/brands/".concat(this.currentBrand.id):"/api/advertising/brands",e=this.currentBrand?"PUT":"POST",n=await fetch(t,{method:e,headers:{"Content-Type":"application/json"},body:JSON.stringify(this.formData)}),i=await n.json();i.success?(this.showToast(i.message||"Marca guardada com sucesso!","success"),this.showCreateModal=!1,this.loadBrands()):this.showToast(i.message||"Erro ao guardar marca","danger")}catch(t){console.error("Erro ao guardar marca:",t),this.showToast("Erro ao guardar marca","danger")}},openDeleteModal(t){this.brandToDelete=t,this.showDeleteModal=!0},async confirmDelete(){try{const t=await fetch("/api/advertising/brands/".concat(this.brandToDelete.id),{method:"DELETE"}),e=await t.json();e.success?(this.showToast(e.message||"Marca eliminada com sucesso!","success"),this.showDeleteModal=!1,this.brandToDelete=null,this.loadBrands()):this.showToast(e.message||"Erro ao eliminar marca","danger")}catch(t){console.error("Erro ao eliminar marca:",t),this.showToast("Erro ao eliminar marca","danger")}},showToast(t){alert(t)},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT"):"N/A",init(){this.loadBrands()}}),N3=()=>({siteGroup:null,campaigns:[],trackers:[],domains:[],stats:{},loading:!0,error:null,siteGroupId:null,init(){const t=window.location.pathname.split("/");this.siteGroupId=t[t.length-2],this.siteGroupId&&!isNaN(this.siteGroupId)?this.loadSiteGroup():(this.error="ID do site group não especificado",this.loading=!1)},async loadSiteGroup(){try{this.loading=!0,this.error=null,console.log("🔍 Carregando site group ID:",this.siteGroupId);const e=await fetch("/api/advertising/site-groups/".concat(this.siteGroupId)),n=await e.json();var t;console.log("📊 Resposta da API:",n),n.success?(this.siteGroup=n.data,this.campaigns=n.data.campaigns||[],this.trackers=n.data.trackers||[],this.domains=n.data.domains||[],this.stats=n.data.stats||{},console.log("✅ Dados carregados:",{siteGroup:null===(t=this.siteGroup)||void 0===t?void 0:t.name,campaigns:this.campaigns.length,trackers:this.trackers.length,domains:this.domains.length,stats:this.stats})):(this.error=n.message||"Erro ao carregar site group",console.error("❌ Erro da API:",n.message))}catch(t){console.error("❌ Erro ao carregar site group:",t),this.error="Erro de conexão"}finally{this.loading=!1}},async editDomain(t){const{value:e}=await Swal.fire({title:"Editar domínio",html:'<input id="swal-domain" class="swal2-input" placeholder="domínio" value="'.concat(t.domain||"",'">')+'<input id="swal-subdomain" class="swal2-input" placeholder="subdomínio" value="'.concat(t.subdomain||"",'">')+'<label class="mt-2"><input type="checkbox" id="swal-primary" '.concat(t.is_primary?"checked":"","> Primário</label>"),focusConfirm:!1,showCancelButton:!0,confirmButtonText:"Guardar",cancelButtonText:"Cancelar",preConfirm:()=>({domain:document.getElementById("swal-domain").value.trim(),subdomain:document.getElementById("swal-subdomain").value.trim(),is_primary:document.getElementById("swal-primary").checked?1:0})});if(e)try{const n=await fetch("/api/advertising/site-groups/".concat(this.siteGroupId,"/domains/").concat(t.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),i=await n.json();i.success?(await this.loadSiteGroup(),Swal.fire({icon:"success",title:"Guardado"})):Swal.fire({icon:"error",title:"Erro",text:i.message||"Falha ao guardar"})}catch(t){console.error("Erro a atualizar domínio",t),Swal.fire({icon:"error",title:"Erro de conexão"})}},async removeDomain(t){if(console.log("🗑️ Removendo domínio:",t),(await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#6c757d",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-primary w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/advertising/site-groups/".concat(this.siteGroupId,"/domains/").concat(t.id),{method:"DELETE"}),n=await e.json();n.success?(await this.loadSiteGroup(),Swal.fire({icon:"success",title:"Removido"})):Swal.fire({icon:"error",title:"Erro",text:n.message||"Falha ao remover"})}catch(t){console.error("Erro a remover domínio",t),Swal.fire({icon:"error",title:"Erro de conexão"})}},editCampaign(t){console.log("🔧 Editando campanha:",t),window.location.href="/advertising/campaigns/".concat(t.id,"/edit")},viewCampaign(t){console.log("👁️ Visualizando campanha:",t),window.location.href="/advertising/campaigns/".concat(t.id)},editTracker(t){console.log("🔧 Editando tracker:",t),window.location.href="/advertising/trackers/".concat(t.id,"/edit")},viewTracker(t){console.log("👁️ Visualizando tracker:",t),window.location.href="/advertising/trackers/".concat(t.id)},getStatusText:t=>"active"===t?"Ativo":"inactive"===t?"Inativo":"pending"===t?"Pendente":"Desconhecido",formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"--",formatCurrency:t=>!t||t<=0?"0,00 €":new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t)});function z3(){return{categories:[],statuses:[],visibilityOptions:[],brands:[],init(){console.log("🚀 Product Create page initialized"),this.loadFormData(),this.initializeForm()},async loadFormData(){try{const t=await fetch("/api/ecommerce/categories"),e=await t.json();e.success&&(this.categories=e.data,this.populateCategories());const n=await fetch("/api/ecommerce/statuses"),i=await n.json();i.success&&(this.statuses=i.data,this.populateStatuses());const r=await fetch("/api/ecommerce/visibility"),o=await r.json();o.success&&(this.visibilityOptions=o.data,this.populateVisibility());const a=await fetch("/api/ecommerce/brands"),s=await a.json();s.success&&(this.brands=s.data,this.populateBrands())}catch(t){console.error("Erro ao carregar dados do formulário:",t)}},populateCategories(){const t=document.getElementById("productCategory");t&&(t.innerHTML='<option value="">Selecionar categoria</option>',this.categories.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},populateStatuses(){const t=document.getElementById("choices-publish-status-input");t&&(t.innerHTML="",this.statuses.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,"Published"===e.value&&(n.selected=!0),t.appendChild(n)}))},populateVisibility(){const t=document.getElementById("choices-publish-visibility-input");t&&(t.innerHTML="",this.visibilityOptions.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,"Public"===e.value&&(n.selected=!0),t.appendChild(n)}))},populateBrands(){const t=document.getElementById("productBrand");t&&(t.innerHTML='<option value="">Selecionar marca</option>',this.brands.forEach(e=>{const n=document.createElement("option");n.value=e.value,n.textContent=e.label,t.appendChild(n)}))},initializeForm(){"undefined"!=typeof bootstrap&&bootstrap.Tooltip&&[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(t){return new bootstrap.Tooltip(t)}),"undefined"!=typeof Choices&&document.querySelectorAll("[data-choices]").forEach(t=>{new Choices(t,{searchEnabled:!1,itemSelectText:""})})},async submitForm(){try{const t=document.getElementById("productForm");if(!t)return;const e=new FormData(t),n=await fetch("/api/ecommerce/products",{method:"POST",body:e}),i=await n.json();i.success?(this.showAlert("success","Produto criado com sucesso!"),t.reset()):this.showAlert("error",i.message||"Erro ao criar produto")}catch(t){console.error("Erro ao submeter formulário:",t),this.showAlert("error","Erro interno do servidor")}},showAlert(t,e){"success"===t?"undefined"!=typeof Swal?Swal.fire({icon:"success",title:"Sucesso!",text:e}):alert(e):"undefined"!=typeof Swal?Swal.fire({icon:"error",title:"Erro!",text:e}):alert("Erro: "+e)}}}function F3(){return{init(){this.initCustomizer()},initCustomizer(){var t=window.brandingVariants||{};this.setDefaultAttribute(t),this.initFullScreen(),this.initModeSetting(),this.resetLayout(),this.initLayoutSwitch()},setDefaultAttribute(t){if(sessionStorage.getItem("defaultAttribute"))(n={})["data-layout"]=sessionStorage.getItem("data-layout")||t["data-layout"]||"vertical",n["data-sidebar-size"]=sessionStorage.getItem("data-sidebar-size")||t["data-sidebar-size"]||"lg",n["data-bs-theme"]=sessionStorage.getItem("data-bs-theme")||t["data-bs-theme"]||"light",n["data-layout-width"]=sessionStorage.getItem("data-layout-width")||t["data-layout-width"]||"fluid",n["data-sidebar"]=sessionStorage.getItem("data-sidebar")||t["data-sidebar"]||"light",n["data-sidebar-image"]=sessionStorage.getItem("data-sidebar-image")||t["data-sidebar-image"]||"none",n["data-layout-position"]=sessionStorage.getItem("data-layout-position")||t["data-layout-position"]||"fixed",n["data-layout-style"]=sessionStorage.getItem("data-layout-style")||t["data-layout-style"]||"default",n["data-topbar"]=sessionStorage.getItem("data-topbar")||t["data-topbar"]||"light",n["data-preloader"]=sessionStorage.getItem("data-preloader")||t["data-preloader"]||"enable",n["data-body-image"]=sessionStorage.getItem("data-body-image")||t["data-body-image"]||"none",this.layoutSwitch(n);else{var e=document.documentElement.attributes,n={};Array.from(e).forEach(t=>{if(t&&t.nodeName&&"undefined"!=t.nodeName){var e=t.nodeName;n[e]=t.nodeValue,sessionStorage.setItem(e,t.nodeValue)}}),sessionStorage.setItem("defaultAttribute",JSON.stringify(n)),this.layoutSwitch(n)}},initFullScreen(){var t=document.querySelector('[data-toggle="fullscreen"]');t&&t.addEventListener("click",t=>{t.preventDefault(),document.body.classList.toggle("fullscreen-enable"),document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():document.documentElement.requestFullscreen?document.documentElement.requestFullscreen():document.documentElement.mozRequestFullScreen?document.documentElement.mozRequestFullScreen():document.documentElement.webkitRequestFullscreen&&document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}),document.addEventListener("fullscreenchange",this.exitHandler),document.addEventListener("webkitfullscreenchange",this.exitHandler),document.addEventListener("mozfullscreenchange",this.exitHandler)},exitHandler(){document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.body.classList.remove("fullscreen-enable")},initModeSetting(){var t=document.getElementsByTagName("HTML")[0],e=document.querySelectorAll(".light-dark-mode");e&&e.length&&e[0].addEventListener("click",e=>{t.hasAttribute("data-bs-theme")&&"dark"==t.getAttribute("data-bs-theme")?this.setLayoutMode("data-bs-theme","light","layout-mode-light",t):this.setLayoutMode("data-bs-theme","dark","layout-mode-dark",t),window.dispatchEvent(new Event("resize"))})},setLayoutMode(t,e,n,i){var r=document.getElementById(n);i.setAttribute(t,e),r&&document.getElementById(n).click()},resetLayout(){document.getElementById("reset-layout")&&document.getElementById("reset-layout").addEventListener("click",()=>{var t=window.brandingVariants||{};Object.keys(t).length>0?(sessionStorage.clear(),Object.keys(t).forEach(e=>{sessionStorage.setItem(e,t[e])})):sessionStorage.clear(),window.location.reload()})},initLayoutSwitch(){document.querySelectorAll('#theme-settings-offcanvas input[type="radio"]').forEach(t=>{t.addEventListener("change",t=>{const e=t.target.name,n=t.target.value;document.documentElement.setAttribute(e,n),sessionStorage.setItem(e,n),window.dispatchEvent(new Event("resize"))})})},layoutSwitch(t){Object.keys(t).forEach(e=>{document.documentElement.setAttribute(e,t[e])}),Object.keys(t).forEach(e=>{const n=document.querySelector('input[name="'.concat(e,'"][value="').concat(t[e],'"]'));n&&(n.checked=!0)})}}}function V3(){return"undefined"==typeof Alpine?(console.warn("⚠️ Alpine.js not available, waiting for initialization..."),!1):(console.log("🔧 Registering Alpine.js components..."),Alpine.data("formValidation",()=>({})),Alpine.data("modal",()=>({init(){console.log("modal component initialized")}})),Alpine.data("nestable",()=>({init(){console.log("nestable component initialized")}})),Alpine.data("formAdvanced",()=>({})),Alpine.data("formFileUpload",()=>({})),Alpine.data("formInputSpin",()=>({})),Alpine.data("formMasks",()=>({})),Alpine.data("formPickers",()=>({})),Alpine.data("formWizard",()=>({})),Alpine.data("animationAos",()=>({init(){console.log("animationAos component initialized")}})),Alpine.data("apiKey",()=>({init(){console.log("apiKey component initialized")}})),Alpine.data("calendarMonthGrid",()=>({init(){console.log("calendarMonthGrid component initialized")}})),Alpine.data("calendar",()=>({init(){console.log("calendar component initialized")}})),Alpine.data("crmCalendar",D0),Alpine.data("card",()=>({init(){console.log("card component initialized")}})),Alpine.data("chat",k0),Alpine.data("comingSoon",()=>({init(){console.log("comingSoon component initialized")}})),Alpine.data("sweetalerts",()=>({init(){console.log("sweetalerts component initialized")}})),Alpine.data("campaignsManager",H0),Alpine.data("campaignCreate",f5),Alpine.data("creativeCreate",g5),Alpine.data("siteGroupCreate",m5),Alpine.data("landingTypesManager",A5),Alpine.data("trackerViewModel",E5),Alpine.data("trackingViewModel",C3),Alpine.data("advertisingDashboard",T3),Alpine.data("trackerEditViewModel",A3),Alpine.data("campaignEditViewModel",O3),Alpine.data("trackerCreate",R3),Alpine.data("creativeEditModel",L5),Alpine.data("tasksList",u3),Alpine.data("brandsManager",B3),Alpine.data("siteGroupViewModel",N3),Alpine.data("crmContacts",z5),Alpine.data("dashboardCrm",V0),Alpine.data("advertisingReports",P5),Alpine.data("ecommerceProductList",R0),Alpine.data("productDetails",B0),Alpine.data("errorMonitoringDashboard",N0),Alpine.data("errorMonitoringDetail",z0),Alpine.data("errorMonitoringImport",F0),Alpine.data("productCreate",z3),Alpine.data("blogFilters",i3),Alpine.data("redirectCreate",r3),Alpine.data("customizer",F3),document.addEventListener("DOMContentLoaded",()=>{console.log("🔧 Initializing customizer...");const t=F3();t&&t.init?(t.init(),console.log("✅ Customizer initialized")):console.warn("⚠️ Customizer not available")}),Alpine.data("init",()=>({init(){console.log("Legacy init component initialized")}})),console.log("✅ Alpine.js components registered successfully"),!0)}n(5987),n(9412),console.log("✅ Advertising module loaded"),window.Chart=wa,window.echarts=p,window.copyTrackingCode=function(){const t=document.querySelector("pre code"),e=document.createElement("textarea");e.value=t.textContent,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e);const n=document.querySelector('button[onclick="copyTrackingCode()"]'),i=n.innerHTML;n.innerHTML='<i class="ri-check-line me-1"></i> Copiado!',n.classList.remove("btn-primary"),n.classList.add("btn-success"),setTimeout(()=>{n.innerHTML=i,n.classList.remove("btn-success"),n.classList.add("btn-primary")},2e3)},Alpine.data("editRedirect")?console.log("⚠️ EditRedirect component already registered, skipping..."):(Alpine.data("editRedirect",function(){return{redirect:null,loading:!0,error:null,saving:!1,success:!1,get redirectId(){const t=window.location.pathname.match(/\/redirects\/redirects\/(\d+)\/edit/);return t?t[1]:null},async loadRedirect(){if(!this.redirectId)return this.error="ID do redirect não encontrado",void(this.loading=!1);try{const t=await fetch("/api/redirects/".concat(this.redirectId),{credentials:"include",headers:{"Content-Type":"application/json"}}),e=await t.json();e.success?(this.redirect=e.data.redirect,this.redirect=a3({name:this.redirect.name||"",source_url:this.redirect.source_url||"",target_url:this.redirect.target_url||"",fallback_url:this.redirect.fallback_url||"",status:void 0!==this.redirect.status?this.redirect.status:1,redirect_type:this.redirect.redirect_type||"302",tracking_enabled:void 0!==this.redirect.tracking_enabled?this.redirect.tracking_enabled:1,max_clicks:this.redirect.max_clicks||null,expires_at:this.redirect.expires_at||null},this.redirect)):this.error=e.message||"Erro ao carregar dados do redirect"}catch(t){this.error="Erro de ligação ao servidor",console.error("Error loading redirect:",t)}finally{this.loading=!1}},async updateRedirect(){if(this.redirect){this.saving=!0,this.error=null,this.success=!1;try{var t;const e=document.getElementById("editRedirectForm"),n=new FormData(e),i=document.getElementById("status-toggle"),r=i&&"boolean"==typeof i.checked?i.checked?1:0:null!==(t=this.redirect)&&void 0!==t&&t.status?1:0;n.set("status",r);const o={name:n.get("name"),source_url:n.get("source_url"),target_url:n.get("target_url"),fallback_url:n.get("fallback_url")||"",status:parseInt(n.get("status"),10),redirect_type:n.get("redirect_type"),tracking_enabled:n.get("tracking_enabled")?1:0,max_clicks:n.get("max_clicks")?parseInt(n.get("max_clicks")):null,expires_at:n.get("expires_at")||null},a=await fetch("/api/redirects/".concat(this.redirectId),{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}),s=await a.json();s.success?(this.success=!0,this.redirect=a3(a3({},this.redirect),o),setTimeout(()=>{this.success=!1},3e3)):this.error=s.message||"Erro ao atualizar redirect"}catch(t){this.error="Erro de ligação ao servidor",console.error("Error updating redirect:",t)}finally{this.saving=!1}}},formatDateForInput:t=>t?new Date(t).toISOString().slice(0,16):"",goBack(){window.location.href="/redirects/redirects"}}}),console.log("✅ EditRedirect component registered with Alpine.js")),Alpine.data("redirectsList")?console.log("⚠️ RedirectsList component already registered, skipping..."):(Alpine.data("redirectsList",function(){return{redirects:[],filters:{search:"",status:""},loading:!0,error:null,init(){this.loadRedirects()},async loadRedirects(){this.loading=!0,this.error=null;try{const t=new URLSearchParams;this.filters.search&&t.append("search",this.filters.search),this.filters.status&&t.append("status",this.filters.status);const e=await fetch("/api/redirects?".concat(t.toString()),{credentials:"include",headers:{"Content-Type":"application/json"}}),n=await e.json();n.success?this.redirects=n.data.redirects:this.error=n.message||"Erro ao carregar redirects"}catch(t){this.error="Erro de ligação ao servidor",console.error("Error loading redirects:",t)}finally{this.loading=!1}},applyFilters(){this.loadRedirects()},clearFilters(){this.filters={search:"",status:""},this.loadRedirects()},formatDate:t=>t?new Date(t).toLocaleDateString("pt-PT",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"",getStatusBadgeClass:t=>1==t?"bg-success":"bg-secondary",getStatusText:t=>1==t?"Ativo":"Inativo",getTypeBadgeClass(t){switch(t){case"301":return"bg-primary";case"302":return"bg-info";case"meta":return"bg-warning";case"javascript":return"bg-dark";default:return"bg-secondary"}},getTrackingBadgeClass:t=>t?"bg-success":"bg-secondary",getTrackingText:t=>t?"Ativo":"Inativo",async deleteRedirect(t,e){if((await Swal.fire({title:this.$t("common.confirm_title"),text:this.$t("common.confirm_text"),icon:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:this.$t("common.confirm_button"),cancelButtonText:this.$t("common.cancel"),customClass:{confirmButton:"btn btn-danger w-xs me-2 mt-2",cancelButton:"btn btn-secondary w-xs mt-2"},buttonsStyling:!1,showCloseButton:!0})).isConfirmed)try{const e=await fetch("/api/redirects/".concat(t),{method:"DELETE"}),n=await e.json();n.success?this.redirects=this.redirects.filter(e=>e.id!==t):alert("Erro ao apagar redirect: "+n.message)}catch(t){console.error("Error deleting redirect:",t),alert("Erro ao apagar redirect")}},goToCreate(){window.location.href="/redirects/redirects/create"},goToEdit(t){window.location.href="/redirects/redirects/".concat(t,"/edit")},goToView(t){window.location.href="/redirects/redirects/".concat(t)}}}),console.log("✅ RedirectsList component registered with Alpine.js")),Alpine.data("redirectsStats")?console.log("⚠️ RedirectsStats component already registered, skipping..."):(Alpine.data("redirectsStats",function(){return{loading:!1,selectedRange:"all",startDate:"",endDate:"",selectedTracker:"",selectedCountry:"",selectedDevice:"",selectedBrowser:"",selectedOS:"",availableRedirects:[],availableCountries:[],availableBrowsers:[],availableOS:[],stats:{overview:{},by_country:[],by_device:[],by_browser:[]},charts:{},t:t=>"function"==typeof window.$t?window.$t(t):{"redirects.common.tracker":"Tracker","redirects.common.country":"País","redirects.common.device":"Dispositivo","redirects.common.browser":"Navegador","redirects.common.operating_system":"Sistema Operativo","redirects.common.start_date":"Data Início","redirects.common.end_date":"Data Fim","redirects.common.filter":"Filtrar","redirects.common.reset":"Reset","redirects.common.export":"Exportar","redirects.common.total_clicks":"Total de Cliques","redirects.common.unique_clicks":"Cliques Únicos","redirects.common.unique_ips":"IPs Únicos","redirects.common.avg_response_time":"Tempo Médio de Resposta","redirects.common.clicks_by_country":"Cliques por País","redirects.common.clicks_by_device":"Cliques por Dispositivo","redirects.common.clicks_by_browser":"Cliques por Navegador","redirects.common.top_countries":"Top Países","redirects.common.clicks":"Cliques","redirects.common.percentage":"Percentagem","redirects.common.no_data_available":"Nenhuns dados disponíveis","redirects.common.top_devices":"Top Dispositivos"}[t]||t,async init(){var t,e,n,i,r,o,a;this.startDate=(null===(t=window.redirectsStatsData)||void 0===t?void 0:t.startDate)||"",this.endDate=(null===(e=window.redirectsStatsData)||void 0===e?void 0:e.endDate)||"",this.availableRedirects=(null===(n=window.redirectsStatsData)||void 0===n||null===(n=n.filterOptions)||void 0===n?void 0:n.redirects)||[],this.availableCountries=(null===(i=window.redirectsStatsData)||void 0===i||null===(i=i.filterOptions)||void 0===i?void 0:i.countries)||[],this.availableBrowsers=(null===(r=window.redirectsStatsData)||void 0===r||null===(r=r.filterOptions)||void 0===r?void 0:r.browsers)||[],this.availableOS=(null===(o=window.redirectsStatsData)||void 0===o||null===(o=o.filterOptions)||void 0===o?void 0:o.operatingSystems)||[],this.stats=(null===(a=window.redirectsStatsData)||void 0===a?void 0:a.stats)||{overview:{},by_country:[],by_device:[],by_browser:[]},window.redirectsStatsInitialized?console.log("🚫 RedirectsStats already initialized globally, skipping full init..."):(window.redirectsStatsInitialized=!0,console.log("🚀 RedirectsStats component initializing...",{timestamp:(new Date).toISOString(),stack:(new Error).stack}),console.log("📊 Initial data loaded:",{startDate:this.startDate,endDate:this.endDate,redirects:this.availableRedirects.length,countries:this.availableCountries.length,browsers:this.availableBrowsers.length,os:this.availableOS.length}),await this.loadFilterOptions(),await this.loadStats(),this.setupCharts(),console.log("✅ RedirectsStats component initialized successfully"))},updateDateRange(){const t=new Date,e={7:new Date(t.getTime()-6048e5),30:new Date(t.getTime()-2592e6),90:new Date(t.getTime()-7776e6),month:new Date(t.getFullYear(),t.getMonth(),1),year:new Date(t.getFullYear(),0,1),all:null};"custom"!==this.selectedRange&&(e[this.selectedRange]?(this.startDate=e[this.selectedRange].toISOString().split("T")[0],this.endDate=t.toISOString().split("T")[0]):(this.startDate="",this.endDate=""))},async loadFilterOptions(){console.log("Filter options loaded:",{redirects:this.availableRedirects.length,countries:this.availableCountries.length,browsers:this.availableBrowsers.length,os:this.availableOS.length})},async loadStats(){console.log("📡 Loading stats from API..."),this.loading=!0;try{const t=new URLSearchParams;this.startDate&&t.append("start_date",this.startDate),this.endDate&&t.append("end_date",this.endDate),this.selectedTracker&&t.append("tracker_id",this.selectedTracker),this.selectedCountry&&t.append("country",this.selectedCountry),this.selectedDevice&&t.append("device",this.selectedDevice),this.selectedBrowser&&t.append("browser",this.selectedBrowser),this.selectedOS&&t.append("os",this.selectedOS);const e=await fetch("/api/redirects/stats?".concat(t));if(!e.ok)throw new Error("Failed to load statistics");{const t=await e.json();this.stats=t.data,console.log("📊 Stats loaded successfully:",this.stats),this.updateCharts()}}catch(t){console.error("❌ Error loading stats:",t)}finally{this.loading=!1}},resetFilters(){this.selectedRange="all",this.startDate="",this.endDate="",this.selectedTracker="",this.selectedCountry="",this.selectedDevice="",this.selectedBrowser="",this.selectedOS="",this.loadStats()},exportStats(){let t="data:text/csv;charset=utf-8,";t+="Overview Statistics\n",t+="Metric,Value\n",t+="Total Clicks,".concat(this.stats.overview.total_clicks||0,"\n"),t+="Unique Clicks,".concat(this.stats.overview.unique_clicks||0,"\n"),t+="Unique IPs,".concat(this.stats.overview.unique_ips||0,"\n"),t+="Average Response Time,".concat(this.stats.overview.avg_response_time||0,"ms\n\n"),t+="Clicks by Country\n",t+="Country,Code,Clicks,Unique Clicks\n",this.stats.by_country.forEach(e=>{t+="".concat(e.country_name||"Unknown",",").concat(e.country_code,",").concat(e.clicks,",").concat(e.unique_clicks,"\n")}),t+="\n",t+="Clicks by Device\n",t+="Device,Clicks,Unique Clicks\n",this.stats.by_device.forEach(e=>{t+="".concat(e.device_type,",").concat(e.clicks,",").concat(e.unique_clicks,"\n")}),t+="\n",t+="Clicks by Browser\n",t+="Browser,Clicks,Unique Clicks\n",this.stats.by_browser.forEach(e=>{t+="".concat(e.browser,",").concat(e.clicks,",").concat(e.unique_clicks,"\n")}),t+="\n",t+="Applied Filters\n",t+="Filter,Value\n",t+="Date Range,".concat(this.selectedRange,"\n"),this.startDate&&(t+="Start Date,".concat(this.startDate,"\n")),this.endDate&&(t+="End Date,".concat(this.endDate,"\n")),this.selectedTracker&&(t+="Tracker,".concat(this.selectedTracker,"\n")),this.selectedCountry&&(t+="Country,".concat(this.selectedCountry,"\n")),this.selectedDevice&&(t+="Device,".concat(this.selectedDevice,"\n")),this.selectedBrowser&&(t+="Browser,".concat(this.selectedBrowser,"\n")),this.selectedOS&&(t+="Operating System,".concat(this.selectedOS,"\n"));const e=new Blob([t],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download="redirects-stats-".concat((new Date).toISOString().split("T")[0],".csv"),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(n)},setupCharts(){console.log("🎨 Setting up charts..."),console.log("📊 Chart.js available:","undefined"!=typeof Chart),"undefined"!=typeof Chart?this._chartsSetup?console.log("🚫 Charts already setup, skipping..."):this.$nextTick(()=>{this.createCountryChart(),this.createDeviceChart(),this.createBrowserChart(),this._chartsSetup=!0,console.log("✅ Charts setup completed")}):console.warn("❌ Chart.js not available")},createCountryChart(){const t=document.getElementById("country-chart");if(console.log("🎯 Creating country chart, element:",t),!t)return void console.warn("❌ Country chart element not found");if(!t.getContext("2d"))return void console.warn("❌ Canvas context not available for country chart");if(this.charts.country)try{this.charts.country.destroy()}catch(t){console.warn("⚠️ Error destroying existing country chart:",t)}const e=this.getChartData("country");console.log("📊 Country chart data:",e);try{this.charts.country=new Chart(t,{type:"doughnut",data:e,options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom"}},elements:{arc:{borderWidth:0}}}}),console.log("✅ Country chart created successfully")}catch(t){console.error("❌ Error creating country chart:",t)}},createDeviceChart(){const t=document.getElementById("device-chart");if(t)if(t.getContext("2d")){if(this.charts.device)try{this.charts.device.destroy()}catch(t){console.warn("⚠️ Error destroying existing device chart:",t)}try{this.charts.device=new Chart(t,{type:"pie",data:this.getChartData("device"),options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom"}}}})}catch(t){console.error("❌ Error creating device chart:",t)}}else console.warn("❌ Canvas context not available for device chart")},createBrowserChart(){const t=document.getElementById("browser-chart");if(t)if(t.getContext("2d")){if(this.charts.browser)try{this.charts.browser.destroy()}catch(t){console.warn("⚠️ Error destroying existing browser chart:",t)}try{this.charts.browser=new Chart(t,{type:"bar",data:this.getChartData("browser"),options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{beginAtZero:!0}}}})}catch(t){console.error("❌ Error creating browser chart:",t)}}else console.warn("❌ Canvas context not available for browser chart")},updateCharts(){this._chartsSetup?Object.keys(this.charts).forEach(t=>{if(this.charts[t]&&"function"==typeof this.charts[t].update)try{if(this.charts[t].data&&this.charts[t].data.datasets&&this.charts[t].data.datasets.length>0){const e=this.getChartData(t);e&&e.datasets&&e.datasets.length>0&&(this.charts[t].data=e,this.charts[t].update("none"))}}catch(e){console.warn("❌ Error updating ".concat(t," chart:"),e)}}):console.log("🚫 Charts not yet setup, skipping update...")},getChartData(t){const e="country"===t?"by_country":"device"===t?"by_device":"by_browser",n=this.stats[e]||[],i=["#556ee6","#34c38f","#f46a6a","#50a5f1","#f1b44c","#74788d"];return"browser"===t?{labels:n.map(t=>t.browser||"Unknown"),datasets:[{data:n.map(t=>t.clicks),backgroundColor:i,borderColor:i,borderWidth:1}]}:{labels:n.map(e=>e["country"===t?"country_code":"device_type"]||"Unknown"),datasets:[{data:n.map(t=>t.clicks),backgroundColor:i,borderColor:i,borderWidth:1}]}},formatNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null==t?"0":(new Intl.NumberFormat).format(parseFloat(t).toFixed(e))},calculatePercentage:(t,e)=>e&&0!==e?t/e*100:0}}),console.log("✅ RedirectsStats component registered with Alpine.js")),window.DEBUG_MODE=!0,window.debugLog=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;window.DEBUG_MODE&&(e?console.log("[DEBUG] ".concat(t),e):console.log("[DEBUG] ".concat(t)))},window.campaignsDebugLog=j0,V3()||(document.addEventListener("alpine:init",()=>{console.log("🔄 Alpine.js initialized, registering components..."),V3()}),setTimeout(()=>{"undefined"!=typeof Alpine?(console.log("⏰ Fallback: Alpine.js detected, registering components..."),V3()):console.error("❌ Alpine.js not available after timeout")},1e3));const H3=async(t,e)=>{try{const n=await fetch("/app/Modules/".concat(t,"/Assets/js/").concat(e,".js"));if(!n.ok)throw new Error("HTTP error! status: ".concat(n.status));const i=await n.text(),r=document.createElement("script");return r.textContent=i,document.head.appendChild(r),document.head.removeChild(r),e}catch(n){return console.warn("Failed to load module component: ".concat(t,"/").concat(e),n),null}};function j3(){function t(t){const e=document.getElementById("header-lang-img");e&&(e.src="pt"===t?"/assets/images/flags/pt.svg":"/assets/images/flags/us.svg")}localStorage.getItem("language"),document.querySelectorAll(".language").forEach(e=>{e.addEventListener("click",async n=>{n.preventDefault();const i=e.getAttribute("data-lang");console.log("🌍 Language button clicked:",i),i&&(localStorage.setItem("language",i),console.log("💾 Language saved to localStorage:",i),window.Alpine&&Alpine.store("i18n")?(console.log("🔄 Setting Alpine store language..."),await Alpine.store("i18n").setLang(i),console.log("✅ Alpine store language set")):console.warn("⚠️ Alpine or i18n store not available"),t(i),console.log("🏳️ Language icon updated"))})}),window.addEventListener("language-changed",e=>{t(e.detail.lang)})}Alpine.data("dashboardAnalytics",()=>({init(){console.log("dashboardAnalytics component initialized"),H3("Analytics","dashboard").then(t=>{t&&console.log("Loaded Analytics dashboard component: ".concat(t))})}})),Alpine.data("crmDashboard",()=>({init(){console.log("crmDashboard component initialized"),H3("Crm","dashboard").then(t=>{t&&console.log("Loaded CRM dashboard component: ".concat(t))})}})),Alpine.data("ecommerceDashboard",()=>({init(){console.log("ecommerceDashboard component initialized"),H3("Ecommerce","dashboard").then(t=>{t&&console.log("Loaded Ecommerce dashboard component: ".concat(t))})}})),Alpine.data("cryptoDashboard",()=>({init(){console.log("cryptoDashboard component initialized"),H3("Crypto","dashboard").then(t=>{t&&console.log("Loaded Crypto dashboard component: ".concat(t))})}})),Alpine.data("projectsDashboard",()=>({init(){console.log("projectsDashboard component initialized"),H3("Projects","dashboard").then(t=>{t&&console.log("Loaded Projects dashboard component: ".concat(t))})}})),Alpine.data("nftDashboard",function(){return{recentSales:[],topCollections:[],trendingCollections:[],totalVolume:0,activeUsers:0,loading:!0,error:null,async init(){this.loading=!0;try{await this.loadDashboardData()}catch(t){console.error("Error initializing NFT dashboard:",t),this.error="Failed to load dashboard data"}finally{this.loading=!1}},async loadDashboardData(){try{const[t,e,n]=await Promise.all([fetch("/api/nft/dashboard/recent-sales"),fetch("/api/nft/dashboard/top-collections"),fetch("/api/nft/dashboard/summary")]);if(t.ok?this.recentSales=await t.json():(this.recentSales=[],console.warn("Failed to load recent sales")),e.ok?this.topCollections=await e.json():(this.topCollections=[],console.warn("Failed to load top collections")),n.ok){const t=await n.json();this.totalVolume=t.total_volume||0,this.activeUsers=t.active_users||0,this.trendingCollections=t.trending_collections||[]}else console.warn("Failed to load NFT summary")}catch(t){console.error("Error loading NFT dashboard data:",t),this.recentSales=[],this.topCollections=[],this.trendingCollections=[],this.totalVolume=0,this.activeUsers=0}},async refresh(){await this.loadDashboardData()},formatCurrency:t=>new Intl.NumberFormat("pt-PT",{style:"currency",currency:"EUR"}).format(t),formatNumber:t=>t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"K":t.toString(),formatDate:t=>new Date(t).toLocaleDateString("pt-PT",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}}),Alpine.data("jobDashboard",()=>({init(){console.log("jobDashboard component initialized"),H3("Job","dashboard").then(t=>{t&&console.log("Loaded Job dashboard component: ".concat(t))})}})),Alpine.data("blogDashboard",()=>({init(){console.log("blogDashboard component initialized"),H3("Blog","dashboard").then(t=>{t&&console.log("Loaded Blog dashboard component: ".concat(t))})}})),Alpine.data("formValidation",()=>({init(){console.log("formValidation component initialized")},validateForm(t){console.log("Validating form: ".concat(t))}})),Alpine.data("datatable",()=>({init(){console.log("datatable component initialized")},initDataTable(t){console.log("Initializing DataTable: ".concat(t))}})),Alpine.data("apexcharts",()=>({charts:{},initChart(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"==typeof ApexCharts)return void console.error("ApexCharts library not loaded");const n=document.getElementById(t);if(!n)return void console.error('Chart element with id "'.concat(t,'" not found'));if(n.hasAttribute("_apexcharts_instance_"))return;const i={chart:{toolbar:{show:!1},animations:{enabled:!0}},colors:this.getChartColors(t),dataLabels:{enabled:!1},legend:{show:!0},grid:{show:!0}},r=this.mergeDeep(i,e);this.charts[t]=new ApexCharts(n,r),this.charts[t].render(),console.log('Chart "'.concat(t,'" initialized successfully'))},getChartColors(t){const e=document.getElementById(t);if(!e)return[];const n=e.getAttribute("data-colors");if(!n)return[];try{return JSON.parse(n).map(t=>t.startsWith("--")?getComputedStyle(document.documentElement).getPropertyValue(t):t)}catch(e){return console.error('Error parsing colors for chart "'.concat(t,'":'),e),[]}},mergeDeep(t,e){const n=M0({},t);for(const t in e)e[t]&&"object"==typeof e[t]&&!Array.isArray(e[t])?n[t]=this.mergeDeep(n[t]||{},e[t]):n[t]=e[t];return n},updateChart(t,e){this.charts[t]&&this.charts[t].updateSeries(e)},destroyChart(t){this.charts[t]&&(this.charts[t].destroy(),delete this.charts[t])},createLineChart(t,e,n){const i=M0({series:e,chart:{type:"line",height:350},xaxis:{categories:n},stroke:{curve:"smooth",width:3}},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{});this.initChart(t,i)},createBarChart(t,e,n){const i=M0({series:e,chart:{type:"bar",height:350},xaxis:{categories:n},plotOptions:{bar:{horizontal:!1,columnWidth:"55%"}}},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{});this.initChart(t,i)},createPieChart(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=M0({series:e,chart:{type:"pie",height:350},labels:n.labels||[]},n);this.initChart(t,i)},createAreaChart(t,e,n){const i=M0({series:e,chart:{type:"area",height:350},xaxis:{categories:n},stroke:{curve:"smooth"},fill:{opacity:.3}},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{});this.initChart(t,i)},createRadarChart(t,e,n){const i=M0({series:e,chart:{type:"radar",height:350},xaxis:{categories:n},stroke:{width:2},fill:{opacity:.2}},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{});this.initChart(t,i)}})),Alpine.data("notifications",()=>({init(){console.log("notifications component initialized")},showSuccess(t){console.log("Success notification: ".concat(t))},showError(t){console.log("Error notification: ".concat(t))}})),document.addEventListener("DOMContentLoaded",function(){console.log("🌍 Initializing language system..."),j3(),console.log("✅ Language system initialized")}),document.addEventListener("DOMContentLoaded",async()=>{if(console.log("🚀 Initializing main.js..."),j3(),console.log("🖥️ Initializing fullscreen and dark mode..."),window.Alpine&&Alpine.data("customizer")){const t=Alpine.data("customizer")();t&&(t.initFullScreen(),t.initModeSetting(),console.log("✅ Fullscreen and dark mode initialized"))}await new Promise(t=>setTimeout(t,200)),console.log("✅ App bundle loaded: Components registered")}),console.log("✅ App bundle loaded: Components registered, waiting for vendor bundle to initialize translations")})()})();
//# sourceMappingURL=app.8e9399a666b59b9816a2.js.map