!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.zrender={})}(this,function(t){"use strict";function r(){return e++}var e=2311,_="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),r=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),n=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);r&&(e.ie=!0,e.version=r[1]);n&&(e.edge=!0,e.version=n[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},h={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},l=Object.prototype.toString,i=Array.prototype,o=i.forEach,u=i.filter,n=i.slice,c=i.map,f=i.reduce,a={};function d(t){if(null==t||"object"!=typeof t)return t;var e=t,i=l.call(t);if("[object Array]"===i){if(!H(t)){e=[];for(var r=0,n=t.length;r>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[h]+":0",n[l]+":0",r[1-h]+":auto",n[1-l]+":auto",""].join("!important;"),t.appendChild(o),i.push(o)}return i}(e,a),a,n);if(o)return o(t,i,r),!0}return!1}function mt(t){return"CANVAS"===t.nodeName.toUpperCase()}var yt="undefined"!=typeof window&&!!window.addEventListener,xt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,wt=[];function bt(t,e,i,r){return i=i||{},r||!_.canvasSupported?kt(t,e,i):_.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):kt(t,e,i),i}function kt(t,e,i){if(_.domSupported&&t.getBoundingClientRect){var r=e.clientX,n=e.clientY;if(mt(t)){var a=t.getBoundingClientRect();return i.zrX=r-a.left,void(i.zrY=n-a.top)}if(_t(wt,t,r,n))return i.zrX=wt[0],void(i.zrY=wt[1])}i.zrX=i.zrY=0}function Tt(t){return t||window.event}function St(t,e,i){if(null!=(e=Tt(e)).zrX)return e;var r=e.type;if(r&&0<=r.indexOf("touch")){var n="touchend"!==r?e.targetTouches[0]:e.changedTouches[0];n&&bt(t,n,e,i)}else bt(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&xt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Ct(){this._track=[]}var Mt=yt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function At(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}Ct.prototype={constructor:Ct,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var r=t.touches;if(r){for(var n={points:[],touches:[],target:e,event:t},a=0,o=r.length;ar.getWidth()||i<0||i>r.getHeight()}Bt.prototype={constructor:Bt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(T(It,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,i=t.zrY,r=Rt(this,e,i),n=this._hovered,a=n.target;a&&!a.__zr&&(a=(n=this.findHover(n.x,n.y)).target);var o=this._hovered=r?{x:e,y:i}:this.findHover(e,i),s=o.target,h=this.proxy;h.setCursor&&h.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(o,"mousemove",t),s&&s!==a&&this.dispatchToElement(o,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,i=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&(i||this.trigger("globalout",{type:"globalout",event:t}))},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){var r=(t=t||{}).target;if(!r||!r.silent){for(var n="on"+e,a=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:zt}}(e,t,i);r&&(r[n]&&(a.cancelBubble=r[n].call(r,a)),r.trigger(e,a),r=r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[n]&&t[n].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,i){for(var r=this.storage.getDisplayList(),n={x:t,y:e},a=r.length-1;0<=a;a--){var o;if(r[a]!==i&&!r[a].ignore&&(o=Ot(r[a],t,e))&&(n.topTarget||(n.topTarget=r[a]),o!==Lt)){n.target=r[a];break}}return n},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new Ct);var i=this._gestureMgr;"start"===e&&i.clear();var r=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),r){var n=r.type;t.gestureEvent=n,this.dispatchToElement({target:r.target},n,r.event)}}},T(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(o){Bt.prototype[o]=function(t){var e,i,r=t.zrX,n=t.zrY,a=Rt(this,r,n);if("mouseup"===o&&a||(i=(e=this.findHover(r,n)).target),"mousedown"===o)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===o)this._upEl=i;else if("click"===o){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),me(t,e),e):void pe(e,0,0,0,1):7===n.length?0<=(r=parseInt(n.substr(1),16))&&r<=16777215?(pe(e,(16711680&r)>>16,(65280&r)>>8,255&r,1),me(t,e),e):void pe(e,0,0,0,1):void 0;var a=n.indexOf("("),o=n.indexOf(")");if(-1!==a&&o+1===n.length){var s=n.substr(0,a),h=n.substr(a+1,o-(a+1)).split(","),l=1;switch(s){case"rgba":if(4!==h.length)return void pe(e,0,0,0,1);l=ce(h.pop());case"rgb":return 3!==h.length?void pe(e,0,0,0,1):(pe(e,ue(h[0]),ue(h[1]),ue(h[2]),l),me(t,e),e);case"hsla":return 4!==h.length?void pe(e,0,0,0,1):(h[3]=ce(h[3]),xe(h,e),me(t,e),e);case"hsl":return 3!==h.length?void pe(e,0,0,0,1):(xe(h,e),me(t,e),e);default:return}}pe(e,0,0,0,1)}}function xe(t,e){var i=(parseFloat(t[0])%360+360)%360/360,r=ce(t[1]),n=ce(t[2]),a=n<=.5?n*(r+1):n+r-n*r,o=2*n-a;return pe(e=e||[],he(255*fe(o,a,i+1/3)),he(255*fe(o,a,i)),he(255*fe(o,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function we(t){var e=ye(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function be(t,e,i){if(e&&e.length&&0<=t&&t<=1){i=i||[];var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),o=e[n],s=e[a],h=r-n;return i[0]=he(de(o[0],s[0],h)),i[1]=he(de(o[1],s[1],h)),i[2]=he(de(o[2],s[2],h)),i[3]=le(de(o[3],s[3],h)),i}}var ke=be;function Te(t,e,i){if(e&&e.length&&0<=t&&t<=1){var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),o=ye(e[n]),s=ye(e[a]),h=r-n,l=Ce([he(de(o[0],s[0],h)),he(de(o[1],s[1],h)),he(de(o[2],s[2],h)),le(de(o[3],s[3],h))],"rgba");return i?{color:l,leftIndex:n,rightIndex:a,value:r}:l}}var Se=Te;function Ce(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}var Me=(Object.freeze||Object)({parse:ye,lift:function(t,e){var i=ye(t);if(i){for(var r=0;r<3;r++)i[r]=e<0?i[r]*(1-e)|0:(255-i[r])*e+i[r]|0,255e);i++);i=Math.min(i-1,l-2)}P=e;var r=g[(A=i)+1]-g[i];if(0!=r)if(k=(e-g[i])/r,h)if(S=v[i],T=v[0===i?i:i-1],C=v[l-2=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new ri(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}};function ni(t){for(var e in t=t||{},Ze.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0}ni.prototype={constructor:ni,isGroup:!0,type:"group",silent:!(ri.create=function(t){return new ri(t.x,t.y,t.width,t.height)}),children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i>>1])<0?h=a:s=1+a;var l=r-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);a(t,e[i+u])<0?h=u:o=u+1}return h}function ci(p,g){var o,s,v=oi,h=0,_=[];function e(t){var e=o[t],i=s[t],r=o[t+1],n=s[t+1];s[t]=i+n,t===h-3&&(o[t+1]=o[t+2],s[t+1]=s[t+2]),h--;var a=ui(p[r],p,e,i,0,g);e+=a,0!==(i-=a)&&0!==(n=li(p[e+i-1],p,r,n,n-1,g))&&(i<=n?function(t,e,i,r){var n=0;for(n=0;ns[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1>=1;return t+e}(n);do{if((a=si(t,i,r,e))=e.maxIterations){t+=e.ellipsis;break}var s=0===o?Qi(t,n,e.ascCharWidth,e.cnCharWidth):0d)return{lines:[],width:0,height:0};P.textWidth=Vi(P.text,w);var k=y.textWidth,T=null==k||"auto"===k;if("string"==typeof k&&"%"===k.charAt(k.length-1))P.percentWidth=k,l.push(P),k=0;else{if(T){k=P.textWidth;var S=y.textBackgroundColor,C=S&&S.image;C&&Oi(C=Di(C))&&(k=Math.max(k,C.width*b/C.height))}var M=x?x[1]+x[3]:0;k+=M;var A=null!=f?f-_:null;null!=A&&Ar[0]){for(o=0;ot);o++);a=i[r[o]]}if(r.splice(o+1,0,t),!(i[t]=e).virtual)if(a){var h=a.dom;h.nextSibling?s.insertBefore(e.dom,h.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else Ye("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,r,n=this._zlevelList;for(r=0;rthis._ux||Gn(e-this._yi)>this._uy||this._len<5;return this.addData(Fn.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,r,n,a){return this.addData(Fn.C,t,e,i,r,n,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,r,n,a):this._ctx.bezierCurveTo(t,e,i,r,n,a)),this._xi=n,this._yi=a,this},quadraticCurveTo:function(t,e,i,r){return this.addData(Fn.Q,t,e,i,r),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,r):this._ctx.quadraticCurveTo(t,e,i,r)),this._xi=i,this._yi=r,this},arc:function(t,e,i,r,n,a){return this.addData(Fn.A,t,e,i,i,r,n-r,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,r,n,a),this._xi=jn(n)*i+t,this._yi=Yn(n)*i+e,this},arcTo:function(t,e,i,r,n){return this._ctx&&this._ctx.arcTo(t,e,i,r,n),this},rect:function(t,e,i,r){return this._ctx&&this._ctx.rect(t,e,i,r),this.addData(Fn.R,t,e,i,r),this},closePath:function(){this.addData(Fn.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;ih||Gn(o-n)>l||c===u-1)&&(t.lineTo(a,o),r=a,n=o);break;case Fn.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),r=s[c-2],n=s[c-1];break;case Fn.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),r=s[c-2],n=s[c-1];break;case Fn.A:var d=s[c++],p=s[c++],g=s[c++],v=s[c++],_=s[c++],m=s[c++],y=s[c++],x=s[c++],w=v=ha[r=0]+t&&o<=ha[1]+t?u:0}if(a){h=r;r=ea(n),n=ea(h)}else r=ea(r),n=ea(n);nMath.PI/2&&p<1.5*Math.PI&&(u=-u),c+=u)}}return c}function da(t,e,i,r,n){for(var a=0,o=0,s=0,h=0,l=0,u=0;u=c&&f<=i+1){for(var r=[],n=0;n=c&&f<=n+1)return fs(u,e.components,l,h);p[t]=e}else p[t]=void 0}var s;d++}for(;d<=e;){var o=a();if(o)return o}},pushComponent:function(t,e,i){var r=t[t.length-1];r&&r.added===e&&r.removed===i?t[t.length-1]={count:r.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,r){for(var n=e.length,a=i.length,o=t.newPos,s=o-r,h=0;o+1\n\r<"))}},T(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],function(t){Cs.prototype[t]=function(t){return function(){Ye('In SVG mode painter not support method "'+t+'"')}}(t)}),nn("svg",Cs);var Ms,As="urn:schemas-microsoft-com:vml",Ps="undefined"==typeof window?null:window,Ls=!1,zs=Ps&&Ps.document;function Ds(t){return Ms(t)}if(zs&&!_.canvasSupported)try{zs.namespaces.zrvml||zs.namespaces.add("zrvml",As),Ms=function(t){return zs.createElement("')}}catch(t){Ms=function(t){return zs.createElement("<"+t+' xmlns="'+As+'" class="zrvml">')}}var Bs,Is=Qn.CMD,Os=Math.round,Rs=Math.sqrt,Es=Math.abs,Fs=Math.cos,Hs=Math.sin,Ns=Math.max;if(!_.canvasSupported){var Ws=",",Vs="progid:DXImageTransform.Microsoft",Xs=21600,qs=Xs/2,js=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=Xs+","+Xs,t.coordorigin="0,0"},Ys=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},Us=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},Gs=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},Zs=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},Qs=xr,$s=function(t,e,i){var r=ye(e);i=+i,isNaN(i)&&(i=1),r&&(t.color=Ys(r[0],r[1],r[2]),t.opacity=i*r[3])},Ks=function(t,e,i,r){var n="fill"===e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(n||!n&&i.lineWidth)?(t[n?"filled":"stroked"]="true",i[e]instanceof Ua&&Gs(t,a),a=a||Ds(e),n?function(t,e,i){var r,n,a=e.fill;if(null!=a)if(a instanceof Ua){var o,s=0,h=[0,0],l=0,u=1,c=i.getBoundingRect(),f=c.width,d=c.height;if("linear"===a.type){o="gradient";var p=i.transform,g=[a.x*f,a.y*d],v=[a.x2*f,a.y2*d];p&&(nt(g,g,p),nt(v,v,p));var _=v[0]-g[0],m=v[1]-g[1];(s=180*Math.atan2(_,m)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{o="gradientradial";g=[a.x*f,a.y*d],p=i.transform;var y=i.scale,x=f,w=d;h=[(g[0]-c.x)/x,(g[1]-c.y)/w],p&&nt(g,g,p),x/=y[0]*Xs,w/=y[1]*Xs;var b=Ns(x,w);l=0/b,u=2*a.r/b-l}var k=a.colorStops.slice();k.sort(function(t,e){return t.offset-e.offset});for(var T=k.length,S=[],C=[],M=0;M