var Bf=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),Hf=function(){function r(){this.browser=new Bf,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=typeof window<"u"}return r}(),X=new Hf;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(X.wxa=!0,X.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?X.worker=!0:!X.hasGlobalWindow||"Deno"in window?(X.node=!0,X.svgSupported=!0):zf(navigator.userAgent,X);function zf(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),a=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),n=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),a&&(e.ie=!0,e.version=a[1]),n&&(e.edge=!0,e.version=n[1],e.newEdge=+n[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in s||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}var on=12,vs="sans-serif",Qt=on+"px "+vs,Nf=20,Yf=100,Gf="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Xf(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e=0)s=o*e.length;else for(var f=0;f>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[f]+":0",a[h]+":0",i[1-f]+":auto",a[1-h]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return e}function dh(r,t,e){for(var i=e?"invTrans":"trans",a=t[i],n=t.srcCoords,o=[],s=[],f=!0,h=0;h<4;h++){var u=r[h].getBoundingClientRect(),v=2*h,l=u.left,c=u.top;o.push(l,c),f=f&&n&&l===n[v]&&c===n[v+1],s.push(r[h].offsetLeft,r[h].offsetTop)}return f&&a?a:(t.srcCoords=o,t[i]=e?Dn(s,o):Dn(o,s))}function ws(r){return r.nodeName.toUpperCase()==="CANVAS"}var ph=/([&<>"'])/g,gh={"&":"&","<":"<",">":">",'"':""","'":"'"};function _h(r){return r==null?"":(r+"").replace(ph,function(t,e){return gh[e]})}var yh=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ni=[],mh=X.browser.firefox&&+X.browser.version.split(".")[0]<39;function Da(r,t,e,i){return e=e||{},i?En(r,t,e):mh&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):En(r,t,e),e}function En(r,t,e){if(X.domSupported&&r.getBoundingClientRect){var i=t.clientX,a=t.clientY;if(ws(r)){var n=r.getBoundingClientRect();e.zrX=i-n.left,e.zrY=a-n.top;return}else if(Aa(Ni,r,i,a)){e.zrX=Ni[0],e.zrY=Ni[1];return}}e.zrX=e.zrY=0}function un(r){return r||window.event}function bt(r,t,e){if(t=un(t),t.zrX!=null)return t;var i=t.type,a=i&&i.indexOf("touch")>=0;if(a){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Da(r,o,t,e)}else{Da(r,t,t,e);var n=wh(t);t.zrDelta=n?n/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&yh.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function wh(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var a=Math.abs(i!==0?i:e),n=i>0?-1:i<0?1:e>0?-1:1;return 3*a*n}function Th(r,t,e,i){r.addEventListener(t,e,i)}function bh(r,t,e,i){r.removeEventListener(t,e,i)}var Sh=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function Ac(r){return r.which===2||r.which===3}var Ch=function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var a=t.touches;if(a){for(var n={points:[],touches:[],target:e,event:t},o=0,s=a.length;o1&&i&&i.length>1){var n=Fn(i)/Fn(a);!isFinite(n)&&(n=1),t.pinchScale=n;var o=Mh(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function Sr(){return[1,0,0,1,0,0]}function Ph(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function Ts(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function ge(r,t,e){var i=t[0]*e[0]+t[2]*e[1],a=t[1]*e[0]+t[3]*e[1],n=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],f=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=a,r[2]=n,r[3]=o,r[4]=s,r[5]=f,r}function Ia(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function bs(r,t,e,i){i===void 0&&(i=[0,0]);var a=t[0],n=t[2],o=t[4],s=t[1],f=t[3],h=t[5],u=Math.sin(e),v=Math.cos(e);return r[0]=a*v+s*u,r[1]=-a*u+s*v,r[2]=n*v+f*u,r[3]=-n*u+v*f,r[4]=v*(o-i[0])+u*(h-i[1])+i[0],r[5]=v*(h-i[1])-u*(o-i[0])+i[1],r}function Ss(r,t,e){var i=e[0],a=e[1];return r[0]=t[0]*i,r[1]=t[1]*a,r[2]=t[2]*i,r[3]=t[3]*a,r[4]=t[4]*i,r[5]=t[5]*a,r}function Lh(r,t){var e=t[0],i=t[2],a=t[4],n=t[1],o=t[3],s=t[5],f=e*o-n*i;return f?(f=1/f,r[0]=o*f,r[1]=-n*f,r[2]=-i*f,r[3]=e*f,r[4]=(i*s-o*a)*f,r[5]=(n*a-e*s)*f,r):null}function Dc(r){var t=Sr();return Ts(t,r),t}var k=function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,a){t.x=e.x+i.x*a,t.y=e.y+i.y*a},r.lerp=function(t,e,i,a){var n=1-a;t.x=n*e.x+a*i.x,t.y=n*e.y+a*i.y},r}(),Oe=Math.min,ke=Math.max,tr=new k,rr=new k,er=new k,ir=new k,te=new k,re=new k,U=function(){function r(t,e,i,a){i<0&&(t=t+i,i=-i),a<0&&(e=e+a,a=-a),this.x=t,this.y=e,this.width=i,this.height=a}return r.prototype.union=function(t){var e=Oe(t.x,this.x),i=Oe(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ke(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ke(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,a=t.height/e.height,n=Sr();return Ia(n,n,[-e.x,-e.y]),Ss(n,n,[i,a]),Ia(n,n,[t.x,t.y]),n},r.prototype.intersect=function(t,e){if(!t)return!1;t instanceof r||(t=r.create(t));var i=this,a=i.x,n=i.x+i.width,o=i.y,s=i.y+i.height,f=t.x,h=t.x+t.width,u=t.y,v=t.y+t.height,l=!(np&&(p=m,_p&&(p=w,g=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var a=i[0],n=i[3],o=i[4],s=i[5];t.x=e.x*a+o,t.y=e.y*n+s,t.width=e.width*a,t.height=e.height*n,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}tr.x=er.x=e.x,tr.y=ir.y=e.y,rr.x=ir.x=e.x+e.width,rr.y=er.y=e.y+e.height,tr.transform(i),ir.transform(i),rr.transform(i),er.transform(i),t.x=Oe(tr.x,rr.x,er.x,ir.x),t.y=Oe(tr.y,rr.y,er.y,ir.y);var f=ke(tr.x,rr.x,er.x,ir.x),h=ke(tr.y,rr.y,er.y,ir.y);t.width=f-t.x,t.height=h-t.y},r}(),Cs="silent";function xh(r,t,e){return{type:r,event:e,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:e.zrX,offsetY:e.zrY,gestureEvent:e.gestureEvent,pinchX:e.pinchX,pinchY:e.pinchY,pinchScale:e.pinchScale,wheelDelta:e.zrDelta,zrByTouch:e.zrByTouch,which:e.which,stop:Rh}}function Rh(){Sh(this.event)}var Ah=function(r){N(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.handler=null,e}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Jr),ee=function(){function r(t,e){this.x=t,this.y=e}return r}(),Dh=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Gi=new U(0,0,0,0),Ms=function(r){N(t,r);function t(e,i,a,n,o){var s=r.call(this)||this;return s._hovered=new ee(0,0),s.storage=e,s.painter=i,s.painterRoot=n,s._pointerSize=o,a=a||new Ah,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new vh(s),s}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(nt(Dh,function(i){e.on&&e.on(i,this[i],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var i=e.zrX,a=e.zrY,n=Ps(this,i,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var f=this._hovered=n?new ee(i,a):this.findHover(i,a),h=f.target,u=this.proxy;u.setCursor&&u.setCursor(h?h.cursor:"default"),s&&h!==s&&this.dispatchToElement(o,"mouseout",e),this.dispatchToElement(f,"mousemove",e),h&&h!==s&&this.dispatchToElement(f,"mouseover",e)},t.prototype.mouseout=function(e){var i=e.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",e),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:e})},t.prototype.resize=function(){this._hovered=new ee(0,0)},t.prototype.dispatch=function(e,i){var a=this[e];a&&a.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var i=this.proxy;i.setCursor&&i.setCursor(e)},t.prototype.dispatchToElement=function(e,i,a){e=e||{};var n=e.target;if(!(n&&n.silent)){for(var o="on"+i,s=xh(i,e,a);n&&(n[o]&&(s.cancelBubble=!!n[o].call(n,s)),n.trigger(i,s),n=n.__hostTarget?n.__hostTarget:n.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(f){typeof f[o]=="function"&&f[o].call(f,s),f.trigger&&f.trigger(i,s)}))}},t.prototype.findHover=function(e,i,a){var n=this.storage.getDisplayList(),o=new ee(e,i);if(On(n,o,e,i,a),this._pointerSize&&!o.target){for(var s=[],f=this._pointerSize,h=f/2,u=new U(e-h,i-h,f,f),v=n.length-1;v>=0;v--){var l=n[v];l!==a&&!l.ignore&&!l.ignoreCoarsePointer&&(!l.parent||!l.parent.ignoreCoarsePointer)&&(Gi.copy(l.getBoundingRect()),l.transform&&Gi.applyTransform(l.transform),Gi.intersect(u)&&s.push(l))}if(s.length)for(var c=4,p=Math.PI/12,_=Math.PI*2,d=0;d4)return;this._downPoint=null}this.dispatchToElement(n,r,t)}});function Ih(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,a=void 0,n=!1;i;){if(i.ignoreClip&&(n=!0),!n){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1}i.silent&&(a=!0);var s=i.__hostTarget;i=s||i.parent}return a?Cs:!0}return!1}function On(r,t,e,i,a){for(var n=r.length-1;n>=0;n--){var o=r[n],s=void 0;if(o!==a&&!o.ignore&&(s=Ih(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==Cs)){t.target=o;break}}}function Ps(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var Ls=32,ie=7;function Eh(r){for(var t=0;r>=Ls;)t|=r&1,r>>=1;return r+t}function kn(r,t,e,i){var a=t+1;if(a===e)return 1;if(i(r[a++],r[t])<0){for(;a=0;)a++;return a-t}function Fh(r,t,e){for(e--;t>>1,a(n,r[f])<0?s=f:o=f+1;var h=i-o;switch(h){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;h>0;)r[o+h]=r[o+h-1],h--}r[o]=n}}function Xi(r,t,e,i,a,n){var o=0,s=0,f=1;if(n(r,t[e+a])>0){for(s=i-a;f0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=a,f+=a}else{for(s=a+1;fs&&(f=s);var h=o;o=a-f,f=a-h}for(o++;o>>1);n(r,t[e+u])>0?o=u+1:f=u}return f}function Ui(r,t,e,i,a,n){var o=0,s=0,f=1;if(n(r,t[e+a])<0){for(s=a+1;fs&&(f=s);var h=o;o=a-f,f=a-h}else{for(s=i-a;f=0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=a,f+=a}for(o++;o>>1);n(r,t[e+u])<0?f=u:o=u+1}return f}function Oh(r,t){var e=ie,i,a,n=0,o=[];i=[],a=[];function s(c,p){i[n]=c,a[n]=p,n+=1}function f(){for(;n>1;){var c=n-2;if(c>=1&&a[c-1]<=a[c]+a[c+1]||c>=2&&a[c-2]<=a[c]+a[c-1])a[c-1]a[c+1])break;u(c)}}function h(){for(;n>1;){var c=n-2;c>0&&a[c-1]=ie||T>=ie);if(C)break;S<0&&(S=0),S+=2}if(e=S,e<1&&(e=1),p===1){for(g=0;g=0;g--)r[b+g]=r[S+g];r[w]=o[m];return}for(var T=e;;){var C=0,M=0,P=!1;do if(t(o[m],r[y])<0){if(r[w--]=r[y--],C++,M=0,--p===0){P=!0;break}}else if(r[w--]=o[m--],M++,C=0,--d===1){P=!0;break}while((C|M)=0;g--)r[b+g]=r[S+g];if(p===0){P=!0;break}}if(r[w--]=o[m--],--d===1){P=!0;break}if(M=d-Xi(r[y],o,0,d,d-1,t),M!==0){for(w-=M,m-=M,d-=M,b=w+1,S=m+1,g=0;g=ie||M>=ie);if(P)break;T<0&&(T=0),T+=2}if(e=T,e<1&&(e=1),d===1){for(w-=p,y-=p,b=w+1,S=y+1,g=p-1;g>=0;g--)r[b+g]=r[S+g];r[w]=o[m]}else{if(d===0)throw new Error;for(S=w-(d-1),g=0;gs&&(f=s),Bn(r,e,e+f,e+n,t),n=f}o.pushRun(e,n),o.mergeRuns(),a-=n,e+=n}while(a!==0);o.forceMergeRuns()}}var Ft=1,ii=2,fe=4,Hn=!1;function Wi(){Hn||(Hn=!0)}function zn(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var Bh=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=zn}return r.prototype.traverse=function(t,e){for(var i=0;i0&&(u.__clipPaths=[]),isNaN(u.z)&&(Wi(),u.z=0),isNaN(u.z2)&&(Wi(),u.z2=0),isNaN(u.zlevel)&&(Wi(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var v=t.getDecalElement&&t.getDecalElement();v&&this._updateAndAddDisplayable(v,e,i);var l=t.getTextGuideLine();l&&this._updateAndAddDisplayable(l,e,i);var c=t.getTextContent();c&&this._updateAndAddDisplayable(c,e,i)}},r.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},r.prototype.delRoot=function(t){if(t instanceof Array){for(var e=0,i=t.length;e=0&&this._roots.splice(a,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),ui;ui=X.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var _e={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-_e.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?_e.bounceIn(r*2)*.5:_e.bounceOut(r*2-1)*.5+.5}},Be=Math.pow,Kt=Math.sqrt,xs=1e-8,Rs=1e-4,Nn=Kt(3),He=1/3,Et=Qr(),mt=Qr(),$r=Qr();function $t(r){return r>-1e-8&&rxs||r<-1e-8}function rt(r,t,e,i,a){var n=1-a;return n*n*(n*r+3*a*t)+a*a*(a*i+3*n*e)}function Yn(r,t,e,i,a){var n=1-a;return 3*(((t-r)*n+2*(e-t)*a)*n+(i-e)*a*a)}function Ds(r,t,e,i,a,n){var o=i+3*(t-e)-r,s=3*(e-t*2+r),f=3*(t-r),h=r-a,u=s*s-3*o*f,v=s*f-9*o*h,l=f*f-3*s*h,c=0;if($t(u)&&$t(v))if($t(s))n[0]=0;else{var p=-f/s;p>=0&&p<=1&&(n[c++]=p)}else{var _=v*v-4*u*l;if($t(_)){var d=v/u,p=-s/o+d,g=-d/2;p>=0&&p<=1&&(n[c++]=p),g>=0&&g<=1&&(n[c++]=g)}else if(_>0){var y=Kt(_),m=u*s+1.5*o*(-v+y),w=u*s+1.5*o*(-v-y);m<0?m=-Be(-m,He):m=Be(m,He),w<0?w=-Be(-w,He):w=Be(w,He);var p=(-s-(m+w))/(3*o);p>=0&&p<=1&&(n[c++]=p)}else{var S=(2*u*s-3*o*v)/(2*Kt(u*u*u)),b=Math.acos(S)/3,T=Kt(u),C=Math.cos(b),p=(-s-2*T*C)/(3*o),g=(-s+T*(C+Nn*Math.sin(b)))/(3*o),M=(-s+T*(C-Nn*Math.sin(b)))/(3*o);p>=0&&p<=1&&(n[c++]=p),g>=0&&g<=1&&(n[c++]=g),M>=0&&M<=1&&(n[c++]=M)}}return c}function Is(r,t,e,i,a){var n=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,f=0;if($t(o)){if(As(n)){var h=-s/n;h>=0&&h<=1&&(a[f++]=h)}}else{var u=n*n-4*o*s;if($t(u))a[0]=-n/(2*o);else if(u>0){var v=Kt(u),h=(-n+v)/(2*o),l=(-n-v)/(2*o);h>=0&&h<=1&&(a[f++]=h),l>=0&&l<=1&&(a[f++]=l)}}return f}function Jt(r,t,e,i,a,n){var o=(t-r)*a+r,s=(e-t)*a+t,f=(i-e)*a+e,h=(s-o)*a+o,u=(f-s)*a+s,v=(u-h)*a+h;n[0]=r,n[1]=o,n[2]=h,n[3]=v,n[4]=v,n[5]=u,n[6]=f,n[7]=i}function Hh(r,t,e,i,a,n,o,s,f,h,u){var v,l=.005,c=1/0,p,_,d,g;Et[0]=f,Et[1]=h;for(var y=0;y<1;y+=.05)mt[0]=rt(r,e,a,o,y),mt[1]=rt(t,i,n,s,y),d=qr(Et,mt),d=0&&d=0&&h<=1&&(a[f++]=h)}}else{var u=o*o-4*n*s;if($t(u)){var h=-o/(2*n);h>=0&&h<=1&&(a[f++]=h)}else if(u>0){var v=Kt(u),h=(-o+v)/(2*n),l=(-o-v)/(2*n);h>=0&&h<=1&&(a[f++]=h),l>=0&&l<=1&&(a[f++]=l)}}return f}function Es(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function vi(r,t,e,i,a){var n=(t-r)*i+r,o=(e-t)*i+t,s=(o-n)*i+n;a[0]=r,a[1]=n,a[2]=s,a[3]=s,a[4]=o,a[5]=e}function Yh(r,t,e,i,a,n,o,s,f){var h,u=.005,v=1/0;Et[0]=o,Et[1]=s;for(var l=0;l<1;l+=.05){mt[0]=at(r,e,a,l),mt[1]=at(t,i,n,l);var c=qr(Et,mt);c=0&&c=1?1:Ds(0,i,n,1,f,s)&&rt(0,a,o,1,s[0])}}}var Uh=function(){function r(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||br,this.ondestroy=t.ondestroy||br,this.onrestart=t.onrestart||br,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,a=t-this._startTime-this._pausedTime,n=a/i;n<0&&(n=0),n=Math.min(n,1);var o=this.easingFunc,s=o?o(n):n;if(this.onframe(s),n===1)if(this.loop){var f=a%i;this._startTime=t-f,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=xe(t)?t:_e[t]||vn(t)},r}(),Fs=function(){function r(t){this.value=t}return r}(),Wh=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new Fs(t);return this.insertEntry(e),e},r.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++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),Ri=function(){function r(t){this._list=new Wh,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,a=this._map,n=null;if(a[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var f=i.head;i.remove(f),delete a[f.key],n=f.value,this._lastRemovedEntry=f}s?s.value=e:s=new Fs(e),s.key=t,i.insertEntry(s),a[t]=s}return n},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),Xn={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 Ct(r){return r=Math.round(r),r<0?0:r>255?255:r}function qh(r){return r=Math.round(r),r<0?0:r>360?360:r}function we(r){return r<0?0:r>1?1:r}function qi(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Ct(parseFloat(t)/100*255):Ct(parseInt(t,10))}function Cr(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?we(parseFloat(t)/100):we(parseFloat(t))}function $i(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function Vt(r,t,e){return r+(t-r)*e}function _t(r,t,e,i,a){return r[0]=t,r[1]=e,r[2]=i,r[3]=a,r}function Ea(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var Os=new Ri(20),ze=null;function xr(r,t){ze&&Ea(ze,t),ze=Os.put(r,ze||t.slice())}function Mt(r,t){if(r){t=t||[];var e=Os.get(r);if(e)return Ea(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in Xn)return Ea(t,Xn[i]),xr(r,t),t;var a=i.length;if(i.charAt(0)==="#"){if(a===4||a===5){var n=parseInt(i.slice(1,4),16);if(!(n>=0&&n<=4095)){_t(t,0,0,0,1);return}return _t(t,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,a===5?parseInt(i.slice(4),16)/15:1),xr(r,t),t}else if(a===7||a===9){var n=parseInt(i.slice(1,7),16);if(!(n>=0&&n<=16777215)){_t(t,0,0,0,1);return}return _t(t,(n&16711680)>>16,(n&65280)>>8,n&255,a===9?parseInt(i.slice(7),16)/255:1),xr(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===a){var f=i.substr(0,o),h=i.substr(o+1,s-(o+1)).split(","),u=1;switch(f){case"rgba":if(h.length!==4)return h.length===3?_t(t,+h[0],+h[1],+h[2],1):_t(t,0,0,0,1);u=Cr(h.pop());case"rgb":if(h.length>=3)return _t(t,qi(h[0]),qi(h[1]),qi(h[2]),h.length===3?u:Cr(h[3])),xr(r,t),t;_t(t,0,0,0,1);return;case"hsla":if(h.length!==4){_t(t,0,0,0,1);return}return h[3]=Cr(h[3]),Fa(h,t),xr(r,t),t;case"hsl":if(h.length!==3){_t(t,0,0,0,1);return}return Fa(h,t),xr(r,t),t;default:return}}_t(t,0,0,0,1)}}function Fa(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=Cr(r[1]),a=Cr(r[2]),n=a<=.5?a*(i+1):a+i-a*i,o=a*2-n;return t=t||[],_t(t,Ct($i(o,n,e+1/3)*255),Ct($i(o,n,e)*255),Ct($i(o,n,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function $h(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,a=Math.min(t,e,i),n=Math.max(t,e,i),o=n-a,s=(n+a)/2,f,h;if(o===0)f=0,h=0;else{s<.5?h=o/(n+a):h=o/(2-n-a);var u=((n-t)/6+o/2)/o,v=((n-e)/6+o/2)/o,l=((n-i)/6+o/2)/o;t===n?f=l-v:e===n?f=1/3+u-l:i===n&&(f=2/3+v-u),f<0&&(f+=1),f>1&&(f-=1)}var c=[f*360,h,s];return r[3]!=null&&c.push(r[3]),c}}function Un(r,t){var e=Mt(r);if(e){for(var i=0;i<3;i++)t<0?e[i]=e[i]*(1-t)|0:e[i]=(255-e[i])*t+e[i]|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return Re(e,e.length===4?"rgba":"rgb")}}function Ic(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),a=Math.floor(i),n=Math.ceil(i),o=t[a],s=t[n],f=i-a;return e[0]=Ct(Vt(o[0],s[0],f)),e[1]=Ct(Vt(o[1],s[1],f)),e[2]=Ct(Vt(o[2],s[2],f)),e[3]=we(Vt(o[3],s[3],f)),e}}function Ec(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),a=Math.floor(i),n=Math.ceil(i),o=Mt(t[a]),s=Mt(t[n]),f=i-a,h=Re([Ct(Vt(o[0],s[0],f)),Ct(Vt(o[1],s[1],f)),Ct(Vt(o[2],s[2],f)),we(Vt(o[3],s[3],f))],"rgba");return e?{color:h,leftIndex:a,rightIndex:n,value:i}:h}}function Fc(r,t,e,i){var a=Mt(r);if(r)return a=$h(a),t!=null&&(a[0]=qh(t)),e!=null&&(a[1]=Cr(e)),i!=null&&(a[2]=Cr(i)),Re(Fa(a),"rgba")}function Oc(r,t){var e=Mt(r);if(e&&t!=null)return e[3]=we(t),Re(e,"rgba")}function Re(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function li(r,t){var e=Mt(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}var Wn=new Ri(100);function Vh(r){if(kt(r)){var t=Wn.get(r);return t||(t=Un(r,-.1),Wn.put(r,t)),t}else if(Li(r)){var e=z({},r);return e.colorStops=Z(r.colorStops,function(i){return{offset:i.offset,color:Un(i.color,-.1)}}),e}return r}var ci=Math.round;function Te(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=Mt(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t??1}}var Zh=1e-4;function Zt(r){return r-1e-4}function Ne(r){return ci(r*1e3)/1e3}function Oa(r){return ci(r*1e4)/1e4}function Kh(r){return"matrix("+Ne(r[0])+","+Ne(r[1])+","+Ne(r[2])+","+Ne(r[3])+","+Oa(r[4])+","+Oa(r[5])+")"}var Qh={left:"start",right:"end",center:"middle",middle:"middle"};function Jh(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function jh(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function tu(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function ks(r){return r&&!!r.image}function ru(r){return r&&!!r.svgElement}function ln(r){return ks(r)||ru(r)}function Bs(r){return r.type==="linear"}function Hs(r){return r.type==="radial"}function zs(r){return r&&(r.type==="linear"||r.type==="radial")}function Ai(r){return"url(#"+r+")"}function Ns(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function Ys(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*ei,a=$(r.scaleX,1),n=$(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,f=[];return(t||e)&&f.push("translate("+t+"px,"+e+"px)"),i&&f.push("rotate("+i+")"),(a!==1||n!==1)&&f.push("scale("+a+","+n+")"),(o||s)&&f.push("skew("+ci(o*ei)+"deg, "+ci(s*ei)+"deg)"),f.join(" ")}var eu=function(){return X.hasGlobalWindow&&xe(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),ka=Array.prototype.slice;function Yt(r,t,e){return(t-r)*e+r}function Vi(r,t,e,i){for(var a=t.length,n=0;ni?t:r,n=Math.min(e,i),o=a[n-1]||{color:[0,0,0,0],offset:0},s=n;so;if(s)i.length=o;else for(var f=n;f=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var a=this.keyframes,n=a.length,o=!1,s=$n,f=e;if(Ot(e)){var h=ou(e);s=h,(h===1&&!ce(e[0])||h===2&&!ce(e[0][0]))&&(o=!0)}else if(ce(e)&&!Jf(e))s=Ge;else if(kt(e))if(!isNaN(+e))s=Ge;else{var u=Mt(e);u&&(f=u,s=he)}else if(Li(e)){var v=z({},f);v.colorStops=Z(e.colorStops,function(c){return{offset:c.offset,color:Mt(c.color)}}),Bs(e)?s=Ba:Hs(e)&&(s=Ha),f=v}n===0?this.valType=s:(s!==this.valType||s===$n)&&(o=!0),this.discrete=this.discrete||o;var l={time:t,value:f,rawValue:e,percent:0};return i&&(l.easing=i,l.easingFunc=xe(i)?i:_e[i]||vn(i)),a.push(l),l},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(_,d){return _.time-d.time});for(var a=this.valType,n=i.length,o=i[n-1],s=this.discrete,f=Xe(a),h=Vn(a),u=0;u=0&&!(o[u].percent<=e);u--);u=l(u,s-2)}else{for(u=v;ue);u++);u=l(u-1,s-2)}p=o[u+1],c=o[u]}if(c&&p){this._lastFr=u,this._lastFrP=e;var d=p.percent-c.percent,g=d===0?1:l((e-c.percent)/d,1);p.easingFunc&&(g=p.easingFunc(g));var y=i?this._additiveValue:h?ae:t[f];if((Xe(n)||h)&&!y&&(y=this._additiveValue=[]),this.discrete)t[f]=g<1?c.rawValue:p.rawValue;else if(Xe(n))n===oi?Vi(y,c[a],p[a],g):iu(y,c[a],p[a],g);else if(Vn(n)){var m=c[a],w=p[a],S=n===Ba;t[f]={type:S?"linear":"radial",x:Yt(m.x,w.x,g),y:Yt(m.y,w.y,g),colorStops:Z(m.colorStops,function(T,C){var M=w.colorStops[C];return{offset:Yt(T.offset,M.offset,g),color:ni(Vi([],T.color,M.color,g))}}),global:w.global},S?(t[f].x2=Yt(m.x2,w.x2,g),t[f].y2=Yt(m.y2,w.y2,g)):t[f].r=Yt(m.r,w.r,g)}else if(h)Vi(y,c[a],p[a],g),i||(t[f]=ni(y));else{var b=Yt(c[a],p[a],g);i?this._additiveValue=b:t[f]=b}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,a=this._additiveValue;e===Ge?t[i]=t[i]+a:e===he?(Mt(t[i],ae),Ye(ae,ae,a,1),t[i]=ni(ae)):e===oi?Ye(t[i],t[i],a,1):e===Gs&&qn(t[i],t[i],a,1)},r}(),cn=function(){function r(t,e,i,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&a){hn("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,G(e),i)},r.prototype.whenWithKeys=function(t,e,i,a){for(var n=this._tracks,o=0;o0&&f.addKeyframe(0,ai(h),a),this._trackKeys.push(s)}f.addKeyframe(t,ai(e[s]),a)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],a=this._maxTime||0,n=0;n1){var s=o.pop();n.addKeyframe(s.time,t[a]),n.prepare(this._maxTime,n.getAdditiveTrack())}}}},r}();function Yr(){return new Date().getTime()}var fu=function(r){N(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,a=e.next;i?i.next=a:this._head=a,a?a.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=Yr()-this._pausedTime,a=i-this._time,n=this._head;n;){var o=n.next,s=n.step(i,a);s&&(n.ondestroy(),this.removeClip(n)),n=o}this._time=i,e||(this.trigger("frame",a),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(ui(i),!e._paused&&e.update())}ui(i)},t.prototype.start=function(){this._running||(this._time=Yr(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Yr(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Yr()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var a=new cn(e,i.loop);return this.addAnimator(a),a},t}(Jr),hu=300,Zi=X.domSupported,Ki=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=Z(r,function(a){var n=a.replace("mouse","pointer");return e.hasOwnProperty(n)?n:a});return{mouse:r,touch:t,pointer:i}}(),Zn={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Kn=!1;function za(r){var t=r.pointerType;return t==="pen"||t==="touch"}function uu(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function Qi(r){r&&(r.zrByTouch=!0)}function vu(r,t){return bt(r.dom,new lu(r,t),!0)}function Xs(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var lu=function(){function r(t,e){this.stopPropagation=br,this.stopImmediatePropagation=br,this.preventDefault=br,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r}(),St={mousedown:function(r){r=bt(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=bt(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=bt(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=bt(this.dom,r);var t=r.toElement||r.relatedTarget;Xs(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Kn=!0,r=bt(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Kn||(r=bt(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=bt(this.dom,r),Qi(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),St.mousemove.call(this,r),St.mousedown.call(this,r)},touchmove:function(r){r=bt(this.dom,r),Qi(r),this.handler.processGesture(r,"change"),St.mousemove.call(this,r)},touchend:function(r){r=bt(this.dom,r),Qi(r),this.handler.processGesture(r,"end"),St.mouseup.call(this,r),+new Date-+this.__lastTouchMoment_u||r<-5e-5}var nr=[],Rr=[],ji=Sr(),ta=Math.abs,dn=function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return ar(this.rotation)||ar(this.x)||ar(this.y)||ar(this.scaleX-1)||ar(this.scaleY-1)||ar(this.skewX)||ar(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(Jn(i),this.invTransform=null);return}i=i||Sr(),e?this.getLocalTransform(i):Jn(i),t&&(e?ge(i,t,i):Ts(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(nr);var i=nr[0]<0?-1:1,a=nr[1]<0?-1:1,n=((nr[0]-i)*e+i)/nr[0]||0,o=((nr[1]-a)*e+a)/nr[1]||0;t[0]*=n,t[1]*=n,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Sr(),Lh(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],a=Math.atan2(t[1],t[0]),n=Math.PI/2+a-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(n),e=Math.sqrt(e),this.skewX=n,this.skewY=0,this.rotation=-a,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Sr(),ge(Rr,t.invTransform,e),e=Rr);var i=this.originX,a=this.originY;(i||a)&&(ji[4]=i,ji[5]=a,ge(Rr,e,ji),Rr[4]-=i,Rr[5]-=a,e=Rr),this.setLocalTransform(e)}},r.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)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],a=this.invTransform;return a&&pe(i,i,a),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],a=this.transform;return a&&pe(i,i,a),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&ta(t[0]-1)>1e-10&&ta(t[3]-1)>1e-10?Math.sqrt(ta(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){Ws(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,a=t.originY||0,n=t.scaleX,o=t.scaleY,s=t.anchorX,f=t.anchorY,h=t.rotation||0,u=t.x,v=t.y,l=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(i||a||s||f){var p=i+s,_=a+f;e[4]=-p*n-l*_*o,e[5]=-_*o-c*p*n}else e[4]=e[5]=0;return e[0]=n,e[3]=o,e[1]=c*n,e[2]=l*o,h&&bs(e,e,h),e[4]+=i+u,e[5]+=a+v,e},r.initDefaultProps=function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),r}(),be=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Ws(r,t){for(var e=0;e=0?parseFloat(r)/100*t:parseFloat(r):r}function mu(r,t,e){var i=t.position||"inside",a=t.distance!=null?t.distance:5,n=e.height,o=e.width,s=n/2,f=e.x,h=e.y,u="left",v="top";if(i instanceof Array)f+=Se(i[0],e.width),h+=Se(i[1],e.height),u=null,v=null;else switch(i){case"left":f-=a,h+=s,u="right",v="middle";break;case"right":f+=a+o,h+=s,v="middle";break;case"top":f+=o/2,h-=a,u="center",v="bottom";break;case"bottom":f+=o/2,h+=n+a,u="center";break;case"inside":f+=o/2,h+=s,u="center",v="middle";break;case"insideLeft":f+=a,h+=s,v="middle";break;case"insideRight":f+=o-a,h+=s,u="right",v="middle";break;case"insideTop":f+=o/2,h+=a,u="center";break;case"insideBottom":f+=o/2,h+=n-a,u="center",v="bottom";break;case"insideTopLeft":f+=a,h+=a;break;case"insideTopRight":f+=o-a,h+=a,u="right";break;case"insideBottomLeft":f+=a,h+=n-a,v="bottom";break;case"insideBottomRight":f+=o-a,h+=n-a,u="right",v="bottom";break}return r=r||{},r.x=f,r.y=h,r.align=u,r.verticalAlign=v,r}var ra="__zr_normal__",ea=be.concat(["ignore"]),wu=Pi(be,function(r,t){return r[t]=!0,r},{ignore:!1}),Ar={},Tu=new U(0,0,0,0),Ii=function(){function r(t){this.id=ds(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=t,a[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,a=i.local,n=e.innerTransformable,o=void 0,s=void 0,f=!1;n.parent=a?this:null;var h=!1;if(n.copyTransform(e),i.position!=null){var u=Tu;i.layoutRect?u.copy(i.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ar,i,u):mu(Ar,i,u),n.x=Ar.x,n.y=Ar.y,o=Ar.align,s=Ar.verticalAlign;var v=i.origin;if(v&&i.rotation!=null){var l=void 0,c=void 0;v==="center"?(l=u.width*.5,c=u.height*.5):(l=Se(v[0],u.width),c=Se(v[1],u.height)),h=!0,n.originX=-n.x+l+(a?0:u.x),n.originY=-n.y+c+(a?0:u.y)}}i.rotation!=null&&(n.rotation=i.rotation);var p=i.offset;p&&(n.x+=p[0],n.y+=p[1],h||(n.originX=-p[0],n.originY=-p[1]));var _=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,d=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,y=void 0,m=void 0;_&&this.canBeInsideText()?(g=i.insideFill,y=i.insideStroke,(g==null||g==="auto")&&(g=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(g),m=!0)):(g=i.outsideFill,y=i.outsideStroke,(g==null||g==="auto")&&(g=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(g),m=!0)),g=g||"#000",(g!==d.fill||y!==d.stroke||m!==d.autoStroke||o!==d.align||s!==d.verticalAlign)&&(f=!0,d.fill=g,d.stroke=y,d.autoStroke=m,d.align=o,d.verticalAlign=s,e.setDefaultTextStyle(d)),e.__dirty|=Ft,f&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Xa:Ga},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&Mt(e);i||(i=[255,255,255,1]);for(var a=i[3],n=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*a+(n?0:255)*(1-a);return i[3]=1,Re(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},z(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(Xt(t))for(var i=t,a=G(i),n=0;n0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(ra,!1,t)},r.prototype.useState=function(t,e,i,a){var n=t===ra,o=this.hasState();if(!(!o&&n)){var s=this.currentStates,f=this.stateTransition;if(!(It(s,t)>=0&&(e||s.length===1))){var h;if(this.stateProxy&&!n&&(h=this.stateProxy(t)),h||(h=this.states&&this.states[t]),!h&&!n){hn("State "+t+" not exists.");return}n||this.saveCurrentToNormalState(h);var u=!!(h&&h.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,h,this._normalState,e,!i&&!this.__inHover&&f&&f.duration>0,f);var v=this._textContent,l=this._textGuide;return v&&v.useState(t,e,i,u),l&&l.useState(t,e,i,u),n?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),h}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var a=[],n=this.currentStates,o=t.length,s=o===n.length;if(s){for(var f=0;f0,p);var _=this._textContent,d=this._textGuide;_&&_.useStates(t,e,l),d&&d.useStates(t,e,l),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},r.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},r.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var a=this.currentStates.slice(),n=It(a,t),o=It(a,e)>=0;n>=0?o?a.splice(n,1):a[n]=e:i&&!o&&a.push(e),this.useStates(a)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,a=0;a=0&&n.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,a=i.length,n=[],o=0;o0&&e.during&&n[0].during(function(p,_){e.during(_)});for(var l=0;l0||a.force&&!o.length){var C=void 0,M=void 0,P=void 0;if(s){M={},l&&(C={});for(var w=0;w=0&&(a.splice(n,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var a=It(this._children,e);return a>=0&&this.replaceAt(i,a),this},t.prototype.replaceAt=function(e,i){var a=this._children,n=a[i];if(e&&e!==this&&e.parent!==this&&e!==n){a[i]=e,n.parent=null;var o=this.__zr;o&&n.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,a=this._children,n=It(a,e);return n<0?this:(a.splice(n,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,a=0;a0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=o;f++)s-=o;var h=ct(e,t);return h>s&&(e="",h=0),s=r-h,a.ellipsis=e,a.ellipsisWidth=h,a.contentWidth=s,a.containerWidth=r,a}function Zs(r,t,e){var i=e.containerWidth,a=e.font,n=e.contentWidth;if(!i){r.textLine="",r.isTruncated=!1;return}var o=ct(t,a);if(o<=i){r.textLine=t,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=n||s>=e.maxIterations){t+=e.ellipsis;break}var f=s===0?Iu(t,n,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*n/o):0;t=t.substr(0,f),o=ct(t,a)}t===""&&(t=e.placeholder),r.textLine=t,r.isTruncated=!0}function Iu(r,t,e,i){for(var a=0,n=0,o=r.length;np&&h){var _=Math.floor(p/s);u=u||l.length>_,l=l.slice(0,_)}if(r&&n&&v!=null)for(var d=Vs(v,a,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),g={},y=0;ys&&oa(e,r.substring(s,h),t,o),oa(e,f[2],t,o,f[1]),s=na.lastIndex}sa){var A=e.lines.length;b>0?(m.tokens=m.tokens.slice(0,b),g(m,S,w),e.lines=e.lines.slice(0,y+1)):e.lines=e.lines.slice(0,y),e.isTruncated=e.isTruncated||e.lines.length0&&p+i.accumWidth>i.width&&(u=t.split(` `),h=!0),i.accumWidth=p}else{var _=Ks(t,f,i.width,i.breakAll,i.accumWidth);i.accumWidth=_.accumWidth+c,v=_.linesWidths,u=_.lines}}else u=t.split(` `);for(var d=0;d=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Hu=Pi(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function zu(r){return Bu(r)?!!Hu[r]:!0}function Ks(r,t,e,i,a){for(var n=[],o=[],s="",f="",h=0,u=0,v=0;ve:a+u+c>e){u?(s||f)&&(p?(s||(s=f,f="",h=0,u=h),n.push(s),o.push(u-h),f+=l,h+=c,s="",u=h):(f&&(s+=f,f="",h=0),n.push(s),o.push(u),s=l,u=c)):p?(n.push(f),o.push(h),f=l,h=c):(n.push(l),o.push(c));continue}u+=c,p?(f+=l,h+=c):(f&&(s+=f,f="",h=0),s+=l)}return!n.length&&!s&&(s=r,f="",h=0),f&&(s+=f),s&&(n.push(s),o.push(u)),n.length===1&&(u+=a),{accumWidth:u,lines:n,linesWidths:o}}var qa="__zr_style_"+Math.round(Math.random()*10),Mr={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Fi={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Mr[qa]=!0;var io=["z","z2","invisible"],Nu=["invisible"],Ae=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=G(e),a=0;a1e-4){s[0]=r-e,s[1]=t-i,f[0]=r+e,f[1]=t+i;return}if(Ue[0]=ua(a)*e+r,Ue[1]=ha(a)*i+t,We[0]=ua(n)*e+r,We[1]=ha(n)*i+t,h(s,Ue,We),u(f,Ue,We),a=a%or,a<0&&(a=a+or),n=n%or,n<0&&(n=n+or),a>n&&!o?n+=or:aa&&(qe[0]=ua(c)*e+r,qe[1]=ha(c)*i+t,h(s,qe,s),u(f,qe,f))}var B={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},sr=[],fr=[],Pt=[],Ut=[],Lt=[],xt=[],va=Math.min,la=Math.max,hr=Math.cos,ur=Math.sin,Nt=Math.abs,$a=Math.PI,qt=$a*2,ca=typeof Float32Array<"u",ne=[];function da(r){var t=Math.round(r/$a*1e8)/1e8;return t%2*$a}function Wu(r,t){var e=da(r[0]);e<0&&(e+=qt);var i=e-r[0],a=r[1];a+=i,!t&&a-e>=qt?a=e+qt:t&&e-a>=qt?a=e-qt:!t&&e>a?a=e+(qt-da(e-a)):t&&e0&&(this._ux=Nt(i/di/t)||0,this._uy=Nt(i/di/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(B.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=Nt(t-this._xi),a=Nt(e-this._yi),n=i>this._ux||a>this._uy;if(this.addData(B.L,t,e),this._ctx&&n&&this._ctx.lineTo(t,e),n)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+a*a;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,a,n,o){return this._drawPendingPt(),this.addData(B.C,t,e,i,a,n,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,a,n,o),this._xi=n,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,a){return this._drawPendingPt(),this.addData(B.Q,t,e,i,a),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,a),this._xi=i,this._yi=a,this},r.prototype.arc=function(t,e,i,a,n,o){this._drawPendingPt(),ne[0]=a,ne[1]=n,Wu(ne,o),a=ne[0],n=ne[1];var s=n-a;return this.addData(B.A,t,e,i,i,a,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,a,n,o),this._xi=hr(n)*i+t,this._yi=ur(n)*i+e,this},r.prototype.arcTo=function(t,e,i,a,n){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,a,n),this},r.prototype.rect=function(t,e,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,a),this.addData(B.R,t,e,i,a),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(B.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){var e=t.length;!(this.data&&this.data.length===e)&&ca&&(this.data=new Float32Array(e));for(var i=0;iu.length&&(this._expandData(),u=this.data);for(var v=0;v0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){Pt[0]=Pt[1]=Lt[0]=Lt[1]=Number.MAX_VALUE,Ut[0]=Ut[1]=xt[0]=xt[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,a=0,n=0,o;for(o=0;oi||Nt(m)>a||l===e-1)&&(_=Math.sqrt(y*y+m*m),n=d,o=g);break}case B.C:{var w=t[l++],S=t[l++],d=t[l++],g=t[l++],b=t[l++],T=t[l++];_=zh(n,o,w,S,d,g,b,T,10),n=b,o=T;break}case B.Q:{var w=t[l++],S=t[l++],d=t[l++],g=t[l++];_=Gh(n,o,w,S,d,g,10),n=d,o=g;break}case B.A:var C=t[l++],M=t[l++],P=t[l++],L=t[l++],R=t[l++],A=t[l++],x=A+R;l+=1,p&&(s=hr(R)*P+C,f=ur(R)*L+M),_=la(P,L)*va(qt,Math.abs(A)),n=hr(x)*P+C,o=ur(x)*L+M;break;case B.R:{s=n=t[l++],f=o=t[l++];var E=t[l++],D=t[l++];_=E*2+D*2;break}case B.Z:{var y=s-n,m=f-o;_=Math.sqrt(y*y+m*m),n=s,o=f;break}}_>=0&&(h[v++]=_,u+=_)}return this._pathLen=u,u},r.prototype.rebuildPath=function(t,e){var i=this.data,a=this._ux,n=this._uy,o=this._len,s,f,h,u,v,l,c=e<1,p,_,d=0,g=0,y,m=0,w,S;if(!(c&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,_=this._pathLen,y=e*_,!y)))t:for(var b=0;b0&&(t.lineTo(w,S),m=0),T){case B.M:s=h=i[b++],f=u=i[b++],t.moveTo(h,u);break;case B.L:{v=i[b++],l=i[b++];var M=Nt(v-h),P=Nt(l-u);if(M>a||P>n){if(c){var L=p[g++];if(d+L>y){var R=(y-d)/L;t.lineTo(h*(1-R)+v*R,u*(1-R)+l*R);break t}d+=L}t.lineTo(v,l),h=v,u=l,m=0}else{var A=M*M+P*P;A>m&&(w=v,S=l,m=A)}break}case B.C:{var x=i[b++],E=i[b++],D=i[b++],F=i[b++],H=i[b++],j=i[b++];if(c){var L=p[g++];if(d+L>y){var R=(y-d)/L;Jt(h,x,D,H,R,sr),Jt(u,E,F,j,R,fr),t.bezierCurveTo(sr[1],fr[1],sr[2],fr[2],sr[3],fr[3]);break t}d+=L}t.bezierCurveTo(x,E,D,F,H,j),h=H,u=j;break}case B.Q:{var x=i[b++],E=i[b++],D=i[b++],F=i[b++];if(c){var L=p[g++];if(d+L>y){var R=(y-d)/L;vi(h,x,D,R,sr),vi(u,E,F,R,fr),t.quadraticCurveTo(sr[1],fr[1],sr[2],fr[2]);break t}d+=L}t.quadraticCurveTo(x,E,D,F),h=D,u=F;break}case B.A:var V=i[b++],W=i[b++],Y=i[b++],et=i[b++],tt=i[b++],dt=i[b++],Bt=i[b++],Ht=!i[b++],pt=Y>et?Y:et,Q=Nt(Y-et)>.001,q=tt+dt,I=!1;if(c){var L=p[g++];d+L>y&&(q=tt+dt*(y-d)/L,I=!0),d+=L}if(Q&&t.ellipse?t.ellipse(V,W,Y,et,Bt,tt,q,Ht):t.arc(V,W,pt,tt,q,Ht),I)break t;C&&(s=hr(tt)*Y+V,f=ur(tt)*et+W),h=hr(q)*Y+V,u=ur(q)*et+W;break;case B.R:s=h=i[b],f=u=i[b+1],v=i[b++],l=i[b++];var O=i[b++],zt=i[b++];if(c){var L=p[g++];if(d+L>y){var st=y-d;t.moveTo(v,l),t.lineTo(v+va(st,O),l),st-=O,st>0&&t.lineTo(v+O,l+va(st,zt)),st-=zt,st>0&&t.lineTo(v+la(O-st,0),l+zt),st-=O,st>0&&t.lineTo(v,l+la(zt-st,0));break t}d+=L}t.rect(v,l,O,zt);break;case B.Z:if(c){var L=p[g++];if(d+L>y){var R=(y-d)/L;t.lineTo(h*(1-R)+s*R,u*(1-R)+f*R);break t}d+=L}t.closePath(),h=s,u=f}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.CMD=B,r.initDefaultProps=function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),r}();function Dr(r,t,e,i,a,n,o){if(a===0)return!1;var s=a,f=0,h=r;if(o>t+s&&o>i+s||or+s&&n>e+s||nt+v&&u>i+v&&u>n+v&&u>s+v||ur+v&&h>e+v&&h>a+v&&h>o+v||ht+h&&f>i+h&&f>n+h||fr+h&&s>e+h&&s>a+h||se||u+ha&&(a+=oe);var l=Math.atan2(f,s);return l<0&&(l+=oe),l>=i&&l<=a||l+oe>=i&&l+oe<=a}function Gt(r,t,e,i,a,n){if(n>t&&n>i||na?s:0}var Wt=jt.CMD,vr=Math.PI*2,Zu=1e-4;function Ku(r,t){return Math.abs(r-t)t&&h>i&&h>n&&h>s||h1&&Qu(),c=rt(t,i,n,s,yt[0]),l>1&&(p=rt(t,i,n,s,yt[1]))),l===2?dt&&s>i&&s>n||s=0&&h<=1){for(var u=0,v=at(t,i,n,h),l=0;le||s<-e)return 0;var f=Math.sqrt(e*e-s*s);ot[0]=-f,ot[1]=f;var h=Math.abs(i-a);if(h<1e-4)return 0;if(h>=vr-1e-4){i=0,a=vr;var u=n?1:-1;return o>=ot[0]+r&&o<=ot[1]+r?u:0}if(i>a){var v=i;i=a,a=v}i<0&&(i+=vr,a+=vr);for(var l=0,c=0;c<2;c++){var p=ot[c];if(p+r>o){var _=Math.atan2(s,p),u=n?1:-1;_<0&&(_=vr+_),(_>=i&&_<=a||_+vr>=i&&_+vr<=a)&&(_>Math.PI/2&&_1&&(e||(s+=Gt(f,h,u,v,i,a))),d&&(f=n[p],h=n[p+1],u=f,v=h),_){case Wt.M:u=n[p++],v=n[p++],f=u,h=v;break;case Wt.L:if(e){if(Dr(f,h,n[p],n[p+1],t,i,a))return!0}else s+=Gt(f,h,n[p],n[p+1],i,a)||0;f=n[p++],h=n[p++];break;case Wt.C:if(e){if(qu(f,h,n[p++],n[p++],n[p++],n[p++],n[p],n[p+1],t,i,a))return!0}else s+=Ju(f,h,n[p++],n[p++],n[p++],n[p++],n[p],n[p+1],i,a)||0;f=n[p++],h=n[p++];break;case Wt.Q:if(e){if($u(f,h,n[p++],n[p++],n[p],n[p+1],t,i,a))return!0}else s+=ju(f,h,n[p++],n[p++],n[p],n[p+1],i,a)||0;f=n[p++],h=n[p++];break;case Wt.A:var g=n[p++],y=n[p++],m=n[p++],w=n[p++],S=n[p++],b=n[p++];p+=1;var T=!!(1-n[p++]);l=Math.cos(S)*m+g,c=Math.sin(S)*w+y,d?(u=l,v=c):s+=Gt(f,h,l,c,i,a);var C=(i-g)*w/m+g;if(e){if(Vu(g,y,w,S,S+b,T,t,C,a))return!0}else s+=tv(g,y,w,S,S+b,T,C,a);f=Math.cos(S+b)*m+g,h=Math.sin(S+b)*w+y;break;case Wt.R:u=f=n[p++],v=h=n[p++];var M=n[p++],P=n[p++];if(l=u+M,c=v+P,e){if(Dr(u,v,l,v,t,i,a)||Dr(l,v,l,c,t,i,a)||Dr(l,c,u,c,t,i,a)||Dr(u,c,u,v,t,i,a))return!0}else s+=Gt(l,v,l,c,i,a),s+=Gt(u,c,u,v,i,a);break;case Wt.Z:if(e){if(Dr(f,h,u,v,t,i,a))return!0}else s+=Gt(f,h,u,v,i,a);f=u,h=v;break}}return!e&&!Ku(h,v)&&(s+=Gt(f,h,u,v,i,a)||0),s!==0}function rv(r,t,e){return Js(r,0,!1,t,e)}function ev(r,t,e,i){return Js(r,t,!0,e,i)}var pi=wt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Mr),iv={style:wt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Fi.style)},pa=be.concat(["invisible","culling","z","z2","zlevel","parent"]),K=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var a=this._decalEl=this._decalEl||new t;a.buildPath===t.prototype.buildPath&&(a.buildPath=function(f){e.buildPath(f,e.shape)}),a.silent=!0;var n=a.style;for(var o in i)n[o]!==i[o]&&(n[o]=i[o]);n.fill=i.fill?i.decal:null,n.decal=null,n.shadowColor=null,i.strokeFirst&&(n.stroke=null);for(var s=0;s.5?Ga:i>.2?gu:Xa}else if(e)return Xa}return Ga},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(kt(i)){var a=this.__zr,n=!!(a&&a.isDarkMode()),o=li(e,0)0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,a=!e;if(a){var n=!1;this.path||(n=!0,this.createPathProxy());var o=this.path;(n||this.__dirty&fe)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||a){s.copy(e);var f=i.strokeNoScale?this.getLineScale():1,h=i.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;h=Math.max(h,u??4)}f>1e-10&&(s.width+=h/f,s.height+=h/f,s.x-=h/f/2,s.y-=h/f/2)}return s}return e},t.prototype.contain=function(e,i){var a=this.transformCoordToLocal(e,i),n=this.getBoundingRect(),o=this.style;if(e=a[0],i=a[1],n.contain(e,i)){var s=this.path;if(this.hasStroke()){var f=o.lineWidth,h=o.strokeNoScale?this.getLineScale():1;if(h>1e-10&&(this.hasFill()||(f=Math.max(f,this.strokeContainThreshold)),ev(s,f/h,e,i)))return!0}if(this.hasFill())return rv(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=fe,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var a=this.shape;return a||(a=this.shape={}),typeof e=="string"?a[e]=i:z(a,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&fe)},t.prototype.createStyle=function(e){return xi(pi,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=z({},this.shape))},t.prototype._applyStateObj=function(e,i,a,n,o,s){r.prototype._applyStateObj.call(this,e,i,a,n,o,s);var f=!(i&&n),h;if(i&&i.shape?o?n?h=i.shape:(h=z({},a.shape),z(h,i.shape)):(h=z({},n?this.shape:a.shape),z(h,i.shape)):f&&(h=a.shape),h)if(o){this.shape=z({},this.shape);for(var u={},v=G(h),l=0;l0},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(e){return xi(av,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var i=e.text;i!=null?i+="":i="";var a=yu(i,e.font,e.textAlign,e.textBaseline);if(a.x+=e.x||0,a.y+=e.y||0,this.hasStroke()){var n=e.lineWidth;a.x-=n/2,a.y-=n/2,a.width+=n,a.height+=n}this._rect=a}return this._rect},t.initDefaultProps=function(){var e=t.prototype;e.dirtyRectTolerance=10}(),t}(Ae);Zr.prototype.type="tspan";var nv=wt({x:0,y:0},Mr),ov={style:wt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Fi.style)};function sv(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var jr=function(r){N(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return xi(nv,e)},t.prototype._getSize=function(e){var i=this.style,a=i[e];if(a!=null)return a;var n=sv(i.image)?i.image:this.__image;if(!n)return 0;var o=e==="width"?"height":"width",s=i[o];return s==null?n[e]:n[e]/n[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return ov},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||(this._rect=new U(e.x||0,e.y||0,this.getWidth(),this.getHeight())),this._rect},t}(Ae);jr.prototype.type="image";function fv(r,t){var e=t.x,i=t.y,a=t.width,n=t.height,o=t.r,s,f,h,u;a<0&&(e=e+a,a=-a),n<0&&(i=i+n,n=-n),typeof o=="number"?s=f=h=u=o:o instanceof Array?o.length===1?s=f=h=u=o[0]:o.length===2?(s=h=o[0],f=u=o[1]):o.length===3?(s=o[0],f=u=o[1],h=o[2]):(s=o[0],f=o[1],h=o[2],u=o[3]):s=f=h=u=0;var v;s+f>a&&(v=s+f,s*=a/v,f*=a/v),h+u>a&&(v=h+u,h*=a/v,u*=a/v),f+h>n&&(v=f+h,f*=n/v,h*=n/v),s+u>n&&(v=s+u,s*=n/v,u*=n/v),r.moveTo(e+s,i),r.lineTo(e+a-f,i),f!==0&&r.arc(e+a-f,i+f,f,-Math.PI/2,0),r.lineTo(e+a,i+n-h),h!==0&&r.arc(e+a-h,i+n-h,h,0,Math.PI/2),r.lineTo(e+u,i+n),u!==0&&r.arc(e+u,i+n-u,u,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var Gr=Math.round;function hv(r,t,e){if(t){var i=t.x1,a=t.x2,n=t.y1,o=t.y2;r.x1=i,r.x2=a,r.y1=n,r.y2=o;var s=e&&e.lineWidth;return s&&(Gr(i*2)===Gr(a*2)&&(r.x1=r.x2=Xr(i,s,!0)),Gr(n*2)===Gr(o*2)&&(r.y1=r.y2=Xr(n,s,!0))),r}}function uv(r,t,e){if(t){var i=t.x,a=t.y,n=t.width,o=t.height;r.x=i,r.y=a,r.width=n,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=Xr(i,s,!0),r.y=Xr(a,s,!0),r.width=Math.max(Xr(i+n,s,!1)-r.x,n===0?0:1),r.height=Math.max(Xr(a+o,s,!1)-r.y,o===0?0:1)),r}}function Xr(r,t,e){if(!t)return r;var i=Gr(r*2);return(i+Gr(t))%2===0?i/2:(i+(e?1:-1))/2}var vv=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),lv={},Ce=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new vv},t.prototype.buildPath=function(e,i){var a,n,o,s;if(this.subPixelOptimize){var f=uv(lv,i,this.style);a=f.x,n=f.y,o=f.width,s=f.height,f.r=i.r,i=f}else a=i.x,n=i.y,o=i.width,s=i.height;i.r?fv(e,i):e.rect(a,n,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(K);Ce.prototype.type="rect";var fo={fill:"#000"},ho=2,cv={style:wt({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},Fi.style)},dv=function(r){N(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=fo,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,R=e.width!=null&&(e.overflow==="truncate"||e.overflow==="break"||e.overflow==="breakAll"),A=o.calculatedLineHeight,x=0;x=0&&(x=b[A],x.align==="right");)this._placeToken(x,e,C,g,R,"right",m),M-=x.width,R-=x.width,A--;for(L+=(n-(L-d)-(y-R)-M)/2;P<=A;)x=b[P],this._placeToken(x,e,C,g,L+x.width/2,"center",m),L+=x.width,P++;g+=C}},t.prototype._placeToken=function(e,i,a,n,o,s,f){var h=i.rich[e.styleName]||{};h.text=e.text;var u=e.verticalAlign,v=n+a/2;u==="top"?v=n+e.height/2:u==="bottom"&&(v=n+a-e.height/2);var l=!e.isLineHolder&&ga(h);l&&this._renderBackground(h,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,v-e.height/2,e.width,e.height);var c=!!h.backgroundColor,p=e.textPadding;p&&(o=go(o,s,p),v-=e.height/2-p[0]-e.innerHeight/2);var _=this._getOrCreateChild(Zr),d=_.createStyle();_.useStyle(d);var g=this._defaultStyle,y=!1,m=0,w=po("fill"in h?h.fill:"fill"in i?i.fill:(y=!0,g.fill)),S=co("stroke"in h?h.stroke:"stroke"in i?i.stroke:!c&&!f&&(!g.autoStroke||y)?(m=ho,g.stroke):null),b=h.textShadowBlur>0||i.textShadowBlur>0;d.text=e.text,d.x=o,d.y=v,b&&(d.shadowBlur=h.textShadowBlur||i.textShadowBlur||0,d.shadowColor=h.textShadowColor||i.textShadowColor||"transparent",d.shadowOffsetX=h.textShadowOffsetX||i.textShadowOffsetX||0,d.shadowOffsetY=h.textShadowOffsetY||i.textShadowOffsetY||0),d.textAlign=s,d.textBaseline="middle",d.font=e.font||Qt,d.opacity=ri(h.opacity,i.opacity,1),vo(d,h),S&&(d.lineWidth=ri(h.lineWidth,i.lineWidth,m),d.lineDash=$(h.lineDash,i.lineDash),d.lineDashOffset=i.lineDashOffset||0,d.stroke=S),w&&(d.fill=w);var T=e.contentWidth,C=e.contentHeight;_.setBoundingRect(new U(ue(d.x,T,d.textAlign),Or(d.y,C,d.textBaseline),T,C))},t.prototype._renderBackground=function(e,i,a,n,o,s){var f=e.backgroundColor,h=e.borderWidth,u=e.borderColor,v=f&&f.image,l=f&&!v,c=e.borderRadius,p=this,_,d;if(l||e.lineHeight||h&&u){_=this._getOrCreateChild(Ce),_.useStyle(_.createStyle()),_.style.fill=null;var g=_.shape;g.x=a,g.y=n,g.width=o,g.height=s,g.r=c,_.dirtyShape()}if(l){var y=_.style;y.fill=f||null,y.fillOpacity=$(e.fillOpacity,1)}else if(v){d=this._getOrCreateChild(jr),d.onload=function(){p.dirtyStyle()};var m=d.style;m.image=f.image,m.x=a,m.y=n,m.width=o,m.height=s}if(h&&u){var y=_.style;y.lineWidth=h,y.stroke=u,y.strokeOpacity=$(e.strokeOpacity,1),y.lineDash=e.borderDash,y.lineDashOffset=e.borderDashOffset||0,_.strokeContainThreshold=0,_.hasFill()&&_.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var w=(_||d).style;w.shadowBlur=e.shadowBlur||0,w.shadowColor=e.shadowColor||"transparent",w.shadowOffsetX=e.shadowOffsetX||0,w.shadowOffsetY=e.shadowOffsetY||0,w.opacity=ri(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return tf(e)&&(i=[e.fontStyle,e.fontWeight,js(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&Hr(i)||e.textFont||e.font},t}(Ae),pv={left:!0,right:1,center:1},gv={top:1,bottom:1,middle:1},uo=["fontStyle","fontWeight","fontSize","fontFamily"];function js(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?on+"px":r+"px"}function vo(r,t){for(var e=0;e1&&(o*=_a(p),s*=_a(p));var _=(a===n?-1:1)*_a((o*o*(s*s)-o*o*(c*c)-s*s*(l*l))/(o*o*(c*c)+s*s*(l*l)))||0,d=_*o*c/s,g=_*-s*l/o,y=(r+e)/2+Ze(v)*d-Ve(v)*g,m=(t+i)/2+Ve(v)*d+Ze(v)*g,w=wo([1,0],[(l-d)/o,(c-g)/s]),S=[(l-d)/o,(c-g)/s],b=[(-1*l-d)/o,(-1*c-g)/s],T=wo(S,b);if(Va(S,b)<=-1&&(T=se),Va(S,b)>=1&&(T=0),T<0){var C=Math.round(T/se*1e6)/1e6;T=se*2+C%2*se}u.addData(h,y,m,o,s,w,T,v,n)}var wv=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Tv=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function bv(r){var t=new jt;if(!r)return t;var e=0,i=0,a=e,n=i,o,s=jt.CMD,f=r.match(wv);if(!f)return t;for(var h=0;hx*x+E*E&&(C=P,M=L),{cx:C,cy:M,x0:-u,y0:-v,x1:C*(a/S-1),y1:M*(a/S-1)}}function xv(r){var t;if(Vr(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function Rv(r,t){var e,i=ve(t.r,0),a=ve(t.r0||0,0),n=i>0,o=a>0;if(!(!n&&!o)){if(n||(i=a,a=0),a>i){var s=i;i=a,a=s}var f=t.startAngle,h=t.endAngle;if(!(isNaN(f)||isNaN(h))){var u=t.cx,v=t.cy,l=!!t.clockwise,c=bo(h-f),p=c>ya&&c%ya;if(p>Tt&&(c=p),!(i>Tt))r.moveTo(u,v);else if(c>ya-Tt)r.moveTo(u+i*Er(f),v+i*lr(f)),r.arc(u,v,i,f,h,!l),a>Tt&&(r.moveTo(u+a*Er(h),v+a*lr(h)),r.arc(u,v,a,h,f,l));else{var _=void 0,d=void 0,g=void 0,y=void 0,m=void 0,w=void 0,S=void 0,b=void 0,T=void 0,C=void 0,M=void 0,P=void 0,L=void 0,R=void 0,A=void 0,x=void 0,E=i*Er(f),D=i*lr(f),F=a*Er(h),H=a*lr(h),j=c>Tt;if(j){var V=t.cornerRadius;V&&(e=xv(V),_=e[0],d=e[1],g=e[2],y=e[3]);var W=bo(i-a)/2;if(m=Rt(W,g),w=Rt(W,y),S=Rt(W,_),b=Rt(W,d),M=T=ve(m,w),P=C=ve(S,b),(T>Tt||C>Tt)&&(L=i*Er(h),R=i*lr(h),A=a*Er(f),x=a*lr(f),cTt){var Q=Rt(g,M),q=Rt(y,M),I=Ke(A,x,E,D,i,Q,l),O=Ke(L,R,F,H,i,q,l);r.moveTo(u+I.cx+I.x0,v+I.cy+I.y0),M0&&r.arc(u+I.cx,v+I.cy,Q,it(I.y0,I.x0),it(I.y1,I.x1),!l),r.arc(u,v,i,it(I.cy+I.y1,I.cx+I.x1),it(O.cy+O.y1,O.cx+O.x1),!l),q>0&&r.arc(u+O.cx,v+O.cy,q,it(O.y1,O.x1),it(O.y0,O.x0),!l))}else r.moveTo(u+E,v+D),r.arc(u,v,i,f,h,!l);if(!(a>Tt)||!j)r.lineTo(u+F,v+H);else if(P>Tt){var Q=Rt(_,P),q=Rt(d,P),I=Ke(F,H,L,R,a,-q,l),O=Ke(E,D,A,x,a,-Q,l);r.lineTo(u+I.cx+I.x0,v+I.cy+I.y0),P0&&r.arc(u+I.cx,v+I.cy,q,it(I.y0,I.x0),it(I.y1,I.x1),!l),r.arc(u,v,a,it(I.cy+I.y1,I.cx+I.x1),it(O.cy+O.y1,O.cx+O.x1),l),Q>0&&r.arc(u+O.cx,v+O.cy,Q,it(O.y1,O.x1),it(O.y0,O.x0),!l))}else r.lineTo(u+F,v+H),r.arc(u,v,a,h,f,l)}r.closePath()}}}var Av=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),Za=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Av},t.prototype.buildPath=function(e,i){Rv(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(K);Za.prototype.type="sector";var Dv=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),Iv=function(r){N(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Dv},t.prototype.buildPath=function(e,i){var a=i.cx,n=i.cy,o=Math.PI*2;e.moveTo(a+i.r,n),e.arc(a,n,i.r,0,o,!1),e.moveTo(a+i.r0,n),e.arc(a,n,i.r0,0,o,!0)},t}(K);Iv.prototype.type="ring";function Ev(r,t,e,i){var a=[],n=[],o=[],s=[],f,h,u,v;if(i){u=[1/0,1/0],v=[-1/0,-1/0];for(var l=0,c=r.length;l=2){if(i){var n=Ev(a,i,e,t.smoothConstraint);r.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(e?o:o-1);s++){var f=n[s*2],h=n[s*2+1],u=a[(s+1)%o];r.bezierCurveTo(f[0],f[1],h[0],h[1],u[0],u[1])}}else{r.moveTo(a[0][0],a[0][1]);for(var s=1,v=a.length;sdr[1]){if(s=!1,n)return s;var u=Math.abs(dr[0]-cr[1]),v=Math.abs(cr[0]-dr[1]);Math.min(u,v)>a.len()&&(u=0&&wr(f)?f:.5;var h=r.createRadialGradient(o,s,0,o,s,f);return h}function Ka(r,t,e){for(var i=t.type==="radial"?Zv(r,t,e):Vv(r,t,e),a=t.colorStops,n=0;n0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:ce(r)?[r]:Vr(r)?r:null}function _n(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&Qv(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var a=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;a&&a!==1&&(e=Z(e,function(n){return n/a}),i/=a)}return[e,i]}var Jv=new jt(!0);function gi(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function Co(r){return typeof r=="string"&&r!=="none"}function _i(r){var t=r.fill;return t!=null&&t!=="none"}function Mo(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Po(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function Qa(r,t,e){var i=pn(t.image,t.__image,e);if(Ei(i)){var a=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var n=new DOMMatrix;n.translateSelf(t.x||0,t.y||0),n.rotateSelf(0,0,(t.rotation||0)*ei),n.scaleSelf(t.scaleX||1,t.scaleY||1),a.setTransform(n)}return a}}function jv(r,t,e,i){var a,n=gi(e),o=_i(e),s=e.strokePercent,f=s<1,h=!t.path;(!t.silent||f)&&h&&t.createPathProxy();var u=t.path||Jv,v=t.__dirty;if(!i){var l=e.fill,c=e.stroke,p=o&&!!l.colorStops,_=n&&!!c.colorStops,d=o&&!!l.image,g=n&&!!c.image,y=void 0,m=void 0,w=void 0,S=void 0,b=void 0;(p||_)&&(b=t.getBoundingRect()),p&&(y=v?Ka(r,l,b):t.__canvasFillGradient,t.__canvasFillGradient=y),_&&(m=v?Ka(r,c,b):t.__canvasStrokeGradient,t.__canvasStrokeGradient=m),d&&(w=v||!t.__canvasFillPattern?Qa(r,l,t):t.__canvasFillPattern,t.__canvasFillPattern=w),g&&(S=v||!t.__canvasStrokePattern?Qa(r,c,t):t.__canvasStrokePattern,t.__canvasStrokePattern=w),p?r.fillStyle=y:d&&(w?r.fillStyle=w:o=!1),_?r.strokeStyle=m:g&&(S?r.strokeStyle=S:n=!1)}var T=t.getGlobalScale();u.setScale(T[0],T[1],t.segmentIgnoreThreshold);var C,M;r.setLineDash&&e.lineDash&&(a=_n(t),C=a[0],M=a[1]);var P=!0;(h||v&fe)&&(u.setDPR(r.dpr),f?u.setContext(null):(u.setContext(r),P=!1),u.reset(),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),P&&u.rebuildPath(r,f?s:1),C&&(r.setLineDash(C),r.lineDashOffset=M),i||(e.strokeFirst?(n&&Po(r,e),o&&Mo(r,e)):(o&&Mo(r,e),n&&Po(r,e))),C&&r.setLineDash([])}function tl(r,t,e){var i=t.__image=pn(e.image,t.__image,t,t.onload);if(!(!i||!Ei(i))){var a=e.x||0,n=e.y||0,o=t.getWidth(),s=t.getHeight(),f=i.width/i.height;if(o==null&&s!=null?o=s*f:s==null&&o!=null?s=o/f:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var h=e.sx||0,u=e.sy||0;r.drawImage(i,h,u,e.sWidth,e.sHeight,a,n,o,s)}else if(e.sx&&e.sy){var h=e.sx,u=e.sy,v=o-h,l=s-u;r.drawImage(i,h,u,v,l,a,n,o,s)}else r.drawImage(i,a,n,o,s)}}function rl(r,t,e){var i,a=e.text;if(a!=null&&(a+=""),a){r.font=e.font||Qt,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var n=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=_n(t),n=i[0],o=i[1]),n&&(r.setLineDash(n),r.lineDashOffset=o),e.strokeFirst?(gi(e)&&r.strokeText(a,e.x,e.y),_i(e)&&r.fillText(a,e.x,e.y)):(_i(e)&&r.fillText(a,e.x,e.y),gi(e)&&r.strokeText(a,e.x,e.y)),n&&r.setLineDash([])}}var Lo=["shadowBlur","shadowOffsetX","shadowOffsetY"],xo=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function df(r,t,e,i,a){var n=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){vt(r,a),n=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?Mr.opacity:o}(i||t.blend!==e.blend)&&(n||(vt(r,a),n=!0),r.globalCompositeOperation=t.blend||Mr.blend);for(var s=0;s=pr:-h>=pr),c=h>0?h%pr:h%pr+pr,p=!1;l?p=!0:Zt(v)?p=!1:p=c>=gf==!!u;var _=t+i*wa(o),d=e+a*ma(o);this._start&&this._add("M",_,d);var g=Math.round(n*hl);if(l){var y=1/this._p,m=(u?1:-1)*(pr-y);this._add("A",i,a,g,1,+u,t+i*wa(o+m),e+a*ma(o+m)),y>.01&&this._add("A",i,a,g,0,+u,_,d)}else{var w=t+i*wa(s),S=e+a*ma(s);this._add("A",i,a,g,+p,+u,w,S)}},r.prototype.rect=function(t,e,i,a){this._add("M",t,e),this._add("l",i,0),this._add("l",0,a),this._add("l",-i,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(t,e,i,a,n,o,s,f,h){for(var u=[],v=this._p,l=1;l"}function yl(r){return""}function mn(r,t){t=t||{};var e=t.newline?` `:"";function i(a){var n=a.children,o=a.tag,s=a.attrs,f=a.text;return _l(o,s)+(o!=="style"?_h(f):f||"")+(n?""+e+Z(n,function(h){return i(h)}).join(e)+e:"")+yl(o)}return i(r)}function ml(r,t,e){e=e||{};var i=e.newline?` `:"",a=" {"+i,n=i+"}",o=Z(G(r),function(f){return f+a+Z(G(r[f]),function(h){return h+":"+r[f][h]+";"}).join(i)+n}).join(i),s=Z(G(t),function(f){return"@keyframes "+f+a+Z(G(t[f]),function(h){return h+a+Z(G(t[f][h]),function(u){var v=t[f][h][u];return u==="d"&&(v='path("'+v+'")'),u+":"+v+";"}).join(i)+n}).join(i)+n}).join(i);return!o&&!s?"":[""].join(i)}function ja(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function ko(r,t,e,i){return J("svg","root",{width:r,height:t,xmlns:yf,"xmlns:xlink":mf,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+r+" "+t:!1},e)}var wl=0;function Tf(){return wl++}var Bo={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"},_r="transform-origin";function Tl(r,t,e){var i=z({},r.shape);z(i,t),r.buildPath(e,i);var a=new _f;return a.reset(Ns(r)),e.rebuildPath(a,1),a.generateStr(),a.getStr()}function bl(r,t){var e=t.originX,i=t.originY;(e||i)&&(r[_r]=e+"px "+i+"px")}var Sl={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function bf(r,t){var e=t.zrId+"-ani-"+t.cssAnimIdx++;return t.cssAnims[e]=r,e}function Cl(r,t,e){var i=r.shape.paths,a={},n,o;if(nt(i,function(f){var h=ja(e.zrId);h.animation=!0,Oi(f,{},h,!0);var u=h.cssAnims,v=h.cssNodes,l=G(u),c=l.length;if(c){o=l[c-1];var p=u[o];for(var _ in p){var d=p[_];a[_]=a[_]||{d:""},a[_].d+=d.d||""}for(var g in v){var y=v[g].animation;y.indexOf(o)>=0&&(n=y)}}}),!!n){t.d=!1;var s=bf(a,e);return n.replace(o,s)}}function Ho(r){return kt(r)?Bo[r]?"cubic-bezier("+Bo[r]+")":vn(r)?r:"":""}function Oi(r,t,e,i){var a=r.animators,n=a.length,o=[];if(r instanceof Gv){var s=Cl(r,t,e);if(s)o.push(s);else if(!n)return}else if(!n)return;for(var f={},h=0;h0}).length){var Ht=bf(T,e);return Ht+" "+y[0]+" both"}}for(var d in f){var s=_(f[d]);s&&o.push(s)}if(o.length){var g=e.zrId+"-cls-"+Tf();e.cssNodes["."+g]={animation:o.join(",")},t.class=g}}function Ml(r,t,e){if(!r.ignore)if(r.isSilent()){var i={"pointer-events":"none"};zo(i,t,e)}else{var a=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},n=a.fill;if(!n){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,f=r.currentStates.indexOf("select")>=0&&s||o;f&&(n=Vh(f))}var h=a.lineWidth;if(h){var u=!a.strokeNoScale&&r.transform?r.transform[0]:1;h=h/u}var i={cursor:"pointer"};n&&(i.fill=n),a.stroke&&(i.stroke=a.stroke),h&&(i["stroke-width"]=h),zo(i,t,e)}}function zo(r,t,e,i){var a=JSON.stringify(r),n=e.cssStyleCache[a];n||(n=e.zrId+"-cls-"+Tf(),e.cssStyleCache[a]=n,e.cssNodes["."+n+":hover"]=r),t.class=t.class?t.class+" "+n:n}var Pe=Math.round;function Sf(r){return r&&kt(r.src)}function Cf(r){return r&&xe(r.toDataURL)}function wn(r,t,e,i){dl(function(a,n){var o=a==="fill"||a==="stroke";o&&zs(n)?Pf(t,r,a,i):o&&ln(n)?Lf(e,r,a,i):r[a]=n,o&&i.ssr&&n==="none"&&(r["pointer-events"]="visible")},t,e,!1),Il(e,r,i)}function Tn(r,t){var e=Ru(t);e&&(e.each(function(i,a){i!=null&&(r[(Oo+a).toLowerCase()]=i+"")}),t.isSilent()&&(r[Oo+"silent"]="true"))}function No(r){return Zt(r[0]-1)&&Zt(r[1])&&Zt(r[2])&&Zt(r[3]-1)}function Pl(r){return Zt(r[4])&&Zt(r[5])}function bn(r,t,e){if(t&&!(Pl(t)&&No(t))){var i=1e4;r.transform=No(t)?"translate("+Pe(t[4]*i)/i+" "+Pe(t[5]*i)/i+")":Kh(t)}}function Yo(r,t,e){for(var i=r.points,a=[],n=0;n"u"){var d="Image width/height must been given explictly in svg-ssr renderer.";Rn(l,d),Rn(c,d)}else if(l==null||c==null){var g=function(P,L){if(P){var R=P.elm,A=l||L.width,x=c||L.height;P.tag==="pattern"&&(h?(x=1,A/=n.width):u&&(A=1,x/=n.height)),P.attrs.width=A,P.attrs.height=x,R&&(R.setAttribute("width",A),R.setAttribute("height",x))}},y=pn(p,null,r,function(P){f||g(b,P),g(v,P)});y&&y.width&&y.height&&(l=l||y.width,c=c||y.height)}v=J("image","img",{href:p,width:l,height:c}),o.width=l,o.height=c}else a.svgElement&&(v=Pr(a.svgElement),o.width=a.svgWidth,o.height=a.svgHeight);if(v){var m,w;f?m=w=1:h?(w=1,m=o.width/n.width):u?(m=1,w=o.height/n.height):o.patternUnits="userSpaceOnUse",m!=null&&!isNaN(m)&&(o.width=m),w!=null&&!isNaN(w)&&(o.height=w);var S=Ys(a);S&&(o.patternTransform=S);var b=J("pattern","",o,[v]),T=mn(b),C=i.patternCache,M=C[T];M||(M=i.zrId+"-p"+i.patternIdx++,C[T]=M,o.id=M,b=i.defs[M]=J("pattern",M,o,[v])),t[e]=Ai(M)}}function El(r,t,e){var i=e.clipPathCache,a=e.defs,n=i[r.id];if(!n){n=e.zrId+"-c"+e.clipPathIdx++;var o={id:n};i[r.id]=n,a[n]=J("clipPath",n,o,[Mf(r,e)])}t["clip-path"]=Ai(n)}function Uo(r){return document.createTextNode(r)}function mr(r,t,e){r.insertBefore(t,e)}function Wo(r,t){r.removeChild(t)}function qo(r,t){r.appendChild(t)}function xf(r){return r.parentNode}function Rf(r){return r.nextSibling}function Ta(r,t){r.textContent=t}var $o=58,Fl=120,Ol=J("","");function tn(r){return r===void 0}function Dt(r){return r!==void 0}function kl(r,t,e){for(var i={},a=t;a<=e;++a){var n=r[a].key;n!==void 0&&(i[n]=a)}return i}function le(r,t){var e=r.key===t.key,i=r.tag===t.tag;return i&&e}function Le(r){var t,e=r.children,i=r.tag;if(Dt(i)){var a=r.elm=wf(i);if(Sn(Ol,r),Vr(e))for(t=0;tn?(p=e[f+1]==null?null:e[f+1].elm,Af(r,p,e,a,f)):yi(r,t,i,n))}function kr(r,t){var e=t.elm=r.elm,i=r.children,a=t.children;r!==t&&(Sn(r,t),tn(t.text)?Dt(i)&&Dt(a)?i!==a&&Bl(e,i,a):Dt(a)?(Dt(r.text)&&Ta(e,""),Af(e,null,a,0,a.length-1)):Dt(i)?yi(e,i,0,i.length-1):Dt(r.text)&&Ta(e,""):r.text!==t.text&&(Dt(i)&&yi(e,i,0,i.length-1),Ta(e,t.text)))}function Hl(r,t){if(le(r,t))kr(r,t);else{var e=r.elm,i=xf(e);Le(t),i!==null&&(mr(i,t.elm,Rf(e)),yi(i,[r],0,0))}return t}var zl=0,Wc=function(){function r(t,e,i){if(this.type="svg",this.refreshHover=Vo(),this.configLayer=Vo(),this.storage=e,this._opts=i=z({},i),this.root=t,this._id="zr"+zl++,this._oldVNode=ko(i.width,i.height),t&&!i.ssr){var a=this._viewport=document.createElement("div");a.style.cssText="position:relative;overflow:hidden";var n=this._svgDom=this._oldVNode.elm=wf("svg");Sn(null,this._oldVNode),a.appendChild(n),t.appendChild(a)}this.resize(i.width,i.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",Hl(this._oldVNode,t),this._oldVNode=t}},r.prototype.renderOneToVNode=function(t){return Xo(t,ja(this._id))},r.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),i=this._width,a=this._height,n=ja(this._id);n.animation=t.animation,n.willUpdate=t.willUpdate,n.compress=t.compress,n.emphasis=t.emphasis,n.ssr=this._opts.ssr;var o=[],s=this._bgVNode=Nl(i,a,this._backgroundColor,n);s&&o.push(s);var f=t.compress?null:this._mainVNode=J("g","main",{},[]);this._paintList(e,n,f?f.children:o),f&&o.push(f);var h=Z(G(n.defs),function(l){return n.defs[l]});if(h.length&&o.push(J("defs","defs",{},h)),t.animation){var u=ml(n.cssNodes,n.cssAnims,{newline:!0});if(u){var v=J("style","stl",{},[],u);o.push(v)}}return ko(i,a,o,t.useViewBox)},r.prototype.renderToString=function(t){return t=t||{},mn(this.renderToVNode({animation:$(t.cssAnimation,!0),emphasis:$(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:$(t.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(t,e,i){for(var a=t.length,n=[],o=0,s,f,h=0,u=0;u=0&&!(l&&f&&l[_]===f[_]);_--);for(var d=p-1;d>_;d--)o--,s=n[o-1];for(var g=_+1;g=s)}}for(var v=this.__startIndex;v15)break}}x.prevElClipPaths&&g.restore()};if(y)if(y.length===0)C=d.__endIndex;else for(var P=c.dpr,L=0;L0&&t>a[0]){for(f=0;ft);f++);s=i[a[f]]}if(a.splice(f+1,0,t),i[t]=e,!e.virtual)if(s){var h=s.dom;h.nextSibling?o.insertBefore(e.dom,h.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,a=0;a0?ti:0),this._needsManuallyCompositing),u.__builtin__||hn("ZLevel "+h+" has been used by unkown layer "+u.id),u!==n&&(u.__used=!0,u.__startIndex!==f&&(u.__dirty=!0),u.__startIndex=f,u.incremental?u.__drawIndex=-1:u.__drawIndex=f,e(f),n=u),a.__dirty&Ft&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=f))}e(f),this.eachBuiltinLayer(function(v,l){!v.__used&&v.getElementCount()>0&&(v.__dirty=!0,v.__startIndex=v.__endIndex=v.__drawIndex=0),v.__dirty&&v.__drawIndex<0&&(v.__drawIndex=v.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(t){t.clear()},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t,nt(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?Br(i[t],e,!0):i[t]=e;for(var a=0;a=4&&(u={x:parseFloat(l[0]||0),y:parseFloat(l[1]||0),width:parseFloat(l[2]),height:parseFloat(l[3])})}if(u&&s!=null&&f!=null&&(v=jl(u,{x:0,y:0,width:s,height:f}),!e.ignoreViewBox)){var c=a;a=new yr,a.add(c),c.scaleX=c.scaleY=v.scale,c.x=v.x,c.y=v.y}return!e.ignoreRootClip&&s!=null&&f!=null&&a.setClipPath(new Ce({shape:{x:0,y:0,width:s,height:f}})),{root:a,width:s,height:f,viewBoxRect:u,viewBoxTransform:v,named:n}},r.prototype._parseNode=function(t,e,i,a,n,o){var s=t.nodeName.toLowerCase(),f,h=a;if(s==="defs"&&(n=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")f=e;else{if(!n){var u=Sa[s];if(u&&hi(Sa,s)){f=u.call(this,t,e);var v=t.getAttribute("name");if(v){var l={name:v,namedFrom:null,svgNodeTagLower:s,el:f};i.push(l),s==="g"&&(h=l)}else a&&i.push({name:a.name,namedFrom:a,svgNodeTagLower:s,el:f});e.add(f)}}var c=jo[s];if(c&&hi(jo,s)){var p=c.call(this,t),_=t.getAttribute("id");_&&(this._defs[_]=p)}}if(f&&f.isGroup)for(var d=t.firstChild;d;)d.nodeType===1?this._parseNode(d,f,i,h,n,o):d.nodeType===3&&o&&this._parseText(d,f),d=d.nextSibling},r.prototype._parseText=function(t,e){var i=new Zr({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});gt(e,i),lt(t,i,this._defsUsePending,!1,!1),ql(i,e);var a=i.style,n=a.fontSize;n&&n<9&&(a.fontSize=9,i.scaleX*=n/9,i.scaleY*=n/9);var o=(a.fontSize||a.fontFamily)&&[a.fontStyle,a.fontWeight,(a.fontSize||12)+"px",a.fontFamily||"sans-serif"].join(" ");a.font=o;var s=i.getBoundingRect();return this._textX+=s.width,e.add(i),i},r.internalField=function(){Sa={g:function(t,e){var i=new yr;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i},rect:function(t,e){var i=new Ce;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},circle:function(t,e){var i=new sf;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),i.silent=!0,i},line:function(t,e){var i=new lf;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},ellipse:function(t,e){var i=new ff;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},polygon:function(t,e){var i=t.getAttribute("points"),a;i&&(a=es(i));var n=new gn({shape:{points:a||[]},silent:!0});return gt(e,n),lt(t,n,this._defsUsePending,!1,!1),n},polyline:function(t,e){var i=t.getAttribute("points"),a;i&&(a=es(i));var n=new vf({shape:{points:a||[]},silent:!0});return gt(e,n),lt(t,n,this._defsUsePending,!1,!1),n},image:function(t,e){var i=new jr;return gt(e,i),lt(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},text:function(t,e){var i=t.getAttribute("x")||"0",a=t.getAttribute("y")||"0",n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(n),this._textY=parseFloat(a)+parseFloat(o);var s=new yr;return gt(e,s),lt(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,e){var i=t.getAttribute("x"),a=t.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),a!=null&&(this._textY=parseFloat(a));var n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new yr;return gt(e,s),lt(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(n),this._textY+=parseFloat(o),s},path:function(t,e){var i=t.getAttribute("d")||"",a=Sv(i);return gt(e,a),lt(t,a,this._defsUsePending,!1,!1),a.silent=!0,a}}}(),r}(),jo={lineargradient:function(r){var t=parseInt(r.getAttribute("x1")||"0",10),e=parseInt(r.getAttribute("y1")||"0",10),i=parseInt(r.getAttribute("x2")||"10",10),a=parseInt(r.getAttribute("y2")||"0",10),n=new Xv(t,e,i,a);return ts(r,n),rs(r,n),n},radialgradient:function(r){var t=parseInt(r.getAttribute("cx")||"0",10),e=parseInt(r.getAttribute("cy")||"0",10),i=parseInt(r.getAttribute("r")||"0",10),a=new Uv(t,e,i);return ts(r,a),rs(r,a),a}};function ts(r,t){var e=r.getAttribute("gradientUnits");e==="userSpaceOnUse"&&(t.global=!0)}function rs(r,t){for(var e=r.firstChild;e;){if(e.nodeType===1&&e.nodeName.toLocaleLowerCase()==="stop"){var i=e.getAttribute("offset"),a=void 0;i&&i.indexOf("%")>0?a=parseInt(i,10)/100:i?a=parseFloat(i):a=0;var n={};Df(e,n,n);var o=n.stopColor||e.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:a,color:o})}e=e.nextSibling}}function gt(r,t){r&&r.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),wt(t.__inheritedStyle,r.__inheritedStyle))}function es(r){for(var t=ki(r),e=[],i=0;i0;n-=2){var o=i[n],s=i[n-1],f=ki(o);switch(a=a||Sr(),s){case"translate":Ia(a,a,[parseFloat(f[0]),parseFloat(f[1]||"0")]);break;case"scale":Ss(a,a,[parseFloat(f[0]),parseFloat(f[1]||f[0])]);break;case"rotate":bs(a,a,-parseFloat(f[0])*Ca,[parseFloat(f[1]||"0"),parseFloat(f[2]||"0")]);break;case"skewX":var h=Math.tan(parseFloat(f[0])*Ca);ge(a,[1,0,h,1,0,0],a);break;case"skewY":var u=Math.tan(parseFloat(f[0])*Ca);ge(a,[1,u,0,1,0,0],a);break;case"matrix":a[0]=parseFloat(f[0]),a[1]=parseFloat(f[1]),a[2]=parseFloat(f[2]),a[3]=parseFloat(f[3]),a[4]=parseFloat(f[4]),a[5]=parseFloat(f[5]);break}}t.setLocalTransform(a)}}var as=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Df(r,t,e){var i=r.getAttribute("style");if(i){as.lastIndex=0;for(var a;(a=as.exec(i))!=null;){var n=a[1],o=hi(mi,n)?mi[n]:null;o&&(t[o]=a[2]);var s=hi(wi,n)?wi[n]:null;s&&(e[s]=a[2])}}}function Jl(r,t,e){for(var i=0;i2&&i.push(a),a=[A,x]}function u(A,x,E,D){Wr(A,E)&&Wr(x,D)||a.push(A,x,E,D,E,D)}function v(A,x,E,D,F,H){var j=Math.abs(x-A),V=Math.tan(j/4)*4/3,W=xC:L2&&i.push(a),i}function en(r,t,e,i,a,n,o,s,f,h){if(Wr(r,e)&&Wr(t,i)&&Wr(a,o)&&Wr(n,s)){f.push(o,s);return}var u=2/h,v=u*u,l=o-r,c=s-t,p=Math.sqrt(l*l+c*c);l/=p,c/=p;var _=e-r,d=i-t,g=a-o,y=n-s,m=_*_+d*d,w=g*g+y*y;if(m=0&&C=0){f.push(o,s);return}var M=[],P=[];Jt(r,e,a,o,.5,M),Jt(t,i,n,s,.5,P),en(M[0],P[0],M[1],P[1],M[2],P[2],M[3],P[3],f,h),en(M[4],P[4],M[5],P[5],M[6],P[6],M[7],P[7],f,h)}function tc(r,t){var e=rn(r),i=[];t=t||1;for(var a=0;a0)for(var h=0;hMath.abs(h),v=If([f,h],u?0:1,t),l=(u?s:h)/v.length,c=0;ca,o=If([i,a],n?0:1,t),s=n?"width":"height",f=n?"height":"width",h=n?"x":"y",u=n?"y":"x",v=r[s]/o.length,l=0;l1?null:new k(_*f+r,_*h+t)}function ic(r,t,e){var i=new k;k.sub(i,e,t),i.normalize();var a=new k;k.sub(a,r,t);var n=a.dot(i);return n}function Fr(r,t){var e=r[r.length-1];e&&e[0]===t[0]&&e[1]===t[1]||r.push(t)}function ac(r,t,e){for(var i=r.length,a=[],n=0;no?(h.x=u.x=s+n/2,h.y=f,u.y=f+o):(h.y=u.y=f+o/2,h.x=s,u.x=s+n),ac(t,h,u)}function Ti(r,t,e,i){if(e===1)i.push(t);else{var a=Math.floor(e/2),n=r(t);Ti(r,n[0],a,i),Ti(r,n[1],e-a,i)}return i}function nc(r,t){for(var e=[],i=0;i0;h/=2){var u=0,v=0;(r&h)>0&&(u=1),(t&h)>0&&(v=1),s+=h*h*(3*u^v),v===0&&(u===1&&(r=h-1-r,t=h-1-t),f=r,r=t,t=f)}return s}function Si(r){var t=1/0,e=1/0,i=-1/0,a=-1/0,n=Z(r,function(s){var f=s.getBoundingRect(),h=s.getComputedTransform(),u=f.x+f.width/2+(h?h[4]:0),v=f.y+f.height/2+(h?h[5]:0);return t=Math.min(u,t),e=Math.min(v,e),i=Math.max(u,i),a=Math.max(v,a),[u,v]}),o=Z(n,function(s,f){return{cp:s,z:dc(s[0],s[1],t,e,i,a),path:r[f]}});return o.sort(function(s,f){return s.z-f.z}).map(function(s){return s.path})}function kf(r){return fc(r.path,r.count)}function nn(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Vc(r,t,e){var i=[];function a(S){for(var b=0;b