!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).zrender={})}(this,function(t){"use strict";var e=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},h=new function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(h.wxa=!0,h.canvasSupported=!0,h.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(h.worker=!0,h.canvasSupported=!0):"undefined"==typeof navigator?(h.node=!0,h.canvasSupported=!0,h.svgSupported=!0):function(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]);n&&(r.ie=!0,r.version=n[1]);o&&(r.edge=!0,r.version=o[1],r.newEdge=18<+o[1].split(".")[0]);a&&(r.weChat=!0);e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&11<=+r.version),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&9<=+r.version}(navigator.userAgent,h);var s={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},l={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},u=Object.prototype.toString,r=Array.prototype,a=r.forEach,p=r.filter,n=r.slice,c=r.map,i=function(){}.constructor,o=i?i.prototype:null,f="__proto__",d={};var y=2311;function g(){return y++}function v(){for(var t=[],e=0;e>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[h]+":0",n[l]+":0",i[1-h]+":auto",n[1-l]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,o),o,n);if(a)return a(t,r,i),1}}function At(t){return"CANVAS"===t.nodeName.toUpperCase()}var Dt="undefined"!=typeof window&&!!window.addEventListener,zt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Lt=[];function Rt(t,e,r,i){return r=r||{},i||!h.canvasSupported?Ot(t,e,r):h.browser.firefox&&h.browser.version<"39"&&null!=e.layerX&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):null!=e.offsetX?(r.zrX=e.offsetX,r.zrY=e.offsetY):Ot(t,e,r),r}function Ot(t,e,r){if(h.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(At(t)){var o=t.getBoundingClientRect();return r.zrX=i-o.left,void(r.zrY=n-o.top)}if(Mt(Lt,t,i,n))return r.zrX=Lt[0],void(r.zrY=Lt[1])}r.zrX=r.zrY=0}function It(t){return t||window.event}function Ft(t,e,r){if(null!=(e=It(e)).zrX)return e;var i,n,o=e.type;o&&0<=o.indexOf("touch")?(i="touchend"!==o?e.targetTouches[0]:e.changedTouches[0])&&Rt(t,i,e,r):(Rt(t,e,e,r),n=function(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;return null!=r&&null!=i?3*(0!==i?Math.abs(i):Math.abs(r))*(0i.getWidth()||r<0||r>i.getHeight()}S(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){Kt.prototype[a]=function(t){var e,r,i=t.zrX,n=t.zrY,o=$t(this,i,n);if("mouseup"===a&&o||(r=(e=this.findHover(i,n)).target),"mousedown"===a)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===a)this._upEl=r;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4>>1])<0?h=o:s=1+o;var l=i-s;switch(l){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);o(t,e[r+u])<0?h=u:a=u+1}return h}function oe(d,y){var a,s,g=te,h=0,v=(d.length,[]);function e(t){var e=a[t],r=s[t],i=a[t+1],n=s[t+1];s[t]=r+n,t===h-3&&(a[t+1]=a[t+2],s[t+1]=s[t+2]),h--;var o=ne(d[i],d,e,r,0,y);e+=o,0!=(r-=o)&&0!==(n=ie(d[e+r-1],d,i,n,n-1,y))&&(r<=n?function(t,e,r,i){var n=0;for(n=0;ns[t+1])break;e(t)}},forceMergeRuns:function(){for(;1>=1;return t+e}(n);do{(o=ee(t,r,i,e))=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(i.slice(4),16)/15:1),Oe(t,e),e):void De(e,0,0,0,1):7===o||9===o?0<=(n=parseInt(i.slice(1,7),16))&&n<=16777215?(De(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Oe(t,e),e):void De(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var h=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?De(e,+l[0],+l[1],+l[2],1):De(e,0,0,0,1);u=Pe(l.pop());case"rgb":return 3!==l.length?void De(e,0,0,0,1):(De(e,Ce(l[0]),Ce(l[1]),Ce(l[2]),u),Oe(t,e),e);case"hsla":return 4!==l.length?void De(e,0,0,0,1):(l[3]=Pe(l[3]),Fe(l,e),Oe(t,e),e);case"hsl":return 3!==l.length?void De(e,0,0,0,1):(Fe(l,e),Oe(t,e),e);default:return}}De(e,0,0,0,1)}}function Fe(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Pe(t[1]),n=Pe(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return De(e=e||[],Se(255*Me(a,o,r+1/3)),Se(255*Me(a,o,r)),Se(255*Me(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Be(t){var e=Ie(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Ee(t,e,r){if(e&&e.length&&0<=t&&t<=1){r=r||[];var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=e[n],s=e[o],h=i-n;return r[0]=Se(Ae(a[0],s[0],h)),r[1]=Se(Ae(a[1],s[1],h)),r[2]=Se(Ae(a[2],s[2],h)),r[3]=Te(Ae(a[3],s[3],h)),r}}function He(t,e,r){if(e&&e.length&&0<=t&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=Ie(e[n]),s=Ie(e[o]),h=i-n,l=Ne([Se(Ae(a[0],s[0],h)),Se(Ae(a[1],s[1],h)),Se(Ae(a[2],s[2],h)),Te(Ae(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}function Ne(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}function We(t,e){var r=Ie(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Ue=Object.freeze({__proto__:null,parse:Ie,lift:function(t,e){var r=Ie(t);if(r){for(var i=0;i<3;i++)r[i]=e<0?r[i]*(1-e)|0:(255-r[i])*e+r[i]|0,255=this.maxTime?this.maxTime=t:this._needsSort=!0;var r,i=this.keyframes,n=i.length;if(this.interpolable)if(D(e)){var o,a=D((r=e)&&r[0])?2:1;if(0e);l++);l=Math.min(l-1,o-2)}var u,p,c,f,d,y,g,v,_,m,x=n[l+1],b=n[l];b&&x&&(this._lastFrame=l,this._lastFramePercent=e,0!=(u=x.percent-b.percent)&&(p=(e-b.percent)/u,c=r?this._additiveValue:h?Je:t[a],(0=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},hi.prototype.clone=function(){return new hi(this.x,this.y,this.width,this.height)},hi.prototype.copy=function(t){hi.copy(this,t)},hi.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},hi.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},hi.prototype.isZero=function(){return 0===this.width||0===this.height},hi.create=function(t){return new hi(t.x,t.y,t.width,t.height)},hi.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},hi.applyTransform=function(t,e,r){if(r){if(r[1]<1e-5&&-1e-5this._sleepAfterStill&&this.animation.stop())},Bi.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Bi.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Bi.prototype.addHover=function(t){},Bi.prototype.removeHover=function(t){},Bi.prototype.clearHover=function(){},Bi.prototype.refreshHover=function(){this._needsRefreshHover=!0},Bi.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},Bi.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Bi.prototype.clearAnimation=function(){this.animation.clear()},Bi.prototype.getWidth=function(){return this.painter.getWidth()},Bi.prototype.getHeight=function(){return this.painter.getHeight()},Bi.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Bi.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Bi.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Bi.prototype.on=function(t,e,r){return this.handler.on(t,e,r),this},Bi.prototype.off=function(t,e){this.handler.off(t,e)},Bi.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Bi.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;ethis._ux||n>this._uy;return this.addData(Mn.L,t,e),this._ctx&&o&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),o?(this._xi=t,this._yi=e,this._pendingPtDist=0):(r=i*i+n*n)>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=r),this},Zn.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._drawPendingPt(),this.addData(Mn.C,t,e,r,i,n,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,r,i,n,o):this._ctx.bezierCurveTo(t,e,r,i,n,o)),this._xi=n,this._yi=o,this},Zn.prototype.quadraticCurveTo=function(t,e,r,i){return this._drawPendingPt(),this.addData(Mn.Q,t,e,r,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,r,i):this._ctx.quadraticCurveTo(t,e,r,i)),this._xi=r,this._yi=i,this},Zn.prototype.arc=function(t,e,r,i,n,o){this._drawPendingPt(),jn[0]=i,jn[1]=n,qn(jn,o),i=jn[0];var a=(n=jn[1])-i;return this.addData(Mn.A,t,e,r,r,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,r,i,n,o),this._xi=Bn(n)*r+t,this._yi=En(n)*r+e,this},Zn.prototype.arcTo=function(t,e,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,r,i,n),this},Zn.prototype.rect=function(t,e,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,r,i),this.addData(Mn.R,t,e,r,i),this},Zn.prototype.closePath=function(){this._drawPendingPt(),this.addData(Mn.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},Zn.prototype.fill=function(t){t&&t.fill(),this.toStatic()},Zn.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},Zn.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,r=0;rl.length&&(this._expandData(),l=this.data);for(var u=0;ur||Nn(g)>i||p===e-1)&&(d=Math.sqrt(A*A+g*g),n=y,o=m);break;case Mn.C:var v=t[p++],_=t[p++],y=t[p++],m=t[p++],x=t[p++],b=t[p++],d=function(t,e,r,i,n,o,a,s,h){for(var l=t,u=e,p=0,c=1/h,f=1;f<=h;f++){var d=f*c,y=hn(t,r,n,a,d),g=hn(e,i,o,s,d),v=y-l,_=g-u;p+=Math.sqrt(v*v+_*_),l=y,u=g}return p}(n,o,v,_,y,m,x,b,10),n=x,o=b;break;case Mn.Q:d=function(t,e,r,i,n,o,a){for(var s=t,h=e,l=0,u=1/a,p=1;p<=a;p++){var c=p*u,f=cn(t,r,n,c),d=cn(e,i,o,c),y=f-s,g=d-h;l+=Math.sqrt(y*y+g*g),s=f,h=d}return l}(n,o,v=t[p++],_=t[p++],y=t[p++],m=t[p++],10),n=y,o=m;break;case Mn.A:var w=t[p++],k=t[p++],S=t[p++],T=t[p++],C=t[p++],P=t[p++],M=P+C;p+=1,t[p++],f&&(a=Bn(C)*S+w,s=En(C)*T+k),d=Fn(S,T)*In(Un,Math.abs(P)),n=Bn(M)*S+w,o=En(M)*T+k;break;case Mn.R:a=n=t[p++],s=o=t[p++],d=2*t[p++]+2*t[p++];break;case Mn.Z:var A=a-n,g=s-o;d=Math.sqrt(A*A+g*g),n=a,o=s}0<=d&&(l+=h[u++]=d)}return this._pathLen=l},Zn.prototype.rebuildPath=function(t,e){var r,i,n,o,a,s,h,l,u,p,c=this.data,f=this._ux,d=this._uy,y=this._len,g=e<1,v=0,_=0,m=0;if(!g||(this._pathSegLen||this._calculateLength(),h=this._pathSegLen,l=e*this._pathLen))t:for(var x=0;x=ao[i=0]+t&&a<=ao[1]+t?p:0}nMath.PI/2&&d<1.5*Math.PI&&(p=-p),c+=p))}return c}(v,_,x,b,b+w,k,C,n);u=Math.cos(b+w)*m+v,p=Math.sin(b+w)*x+_;break;case io.R:c=u=s[d++],f=p=s[d++];if(S=c+s[d++],T=f+s[d++],r){if(Kn(c,f,S,f,e,i,n)||Kn(S,f,S,T,e,i,n)||Kn(S,T,c,T,e,i,n)||Kn(c,T,c,f,e,i,n))return!0}else l+=ro(S,f,S,T,i,n),l+=ro(c,T,c,f,i,n);break;case io.Z:if(r){if(Kn(u,p,c,f,e,i,n))return!0}else l+=ro(u,p,c,f,i,n);u=c,p=f}}return r||(o=p,a=f,Math.abs(o-a)Math.abs(l),p=ks([h,l],u?0:1,e),c=(u?s:l)/p.length,f=0;f=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,r,i){for(var n=0,o=0,a=t.length;oo){0i.width&&(o=e.split("\n"),y=!0),i.accumWidth=l):(u=ph(e,d,i.width,i.breakAll,i.accumWidth),i.accumWidth=u.accumWidth+h,a=u.linesWidths,o=u.lines)):o=e.split("\n");for(var g=0;gi.len()&&(l=c}}for(var o,a=this.__startIndex;an[0]){for(h=0;ht);h++);s=i[n[h]]}n.splice(h+1,0,t),(i[t]=e).virtual||(s?(r=s.dom).nextSibling?a.insertBefore(e.dom,r.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else v("Layer of zlevel "+t+" is not valid")},ou.prototype.eachLayer=function(t,e){for(var r=this._zlevelList,i=0;i=p&&c<=e+1){for(var r=[],i=0;i=p&&c<=o+1)return function(t){for(var e=0,r=t.length,i=0,n=0;e\n\r<"))},ap);function ap(t,e,r,i){this.type="svg",this.refreshHover=sp("refreshHover"),this.pathToImage=sp("pathToImage"),this.configLayer=sp("configLayer"),this.root=t,this.storage=e,this._opts=r=x({},r||{});var n=au("svg");n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.setAttribute("version","1.1"),n.setAttribute("baseProfile","full"),n.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=au("g");n.appendChild(o);var a=au("g");n.appendChild(a),this._gradientManager=new Fu(i,a),this._patternManager=new ju(i,a),this._clipPathManager=new Vu(i,a),this._shadowManager=new Qu(i,a);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=n,this._svgRoot=a,this._backgroundRoot=o,this._viewport=s,t.appendChild(s),s.appendChild(n),this.resize(r.width,r.height),this._visibleList=[]}function sp(t){return function(){v('In SVG mode painter not support method "'+t+'"')}}Ei("canvas",nu),Ei("svg",op),t.Arc=Ph,t.ArcShape=Ch,t.BezierCurve=Rh,t.BezierCurveShape=Dh,t.BoundingRect=si,t.Circle=Zo,t.CircleShape=Vo,t.CompoundPath=qs,t.Displayable=qi,t.Droplet=Bh,t.DropletShape=Fh,t.Element=Ti,t.Ellipse=aa,t.EllipseShape=oa,t.Group=zi,t.Heart=Wh,t.HeartShape=Nh,t.Image=Yo,t.IncrementalDisplayable=Ks,t.Isogon=Vh,t.IsogonShape=Gh,t.Line=pa,t.LineShape=ua,t.LinearGradient=Ca,t.OrientedBoundingRect=Tl,t.Path=vo,t.Pattern=xl,t.Point=Qr,t.Polygon=va,t.PolygonShape=ga,t.Polyline=ba,t.PolylineShape=xa,t.RadialGradient=Aa,t.Rect=ra,t.RectShape=ta,t.Ring=$h,t.RingShape=Qh,t.Rose=ol,t.RoseShape=nl,t.Sector=vs,t.SectorShape=gs,t.Star=cl,t.StarShape=pl,t.TSpan=Oa,t.Text=yh,t.Trochoid=_l,t.TrochoidShape=vl,t.color=Ue,t.dispose=function(t){t.dispose()},t.disposeAll=function(){for(var t in Ii)Ii.hasOwnProperty(t)&&Ii[t].dispose();Ii={}},t.getInstance=function(t){return Ii[t]},t.init=function(t,e){var r=new Fi(g(),t,e);return Ii[r.id]=r},t.matrix=Nr,t.morph=Ys,t.parseSVG=function(t,e){return(new Na).parse(t,e)},t.path=Wo,t.registerPainter=Ei,t.showDebugDirtyRect=function(t,n){n=n||{};var e=t.painter;if(!e.getLayers)throw new Error("Debug dirty rect can only been used on canvas renderer.");if(e.isSingleCanvas())throw new Error("Debug dirty rect can only been used on zrender inited with container.");var o=document.createElement("div");o.style.cssText="\nposition:absolute;\nleft:0;\ntop:0;\nright:0;\nbottom:0;\npointer-events:none;\n",o.className="ec-debug-dirty-rect-container";var a=[],r=t.dom;r.appendChild(o),"static"===getComputedStyle(r).position&&(r.style.position="relative"),t.on("rendered",function(){if(e.getLayers){var i=0;e.eachBuiltinLayer(function(t){if(t.debugGetPaintRects)for(var e=t.debugGetPaintRects(),r=0;r