import{_ as z}from"./tslib@2.3.0-BDyQ-Jie.js";var ko=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),No=function(){function e(){this.browser=new ko,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 e}(),W=new No;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(W.wxa=!0,W.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?W.worker=!0:!W.hasGlobalWindow||"Deno"in window?(W.node=!0,W.svgSupported=!0):Wo(navigator.userAgent,W);function Wo(e,t){var r=t.browser,i=e.match(/Firefox\/([\d.]+)/),n=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);i&&(r.firefox=!0,r.version=i[1]),n&&(r.ie=!0,r.version=n[1]),a&&(r.edge=!0,r.version=a[1],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}var dn=12,Yo="sans-serif",hr=dn+"px "+Yo,Go=20,Xo=100,qo="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Zo(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.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",n[h]+":0",i[1-f]+":auto",n[1-h]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return r}function ys(e,t,r){for(var i=r?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],f=!0,h=0;h<4;h++){var u=e[h].getBoundingClientRect(),v=2*h,l=u.left,d=u.top;o.push(l,d),f=f&&a&&l===a[v]&&d===a[v+1],s.push(e[h].offsetLeft,e[h].offsetTop)}return f&&n?n:(t.srcCoords=o,t[i]=r?Rn(s,o):Rn(o,s))}function Ua(e){return e.nodeName.toUpperCase()==="CANVAS"}var ms=/([&<>"'])/g,ws={"&":"&","<":"<",">":">",'"':""","'":"'"};function ku(e){return e==null?"":(e+"").replace(ms,function(t,r){return ws[r]})}var Ts=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ai=[],bs=W.browser.firefox&&+W.browser.version.split(".")[0]<39;function Xi(e,t,r,i){return r=r||{},i?xn(e,t,r):bs&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):xn(e,t,r),r}function xn(e,t,r){if(W.domSupported&&e.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(Ua(e)){var a=e.getBoundingClientRect();r.zrX=i-a.left,r.zrY=n-a.top;return}else if(Gi(ai,e,i,n)){r.zrX=ai[0],r.zrY=ai[1];return}}r.zrX=r.zrY=0}function gn(e){return e||window.event}function ct(e,t,r){if(t=gn(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&Xi(e,o,t,r)}else{Xi(e,t,t,r);var a=Cs(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&Ts.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function Cs(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,i=e.deltaY;if(r==null||i==null)return t;var n=Math.abs(i!==0?i:r),a=i>0?-1:i<0?1:r>0?-1:1;return 3*n*a}function Ms(e,t,r,i){e.addEventListener(t,r,i)}function Ls(e,t,r,i){e.removeEventListener(t,r,i)}var Ps=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0},Ss=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,i){return this._doTrack(t,r,i),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:r,event:t},o=0,s=n.length;o1&&i&&i.length>1){var a=An(i)/An(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=Rs(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}};function Qr(){return[1,0,0,1,0,0]}function Ds(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function xs(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function si(e,t,r){var i=t[0]*r[0]+t[2]*r[1],n=t[1]*r[0]+t[3]*r[1],a=t[0]*r[2]+t[2]*r[3],o=t[1]*r[2]+t[3]*r[3],s=t[0]*r[4]+t[2]*r[5]+t[4],f=t[1]*r[4]+t[3]*r[5]+t[5];return e[0]=i,e[1]=n,e[2]=a,e[3]=o,e[4]=s,e[5]=f,e}function En(e,t,r){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+r[0],e[5]=t[5]+r[1],e}function As(e,t,r,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],f=t[3],h=t[5],u=Math.sin(r),v=Math.cos(r);return e[0]=n*v+s*u,e[1]=-n*u+s*v,e[2]=a*v+f*u,e[3]=-a*u+v*f,e[4]=v*(o-i[0])+u*(h-i[1])+i[0],e[5]=v*(h-i[1])-u*(o-i[0])+i[1],e}function Es(e,t,r){var i=r[0],n=r[1];return e[0]=t[0]*i,e[1]=t[1]*n,e[2]=t[2]*i,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*n,e}function Is(e,t){var r=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],f=r*o-a*i;return f?(f=1/f,e[0]=o*f,e[1]=-a*f,e[2]=-i*f,e[3]=r*f,e[4]=(i*s-o*n)*f,e[5]=(a*n-r*s)*f,e):null}var F=function(){function e(t,r){this.x=t||0,this.y=r||0}return e.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(t,r){return this.x=t,this.y=r,this},e.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.scale=function(t){this.x*=t,this.y*=t},e.prototype.scaleAndAdd=function(t,r){this.x+=t.x*r,this.y+=t.y*r},e.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.dot=function(t){return this.x*t.x+this.y*t.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},e.prototype.distance=function(t){var r=this.x-t.x,i=this.y-t.y;return Math.sqrt(r*r+i*i)},e.prototype.distanceSquare=function(t){var r=this.x-t.x,i=this.y-t.y;return r*r+i*i},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(t){if(t){var r=this.x,i=this.y;return this.x=t[0]*r+t[2]*i+t[4],this.y=t[1]*r+t[3]*i+t[5],this}},e.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},e.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},e.set=function(t,r,i){t.x=r,t.y=i},e.copy=function(t,r){t.x=r.x,t.y=r.y},e.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},e.lenSquare=function(t){return t.x*t.x+t.y*t.y},e.dot=function(t,r){return t.x*r.x+t.y*r.y},e.add=function(t,r,i){t.x=r.x+i.x,t.y=r.y+i.y},e.sub=function(t,r,i){t.x=r.x-i.x,t.y=r.y-i.y},e.scale=function(t,r,i){t.x=r.x*i,t.y=r.y*i},e.scaleAndAdd=function(t,r,i,n){t.x=r.x+i.x*n,t.y=r.y+i.y*n},e.lerp=function(t,r,i,n){var a=1-n;t.x=a*r.x+n*i.x,t.y=a*r.y+n*i.y},e}(),se=Math.min,fe=Math.max,Gt=new F,Xt=new F,qt=new F,Zt=new F,Fr=new F,Or=new F,Y=function(){function e(t,r,i,n){i<0&&(t=t+i,i=-i),n<0&&(r=r+n,n=-n),this.x=t,this.y=r,this.width=i,this.height=n}return e.prototype.union=function(t){var r=se(t.x,this.x),i=se(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=fe(t.x+t.width,this.x+this.width)-r:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=fe(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=r,this.y=i},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(t){var r=this,i=t.width/r.width,n=t.height/r.height,a=Qr();return En(a,a,[-r.x,-r.y]),Es(a,a,[i,n]),En(a,a,[t.x,t.y]),a},e.prototype.intersect=function(t,r){if(!t)return!1;t instanceof e||(t=e.create(t));var i=this,n=i.x,a=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=!(a_&&(_=m,g_&&(_=w,p=i.x&&t<=i.x+i.width&&r>=i.y&&r<=i.y+i.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height},e.applyTransform=function(t,r,i){if(!i){t!==r&&e.copy(t,r);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=r.x*n+o,t.y=r.y*a+s,t.width=r.width*n,t.height=r.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Gt.x=qt.x=r.x,Gt.y=Zt.y=r.y,Xt.x=Zt.x=r.x+r.width,Xt.y=qt.y=r.y+r.height,Gt.transform(i),Zt.transform(i),Xt.transform(i),qt.transform(i),t.x=se(Gt.x,Xt.x,qt.x,Zt.x),t.y=se(Gt.y,Xt.y,qt.y,Zt.y);var f=fe(Gt.x,Xt.x,qt.x,Zt.x),h=fe(Gt.y,Xt.y,qt.y,Zt.y);t.width=f-t.x,t.height=h-t.y},e}(),Va="silent";function Fs(e,t,r){return{type:e,event:r,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:Os}}function Os(){Ps(this.event)}var Bs=function(e){z(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.handler=null,r}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Er),Br=function(){function e(t,r){this.x=t,this.y=r}return e}(),Hs=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],fi=new Y(0,0,0,0),Qa=function(e){z(t,e);function t(r,i,n,a,o){var s=e.call(this)||this;return s._hovered=new Br(0,0),s.storage=r,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new Bs,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new ps(s),s}return t.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(st(Hs,function(i){r.on&&r.on(i,this[i],this)},this),r.handler=this),this.proxy=r},t.prototype.mousemove=function(r){var i=r.zrX,n=r.zrY,a=Ka(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var f=this._hovered=a?new Br(i,n):this.findHover(i,n),h=f.target,u=this.proxy;u.setCursor&&u.setCursor(h?h.cursor:"default"),s&&h!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(f,"mousemove",r),h&&h!==s&&this.dispatchToElement(f,"mouseover",r)},t.prototype.mouseout=function(r){var i=r.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},t.prototype.resize=function(){this._hovered=new Br(0,0)},t.prototype.dispatch=function(r,i){var n=this[r];n&&n.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(r){var i=this.proxy;i.setCursor&&i.setCursor(r)},t.prototype.dispatchToElement=function(r,i,n){r=r||{};var a=r.target;if(!(a&&a.silent)){for(var o="on"+i,s=Fs(i,r,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.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(r,i,n){var a=this.storage.getDisplayList(),o=new Br(r,i);if(In(a,o,r,i,n),this._pointerSize&&!o.target){for(var s=[],f=this._pointerSize,h=f/2,u=new Y(r-h,i-h,f,f),v=a.length-1;v>=0;v--){var l=a[v];l!==n&&!l.ignore&&!l.ignoreCoarsePointer&&(!l.parent||!l.parent.ignoreCoarsePointer)&&(fi.copy(l.getBoundingRect()),l.transform&&fi.applyTransform(l.transform),fi.intersect(u)&&s.push(l))}if(s.length)for(var d=4,_=Math.PI/12,g=Math.PI*2,c=0;c4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function zs(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var i=e,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,r))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s||i.parent}return n?Va:!0}return!1}function In(e,t,r,i,n){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==n&&!o.ignore&&(s=zs(o,r,i))&&(!t.topTarget&&(t.topTarget=o),s!==Va)){t.target=o;break}}}function Ka(e,t,r){var i=e.painter;return t<0||t>i.getWidth()||r<0||r>i.getHeight()}var Ja=32,Hr=7;function ks(e){for(var t=0;e>=Ja;)t|=e&1,e>>=1;return e+t}function Fn(e,t,r,i){var n=t+1;if(n===r)return 1;if(i(e[n++],e[t])<0){for(;n=0;)n++;return n-t}function Ns(e,t,r){for(r--;t>>1,n(a,e[f])<0?s=f:o=f+1;var h=i-o;switch(h){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;h>0;)e[o+h]=e[o+h-1],h--}e[o]=a}}function hi(e,t,r,i,n,a){var o=0,s=0,f=1;if(a(e,t[r+n])>0){for(s=i-n;f0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=n,f+=n}else{for(s=n+1;fs&&(f=s);var h=o;o=n-f,f=n-h}for(o++;o>>1);a(e,t[r+u])>0?o=u+1:f=u}return f}function ui(e,t,r,i,n,a){var o=0,s=0,f=1;if(a(e,t[r+n])<0){for(s=n+1;fs&&(f=s);var h=o;o=n-f,f=n-h}else{for(s=i-n;f=0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=n,f+=n}for(o++;o>>1);a(e,t[r+u])<0?f=u:o=u+1}return f}function Ws(e,t){var r=Hr,i,n,a=0,o=[];i=[],n=[];function s(d,_){i[a]=d,n[a]=_,a+=1}function f(){for(;a>1;){var d=a-2;if(d>=1&&n[d-1]<=n[d]+n[d+1]||d>=2&&n[d-2]<=n[d]+n[d-1])n[d-1]n[d+1])break;u(d)}}function h(){for(;a>1;){var d=a-2;d>0&&n[d-1]=Hr||b>=Hr);if(M)break;C<0&&(C=0),C+=2}if(r=C,r<1&&(r=1),_===1){for(p=0;p=0;p--)e[T+p]=e[C+p];e[w]=o[m];return}for(var b=r;;){var M=0,L=0,P=!1;do if(t(o[m],e[y])<0){if(e[w--]=e[y--],M++,L=0,--_===0){P=!0;break}}else if(e[w--]=o[m--],L++,M=0,--c===1){P=!0;break}while((M|L)=0;p--)e[T+p]=e[C+p];if(_===0){P=!0;break}}if(e[w--]=o[m--],--c===1){P=!0;break}if(L=c-hi(e[y],o,0,c,c-1,t),L!==0){for(w-=L,m-=L,c-=L,T=w+1,C=m+1,p=0;p=Hr||L>=Hr);if(P)break;b<0&&(b=0),b+=2}if(r=b,r<1&&(r=1),c===1){for(w-=_,y-=_,T=w+1,C=y+1,p=_-1;p>=0;p--)e[T+p]=e[C+p];e[w]=o[m]}else{if(c===0)throw new Error;for(C=w-(c-1),p=0;ps&&(f=s),On(e,r,r+f,r+a,t),a=f}o.pushRun(r,a),o.mergeRuns(),n-=a,r+=a}while(n!==0);o.forceMergeRuns()}}var Lt=1,xe=2,Xr=4,Bn=!1;function vi(){Bn||(Bn=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Hn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Gs=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Hn}return e.prototype.traverse=function(t,r){for(var i=0;i0&&(u.__clipPaths=[]),isNaN(u.z)&&(vi(),u.z=0),isNaN(u.z2)&&(vi(),u.z2=0),isNaN(u.zlevel)&&(vi(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var v=t.getDecalElement&&t.getDecalElement();v&&this._updateAndAddDisplayable(v,r,i);var l=t.getTextGuideLine();l&&this._updateAndAddDisplayable(l,r,i);var d=t.getTextContent();d&&this._updateAndAddDisplayable(d,r,i)}},e.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},e.prototype.delRoot=function(t){if(t instanceof Array){for(var r=0,i=t.length;r=0&&this._roots.splice(n,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),He;He=W.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};var Kr={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)))},elasticOut:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/i)+1)},elasticInOut:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-Kr.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?Kr.bounceIn(e*2)*.5:Kr.bounceOut(e*2-1)*.5+.5}},he=Math.pow,Bt=Math.sqrt,ja=1e-8,to=1e-4,zn=Bt(3),ue=1/3,Mt=Ar(),lt=Ar(),Rr=Ar();function Ot(e){return e>-1e-8&&eja||e<-1e-8}function U(e,t,r,i,n){var a=1-n;return a*a*(a*e+3*n*t)+n*n*(n*i+3*a*r)}function kn(e,t,r,i,n){var a=1-n;return 3*(((t-e)*a+2*(r-t)*n)*a+(i-r)*n*n)}function eo(e,t,r,i,n,a){var o=i+3*(t-r)-e,s=3*(r-t*2+e),f=3*(t-e),h=e-n,u=s*s-3*o*f,v=s*f-9*o*h,l=f*f-3*s*h,d=0;if(Ot(u)&&Ot(v))if(Ot(s))a[0]=0;else{var _=-f/s;_>=0&&_<=1&&(a[d++]=_)}else{var g=v*v-4*u*l;if(Ot(g)){var c=v/u,_=-s/o+c,p=-c/2;_>=0&&_<=1&&(a[d++]=_),p>=0&&p<=1&&(a[d++]=p)}else if(g>0){var y=Bt(g),m=u*s+1.5*o*(-v+y),w=u*s+1.5*o*(-v-y);m<0?m=-he(-m,ue):m=he(m,ue),w<0?w=-he(-w,ue):w=he(w,ue);var _=(-s-(m+w))/(3*o);_>=0&&_<=1&&(a[d++]=_)}else{var C=(2*u*s-3*o*v)/(2*Bt(u*u*u)),T=Math.acos(C)/3,b=Bt(u),M=Math.cos(T),_=(-s-2*b*M)/(3*o),p=(-s+b*(M+zn*Math.sin(T)))/(3*o),L=(-s+b*(M-zn*Math.sin(T)))/(3*o);_>=0&&_<=1&&(a[d++]=_),p>=0&&p<=1&&(a[d++]=p),L>=0&&L<=1&&(a[d++]=L)}}return d}function io(e,t,r,i,n){var a=6*r-12*t+6*e,o=9*t+3*i-3*e-9*r,s=3*t-3*e,f=0;if(Ot(o)){if(ro(a)){var h=-s/a;h>=0&&h<=1&&(n[f++]=h)}}else{var u=a*a-4*o*s;if(Ot(u))n[0]=-a/(2*o);else if(u>0){var v=Bt(u),h=(-a+v)/(2*o),l=(-a-v)/(2*o);h>=0&&h<=1&&(n[f++]=h),l>=0&&l<=1&&(n[f++]=l)}}return f}function kt(e,t,r,i,n,a){var o=(t-e)*n+e,s=(r-t)*n+t,f=(i-r)*n+r,h=(s-o)*n+o,u=(f-s)*n+s,v=(u-h)*n+h;a[0]=e,a[1]=o,a[2]=h,a[3]=v,a[4]=v,a[5]=u,a[6]=f,a[7]=i}function Xs(e,t,r,i,n,a,o,s,f,h,u){var v,l=.005,d=1/0,_,g,c,p;Mt[0]=f,Mt[1]=h;for(var y=0;y<1;y+=.05)lt[0]=U(e,r,n,o,y),lt[1]=U(t,i,a,s,y),c=Sr(Mt,lt),c=0&&c=0&&h<=1&&(n[f++]=h)}}else{var u=o*o-4*a*s;if(Ot(u)){var h=-o/(2*a);h>=0&&h<=1&&(n[f++]=h)}else if(u>0){var v=Bt(u),h=(-o+v)/(2*a),l=(-o-v)/(2*a);h>=0&&h<=1&&(n[f++]=h),l>=0&&l<=1&&(n[f++]=l)}}return f}function no(e,t,r){var i=e+r-2*t;return i===0?.5:(e-t)/i}function ze(e,t,r,i,n){var a=(t-e)*i+e,o=(r-t)*i+t,s=(o-a)*i+a;n[0]=e,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=r}function $s(e,t,r,i,n,a,o,s,f){var h,u=.005,v=1/0;Mt[0]=o,Mt[1]=s;for(var l=0;l<1;l+=.05){lt[0]=Q(e,r,n,l),lt[1]=Q(t,i,a,l);var d=Sr(Mt,lt);d=0&&d=1?1:eo(0,i,a,1,f,s)&&U(0,n,o,1,s[0])}}}var Qs=function(){function e(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||Pr,this.ondestroy=t.ondestroy||Pr,this.onrestart=t.onrestart||Pr,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var f=n%i;this._startTime=t-f,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Qe(t)?t:Kr[t]||ao(t)},e}(),oo=function(){function e(t){this.value=t}return e}(),Ks=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new oo(t);return this.insertEntry(r),r},e.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++},e.prototype.remove=function(t){var r=t.prev,i=t.next;r?r.next=i:this.head=i,i?i.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),je=function(){function e(t){this._list=new Ks,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var f=i.head;i.remove(f),delete n[f.key],a=f.value,this._lastRemovedEntry=f}s?s.value=r:s=new oo(r),s.key=t,i.insertEntry(s),n[t]=s}return a},e.prototype.get=function(t){var r=this._map[t],i=this._list;if(r!=null)return r!==i.tail&&(i.remove(r),i.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),Wn={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 Ht(e){return e=Math.round(e),e<0?0:e>255?255:e}function qi(e){return e<0?0:e>1?1:e}function li(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?Ht(parseFloat(t)/100*255):Ht(parseInt(t,10))}function Jr(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?qi(parseFloat(t)/100):qi(parseFloat(t))}function di(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function ve(e,t,r){return e+(t-e)*r}function ut(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function Zi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var so=new je(20),le=null;function lr(e,t){le&&Zi(le,t),le=so.put(e,le||t.slice())}function zt(e,t){if(e){t=t||[];var r=so.get(e);if(r)return Zi(t,r);e=e+"";var i=e.replace(/ /g,"").toLowerCase();if(i in Wn)return Zi(t,Wn[i]),lr(e,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){ut(t,0,0,0,1);return}return ut(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),lr(e,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){ut(t,0,0,0,1);return}return ut(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),lr(e,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){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?ut(t,+h[0],+h[1],+h[2],1):ut(t,0,0,0,1);u=Jr(h.pop());case"rgb":if(h.length>=3)return ut(t,li(h[0]),li(h[1]),li(h[2]),h.length===3?u:Jr(h[3])),lr(e,t),t;ut(t,0,0,0,1);return;case"hsla":if(h.length!==4){ut(t,0,0,0,1);return}return h[3]=Jr(h[3]),Yn(h,t),lr(e,t),t;case"hsl":if(h.length!==3){ut(t,0,0,0,1);return}return Yn(h,t),lr(e,t),t;default:return}}ut(t,0,0,0,1)}}function Yn(e,t){var r=(parseFloat(e[0])%360+360)%360/360,i=Jr(e[1]),n=Jr(e[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],ut(t,Ht(di(o,a,r+1/3)*255),Ht(di(o,a,r)*255),Ht(di(o,a,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function Gn(e,t){var r=zt(e);if(r){for(var i=0;i<3;i++)r[i]=r[i]*(1-t)|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return yn(r,r.length===4?"rgba":"rgb")}}function Nu(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var i=e*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=zt(t[n]),s=zt(t[a]),f=i-n,h=yn([Ht(ve(o[0],s[0],f)),Ht(ve(o[1],s[1],f)),Ht(ve(o[2],s[2],f)),qi(ve(o[3],s[3],f))],"rgba");return r?{color:h,leftIndex:n,rightIndex:a,value:i}:h}}function yn(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function ke(e,t){var r=zt(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}var Xn=new je(100);function Wu(e){if(Be(e)){var t=Xn.get(e);return t||(t=Gn(e,-.1),Xn.put(e,t)),t}else if(Ke(e)){var r=N({},e);return r.colorStops=St(e.colorStops,function(i){return{offset:i.offset,color:Gn(i.color,-.1)}}),r}return e}function Js(e){return e.type==="linear"}function js(e){return e.type==="radial"}(function(){return W.hasGlobalWindow&&Qe(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}})();var $i=Array.prototype.slice;function xt(e,t,r){return(t-e)*r+e}function ci(e,t,r,i){for(var n=t.length,a=0;ai?t:e,a=Math.min(r,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var f=a;f=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=Zn,f=r;if(Pt(r)){var h=nf(r);s=h,(h===1&&!Re(r[0])||h===2&&!Re(r[0][0]))&&(o=!0)}else if(Re(r)&&!rs(r))s=ce;else if(Be(r))if(!isNaN(+r))s=ce;else{var u=zt(r);u&&(f=u,s=qr)}else if(Ke(r)){var v=N({},f);v.colorStops=St(r.colorStops,function(d){return{offset:d.offset,color:zt(d.color)}}),Js(r)?s=Ui:js(r)&&(s=Vi),f=v}a===0?this.valType=s:(s!==this.valType||s===Zn)&&(o=!0),this.discrete=this.discrete||o;var l={time:t,value:f,rawValue:r,percent:0};return i&&(l.easing=i,l.easingFunc=Qe(i)?i:Kr[i]||ao(i)),n.push(l),l},e.prototype.prepare=function(t,r){var i=this.keyframes;this._needsSort&&i.sort(function(g,c){return g.time-c.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,f=pe(n),h=$n(n),u=0;u=0&&!(o[u].percent<=r);u--);u=l(u,s-2)}else{for(u=v;ur);u++);u=l(u-1,s-2)}_=o[u+1],d=o[u]}if(d&&_){this._lastFr=u,this._lastFrP=r;var c=_.percent-d.percent,p=c===0?1:l((r-d.percent)/c,1);_.easingFunc&&(p=_.easingFunc(p));var y=i?this._additiveValue:h?zr:t[f];if((pe(a)||h)&&!y&&(y=this._additiveValue=[]),this.discrete)t[f]=p<1?d.rawValue:_.rawValue;else if(pe(a))a===Ie?ci(y,d[n],_[n],p):tf(y,d[n],_[n],p);else if($n(a)){var m=d[n],w=_[n],C=a===Ui;t[f]={type:C?"linear":"radial",x:xt(m.x,w.x,p),y:xt(m.y,w.y,p),colorStops:St(m.colorStops,function(b,M){var L=w.colorStops[M];return{offset:xt(b.offset,L.offset,p),color:Ee(ci([],b.color,L.color,p))}}),global:w.global},C?(t[f].x2=xt(m.x2,w.x2,p),t[f].y2=xt(m.y2,w.y2,p)):t[f].r=xt(m.r,w.r,p)}else if(h)ci(y,d[n],_[n],p),i||(t[f]=Ee(y));else{var T=xt(d[n],_[n],p);i?this._additiveValue=T:t[f]=T}i&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,i=this.propName,n=this._additiveValue;r===ce?t[i]=t[i]+n:r===qr?(zt(t[i],zr),de(zr,zr,n,1),t[i]=Ee(zr)):r===Ie?de(t[i],t[i],n,1):r===fo&&qn(t[i],t[i],n,1)},e}(),mn=function(){function e(t,r,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&n){_n("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,i){return this.whenWithKeys(t,r,ft(r),i)},e.prototype.whenWithKeys=function(t,r,i,n){for(var a=this._tracks,o=0;o0&&f.addKeyframe(0,Ae(h),n),this._trackKeys.push(s)}f.addKeyframe(t,Ae(r[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,i=0;i0)){this._started=1;for(var r=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},e}();function br(){return new Date().getTime()}var of=function(e){z(t,e);function t(r){var i=e.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,r=r||{},i.stage=r.stage||{},i}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var i=r.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(r){if(r.animation){var i=r.prev,n=r.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var i=r.getClip();i&&this.removeClip(i),r.animation=null},t.prototype.update=function(r){for(var i=br()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,r||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function i(){r._running&&(He(i),!r._paused&&r.update())}He(i)},t.prototype.start=function(){this._running||(this._time=br(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=br(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=br()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var i=r.next;r.prev=r.next=r.animation=null,r=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,i){i=i||{},this.start();var n=new mn(r,i.loop);return this.addAnimator(n),n},t}(Er),sf=300,pi=W.domSupported,_i=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=St(e,function(n){var a=n.replace("mouse","pointer");return r.hasOwnProperty(a)?a:n});return{mouse:e,touch:t,pointer:i}}(),Un={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Vn=!1;function Qi(e){var t=e.pointerType;return t==="pen"||t==="touch"}function ff(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function gi(e){e&&(e.zrByTouch=!0)}function hf(e,t){return ct(e.dom,new uf(e,t),!0)}function ho(e,t){for(var r=t,i=!1;r&&r.nodeType!==9&&!(i=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return i}var uf=function(){function e(t,r){this.stopPropagation=Pr,this.stopImmediatePropagation=Pr,this.preventDefault=Pr,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),pt={mousedown:function(e){e=ct(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=ct(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=ct(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=ct(this.dom,e);var t=e.toElement||e.relatedTarget;ho(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){Vn=!0,e=ct(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){Vn||(e=ct(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=ct(this.dom,e),gi(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),pt.mousemove.call(this,e),pt.mousedown.call(this,e)},touchmove:function(e){e=ct(this.dom,e),gi(e),this.handler.processGesture(e,"change"),pt.mousemove.call(this,e)},touchend:function(e){e=ct(this.dom,e),gi(e),this.handler.processGesture(e,"end"),pt.mouseup.call(this,e),+new Date-+this.__lastTouchMomentpf||e<-5e-5}var Ut=[],dr=[],mi=Qr(),wi=Math.abs,wn=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return $t(this.rotation)||$t(this.x)||$t(this.y)||$t(this.scaleX-1)||$t(this.scaleY-1)||$t(this.skewX)||$t(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||t)){i&&(Kn(i),this.invTransform=null);return}i=i||Qr(),r?this.getLocalTransform(i):Kn(i),t&&(r?si(i,t,i):xs(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Ut);var i=Ut[0]<0?-1:1,n=Ut[1]<0?-1:1,a=((Ut[0]-i)*r+i)/Ut[0]||0,o=((Ut[1]-n)*r+n)/Ut[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||Qr(),Is(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(t){var r=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=i,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||Qr(),si(dr,t.invTransform,r),r=dr);var i=this.originX,n=this.originY;(i||n)&&(mi[4]=i,mi[5]=n,si(dr,r,mi),dr[4]-=i,dr[5]-=n,r=dr),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var i=[t,r],n=this.invTransform;return n&&Vr(i,i,n),i},e.prototype.transformCoordToGlobal=function(t,r){var i=[t,r],n=this.transform;return n&&Vr(i,i,n),i},e.prototype.getLineScale=function(){var t=this.transform;return t&&wi(t[0]-1)>1e-10&&wi(t[3]-1)>1e-10?Math.sqrt(wi(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){_f(this,t)},e.getLocalTransform=function(t,r){r=r||[];var i=t.originX||0,n=t.originY||0,a=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,d=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||f){var _=i+s,g=n+f;r[4]=-_*a-l*g*o,r[5]=-g*o-d*_*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=d*a,r[2]=l*o,h&&As(r,r,h),r[4]+=i+u,r[5]+=n+v,r},e.initDefaultProps=function(){var t=e.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}(),e}(),ee=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function _f(e,t){for(var r=0;r=0?parseFloat(e)/100*t:parseFloat(e):e}function yf(e,t,r){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=r.height,o=r.width,s=a/2,f=r.x,h=r.y,u="left",v="top";if(i instanceof Array)f+=ie(i[0],r.width),h+=ie(i[1],r.height),u=null,v=null;else switch(i){case"left":f-=n,h+=s,u="right",v="middle";break;case"right":f+=n+o,h+=s,v="middle";break;case"top":f+=o/2,h-=n,u="center",v="bottom";break;case"bottom":f+=o/2,h+=a+n,u="center";break;case"inside":f+=o/2,h+=s,u="center",v="middle";break;case"insideLeft":f+=n,h+=s,v="middle";break;case"insideRight":f+=o-n,h+=s,u="right",v="middle";break;case"insideTop":f+=o/2,h+=n,u="center";break;case"insideBottom":f+=o/2,h+=a-n,u="center",v="bottom";break;case"insideTopLeft":f+=n,h+=n;break;case"insideTopRight":f+=o-n,h+=n,u="right";break;case"insideBottomLeft":f+=n,h+=a-n,v="bottom";break;case"insideBottomRight":f+=o-n,h+=a-n,u="right",v="bottom";break}return e=e||{},e.x=f,e.y=h,e.align=u,e.verticalAlign=v,e}var Ti="__zr_normal__",bi=ee.concat(["ignore"]),mf=Ve(ee,function(e,t){return e[t]=!0,e},{ignore:!1}),cr={},wf=new Y(0,0,0,0),ti=function(){function e(t){this.id=Ya(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,i){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=r.innerTransformable,o=void 0,s=void 0,f=!1;a.parent=n?this:null;var h=!1;if(a.copyTransform(r),i.position!=null){var u=wf;i.layoutRect?u.copy(i.layoutRect):u.copy(this.getBoundingRect()),n||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(cr,i,u):yf(cr,i,u),a.x=cr.x,a.y=cr.y,o=cr.align,s=cr.verticalAlign;var v=i.origin;if(v&&i.rotation!=null){var l=void 0,d=void 0;v==="center"?(l=u.width*.5,d=u.height*.5):(l=ie(v[0],u.width),d=ie(v[1],u.height)),h=!0,a.originX=-a.x+l+(n?0:u.x),a.originY=-a.y+d+(n?0:u.y)}}i.rotation!=null&&(a.rotation=i.rotation);var _=i.offset;_&&(a.x+=_[0],a.y+=_[1],h||(a.originX=-_[0],a.originY=-_[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,c=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),p=void 0,y=void 0,m=void 0;g&&this.canBeInsideText()?(p=i.insideFill,y=i.insideStroke,(p==null||p==="auto")&&(p=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(p),m=!0)):(p=i.outsideFill,y=i.outsideStroke,(p==null||p==="auto")&&(p=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(p),m=!0)),p=p||"#000",(p!==c.fill||y!==c.stroke||m!==c.autoStroke||o!==c.align||s!==c.verticalAlign)&&(f=!0,c.fill=p,c.stroke=y,c.autoStroke=m,c.align=o,c.verticalAlign=s,r.setDefaultTextStyle(c)),r.__dirty|=Lt,f&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?tn:ji},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&zt(r);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,yn(i,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},N(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(Ft(t))for(var i=t,n=ft(i),a=0;a0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(Ti,!1,t)},e.prototype.useState=function(t,r,i,n){var a=t===Ti,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,f=this.stateTransition;if(!(Ct(s,t)>=0&&(r||s.length===1))){var h;if(this.stateProxy&&!a&&(h=this.stateProxy(t)),h||(h=this.states&&this.states[t]),!h&&!a){_n("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(h);var u=!!(h&&h.hoverLayer||n);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,h,this._normalState,r,!i&&!this.__inHover&&f&&f.duration>0,f);var v=this._textContent,l=this._textGuide;return v&&v.useState(t,r,i,u),l&&l.useState(t,r,i,u),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),h}}},e.prototype.useStates=function(t,r,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var f=0;f0,_);var g=this._textContent,c=this._textGuide;g&&g.useStates(t,r,l),c&&c.useStates(t,r,l),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var t=this.silent,r=this.parent;!t&&r;){if(r.silent){t=!0;break}r=r.parent}return t},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(r,1),this.useStates(i)}},e.prototype.replaceState=function(t,r,i){var n=this.currentStates.slice(),a=Ct(n,t),o=Ct(n,r)>=0;a>=0?o?n.splice(a,1):n[a]=r:i&&!o&&n.push(r),this.useStates(n)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var i=this.animators,n=i.length,a=[],o=0;o0&&r.during&&a[0].during(function(_,g){r.during(g)});for(var l=0;l0||n.force&&!o.length){var M=void 0,L=void 0,P=void 0;if(s){L={},l&&(M={});for(var w=0;w=0&&(n.splice(a,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,i){var n=Ct(this._children,r);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(r,i){var n=this._children,a=n[i];if(r&&r!==this&&r.parent!==this&&r!==a){n[i]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var i=this.__zr;i&&i!==r.__zr&&r.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(r){var i=this.__zr,n=this._children,a=Ct(n,r);return a<0?this:(n.splice(a,1),r.parent=null,i&&r.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},e.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){if(!this._disposed)return this.handler.findHover(t,r)},e.prototype.on=function(t,r,i){return this._disposed||this.handler.on(t,r,i),this},e.prototype.off=function(t,r){this._disposed||this.handler.off(t,r)},e.prototype.trigger=function(t,r){this._disposed||this.handler.trigger(t,r)},e.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),r=0;r=o;f++)s-=o;var h=ht(r,t);return h>s&&(r="",h=0),s=e-h,n.ellipsis=r,n.ellipsisWidth=h,n.contentWidth=s,n.containerWidth=e,n}function go(e,t,r){var i=r.containerWidth,n=r.font,a=r.contentWidth;if(!i){e.textLine="",e.isTruncated=!1;return}var o=ht(t,n);if(o<=i){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=r.maxIterations){t+=r.ellipsis;break}var f=s===0?xf(t,a,r.ascCharWidth,r.cnCharWidth):o>0?Math.floor(t.length*a/o):0;t=t.substr(0,f),o=ht(t,n)}t===""&&(t=r.placeholder),e.textLine=t,e.isTruncated=!0}function xf(e,t,r,i){for(var n=0,a=0,o=e.length;a_&&h){var g=Math.floor(_/s);u=u||l.length>g,l=l.slice(0,g)}if(e&&a&&v!=null)for(var c=_o(v,n,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),p={},y=0;ys&&Pi(r,e.substring(s,h),t,o),Pi(r,f[2],t,o,f[1]),s=Li.lastIndex}sn){var A=r.lines.length;T>0?(m.tokens=m.tokens.slice(0,T),p(m,C,w),r.lines=r.lines.slice(0,y+1)):r.lines=r.lines.slice(0,y),r.isTruncated=r.isTruncated||r.lines.length0&&_+i.accumWidth>i.width&&(u=t.split(` `),h=!0),i.accumWidth=_}else{var g=yo(t,f,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,v=g.linesWidths,u=g.lines}}else u=t.split(` `);for(var c=0;c=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Bf=Ve(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function Hf(e){return Of(e)?!!Bf[e]:!0}function yo(e,t,r,i,n){for(var a=[],o=[],s="",f="",h=0,u=0,v=0;vr:n+u+d>r){u?(s||f)&&(_?(s||(s=f,f="",h=0,u=h),a.push(s),o.push(u-h),f+=l,h+=d,s="",u=h):(f&&(s+=f,f="",h=0),a.push(s),o.push(u),s=l,u=d)):_?(a.push(f),o.push(h),f=l,h=d):(a.push(l),o.push(d));continue}u+=d,_?(f+=l,h+=d):(f&&(s+=f,f="",h=0),s+=l)}return!a.length&&!s&&(s=e,f="",h=0),f&&(s+=f),s&&(a.push(s),o.push(u)),a.length===1&&(u+=n),{accumWidth:u,lines:a,linesWidths:o}}var en="__zr_style_"+Math.round(Math.random()*10),fr={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ei={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};fr[en]=!0;var ea=["z","z2","invisible"],zf=["invisible"],ae=function(e){z(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var i=ft(r),n=0;n1e-4){s[0]=e-r,s[1]=t-i,f[0]=e+r,f[1]=t+i;return}if(_e[0]=xi(n)*r+e,_e[1]=Di(n)*i+t,ge[0]=xi(a)*r+e,ge[1]=Di(a)*i+t,h(s,_e,ge),u(f,_e,ge),n=n%Vt,n<0&&(n=n+Vt),a=a%Vt,a<0&&(a=a+Vt),n>a&&!o?a+=Vt:nn&&(ye[0]=xi(d)*r+e,ye[1]=Di(d)*i+t,h(s,ye,s),u(f,ye,f))}var H={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Qt=[],Kt=[],yt=[],At=[],mt=[],wt=[],Ai=Math.min,Ei=Math.max,Jt=Math.cos,jt=Math.sin,Dt=Math.abs,nn=Math.PI,It=nn*2,Ii=typeof Float32Array<"u",kr=[];function Fi(e){var t=Math.round(e/nn*1e8)/1e8;return t%2*nn}function Gf(e,t){var r=Fi(e[0]);r<0&&(r+=It);var i=r-e[0],n=e[1];n+=i,!t&&n-r>=It?n=r+It:t&&r-n>=It?n=r-It:!t&&r>n?n=r+(It-Fi(r-n)):t&&r0&&(this._ux=Dt(i/Ne/t)||0,this._uy=Dt(i/Ne/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(H.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var i=Dt(t-this._xi),n=Dt(r-this._yi),a=i>this._ux||n>this._uy;if(this.addData(H.L,t,r),this._ctx&&a&&this._ctx.lineTo(t,r),a)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,i,n,a,o){return this._drawPendingPt(),this.addData(H.C,t,r,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,r,i,n,a,o),this._xi=a,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,i,n){return this._drawPendingPt(),this.addData(H.Q,t,r,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,r,i,n),this._xi=i,this._yi=n,this},e.prototype.arc=function(t,r,i,n,a,o){this._drawPendingPt(),kr[0]=n,kr[1]=a,Gf(kr,o),n=kr[0],a=kr[1];var s=a-n;return this.addData(H.A,t,r,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,i,n,a,o),this._xi=Jt(a)*i+t,this._yi=jt(a)*i+r,this},e.prototype.arcTo=function(t,r,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,i,n,a),this},e.prototype.rect=function(t,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,i,n),this.addData(H.R,t,r,i,n),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(H.Z);var t=this._ctx,r=this._x0,i=this._y0;return t&&t.closePath(),this._xi=r,this._yi=i,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){var r=t.length;!(this.data&&this.data.length===r)&&Ii&&(this.data=new Float32Array(r));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)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){yt[0]=yt[1]=mt[0]=mt[1]=Number.MAX_VALUE,At[0]=At[1]=wt[0]=wt[1]=-Number.MAX_VALUE;var t=this.data,r=0,i=0,n=0,a=0,o;for(o=0;oi||Dt(m)>n||l===r-1)&&(g=Math.sqrt(y*y+m*m),a=c,o=p);break}case H.C:{var w=t[l++],C=t[l++],c=t[l++],p=t[l++],T=t[l++],b=t[l++];g=qs(a,o,w,C,c,p,T,b,10),a=T,o=b;break}case H.Q:{var w=t[l++],C=t[l++],c=t[l++],p=t[l++];g=Us(a,o,w,C,c,p,10),a=c,o=p;break}case H.A:var M=t[l++],L=t[l++],P=t[l++],S=t[l++],D=t[l++],A=t[l++],R=A+D;l+=1,_&&(s=Jt(D)*P+M,f=jt(D)*S+L),g=Ei(P,S)*Ai(It,Math.abs(A)),a=Jt(R)*P+M,o=jt(R)*S+L;break;case H.R:{s=a=t[l++],f=o=t[l++];var I=t[l++],x=t[l++];g=I*2+x*2;break}case H.Z:{var y=s-a,m=f-o;g=Math.sqrt(y*y+m*m),a=s,o=f;break}}g>=0&&(h[v++]=g,u+=g)}return this._pathLen=u,u},e.prototype.rebuildPath=function(t,r){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,f,h,u,v,l,d=r<1,_,g,c=0,p=0,y,m=0,w,C;if(!(d&&(this._pathSegLen||this._calculateLength(),_=this._pathSegLen,g=this._pathLen,y=r*g,!y)))t:for(var T=0;T0&&(t.lineTo(w,C),m=0),b){case H.M:s=h=i[T++],f=u=i[T++],t.moveTo(h,u);break;case H.L:{v=i[T++],l=i[T++];var L=Dt(v-h),P=Dt(l-u);if(L>n||P>a){if(d){var S=_[p++];if(c+S>y){var D=(y-c)/S;t.lineTo(h*(1-D)+v*D,u*(1-D)+l*D);break t}c+=S}t.lineTo(v,l),h=v,u=l,m=0}else{var A=L*L+P*P;A>m&&(w=v,C=l,m=A)}break}case H.C:{var R=i[T++],I=i[T++],x=i[T++],B=i[T++],k=i[T++],J=i[T++];if(d){var S=_[p++];if(c+S>y){var D=(y-c)/S;kt(h,R,x,k,D,Qt),kt(u,I,B,J,D,Kt),t.bezierCurveTo(Qt[1],Kt[1],Qt[2],Kt[2],Qt[3],Kt[3]);break t}c+=S}t.bezierCurveTo(R,I,x,B,k,J),h=k,u=J;break}case H.Q:{var R=i[T++],I=i[T++],x=i[T++],B=i[T++];if(d){var S=_[p++];if(c+S>y){var D=(y-c)/S;ze(h,R,x,D,Qt),ze(u,I,B,D,Kt),t.quadraticCurveTo(Qt[1],Kt[1],Qt[2],Kt[2]);break t}c+=S}t.quadraticCurveTo(R,I,x,B),h=x,u=B;break}case H.A:var Z=i[T++],X=i[T++],G=i[T++],nt=i[T++],at=i[T++],Rt=i[T++],Nt=i[T++],Wt=!i[T++],Yt=G>nt?G:nt,j=Dt(G-nt)>.001,$=at+Rt,E=!1;if(d){var S=_[p++];c+S>y&&($=at+Rt*(y-c)/S,E=!0),c+=S}if(j&&t.ellipse?t.ellipse(Z,X,G,nt,Nt,at,$,Wt):t.arc(Z,X,Yt,at,$,Wt),E)break t;M&&(s=Jt(at)*G+Z,f=jt(at)*nt+X),h=Jt($)*G+Z,u=jt($)*nt+X;break;case H.R:s=h=i[T],f=u=i[T+1],v=i[T++],l=i[T++];var O=i[T++],Ir=i[T++];if(d){var S=_[p++];if(c+S>y){var gt=y-c;t.moveTo(v,l),t.lineTo(v+Ai(gt,O),l),gt-=O,gt>0&&t.lineTo(v+O,l+Ai(gt,Ir)),gt-=Ir,gt>0&&t.lineTo(v+Ei(O-gt,0),l+Ir),gt-=O,gt>0&&t.lineTo(v,l+Ei(Ir-gt,0));break t}c+=S}t.rect(v,l,O,Ir);break;case H.Z:if(d){var S=_[p++];if(c+S>y){var D=(y-c)/S;t.lineTo(h*(1-D)+s*D,u*(1-D)+f*D);break t}c+=S}t.closePath(),h=s,u=f}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.CMD=H,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();function pr(e,t,r,i,n,a,o){if(n===0)return!1;var s=n,f=0,h=e;if(o>t+s&&o>i+s||oe+s&&a>r+s||at+v&&u>i+v&&u>a+v&&u>s+v||ue+v&&h>r+v&&h>n+v&&h>o+v||ht+h&&f>i+h&&f>a+h||fe+h&&s>r+h&&s>n+h||sr||u+hn&&(n+=Nr);var l=Math.atan2(f,s);return l<0&&(l+=Nr),l>=i&&l<=n||l+Nr>=i&&l+Nr<=n}function tr(e,t,r,i,n,a){if(a>t&&a>i||an?s:0}var Et=ur.CMD,rr=Math.PI*2,$f=1e-4;function Uf(e,t){return Math.abs(e-t)<$f}var K=[-1,-1,-1],vt=[-1,-1];function Vf(){var e=vt[0];vt[0]=vt[1],vt[1]=e}function Qf(e,t,r,i,n,a,o,s,f,h){if(h>t&&h>i&&h>a&&h>s||h1&&Vf(),d=U(t,i,a,s,vt[0]),l>1&&(_=U(t,i,a,s,vt[1]))),l===2?ct&&s>i&&s>a||s=0&&h<=1){for(var u=0,v=Q(t,i,a,h),l=0;lr||s<-r)return 0;var f=Math.sqrt(r*r-s*s);K[0]=-f,K[1]=f;var h=Math.abs(i-n);if(h<1e-4)return 0;if(h>=rr-1e-4){i=0,n=rr;var u=a?1:-1;return o>=K[0]+e&&o<=K[1]+e?u:0}if(i>n){var v=i;i=n,n=v}i<0&&(i+=rr,n+=rr);for(var l=0,d=0;d<2;d++){var _=K[d];if(_+e>o){var g=Math.atan2(s,_),u=a?1:-1;g<0&&(g=rr+g),(g>=i&&g<=n||g+rr>=i&&g+rr<=n)&&(g>Math.PI/2&&g1&&(r||(s+=tr(f,h,u,v,i,n))),c&&(f=a[_],h=a[_+1],u=f,v=h),g){case Et.M:u=a[_++],v=a[_++],f=u,h=v;break;case Et.L:if(r){if(pr(f,h,a[_],a[_+1],t,i,n))return!0}else s+=tr(f,h,a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case Et.C:if(r){if(Xf(f,h,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],t,i,n))return!0}else s+=Qf(f,h,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case Et.Q:if(r){if(qf(f,h,a[_++],a[_++],a[_],a[_+1],t,i,n))return!0}else s+=Kf(f,h,a[_++],a[_++],a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case Et.A:var p=a[_++],y=a[_++],m=a[_++],w=a[_++],C=a[_++],T=a[_++];_+=1;var b=!!(1-a[_++]);l=Math.cos(C)*m+p,d=Math.sin(C)*w+y,c?(u=l,v=d):s+=tr(f,h,l,d,i,n);var M=(i-p)*w/m+p;if(r){if(Zf(p,y,w,C,C+T,b,t,M,n))return!0}else s+=Jf(p,y,w,C,C+T,b,M,n);f=Math.cos(C+T)*m+p,h=Math.sin(C+T)*w+y;break;case Et.R:u=f=a[_++],v=h=a[_++];var L=a[_++],P=a[_++];if(l=u+L,d=v+P,r){if(pr(u,v,l,v,t,i,n)||pr(l,v,l,d,t,i,n)||pr(l,d,u,d,t,i,n)||pr(u,d,u,v,t,i,n))return!0}else s+=tr(l,v,l,d,i,n),s+=tr(u,d,u,v,i,n);break;case Et.Z:if(r){if(pr(f,h,u,v,t,i,n))return!0}else s+=tr(f,h,u,v,i,n);f=u,h=v;break}}return!r&&!Uf(h,v)&&(s+=tr(f,h,u,v,i,n)||0),s!==0}function jf(e,t,r){return wo(e,0,!1,t,r)}function th(e,t,r,i){return wo(e,t,!0,r,i)}var To=_t({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},fr),rh={style:_t({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ei.style)},Oi=ee.concat(["invisible","culling","z","z2","zlevel","parent"]),q=function(e){z(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(f){r.buildPath(f,r.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s.5?ji:i>.2?cf:tn}else if(r)return tn}return ji},t.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(Be(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=ke(r,0)0))},t.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,i=this.style,n=!r;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Xr)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||n){s.copy(r);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 r},t.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect(),o=this.style;if(r=n[0],i=n[1],a.contain(r,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)),th(s,f/h,r,i)))return!0}if(this.hasFill())return jf(s,r,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Xr,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,i){r==="shape"?this.setShape(i):e.prototype.attrKV.call(this,r,i)},t.prototype.setShape=function(r,i){var n=this.shape;return n||(n=this.shape={}),typeof r=="string"?n[r]=i:N(n,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Xr)},t.prototype.createStyle=function(r){return Je(To,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=N({},this.shape))},t.prototype._applyStateObj=function(r,i,n,a,o,s){e.prototype._applyStateObj.call(this,r,i,n,a,o,s);var f=!(i&&a),h;if(i&&i.shape?o?a?h=i.shape:(h=N({},n.shape),N(h,i.shape)):(h=N({},a?this.shape:n.shape),N(h,i.shape)):f&&(h=n.shape),h)if(o){this.shape=N({},this.shape);for(var u={},v=ft(h),l=0;l0},t.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(r){return Je(eh,r)},t.prototype.setBoundingRect=function(r){this._rect=r},t.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var i=r.text;i!=null?i+="":i="";var n=gf(i,r.font,r.textAlign,r.textBaseline);if(n.x+=r.x||0,n.y+=r.y||0,this.hasStroke()){var a=r.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},t.initDefaultProps=function(){var r=t.prototype;r.dirtyRectTolerance=10}(),t}(ae);We.prototype.type="tspan";var ih=_t({x:0,y:0},fr),nh={style:_t({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},ei.style)};function ah(e){return!!(e&&typeof e!="string"&&e.width&&e.height)}var bn=function(e){z(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(r){return Je(ih,r)},t.prototype._getSize=function(r){var i=this.style,n=i[r];if(n!=null)return n;var a=ah(i.image)?i.image:this.__image;if(!a)return 0;var o=r==="width"?"height":"width",s=i[o];return s==null?a[r]:a[r]/a[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return nh},t.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Y(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},t}(ae);bn.prototype.type="image";function oh(e,t){var r=t.x,i=t.y,n=t.width,a=t.height,o=t.r,s,f,h,u;n<0&&(r=r+n,n=-n),a<0&&(i=i+a,a=-a),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>n&&(v=s+f,s*=n/v,f*=n/v),h+u>n&&(v=h+u,h*=n/v,u*=n/v),f+h>a&&(v=f+h,f*=a/v,h*=a/v),s+u>a&&(v=s+u,s*=a/v,u*=a/v),e.moveTo(r+s,i),e.lineTo(r+n-f,i),f!==0&&e.arc(r+n-f,i+f,f,-Math.PI/2,0),e.lineTo(r+n,i+a-h),h!==0&&e.arc(r+n-h,i+a-h,h,0,Math.PI/2),e.lineTo(r+u,i+a),u!==0&&e.arc(r+u,i+a-u,u,Math.PI/2,Math.PI),e.lineTo(r,i+s),s!==0&&e.arc(r+s,i+s,s,Math.PI,Math.PI*1.5)}var Cr=Math.round;function sh(e,t,r){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;e.x1=i,e.x2=n,e.y1=a,e.y2=o;var s=r&&r.lineWidth;return s&&(Cr(i*2)===Cr(n*2)&&(e.x1=e.x2=Mr(i,s,!0)),Cr(a*2)===Cr(o*2)&&(e.y1=e.y2=Mr(a,s,!0))),e}}function fh(e,t,r){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;e.x=i,e.y=n,e.width=a,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=Mr(i,s,!0),e.y=Mr(n,s,!0),e.width=Math.max(Mr(i+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Mr(n+o,s,!1)-e.y,o===0?0:1)),e}}function Mr(e,t,r){if(!t)return e;var i=Cr(e*2);return(i+Cr(t))%2===0?i/2:(i+(r?1:-1))/2}var hh=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),uh={},Cn=function(e){z(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new hh},t.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var f=fh(uh,i,this.style);n=f.x,a=f.y,o=f.width,s=f.height,f.r=i.r,i=f}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?oh(r,i):r.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(q);Cn.prototype.type="rect";var sa={fill:"#000"},fa=2,vh={style:_t({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},ei.style)},lh=function(e){z(t,e);function t(r){var i=e.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=sa,i.attr(r),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,D=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),A=o.calculatedLineHeight,R=0;R=0&&(R=T[A],R.align==="right");)this._placeToken(R,r,M,p,D,"right",m),L-=R.width,D-=R.width,A--;for(S+=(a-(S-c)-(y-D)-L)/2;P<=A;)R=T[P],this._placeToken(R,r,M,p,S+R.width/2,"center",m),S+=R.width,P++;p+=M}},t.prototype._placeToken=function(r,i,n,a,o,s,f){var h=i.rich[r.styleName]||{};h.text=r.text;var u=r.verticalAlign,v=a+n/2;u==="top"?v=a+r.height/2:u==="bottom"&&(v=a+n-r.height/2);var l=!r.isLineHolder&&Bi(h);l&&this._renderBackground(h,i,s==="right"?o-r.width:s==="center"?o-r.width/2:o,v-r.height/2,r.width,r.height);var d=!!h.backgroundColor,_=r.textPadding;_&&(o=ca(o,s,_),v-=r.height/2-_[0]-r.innerHeight/2);var g=this._getOrCreateChild(We),c=g.createStyle();g.useStyle(c);var p=this._defaultStyle,y=!1,m=0,w=da("fill"in h?h.fill:"fill"in i?i.fill:(y=!0,p.fill)),C=la("stroke"in h?h.stroke:"stroke"in i?i.stroke:!d&&!f&&(!p.autoStroke||y)?(m=fa,p.stroke):null),T=h.textShadowBlur>0||i.textShadowBlur>0;c.text=r.text,c.x=o,c.y=v,T&&(c.shadowBlur=h.textShadowBlur||i.textShadowBlur||0,c.shadowColor=h.textShadowColor||i.textShadowColor||"transparent",c.shadowOffsetX=h.textShadowOffsetX||i.textShadowOffsetX||0,c.shadowOffsetY=h.textShadowOffsetY||i.textShadowOffsetY||0),c.textAlign=s,c.textBaseline="middle",c.font=r.font||hr,c.opacity=De(h.opacity,i.opacity,1),ua(c,h),C&&(c.lineWidth=De(h.lineWidth,i.lineWidth,m),c.lineDash=ot(h.lineDash,i.lineDash),c.lineDashOffset=i.lineDashOffset||0,c.stroke=C),w&&(c.fill=w);var b=r.contentWidth,M=r.contentHeight;g.setBoundingRect(new Y(Zr(c.x,b,c.textAlign),mr(c.y,M,c.textBaseline),b,M))},t.prototype._renderBackground=function(r,i,n,a,o,s){var f=r.backgroundColor,h=r.borderWidth,u=r.borderColor,v=f&&f.image,l=f&&!v,d=r.borderRadius,_=this,g,c;if(l||r.lineHeight||h&&u){g=this._getOrCreateChild(Cn),g.useStyle(g.createStyle()),g.style.fill=null;var p=g.shape;p.x=n,p.y=a,p.width=o,p.height=s,p.r=d,g.dirtyShape()}if(l){var y=g.style;y.fill=f||null,y.fillOpacity=ot(r.fillOpacity,1)}else if(v){c=this._getOrCreateChild(bn),c.onload=function(){_.dirtyStyle()};var m=c.style;m.image=f.image,m.x=n,m.y=a,m.width=o,m.height=s}if(h&&u){var y=g.style;y.lineWidth=h,y.stroke=u,y.strokeOpacity=ot(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var w=(g||c).style;w.shadowBlur=r.shadowBlur||0,w.shadowColor=r.shadowColor||"transparent",w.shadowOffsetX=r.shadowOffsetX||0,w.shadowOffsetY=r.shadowOffsetY||0,w.opacity=De(r.opacity,i.opacity,1)},t.makeFont=function(r){var i="";return _h(r)&&(i=[r.fontStyle,r.fontWeight,ph(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&Gr(i)||r.textFont||r.font},t}(ae),dh={left:!0,right:1,center:1},ch={top:1,bottom:1,middle:1},ha=["fontStyle","fontWeight","fontSize","fontFamily"];function ph(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?dn+"px":e+"px"}function ua(e,t){for(var r=0;r1&&(o*=Hi(_),s*=Hi(_));var g=(n===a?-1:1)*Hi((o*o*(s*s)-o*o*(d*d)-s*s*(l*l))/(o*o*(d*d)+s*s*(l*l)))||0,c=g*o*d/s,p=g*-s*l/o,y=(e+r)/2+Te(v)*c-we(v)*p,m=(t+i)/2+we(v)*c+Te(v)*p,w=ya([1,0],[(l-c)/o,(d-p)/s]),C=[(l-c)/o,(d-p)/s],T=[(-1*l-c)/o,(-1*d-p)/s],b=ya(C,T);if(an(C,T)<=-1&&(b=Wr),an(C,T)>=1&&(b=0),b<0){var M=Math.round(b/Wr*1e6)/1e6;b=Wr*2+M%2*Wr}u.addData(h,y,m,o,s,w,b,v,a)}var wh=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Th=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function bh(e){var t=new ur;if(!e)return t;var r=0,i=0,n=r,a=i,o,s=ur.CMD,f=e.match(wh);if(!f)return t;for(var h=0;hR*R+I*I&&(M=P,L=S),{cx:M,cy:L,x0:-u,y0:-v,x1:M*(n/C-1),y1:L*(n/C-1)}}function Dh(e){var t;if(re(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function xh(e,t){var r,i=$r(t.r,0),n=$r(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var f=t.startAngle,h=t.endAngle;if(!(isNaN(f)||isNaN(h))){var u=t.cx,v=t.cy,l=!!t.clockwise,d=wa(h-f),_=d>zi&&d%zi;if(_>dt&&(d=_),!(i>dt))e.moveTo(u,v);else if(d>zi-dt)e.moveTo(u+i*gr(f),v+i*er(f)),e.arc(u,v,i,f,h,!l),n>dt&&(e.moveTo(u+n*gr(h),v+n*er(h)),e.arc(u,v,n,h,f,l));else{var g=void 0,c=void 0,p=void 0,y=void 0,m=void 0,w=void 0,C=void 0,T=void 0,b=void 0,M=void 0,L=void 0,P=void 0,S=void 0,D=void 0,A=void 0,R=void 0,I=i*gr(f),x=i*er(f),B=n*gr(h),k=n*er(h),J=d>dt;if(J){var Z=t.cornerRadius;Z&&(r=Dh(Z),g=r[0],c=r[1],p=r[2],y=r[3]);var X=wa(i-n)/2;if(m=Tt(X,p),w=Tt(X,y),C=Tt(X,g),T=Tt(X,c),L=b=$r(m,w),P=M=$r(C,T),(b>dt||M>dt)&&(S=i*gr(h),D=i*er(h),A=n*gr(f),R=n*er(f),ddt){var j=Tt(p,L),$=Tt(y,L),E=be(A,R,I,x,i,j,l),O=be(S,D,B,k,i,$,l);e.moveTo(u+E.cx+E.x0,v+E.cy+E.y0),L0&&e.arc(u+E.cx,v+E.cy,j,V(E.y0,E.x0),V(E.y1,E.x1),!l),e.arc(u,v,i,V(E.cy+E.y1,E.cx+E.x1),V(O.cy+O.y1,O.cx+O.x1),!l),$>0&&e.arc(u+O.cx,v+O.cy,$,V(O.y1,O.x1),V(O.y0,O.x0),!l))}else e.moveTo(u+I,v+x),e.arc(u,v,i,f,h,!l);if(!(n>dt)||!J)e.lineTo(u+B,v+k);else if(P>dt){var j=Tt(g,P),$=Tt(c,P),E=be(B,k,S,D,n,-$,l),O=be(I,x,A,R,n,-j,l);e.lineTo(u+E.cx+E.x0,v+E.cy+E.y0),P0&&e.arc(u+E.cx,v+E.cy,$,V(E.y0,E.x0),V(E.y1,E.x1),!l),e.arc(u,v,n,V(E.cy+E.y1,E.cx+E.x1),V(O.cy+O.y1,O.cx+O.x1),l),j>0&&e.arc(u+O.cx,v+O.cy,j,V(O.y1,O.x1),V(O.y0,O.x0),!l))}else e.lineTo(u+B,v+k),e.arc(u,v,n,h,f,l)}e.closePath()}}}var Ah=function(){function e(){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 e}(),on=function(e){z(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Ah},t.prototype.buildPath=function(r,i){xh(r,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(q);on.prototype.type="sector";var Eh=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Ih=function(e){z(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Eh},t.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.PI*2;r.moveTo(n+i.r,a),r.arc(n,a,i.r,0,o,!1),r.moveTo(n+i.r0,a),r.arc(n,a,i.r0,0,o,!0)},t}(q);Ih.prototype.type="ring";function Fh(e,t,r,i){var n=[],a=[],o=[],s=[],f,h,u,v;if(i){u=[1/0,1/0],v=[-1/0,-1/0];for(var l=0,d=e.length;l=2){if(i){var a=Fh(n,i,r,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(r?o:o-1);s++){var f=a[s*2],h=a[s*2+1],u=n[(s+1)%o];e.bezierCurveTo(f[0],f[1],h[0],h[1],u[0],u[1])}}else{e.moveTo(n[0][0],n[0][1]);for(var s=1,v=n.length;snr[1]){if(s=!1,a)return s;var u=Math.abs(nr[0]-ir[1]),v=Math.abs(ir[0]-nr[1]);Math.min(u,v)>n.len()&&(u=0&&or(f)?f:.5;var h=e.createRadialGradient(o,s,0,o,s,f);return h}function sn(e,t,r){for(var i=t.type==="radial"?Vh(e,t,r):Uh(e,t,r),n=t.colorStops,a=0;a0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:Re(e)?[e]:re(e)?e:null}function Ao(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&Kh(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(r){var n=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;n&&n!==1&&(r=St(r,function(a){return a/n}),i/=n)}return[r,i]}var Jh=new ur(!0);function Ye(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function ba(e){return typeof e=="string"&&e!=="none"}function Ge(e){var t=e.fill;return t!=null&&t!=="none"}function Ca(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function Ma(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function fn(e,t,r){var i=po(t.image,t.__image,r);if(ri(i)){var n=e.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*os),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function jh(e,t,r,i){var n,a=Ye(r),o=Ge(r),s=r.strokePercent,f=s<1,h=!t.path;(!t.silent||f)&&h&&t.createPathProxy();var u=t.path||Jh,v=t.__dirty;if(!i){var l=r.fill,d=r.stroke,_=o&&!!l.colorStops,g=a&&!!d.colorStops,c=o&&!!l.image,p=a&&!!d.image,y=void 0,m=void 0,w=void 0,C=void 0,T=void 0;(_||g)&&(T=t.getBoundingRect()),_&&(y=v?sn(e,l,T):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(m=v?sn(e,d,T):t.__canvasStrokeGradient,t.__canvasStrokeGradient=m),c&&(w=v||!t.__canvasFillPattern?fn(e,l,t):t.__canvasFillPattern,t.__canvasFillPattern=w),p&&(C=v||!t.__canvasStrokePattern?fn(e,d,t):t.__canvasStrokePattern,t.__canvasStrokePattern=w),_?e.fillStyle=y:c&&(w?e.fillStyle=w:o=!1),g?e.strokeStyle=m:p&&(C?e.strokeStyle=C:a=!1)}var b=t.getGlobalScale();u.setScale(b[0],b[1],t.segmentIgnoreThreshold);var M,L;e.setLineDash&&r.lineDash&&(n=Ao(t),M=n[0],L=n[1]);var P=!0;(h||v&Xr)&&(u.setDPR(e.dpr),f?u.setContext(null):(u.setContext(e),P=!1),u.reset(),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),P&&u.rebuildPath(e,f?s:1),M&&(e.setLineDash(M),e.lineDashOffset=L),i||(r.strokeFirst?(a&&Ma(e,r),o&&Ca(e,r)):(o&&Ca(e,r),a&&Ma(e,r))),M&&e.setLineDash([])}function tu(e,t,r){var i=t.__image=po(r.image,t.__image,t,t.onload);if(!(!i||!ri(i))){var n=r.x||0,a=r.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),r.sWidth&&r.sHeight){var h=r.sx||0,u=r.sy||0;e.drawImage(i,h,u,r.sWidth,r.sHeight,n,a,o,s)}else if(r.sx&&r.sy){var h=r.sx,u=r.sy,v=o-h,l=s-u;e.drawImage(i,h,u,v,l,n,a,o,s)}else e.drawImage(i,n,a,o,s)}}function ru(e,t,r){var i,n=r.text;if(n!=null&&(n+=""),n){e.font=r.font||hr,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,o=void 0;e.setLineDash&&r.lineDash&&(i=Ao(t),a=i[0],o=i[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),r.strokeFirst?(Ye(r)&&e.strokeText(n,r.x,r.y),Ge(r)&&e.fillText(n,r.x,r.y)):(Ge(r)&&e.fillText(n,r.x,r.y),Ye(r)&&e.strokeText(n,r.x,r.y)),a&&e.setLineDash([])}}var La=["shadowBlur","shadowOffsetX","shadowOffsetY"],Pa=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Eo(e,t,r,i,n){var a=!1;if(!i&&(r=r||{},t===r))return!1;if(i||t.opacity!==r.opacity){it(e,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?fr.opacity:o}(i||t.blend!==r.blend)&&(a||(it(e,n),a=!0),e.globalCompositeOperation=t.blend||fr.blend);for(var s=0;s2&&i.push(n),n=[A,R]}function u(A,R,I,x){Lr(A,I)&&Lr(R,x)||n.push(A,R,I,x,I,x)}function v(A,R,I,x,B,k){var J=Math.abs(R-A),Z=Math.tan(J/4)*4/3,X=RM:S2&&i.push(n),i}function un(e,t,r,i,n,a,o,s,f,h){if(Lr(e,r)&&Lr(t,i)&&Lr(n,o)&&Lr(a,s)){f.push(o,s);return}var u=2/h,v=u*u,l=o-e,d=s-t,_=Math.sqrt(l*l+d*d);l/=_,d/=_;var g=r-e,c=i-t,p=n-o,y=a-s,m=g*g+c*c,w=p*p+y*y;if(m=0&&M=0){f.push(o,s);return}var L=[],P=[];kt(e,r,n,o,.5,L),kt(t,i,a,s,.5,P),un(L[0],P[0],L[1],P[1],L[2],P[2],L[3],P[3],f,h),un(L[4],P[4],L[5],P[5],L[6],P[6],L[7],P[7],f,h)}function fu(e,t){var r=hn(e),i=[];t=t||1;for(var n=0;n0)for(var h=0;hMath.abs(h),v=Fo([f,h],u?0:1,t),l=(u?s:h)/v.length,d=0;dn,o=Fo([i,n],a?0:1,t),s=a?"width":"height",f=a?"height":"width",h=a?"x":"y",u=a?"y":"x",v=e[s]/o.length,l=0;l1?null:new F(g*f+e,g*h+t)}function vu(e,t,r){var i=new F;F.sub(i,r,t),i.normalize();var n=new F;F.sub(n,e,t);var a=n.dot(i);return a}function yr(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function lu(e,t,r){for(var i=e.length,n=[],a=0;ao?(h.x=u.x=s+a/2,h.y=f,u.y=f+o):(h.y=u.y=f+o/2,h.x=s,u.x=s+a),lu(t,h,u)}function Xe(e,t,r,i){if(r===1)i.push(t);else{var n=Math.floor(r/2),a=e(t);Xe(e,a[0],n,i),Xe(e,a[1],r-n,i)}return i}function du(e,t){for(var r=[],i=0;i0;h/=2){var u=0,v=0;(e&h)>0&&(u=1),(t&h)>0&&(v=1),s+=h*h*(3*u^v),v===0&&(u===1&&(e=h-1-e,t=h-1-t),f=e,e=t,t=f)}return s}function Ze(e){var t=1/0,r=1/0,i=-1/0,n=-1/0,a=St(e,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),r=Math.min(v,r),i=Math.max(u,i),n=Math.max(v,n),[u,v]}),o=St(a,function(s,f){return{cp:s,z:bu(s[0],s[1],t,r,i,n),path:e[f]}});return o.sort(function(s,f){return s.z-f.z}).map(function(s){return s.path})}function zo(e){return _u(e.path,e.count)}function ln(){return{fromIndividuals:[],toIndividuals:[],count:0}}function ju(e,t,r){var i=[];function n(C){for(var T=0;T=s)}}for(var v=this.__startIndex;v15)break}}R.prevElClipPaths&&p.restore()};if(y)if(y.length===0)M=c.__endIndex;else for(var P=d.dpr,S=0;S0&&t>n[0]){for(f=0;ft);f++);s=i[n[f]]}if(n.splice(f+1,0,t),i[t]=r,!r.virtual)if(s){var h=s.dom;h.nextSibling?o.insertBefore(r.dom,h.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},e.prototype.eachLayer=function(t,r){for(var i=this._zlevelList,n=0;n0?Se:0),this._needsManuallyCompositing),u.__builtin__||_n("ZLevel "+h+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==f&&(u.__dirty=!0),u.__startIndex=f,u.incremental?u.__drawIndex=-1:u.__drawIndex=f,r(f),a=u),n.__dirty&Lt&&!n.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=f))}r(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)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,st(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var i=this._layerConfig;i[t]?Yr(i[t],r,!0):i[t]=r;for(var n=0;n