You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
37 KiB

import{T as ot,m as lr,B as q,n as xt,k as Yr,l as It,o as cr,p as Zr,q as mt,r as j,s as Mt,t as Tt,v as Rt,w as S,x as Ct,y as Dt,z as Xr,A as Pt,C as Et,D as wt,E as Mr,F as Tr,G as qr,H as Gt,P as St,I as or,J as $,K as dt,L as W,M as wr,N as At,S as Wr,R as bt,O as k,Q as Ht,U as tr,V as Gr,W as rr,X as J,Y as _r,Z as kr,_ as gr,$ as Bt,a0 as Ot,a1 as Rr,a2 as Nt,a3 as Ut,a4 as ft,a5 as Cr,a6 as Vt,a7 as Yt,a8 as ut,a9 as Zt,aa as Xt,ab as qt,ac as Wt,ad as er,ae as kt,af as Ft,ag as Kt,ah as ar,ai as Qt,aj as nr}from"./install-2bcffee5.js";function $t(n){if(n){for(var r=[],e=0;e<n.length;e++)r.push(n[e].slice());return r}}function jt(n,r){var e=n.label,t=r&&r.getTextGuideLine();return{dataIndex:n.dataIndex,dataType:n.dataType,seriesIndex:n.seriesModel.seriesIndex,text:n.label.style.text,rect:n.hostRect,labelRect:n.rect,align:e.style.align,verticalAlign:e.style.verticalAlign,labelLinePoints:$t(t&&t.shape.points)}}var Fr=["align","verticalAlign","width","height","fontSize"],b=new ot,pr=lr(),Jt=lr();function ir(n,r,e){for(var t=0;t<e.length;t++){var a=e[t];r[a]!=null&&(n[a]=r[a])}}var sr=["x","y","rotation"],zt=function(){function n(){this._labelList=[],this._chartViewList=[]}return n.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},n.prototype._addLabel=function(r,e,t,a,i){var s=a.style,v=a.__hostTarget,d=v.textConfig||{},o=a.getComputedTransform(),f=a.getBoundingRect().plain();q.applyTransform(f,f,o),o?b.setLocalTransform(o):(b.x=b.y=b.rotation=b.originX=b.originY=0,b.scaleX=b.scaleY=1),b.rotation=xt(b.rotation);var u=a.__hostTarget,h;if(u){h=u.getBoundingRect().plain();var l=u.getComputedTransform();q.applyTransform(h,h,l)}var y=h&&u.getTextGuideLine();this._labelList.push({label:a,labelLine:y,seriesModel:t,dataIndex:r,dataType:e,layoutOption:i,computedLayoutOption:null,rect:f,hostRect:h,priority:h?h.width*h.height:0,defaultAttr:{ignore:a.ignore,labelGuideIgnore:y&&y.ignore,x:b.x,y:b.y,scaleX:b.scaleX,scaleY:b.scaleY,rotation:b.rotation,style:{x:s.x,y:s.y,align:s.align,verticalAlign:s.verticalAlign,width:s.width,height:s.height,fontSize:s.fontSize},cursor:a.cursor,attachedPos:d.position,attachedRot:d.rotation}})},n.prototype.addLabelsOfSeries=function(r){var e=this;this._chartViewList.push(r);var t=r.__model,a=t.get("labelLayout");(Yr(a)||It(a).length)&&r.group.traverse(function(i){if(i.ignore)return!0;var s=i.getTextContent(),v=cr(i);s&&!s.disableLabelLayout&&e._addLabel(v.dataIndex,v.dataType,t,s,a)})},n.prototype.updateLayoutConfig=function(r){var e=r.getWidth(),t=r.getHeight();function a(p,I){return function(){Xr(p,I)}}for(var i=0;i<this._labelList.length;i++){var s=this._labelList[i],v=s.label,d=v.__hostTarget,o=s.defaultAttr,f=void 0;Yr(s.layoutOption)?f=s.layoutOption(jt(s,d)):f=s.layoutOption,f=f||{},s.computedLayoutOption=f;var u=Math.PI/180;d&&d.setTextConfig({local:!1,position:f.x!=null||f.y!=null?null:o.attachedPos,rotation:f.rotate!=null?f.rotate*u:o.attachedRot,offset:[f.dx||0,f.dy||0]});var h=!1;if(f.x!=null?(v.x=Zr(f.x,e),v.setStyle("x",0),h=!0):(v.x=o.x,v.setStyle("x",o.style.x)),f.y!=null?(v.y=Zr(f.y,t),v.setStyle("y",0),h=!0):(v.y=o.y,v.setStyle("y",o.style.y)),f.labelLinePoints){var l=d.getTextGuideLine();l&&(l.setShape({points:f.labelLinePoints}),h=!1)}var y=pr(v);y.needsUpdateLabelLine=h,v.rotation=f.rotate!=null?f.rotate*u:o.rotation,v.scaleX=o.scaleX,v.scaleY=o.scaleY;for(var _=0;_<Fr.length;_++){var c=Fr[_];v.setStyle(c,f[c]!=null?f[c]:o.style[c])}if(f.draggable){if(v.draggable=!0,v.cursor="move",d){var g=s.seriesModel;if(s.dataIndex!=null){var L=s.seriesModel.getData(s.dataType);g=L.getItemModel(s.dataIndex)}v.on("drag",a(d,g.getModel("labelLine")))}}else v.off("drag"),v.cursor=o.cursor}},n.prototype.layout=function(r){var e=r.getWidth(),t=r.getHeight(),a=mt(this._labelList),i=j(a,function(d){return d.layoutOption.moveOverlap==="shiftX"}),s=j(a,function(d){return d.layoutOption.moveOverlap==="shiftY"});Mt(i,0,e),Tt(s,0,t);var v=j(a,function(d){return d.layoutOption.hideOverlap});Rt(v)},n.prototype.processLabelsOverall=function(){var r=this;S(this._chartViewList,function(e){var t=e.__model,a=e.ignoreLabelLineUpdate,i=t.isAnimationEnabled();e.group.traverse(function(s){if(s.ignore&&!s.forceLabelAnimation)return!0;var v=!a,d=s.getTextContent();!v&&d&&(v=pr(d).needsUpdateLabelLine),v&&r._updateLabelLine(s,t),i&&r._animateLabels(s,t)})})},n.prototype._updateLabelLine=function(r,e){var t=r.getTextContent(),a=cr(r),i=a.dataIndex;if(t&&i!=null){var s=e.getData(a.dataType),v=s.getItemModel(i),d={},o=s.getItemVisual(i,"style");if(o){var f=s.getVisual("drawType");d.stroke=o[f]}var u=v.getModel("labelLine");Ct(r,Dt(v),d),Xr(r,u)}},n.prototype._animateLabels=function(r,e){var t=r.getTextContent(),a=r.getTextGuideLine();if(t&&(r.forceLabelAnimation||!t.ignore&&!t.invisible&&!r.disableLabelAnimation&&!Pt(r))){var i=pr(t),s=i.oldLayout,v=cr(r),d=v.dataIndex,o={x:t.x,y:t.y,rotation:t.rotation},f=e.getData(v.dataType);if(s){t.attr(s);var h=r.prevStates;h&&(Tr(h,"select")>=0&&t.attr(i.oldLayoutSelect),Tr(h,"emphasis")>=0&&t.attr(i.oldLayoutEmphasis)),qr(t,o,e,d)}else if(t.attr(o),!Et(t).valueAnimation){var u=wt(t.style.opacity,1);t.style.opacity=0,Mr(t,{style:{opacity:u}},e,d)}if(i.oldLayout=o,t.states.select){var l=i.oldLayoutSelect={};ir(l,o,sr),ir(l,t.states.select,sr)}if(t.states.emphasis){var y=i.oldLayoutEmphasis={};ir(y,o,sr),ir(y,t.states.emphasis,sr)}Gt(t,d,f,e,e)}if(a&&!a.ignore&&!a.invisible){var i=Jt(a),s=i.oldLayout,_={points:a.shape.points};s?(a.attr({shape:s}),qr(a,{shape:_},e)):(a.setShape(_),a.style.strokePercent=0,Mr(a,{style:{strokePercent:1}},e)),i.oldLayout=_}},n}();const re=zt;var yr=lr();function Se(n){n.registerUpdateLifecycle("series:beforeupdate",function(r,e,t){var a=yr(e).labelManager;a||(a=yr(e).labelManager=new re),a.clearLabels()}),n.registerUpdateLifecycle("series:layoutlabels",function(r,e,t){var a=yr(e).labelManager;t.updatedSeries.forEach(function(i){a.addLabelsOfSeries(e.getViewOfSeriesModel(i))}),a.updateLayoutConfig(e),a.layout(e),a.processLabelsOverall()})}var N=St.CMD;function Q(n,r){return Math.abs(n-r)<1e-5}function Dr(n){var r=n.data,e=n.len(),t=[],a,i=0,s=0,v=0,d=0;function o(D,G){a&&a.length>2&&t.push(a),a=[D,G]}function f(D,G,A,E){Q(D,A)&&Q(G,E)||a.push(D,G,A,E,A,E)}function u(D,G,A,E,H,B){var O=Math.abs(G-D),U=Math.tan(O/4)*4/3,Y=G<D?-1:1,Ar=Math.cos(D),br=Math.sin(D),Hr=Math.cos(G),Br=Math.sin(G),yt=Ar*H+A,Lt=br*B+E,Or=Hr*H+A,Nr=Br*B+E,Ur=H*U*Y,Vr=B*U*Y;a.push(yt-Ur*br,Lt+Vr*Ar,Or+Ur*Br,Nr-Vr*Hr,Or,Nr)}for(var h,l,y,_,c=0;c<e;){var g=r[c++],L=c===1;switch(L&&(i=r[c],s=r[c+1],v=i,d=s,(g===N.L||g===N.C||g===N.Q)&&(a=[v,d])),g){case N.M:i=v=r[c++],s=d=r[c++],o(v,d);break;case N.L:h=r[c++],l=r[c++],f(i,s,h,l),i=h,s=l;break;case N.C:a.push(r[c++],r[c++],r[c++],r[c++],i=r[c++],s=r[c++]);break;case N.Q:h=r[c++],l=r[c++],y=r[c++],_=r[c++],a.push(i+2/3*(h-i),s+2/3*(l-s),y+2/3*(h-y),_+2/3*(l-_),y,_),i=y,s=_;break;case N.A:var p=r[c++],I=r[c++],M=r[c++],x=r[c++],m=r[c++],T=r[c++]+m;c+=1;var R=!r[c++];h=Math.cos(m)*M+p,l=Math.sin(m)*x+I,L?(v=h,d=l,o(v,d)):f(i,s,h,l),i=Math.cos(T)*M+p,s=Math.sin(T)*x+I;for(var C=(R?-1:1)*Math.PI/2,P=m;R?P>T:P<T;P+=C){var w=R?Math.max(P+C,T):Math.min(P+C,T);u(P,w,p,I,M,x)}break;case N.R:v=i=r[c++],d=s=r[c++],h=v+r[c++],l=d+r[c++],o(h,d),f(h,d,h,l),f(h,l,v,l),f(v,l,v,d),f(v,d,h,d);break;case N.Z:a&&f(i,s,v,d),i=v,s=d;break}}return a&&a.length>2&&t.push(a),t}function Pr(n,r,e,t,a,i,s,v,d,o){if(Q(n,e)&&Q(r,t)&&Q(a,s)&&Q(i,v)){d.push(s,v);return}var f=2/o,u=f*f,h=s-n,l=v-r,y=Math.sqrt(h*h+l*l);h/=y,l/=y;var _=e-n,c=t-r,g=a-s,L=i-v,p=_*_+c*c,I=g*g+L*L;if(p<u&&I<u){d.push(s,v);return}var M=h*_+l*c,x=-h*g-l*L,m=p-M*M,T=I-x*x;if(m<u&&M>=0&&T<u&&x>=0){d.push(s,v);return}var R=[],C=[];or(n,e,a,s,.5,R),or(r,t,i,v,.5,C),Pr(R[0],C[0],R[1],C[1],R[2],C[2],R[3],C[3],d,o),Pr(R[4],C[4],R[5],C[5],R[6],C[6],R[7],C[7],d,o)}function te(n,r){var e=Dr(n),t=[];r=r||1;for(var a=0;a<e.length;a++){var i=e[a],s=[],v=i[0],d=i[1];s.push(v,d);for(var o=2;o<i.length;){var f=i[o++],u=i[o++],h=i[o++],l=i[o++],y=i[o++],_=i[o++];Pr(v,d,f,u,h,l,y,_,s,r),v=y,d=_}t.push(s)}return t}function ht(n,r,e){var t=n[r],a=n[1-r],i=Math.abs(t/a),s=Math.ceil(Math.sqrt(i*e)),v=Math.floor(e/s);v===0&&(v=1,s=e);for(var d=[],o=0;o<s;o++)d.push(v);var f=s*v,u=e-f;if(u>0)for(var o=0;o<u;o++)d[o%s]+=1;return d}function Kr(n,r,e){for(var t=n.r0,a=n.r,i=n.startAngle,s=n.endAngle,v=Math.abs(s-i),d=v*a,o=a-t,f=d>Math.abs(o),u=ht([d,o],f?0:1,r),h=(f?v:o)/u.length,l=0;l<u.length;l++)for(var y=(f?o:v)/u[l],_=0;_<u[l];_++){var c={};f?(c.startAngle=i+h*l,c.endAngle=i+h*(l+1),c.r0=t+y*_,c.r=t+y*(_+1)):(c.startAngle=i+y*_,c.endAngle=i+y*(_+1),c.r0=t+h*l,c.r=t+h*(l+1)),c.clockwise=n.clockwise,c.cx=n.cx,c.cy=n.cy,e.push(c)}}function ee(n,r,e){for(var t=n.width,a=n.height,i=t>a,s=ht([t,a],i?0:1,r),v=i?"width":"height",d=i?"height":"width",o=i?"x":"y",f=i?"y":"x",u=n[v]/s.length,h=0;h<s.length;h++)for(var l=n[d]/s[h],y=0;y<s[h];y++){var _={};_[o]=h*u,_[f]=y*l,_[v]=u,_[d]=l,_.x+=n.x,_.y+=n.y,e.push(_)}}function Qr(n,r,e,t){return n*t-e*r}function ae(n,r,e,t,a,i,s,v){var d=e-n,o=t-r,f=s-a,u=v-i,h=Qr(f,u,d,o);if(Math.abs(h)<1e-6)return null;var l=n-a,y=r-i,_=Qr(l,y,f,u)/h;return _<0||_>1?null:new W(_*d+n,_*o+r)}function ne(n,r,e){var t=new W;W.sub(t,e,r),t.normalize();var a=new W;W.sub(a,n,r);var i=a.dot(t);return i}function F(n,r){var e=n[n.length-1];e&&e[0]===r[0]&&e[1]===r[1]||n.push(r)}function ie(n,r,e){for(var t=n.length,a=[],i=0;i<t;i++){var s=n[i],v=n[(i+1)%t],d=ae(s[0],s[1],v[0],v[1],r.x,r.y,e.x,e.y);d&&a.push({projPt:ne(d,r,e),pt:d,idx:i})}if(a.length<2)return[{points:n},{points:n}];a.sort(function(c,g){return c.projPt-g.projPt});var o=a[0],f=a[a.length-1];if(f.idx<o.idx){var u=o;o=f,f=u}for(var h=[o.pt.x,o.pt.y],l=[f.pt.x,f.pt.y],y=[h],_=[l],i=o.idx+1;i<=f.idx;i++)F(y,n[i].slice());F(y,l),F(y,h);for(var i=f.idx+1;i<=o.idx+t;i++)F(_,n[i%t].slice());return F(_,h),F(_,l),[{points:y},{points:_}]}function $r(n){var r=n.points,e=[],t=[];dt(r,e,t);var a=new q(e[0],e[1],t[0]-e[0],t[1]-e[1]),i=a.width,s=a.height,v=a.x,d=a.y,o=new W,f=new W;return i>s?(o.x=f.x=v+i/2,o.y=d,f.y=d+s):(o.y=f.y=d+s/2,o.x=v,f.x=v+i),ie(r,o,f)}function dr(n,r,e,t){if(e===1)t.push(r);else{var a=Math.floor(e/2),i=n(r);dr(n,i[0],a,t),dr(n,i[1],e-a,t)}return t}function se(n,r){for(var e=[],t=0;t<r;t++)e.push(wr(n));return e}function ve(n,r){r.setStyle(n.style),r.z=n.z,r.z2=n.z2,r.zlevel=n.zlevel}function oe(n){for(var r=[],e=0;e<n.length;)r.push([n[e++],n[e++]]);return r}function de(n,r){var e=[],t=n.shape,a;switch(n.type){case"rect":ee(t,r,e),a=bt;break;case"sector":Kr(t,r,e),a=Wr;break;case"circle":Kr({r0:0,r:t.r,startAngle:0,endAngle:Math.PI*2,cx:t.cx,cy:t.cy},r,e),a=Wr;break;default:var i=n.getComputedTransform(),s=i?Math.sqrt(Math.max(i[0]*i[0]+i[1]*i[1],i[2]*i[2]+i[3]*i[3])):1,v=$(te(n.getUpdatedPathProxy(),s),function(g){return oe(g)}),d=v.length;if(d===0)dr($r,{points:v[0]},r,e);else if(d===r)for(var o=0;o<d;o++)e.push({points:v[o]});else{var f=0,u=$(v,function(g){var L=[],p=[];dt(g,L,p);var I=(p[1]-L[1])*(p[0]-L[0]);return f+=I,{poly:g,area:I}});u.sort(function(g,L){return L.area-g.area});for(var h=r,o=0;o<d;o++){var l=u[o];if(h<=0)break;var y=o===d-1?h:Math.ceil(l.area/f*r);y<0||(dr($r,{points:l.poly},y,e),h-=y)}}a=At;break}if(!a)return se(n,r);for(var _=[],o=0;o<e.length;o++){var c=new a;c.setShape(e[o]),ve(n,c),_.push(c)}return _}function fe(n,r){var e=n.length,t=r.length;if(e===t)return[n,r];for(var a=[],i=[],s=e<t?n:r,v=Math.min(e,t),d=Math.abs(t-e)/6,o=(v-2)/6,f=Math.ceil(d/o)+1,u=[s[0],s[1]],h=d,l=2;l<v;){var y=s[l-2],_=s[l-1],c=s[l++],g=s[l++],L=s[l++],p=s[l++],I=s[l++],M=s[l++];if(h<=0){u.push(c,g,L,p,I,M);continue}for(var x=Math.min(h,f-1)+1,m=1;m<=x;m++){var T=m/x;or(y,c,L,I,T,a),or(_,g,p,M,T,i),y=a[3],_=i[3],u.push(a[1],i[1],a[2],i[2],y,_),c=a[5],g=i[5],L=a[6],p=i[6]}h-=x-1}return s===n?[u,r]:[n,u]}function jr(n,r){for(var e=n.length,t=n[e-2],a=n[e-1],i=[],s=0;s<r.length;)i[s++]=t,i[s++]=a;return i}function ue(n,r){for(var e,t,a,i=[],s=[],v=0;v<Math.max(n.length,r.length);v++){var d=n[v],o=r[v],f=void 0,u=void 0;d?o?(e=fe(d,o),f=e[0],u=e[1],t=f,a=u):(u=jr(a||d,d),f=d):(f=jr(t||o,o),u=o),i.push(f),s.push(u)}return[i,s]}function Jr(n){for(var r=0,e=0,t=0,a=n.length,i=0,s=a-2;i<a;s=i,i+=2){var v=n[s],d=n[s+1],o=n[i],f=n[i+1],u=v*f-o*d;r+=u,e+=(v+o)*u,t+=(d+f)*u}return r===0?[n[0]||0,n[1]||0]:[e/r/3,t/r/3,r]}function he(n,r,e,t){for(var a=(n.length-2)/6,i=1/0,s=0,v=n.length,d=v-2,o=0;o<a;o++){for(var f=o*6,u=0,h=0;h<v;h+=2){var l=h===0?f:(f+h-2)%d+2,y=n[l]-e[0],_=n[l+1]-e[1],c=r[h]-t[0],g=r[h+1]-t[1],L=c-y,p=g-_;u+=L*L+p*p}u<i&&(i=u,s=o)}return s}function le(n){for(var r=[],e=n.length,t=0;t<e;t+=2)r[t]=n[e-t-2],r[t+1]=n[e-t-1];return r}function ce(n,r,e,t){for(var a=[],i,s=0;s<n.length;s++){var v=n[s],d=r[s],o=Jr(v),f=Jr(d);i==null&&(i=o[2]<0!=f[2]<0);var u=[],h=[],l=0,y=1/0,_=[],c=v.length;i&&(v=le(v));for(var g=he(v,d,o,f)*6,L=c-2,p=0;p<L;p+=2){var I=(g+p)%L+2;u[p+2]=v[I]-o[0],u[p+3]=v[I+1]-o[1]}if(u[0]=v[g]-o[0],u[1]=v[g+1]-o[1],e>0)for(var M=t/e,x=-t/2;x<=t/2;x+=M){for(var m=Math.sin(x),T=Math.cos(x),R=0,p=0;p<v.length;p+=2){var C=u[p],P=u[p+1],w=d[p]-f[0],D=d[p+1]-f[1],G=w*T-D*m,A=w*m+D*T;_[p]=G,_[p+1]=A;var E=G-C,H=A-P;R+=E*E+H*H}if(R<y){y=R,l=x;for(var B=0;B<_.length;B++)h[B]=_[B]}}else for(var O=0;O<c;O+=2)h[O]=d[O]-f[0],h[O+1]=d[O+1]-f[1];a.push({from:u,to:h,fromCp:o,toCp:f,rotation:-l})}return a}function fr(n){return n.__isCombineMorphing}var lt="__mOriginal_";function ur(n,r,e){var t=lt+r,a=n[t]||n[r];n[t]||(n[t]=n[r]);var i=e.replace,s=e.after,v=e.before;n[r]=function(){var d=arguments,o;return v&&v.apply(this,d),i?o=i.apply(this,d):o=a.apply(this,d),s&&s.apply(this,d),o}}function z(n,r){var e=lt+r;n[e]&&(n[r]=n[e],n[e]=null)}function zr(n,r){for(var e=0;e<n.length;e++)for(var t=n[e],a=0;a<t.length;){var i=t[a],s=t[a+1];t[a++]=r[0]*i+r[2]*s+r[4],t[a++]=r[1]*i+r[3]*s+r[5]}}function ct(n,r){var e=n.getUpdatedPathProxy(),t=r.getUpdatedPathProxy(),a=ue(Dr(e),Dr(t)),i=a[0],s=a[1],v=n.getComputedTransform(),d=r.getComputedTransform();function o(){this.transform=null}v&&zr(i,v),d&&zr(s,d),ur(r,"updateTransform",{replace:o}),r.transform=null;var f=ce(i,s,10,Math.PI),u=[];ur(r,"buildPath",{replace:function(h){for(var l=r.__morphT,y=1-l,_=[],c=0;c<f.length;c++){var g=f[c],L=g.from,p=g.to,I=g.rotation*l,M=g.fromCp,x=g.toCp,m=Math.sin(I),T=Math.cos(I);Ht(_,M,x,l);for(var R=0;R<L.length;R+=2){var C=L[R],P=L[R+1],w=p[R],D=p[R+1],G=C*y+w*l,A=P*y+D*l;u[R]=G*T-A*m+_[0],u[R+1]=G*m+A*T+_[1]}var E=u[0],H=u[1];h.moveTo(E,H);for(var R=2;R<L.length;){var w=u[R++],D=u[R++],B=u[R++],O=u[R++],U=u[R++],Y=u[R++];E===w&&H===D&&B===U&&O===Y?h.lineTo(U,Y):h.bezierCurveTo(w,D,B,O,U,Y),E=U,H=Y}}}})}function Sr(n,r,e){if(!n||!r)return r;var t=e.done,a=e.during;ct(n,r),r.__morphT=0;function i(){z(r,"buildPath"),z(r,"updateTransform"),r.__morphT=-1,r.createPathProxy(),r.dirtyShape()}return r.animateTo({__morphT:1},k({during:function(s){r.dirtyShape(),a&&a(s)},done:function(){i(),t&&t()}},e)),r}function _e(n,r,e,t,a,i){var s=16;n=a===e?0:Math.round(32767*(n-e)/(a-e)),r=i===t?0:Math.round(32767*(r-t)/(i-t));for(var v=0,d,o=(1<<s)/2;o>0;o/=2){var f=0,u=0;(n&o)>0&&(f=1),(r&o)>0&&(u=1),v+=o*o*(3*f^u),u===0&&(f===1&&(n=o-1-n,r=o-1-r),d=n,n=r,r=d)}return v}function hr(n){var r=1/0,e=1/0,t=-1/0,a=-1/0,i=$(n,function(v){var d=v.getBoundingRect(),o=v.getComputedTransform(),f=d.x+d.width/2+(o?o[4]:0),u=d.y+d.height/2+(o?o[5]:0);return r=Math.min(f,r),e=Math.min(u,e),t=Math.max(f,t),a=Math.max(u,a),[f,u]}),s=$(i,function(v,d){return{cp:v,z:_e(v[0],v[1],r,e,t,a),path:n[d]}});return s.sort(function(v,d){return v.z-d.z}).map(function(v){return v.path})}function _t(n){return de(n.path,n.count)}function Er(){return{fromIndividuals:[],toIndividuals:[],count:0}}function ge(n,r,e){var t=[];function a(M){for(var x=0;x<M.length;x++){var m=M[x];fr(m)?a(m.childrenRef()):m instanceof tr&&t.push(m)}}a(n);var i=t.length;if(!i)return Er();var s=e.dividePath||_t,v=s({path:r,count:i});if(v.length!==i)return Er();t=hr(t),v=hr(v);for(var d=e.done,o=e.during,f=e.individualDelay,u=new ot,h=0;h<i;h++){var l=t[h],y=v[h];y.parent=r,y.copyTransform(u),f||ct(l,y)}r.__isCombineMorphing=!0,r.childrenRef=function(){return v};function _(M){for(var x=0;x<v.length;x++)v[x].addSelfToZr(M)}ur(r,"addSelfToZr",{after:function(M){_(M)}}),ur(r,"removeSelfFromZr",{after:function(M){for(var x=0;x<v.length;x++)v[x].removeSelfFromZr(M)}});function c(){r.__isCombineMorphing=!1,r.__morphT=-1,r.childrenRef=null,z(r,"addSelfToZr"),z(r,"removeSelfFromZr")}var g=v.length;if(f)for(var L=g,p=function(){L--,L===0&&(c(),d&&d())},h=0;h<g;h++){var I=f?k({delay:(e.delay||0)+f(h,g,t[h],v[h]),done:p},e):e;Sr(t[h],v[h],I)}else r.__morphT=0,r.animateTo({__morphT:1},k({during:function(M){for(var x=0;x<g;x++){var m=v[x];m.__morphT=r.__morphT,m.dirtyShape()}o&&o(M)},done:function(){c();for(var M=0;M<n.length;M++)z(n[M],"updateTransform");d&&d()}},e));return r.__zr&&_(r.__zr),{fromIndividuals:t,toIndividuals:v,count:g}}function pe(n,r,e){var t=r.length,a=[],i=e.dividePath||_t;function s(l){for(var y=0;y<l.length;y++){var _=l[y];fr(_)?s(_.childrenRef()):_ instanceof tr&&a.push(_)}}if(fr(n)){s(n.childrenRef());var v=a.length;if(v<t)for(var d=0,o=v;o<t;o++)a.push(wr(a[d++%v]));a.length=t}else{a=i({path:n,count:t});for(var f=n.getComputedTransform(),o=0;o<a.length;o++)a[o].setLocalTransform(f);if(a.length!==t)return Er()}a=hr(a),r=hr(r);for(var u=e.individualDelay,o=0;o<t;o++){var h=u?k({delay:(e.delay||0)+u(o,t,a[o],r[o])},e):e;Sr(a[o],r[o],h)}return{fromIndividuals:a,toIndividuals:r,count:r.length}}function rt(n){return rr(n[0])}function tt(n,r){for(var e=[],t=n.length,a=0;a<t;a++)e.push({one:n[a],many:[]});for(var a=0;a<r.length;a++){var i=r[a].length,s=void 0;for(s=0;s<i;s++)e[s%t].many.push(r[a][s])}for(var v=0,a=t-1;a>=0;a--)if(!e[a].many.length){var d=e[v].many;if(d.length<=1)if(v)v=0;else return e;var i=d.length,o=Math.ceil(i/2);e[a].many=d.slice(o,i),e[v].many=d.slice(0,o),v++}return e}var ye={clone:function(n){for(var r=[],e=1-Math.pow(1-n.path.style.opacity,1/n.count),t=0;t<n.count;t++){var a=wr(n.path);a.setStyle("opacity",e),r.push(a)}return r},split:null};function Lr(n,r,e,t,a,i){if(!n.length||!r.length)return;var s=Gr("update",t,a);if(!(s&&s.duration>0))return;var v=t.getModel("universalTransition").get("delay"),d=Object.assign({setToFinal:!0},s),o,f;rt(n)&&(o=n,f=r),rt(r)&&(o=r,f=n);function u(g,L,p,I,M){var x=g.many,m=g.one;if(x.length===1&&!M){var T=L?x[0]:m,R=L?m:x[0];if(fr(T))u({many:[T],one:R},!0,p,I,!0);else{var C=v?k({delay:v(p,I)},d):d;Sr(T,R,C),i(T,R,T,R,C)}}else for(var P=k({dividePath:ye[e],individualDelay:v&&function(H,B,O,U){return v(H+p,I)}},d),w=L?ge(x,m,P):pe(m,x,P),D=w.fromIndividuals,G=w.toIndividuals,A=D.length,E=0;E<A;E++){var C=v?k({delay:v(E,A)},d):d;i(D[E],G[E],L?x[E]:g.one,L?g.one:x[E],C)}}for(var h=o?o===n:n.length>r.length,l=o?tt(f,o):tt(h?r:n,[h?n:r]),y=0,_=0;_<l.length;_++)y+=l[_].many.length;for(var c=0,_=0;_<l.length;_++)u(l[_],h,c,y),c+=l[_].many.length}function X(n){if(!n)return[];if(rr(n)){for(var r=[],e=0;e<n.length;e++)r.push(X(n[e]));return r}var t=[];return n.traverse(function(a){a instanceof tr&&!a.disableMorphing&&!a.invisible&&!a.ignore&&t.push(a)}),t}var gt=1e4,Le=lr();function xe(n){for(var r=n.dimensions,e=0;e<r.length;e++){var t=n.getDimensionInfo(r[e]);if(t&&t.otherDims.itemGroupId===0)return r[e]}}function et(n){var r=[];return S(n,function(e){var t=e.data;if(!(t.count()>gt))for(var a=t.getIndices(),i=xe(t),s=0;s<a.length;s++)r.push({dataGroupId:e.dataGroupId,data:t,dim:e.dim||i,divide:e.divide,dataIndex:s})}),r}function xr(n,r,e){n.traverse(function(t){t instanceof tr&&Mr(t,{style:{opacity:0}},r,{dataIndex:e,isFrom:!0})})}function Ir(n){if(n.parent){var r=n.getComputedTransform();n.setLocalTransform(r),n.parent.remove(n)}}function K(n){n.stopAnimation(),n.isGroup&&n.traverse(function(r){r.stopAnimation()})}function Ie(n,r,e){var t=Gr("update",e,r);t&&n.traverse(function(a){if(a instanceof Bt){var i=Ot(a);i&&a.animateFrom({style:i},t)}})}function me(n,r){var e=n.length;if(e!==r.length)return!1;for(var t=0;t<e;t++){var a=n[t],i=r[t];if(a.data.getId(a.dataIndex)!==i.data.getId(i.dataIndex))return!1}return!0}function pt(n,r,e){var t=et(n),a=et(r);function i(g,L,p,I,M){(p||g)&&L.animateFrom({style:p&&p!==g?Rr(Rr({},p.style),g.style):g.style},M)}function s(g){for(var L=0;L<g.length;L++)if(g[L].dim)return g[L].dim}var v=s(t),d=s(a),o=!1;function f(g,L){return function(p){var I=p.data,M=p.dataIndex;if(L)return I.getId(M);var x=p.dataGroupId,m=g?v||d:d||v,T=m&&I.getDimensionInfo(m),R=T&&T.ordinalMeta;if(T){var C=I.get(T.name,M);return R&&R.categories[C]||C+""}var P=I.getRawDataItem(M);return P&&P.groupId?P.groupId+"":x||I.getId(M)}}var u=me(t,a),h={};if(!u)for(var l=0;l<a.length;l++){var y=a[l],_=y.data.getItemGraphicEl(y.dataIndex);_&&(h[_.id]=!0)}function c(g,L){var p=t[L],I=a[g],M=I.data.hostModel,x=p.data.getItemGraphicEl(p.dataIndex),m=I.data.getItemGraphicEl(I.dataIndex);if(x===m){m&&Ie(m,I.dataIndex,M);return}x&&h[x.id]||m&&(K(m),x?(K(x),Ir(x),o=!0,Lr(X(x),X(m),I.divide,M,g,i)):xr(m,M,g))}new kr(t,a,f(!0,u),f(!1,u),null,"multiple").update(c).updateManyToOne(function(g,L){var p=a[g],I=p.data,M=I.hostModel,x=I.getItemGraphicEl(p.dataIndex),m=j($(L,function(T){return t[T].data.getItemGraphicEl(t[T].dataIndex)}),function(T){return T&&T!==x&&!h[T.id]});x&&(K(x),m.length?(S(m,function(T){K(T),Ir(T)}),o=!0,Lr(X(m),X(x),p.divide,M,g,i)):xr(x,M,p.dataIndex))}).updateOneToMany(function(g,L){var p=t[L],I=p.data.getItemGraphicEl(p.dataIndex);if(!(I&&h[I.id])){var M=j($(g,function(m){return a[m].data.getItemGraphicEl(a[m].dataIndex)}),function(m){return m&&m!==I}),x=a[g[0]].data.hostModel;M.length&&(S(M,function(m){return K(m)}),I?(K(I),Ir(I),o=!0,Lr(X(I),X(M),p.divide,x,g[0],i)):S(M,function(m){return xr(m,x,g[0])}))}}).updateManyToMany(function(g,L){new kr(L,g,function(p){return t[p].data.getId(t[p].dataIndex)},function(p){return a[p].data.getId(a[p].dataIndex)}).update(function(p,I){c(g[p],L[I])}).execute()}).execute(),o&&S(r,function(g){var L=g.data,p=L.hostModel,I=p&&e.getViewOfSeriesModel(p),M=Gr("update",p,0);I&&p.isAnimationEnabled()&&M&&M.duration>0&&I.group.traverse(function(x){x instanceof tr&&!x.animators.length&&x.animateFrom({style:{opacity:0}},M)})})}function at(n){var r=n.getModel("universalTransition").get("seriesKey");return r||n.id}function nt(n){return rr(n)?n.sort().join(","):n}function V(n){if(n.hostModel)return n.hostModel.getModel("universalTransition").get("divideShape")}function Me(n,r){var e=gr(),t=gr(),a=gr();return S(n.oldSeries,function(i,s){var v=n.oldDataGroupIds[s],d=n.oldData[s],o=at(i),f=nt(o);t.set(f,{dataGroupId:v,data:d}),rr(o)&&S(o,function(u){a.set(u,{key:f,dataGroupId:v,data:d})})}),S(r.updatedSeries,function(i){if(i.isUniversalTransitionEnabled()&&i.isAnimationEnabled()){var s=i.get("dataGroupId"),v=i.getData(),d=at(i),o=nt(d),f=t.get(o);if(f)e.set(o,{oldSeries:[{dataGroupId:f.dataGroupId,divide:V(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:V(v),data:v}]});else if(rr(d)){var u=[];S(d,function(y){var _=t.get(y);_.data&&u.push({dataGroupId:_.dataGroupId,divide:V(_.data),data:_.data})}),u.length&&e.set(o,{oldSeries:u,newSeries:[{dataGroupId:s,data:v,divide:V(v)}]})}else{var h=a.get(d);if(h){var l=e.get(h.key);l||(l={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:V(h.data)}],newSeries:[]},e.set(h.key,l)),l.newSeries.push({dataGroupId:s,data:v,divide:V(v)})}}}}),e}function it(n,r){for(var e=0;e<n.length;e++){var t=r.seriesIndex!=null&&r.seriesIndex===n[e].seriesIndex||r.seriesId!=null&&r.seriesId===n[e].id;if(t)return e}}function Te(n,r,e,t){var a=[],i=[];S(J(n.from),function(s){var v=it(r.oldSeries,s);v>=0&&a.push({dataGroupId:r.oldDataGroupIds[v],data:r.oldData[v],divide:V(r.oldData[v]),dim:s.dimension})}),S(J(n.to),function(s){var v=it(e.updatedSeries,s);if(v>=0){var d=e.updatedSeries[v].getData();i.push({dataGroupId:r.oldDataGroupIds[v],data:d,divide:V(d),dim:s.dimension})}}),a.length>0&&i.length>0&&pt(a,i,t)}function Ae(n){n.registerUpdateLifecycle("series:beforeupdate",function(r,e,t){S(J(t.seriesTransition),function(a){S(J(a.to),function(i){for(var s=t.updatedSeries,v=0;v<s.length;v++)(i.seriesIndex!=null&&i.seriesIndex===s[v].seriesIndex||i.seriesId!=null&&i.seriesId===s[v].id)&&(s[v][_r]=!0)})})}),n.registerUpdateLifecycle("series:transition",function(r,e,t){var a=Le(e);if(a.oldSeries&&t.updatedSeries&&t.optionChanged){var i=t.seriesTransition;if(i)S(J(i),function(l){Te(l,a,t,e)});else{var s=Me(a,t);S(s.keys(),function(l){var y=s.get(l);pt(y.oldSeries,y.newSeries,e)})}S(t.updatedSeries,function(l){l[_r]&&(l[_r]=!1)})}for(var v=r.getSeries(),d=a.oldSeries=[],o=a.oldDataGroupIds=[],f=a.oldData=[],u=0;u<v.length;u++){var h=v[u].getData();h.count()<gt&&(d.push(v[u]),o.push(v[u].get("dataGroupId")),f.push(h))}})}function st(n,r,e){var t=Yt.createCanvas(),a=r.getWidth(),i=r.getHeight(),s=t.style;return s&&(s.position="absolute",s.left="0",s.top="0",s.width=a+"px",s.height=i+"px",t.setAttribute("data-zr-dom-id",n)),t.width=a*e,t.height=i*e,t}var Re=function(n){Nt(r,n);function r(e,t,a){var i=n.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var s;a=a||ut,typeof e=="string"?s=st(e,t,a):Ut(e)&&(s=e,e=s.id),i.id=e,i.dom=s;var v=s.style;return v&&(ft(s),s.onselectstart=function(){return!1},v.padding="0",v.margin="0",v.borderWidth="0"),i.painter=t,i.dpr=a,i}return r.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},r.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},r.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},r.prototype.setUnpainted=function(){this.__firstTimePaint=!0},r.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=st("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),e!==1&&this.ctxBack.scale(e,e)},r.prototype.createRepaintRects=function(e,t,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var s=[],v=this.maxRepaintRectCount,d=!1,o=new q(0,0,0,0);function f(L){if(!(!L.isFinite()||L.isZero()))if(s.length===0){var p=new q(0,0,0,0);p.copy(L),s.push(p)}else{for(var I=!1,M=1/0,x=0,m=0;m<s.length;++m){var T=s[m];if(T.intersect(L)){var R=new q(0,0,0,0);R.copy(T),R.union(L),s[m]=R,I=!0;break}else if(d){o.copy(L),o.union(T);var C=L.width*L.height,P=T.width*T.height,w=o.width*o.height,D=w-C-P;D<M&&(M=D,x=m)}}if(d&&(s[x].union(L),I=!0),!I){var p=new q(0,0,0,0);p.copy(L),s.push(p)}d||(d=s.length>=v)}}for(var u=this.__startIndex;u<this.__endIndex;++u){var h=e[u];if(h){var l=h.shouldBePainted(a,i,!0,!0),y=h.__isRendered&&(h.__dirty&Cr||!l)?h.getPrevPaintRect():null;y&&f(y);var _=l&&(h.__dirty&Cr||!h.__isRendered)?h.getPaintRect():null;_&&f(_)}}for(var u=this.__prevStartIndex;u<this.__prevEndIndex;++u){var h=t[u],l=h.shouldBePainted(a,i,!0,!0);if(h&&(!l||!h.__zr)&&h.__isRendered){var y=h.getPrevPaintRect();y&&f(y)}}var c;do{c=!1;for(var u=0;u<s.length;){if(s[u].isZero()){s.splice(u,1);continue}for(var g=u+1;g<s.length;)s[u].intersect(s[g])?(c=!0,s[u].union(s[g]),s.splice(g,1)):g++;u++}}while(c);return this._paintRects=s,s},r.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},r.prototype.resize=function(e,t){var a=this.dpr,i=this.dom,s=i.style,v=this.domBack;s&&(s.width=e+"px",s.height=t+"px"),i.width=e*a,i.height=t*a,v&&(v.width=e*a,v.height=t*a,a!==1&&this.ctxBack.scale(a,a))},r.prototype.clear=function(e,t,a){var i=this.dom,s=this.ctx,v=i.width,d=i.height;t=t||this.clearColor;var o=this.motionBlur&&!e,f=this.lastFrameAlpha,u=this.dpr,h=this;o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,v/u,d/u));var l=this.domBack;function y(_,c,g,L){if(s.clearRect(_,c,g,L),t&&t!=="transparent"){var p=void 0;if(Zt(t)){var I=t.global||t.__width===g&&t.__height===L;p=I&&t.__canvasGradient||Xt(s,t,{x:0,y:0,width:g,height:L}),t.__canvasGradient=p,t.__width=g,t.__height=L}else qt(t)&&(t.scaleX=t.scaleX||u,t.scaleY=t.scaleY||u,p=Wt(s,t,{dirty:function(){h.setUnpainted(),h.__painter.refresh()}}));s.save(),s.fillStyle=p||t,s.fillRect(_,c,g,L),s.restore()}o&&(s.save(),s.globalAlpha=f,s.drawImage(l,_,c,g,L),s.restore())}!a||o?y(0,0,v,d):a.length&&S(a,function(_){y(_.x*u,_.y*u,_.width*u,_.height*u)})},r}(Vt);const mr=Re;var vt=1e5,Z=314159,vr=.01,Ce=.001;function De(n){return n?n.__builtin__?!0:!(typeof n.resize!="function"||typeof n.refresh!="function"):!1}function Pe(n,r){var e=document.createElement("div");return e.style.cssText=["position:relative","width:"+n+"px","height:"+r+"px","padding:0","margin:0","border-width:0"].join(";")+";",e}var Ee=function(){function n(r,e,t,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!r.nodeName||r.nodeName.toUpperCase()==="CANVAS";this._opts=t=Rr({},t||{}),this.dpr=t.devicePixelRatio||ut,this._singleCanvas=i,this.root=r;var s=r.style;s&&(ft(r),r.innerHTML=""),this.storage=e;var v=this._zlevelList;this._prevDisplayList=[];var d=this._layers;if(i){var f=r,u=f.width,h=f.height;t.width!=null&&(u=t.width),t.height!=null&&(h=t.height),this.dpr=t.devicePixelRatio||1,f.width=u*this.dpr,f.height=h*this.dpr,this._width=u,this._height=h;var l=new mr(f,this,this.dpr);l.__builtin__=!0,l.initContext(),d[Z]=l,l.zlevel=Z,v.push(Z),this._domRoot=r}else{this._width=nr(r,0,t),this._height=nr(r,1,t);var o=this._domRoot=Pe(this._width,this._height);r.appendChild(o)}}return n.prototype.getType=function(){return"canvas"},n.prototype.isSingleCanvas=function(){return this._singleCanvas},n.prototype.getViewportRoot=function(){return this._domRoot},n.prototype.getViewportRootOffset=function(){var r=this.getViewportRoot();if(r)return{offsetLeft:r.offsetLeft||0,offsetTop:r.offsetTop||0}},n.prototype.refresh=function(r){var e=this.storage.getDisplayList(!0),t=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,r,this._redrawId);for(var i=0;i<a.length;i++){var s=a[i],v=this._layers[s];if(!v.__builtin__&&v.refresh){var d=i===0?this._backgroundColor:null;v.refresh(d)}}return this._opts.useDirtyRect&&(this._prevDisplayList=e.slice()),this},n.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},n.prototype._paintHoverList=function(r){var e=r.length,t=this._hoverlayer;if(t&&t.clear(),!!e){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,s=0;s<e;s++){var v=r[s];v.__inHover&&(t||(t=this._hoverlayer=this.getLayer(vt)),i||(i=t.ctx,i.save()),er(i,v,a,s===e-1))}i&&i.restore()}},n.prototype.getHoverLayer=function(){return this.getLayer(vt)},n.prototype.paintOne=function(r,e){kt(r,e)},n.prototype._paintList=function(r,e,t,a){if(this._redrawId===a){t=t||!1,this._updateLayerStatus(r);var i=this._doPaintList(r,e,t),s=i.finished,v=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),v&&this._paintHoverList(r),s)this.eachLayer(function(o){o.afterBrush&&o.afterBrush()});else{var d=this;Ft(function(){d._paintList(r,e,t,a)})}}},n.prototype._compositeManually=function(){var r=this.getLayer(Z).ctx,e=this._domRoot.width,t=this._domRoot.height;r.clearRect(0,0,e,t),this.eachBuiltinLayer(function(a){a.virtual&&r.drawImage(a.dom,0,0,e,t)})},n.prototype._doPaintList=function(r,e,t){for(var a=this,i=[],s=this._opts.useDirtyRect,v=0;v<this._zlevelList.length;v++){var d=this._zlevelList[v],o=this._layers[d];o.__builtin__&&o!==this._hoverlayer&&(o.__dirty||t)&&i.push(o)}for(var f=!0,u=!1,h=function(_){var c=i[_],g=c.ctx,L=s&&c.createRepaintRects(r,e,l._width,l._height),p=t?c.__startIndex:c.__drawIndex,I=!t&&c.incremental&&Date.now,M=I&&Date.now(),x=c.zlevel===l._zlevelList[0]?l._backgroundColor:null;if(c.__startIndex===c.__endIndex)c.clear(!1,x,L);else if(p===c.__startIndex){var m=r[p];(!m.incremental||!m.notClear||t)&&c.clear(!1,x,L)}p===-1&&(p=c.__startIndex);var T,R=function(D){var G={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(T=p;T<c.__endIndex;T++){var A=r[T];if(A.__inHover&&(u=!0),a._doPaintEl(A,c,s,D,G,T===c.__endIndex-1),I){var E=Date.now()-M;if(E>15)break}}G.prevElClipPaths&&g.restore()};if(L)if(L.length===0)T=c.__endIndex;else for(var C=l.dpr,P=0;P<L.length;++P){var w=L[P];g.save(),g.beginPath(),g.rect(w.x*C,w.y*C,w.width*C,w.height*C),g.clip(),R(w),g.restore()}else g.save(),R(),g.restore();c.__drawIndex=T,c.__drawIndex<c.__endIndex&&(f=!1)},l=this,y=0;y<i.length;y++)h(y);return Kt.wxa&&S(this._layers,function(_){_&&_.ctx&&_.ctx.draw&&_.ctx.draw()}),{finished:f,needsRefreshHover:u}},n.prototype._doPaintEl=function(r,e,t,a,i,s){var v=e.ctx;if(t){var d=r.getPaintRect();(!a||d&&d.intersect(a))&&(er(v,r,i,s),r.setPrevPaintRect(d))}else er(v,r,i,s)},n.prototype.getLayer=function(r,e){this._singleCanvas&&!this._needsManuallyCompositing&&(r=Z);var t=this._layers[r];return t||(t=new mr("zr_"+r,this,this.dpr),t.zlevel=r,t.__builtin__=!0,this._layerConfig[r]?ar(t,this._layerConfig[r],!0):this._layerConfig[r-vr]&&ar(t,this._layerConfig[r-vr],!0),e&&(t.virtual=e),this.insertLayer(r,t),t.initContext()),t},n.prototype.insertLayer=function(r,e){var t=this._layers,a=this._zlevelList,i=a.length,s=this._domRoot,v=null,d=-1;if(!t[r]&&De(e)){if(i>0&&r>a[0]){for(d=0;d<i-1&&!(a[d]<r&&a[d+1]>r);d++);v=t[a[d]]}if(a.splice(d+1,0,r),t[r]=e,!e.virtual)if(v){var o=v.dom;o.nextSibling?s.insertBefore(e.dom,o.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom);e.__painter=this}},n.prototype.eachLayer=function(r,e){for(var t=this._zlevelList,a=0;a<t.length;a++){var i=t[a];r.call(e,this._layers[i],i)}},n.prototype.eachBuiltinLayer=function(r,e){for(var t=this._zlevelList,a=0;a<t.length;a++){var i=t[a],s=this._layers[i];s.__builtin__&&r.call(e,s,i)}},n.prototype.eachOtherLayer=function(r,e){for(var t=this._zlevelList,a=0;a<t.length;a++){var i=t[a],s=this._layers[i];s.__builtin__||r.call(e,s,i)}},n.prototype.getLayers=function(){return this._layers},n.prototype._updateLayerStatus=function(r){this.eachBuiltinLayer(function(u,h){u.__dirty=u.__used=!1});function e(u){i&&(i.__endIndex!==u&&(i.__dirty=!0),i.__endIndex=u)}if(this._singleCanvas)for(var t=1;t<r.length;t++){var a=r[t];if(a.zlevel!==r[t-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,s=0,v,d;for(d=0;d<r.length;d++){var a=r[d],o=a.zlevel,f=void 0;v!==o&&(v=o,s=0),a.incremental?(f=this.getLayer(o+Ce,this._needsManuallyCompositing),f.incremental=!0,s=1):f=this.getLayer(o+(s>0?vr:0),this._needsManuallyCompositing),f.__builtin__||Qt("ZLevel "+o+" has been used by unkown layer "+f.id),f!==i&&(f.__used=!0,f.__startIndex!==d&&(f.__dirty=!0),f.__startIndex=d,f.incremental?f.__drawIndex=-1:f.__drawIndex=d,e(d),i=f),a.__dirty&Cr&&!a.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=d))}e(d),this.eachBuiltinLayer(function(u,h){!u.__used&&u.getElementCount()>0&&(u.__dirty=!0,u.__startIndex=u.__endIndex=u.__drawIndex=0),u.__dirty&&u.__drawIndex<0&&(u.__drawIndex=u.__startIndex)})},n.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},n.prototype._clearLayer=function(r){r.clear()},n.prototype.setBackgroundColor=function(r){this._backgroundColor=r,S(this._layers,function(e){e.setUnpainted()})},n.prototype.configLayer=function(r,e){if(e){var t=this._layerConfig;t[r]?ar(t[r],e,!0):t[r]=e;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===r||i===r+vr){var s=this._layers[i];ar(s,t[r],!0)}}}},n.prototype.delLayer=function(r){var e=this._layers,t=this._zlevelList,a=e[r];a&&(a.dom.parentNode.removeChild(a.dom),delete e[r],t.splice(Tr(t,r),1))},n.prototype.resize=function(r,e){if(this._domRoot.style){var t=this._domRoot;t.style.display="none";var a=this._opts,i=this.root;if(r!=null&&(a.width=r),e!=null&&(a.height=e),r=nr(i,0,a),e=nr(i,1,a),t.style.display="",this._width!==r||e!==this._height){t.style.width=r+"px",t.style.height=e+"px";for(var s in this._layers)this._layers.hasOwnProperty(s)&&this._layers[s].resize(r,e);this.refresh(!0)}this._width=r,this._height=e}else{if(r==null||e==null)return;this._width=r,this._height=e,this.getLayer(Z).resize(r,e)}return this},n.prototype.clearLayer=function(r){var e=this._layers[r];e&&e.clear()},n.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},n.prototype.getRenderedCanvas=function(r){if(r=r||{},this._singleCanvas&&!this._compositeManually)return this._layers[Z].dom;var e=new mr("image",this,r.pixelRatio||this.dpr);e.initContext(),e.clear(!1,r.backgroundColor||this._backgroundColor);var t=e.ctx;if(r.pixelRatio<=this.dpr){this.refresh();var a=e.dom.width,i=e.dom.height;this.eachLayer(function(u){u.__builtin__?t.drawImage(u.dom,0,0,a,i):u.renderToCanvas&&(t.save(),u.renderToCanvas(t),t.restore())})}else for(var s={inHover:!1,viewWidth:this._width,viewHeight:this._height},v=this.storage.getDisplayList(!0),d=0,o=v.length;d<o;d++){var f=v[d];er(t,f,s,d===o-1)}return e.dom},n.prototype.getWidth=function(){return this._width},n.prototype.getHeight=function(){return this._height},n}();const we=Ee;function be(n){n.registerPainter("canvas",we)}export{Se as a,be as b,Ae as i};