// Copyright 2006 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // (c) 2010-2013 Thomas Fuchs // Zepto.js may be freely distributed under the MIT license. /*! * ZRender, a high performance canvas library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. * * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */ define("zrender/dep/excanvas",["require"],function(e){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:function(){function f(){return this.context_||(this.context_=new I(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&").replace(/"/g,""")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.scaleX_=e.scaleX_,t.scaleY_=e.scaleY_,t.lineScale_=e.lineScale_}function N(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function C(e){return parseFloat(e)/100}function k(e,t,n){return Math.min(n,Math.max(t,e))}function L(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=k(C(e[1]),0,1),o=k(C(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=A(a,u,i+1/3),n=A(a,u,i),r=A(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function A(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function M(e){if(e in O)return O[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=N(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(C(r[s])*255):i=+r[s],t+=y[k(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=N(e);t=L(r),n=r[3]}else t=T[e]||e;return O[e]={color:t,alpha:n}}function P(e){if(D[e])return D[e];var t=document.createElement("div"),n=t.style,r;try{n.font=e,r=n.fontFamily.split(",")[0]}catch(i){}return D[e]={style:n.fontStyle||_.style,variant:n.fontVariant||_.variant,weight:n.fontWeight||_.weight,size:n.fontSize||_.size,family:r||_.family}}function H(e,t){var n={};for(var r in e)n[r]=e[r];var i=parseFloat(t.currentStyle.fontSize),s=parseFloat(e.size);return typeof e.size=="number"?n.size=e.size:e.size.indexOf("px")!=-1?n.size=s:e.size.indexOf("em")!=-1?n.size=i*s:e.size.indexOf("%")!=-1?n.size=i/100*s:e.size.indexOf("pt")!=-1?n.size=s/.75:n.size=i,n}function B(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function F(e){return j[e]||"square"}function I(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="#fff",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.scaleX_=1,this.scaleY_=1,this.lineScale_=1}function R(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function U(e,t){var n=M(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("')}function z(t,n,r,i){var s=t.fillStyle,u=t.scaleX_,a=t.scaleY_,f=i.x-r.x,l=i.y-r.y;if(s instanceof $){var c=0,h={x:0,y:0},p=0,d=1;if(s.type_=="gradient"){var v=s.x0_/u,m=s.y0_/a,g=s.x1_/u,y=s.y1_/a,b=W(t,v,m),w=W(t,g,y),E=w.x-b.x,S=w.y-b.y;c=Math.atan2(E,S)*180/Math.PI,c<0&&(c+=360),c<1e-6&&(c=0)}else{var b=W(t,s.x0_,s.y0_);h={x:(b.x-r.x)/f,y:(b.y-r.y)/l},f/=u*o,l/=a*o;var x=e.max(f,l);p=2*s.r0_/x,d=2*s.r1_/x-p}var T=s.colors_;T.sort(function(e,t){return e.offset-t.offset});var N=T.length,C=T[0].color,k=T[N-1].color,L=T[0].alpha*t.globalAlpha,A=T[N-1].alpha*t.globalAlpha,O=[];for(var _=0;_')}else if(s instanceof J){if(f&&l){var P=-r.x,H=-r.y;n.push("')}}else{var B=M(t.fillStyle),j=B.color,F=B.alpha*t.globalAlpha;n.push('')}}function W(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function X(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function V(e,t,n){if(!X(t))return;e.m_=t,e.scaleX_=Math.sqrt(t[0][0]*t[0][0]+t[0][1]*t[0][1]),e.scaleY_=Math.sqrt(t[1][0]*t[1][0]+t[1][1]*t[1][1]);if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function $(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function J(e,t){Q(e);switch(t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:K("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function K(e){throw new G(e)}function Q(e){(!e||e.nodeType!=1||e.tagName!="IMG")&&K("TYPE_MISMATCH_ERR"),e.readyState!="complete"&&K("INVALID_STATE_ERR")}function G(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n'),(f||l)&&w.push('
'),w.push('
'),(f||l)&&w.push("
"),w.push("
"),this.element_.insertAdjacentHTML("BeforeEnd",w.join(""))},q.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("f.x)f.x=c.x;if(a.y==null||c.yf.y)f.y=c.y}}n.push(' ">'),e?z(this,n,a,f):U(this,n),n.push(""),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},q.fill=function(){this.stroke(!0)},q.closePath=function(){this.currentPath_.push({type:"close"})},q.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},q.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},q.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];V(this,S(n,this.m_),!1)},q.rotate=function(e){var t=r(e),i=n(e),s=[[t,i,0],[-i,t,0],[0,0,1]];V(this,S(s,this.m_),!1)},q.scale=function(e,t){var n=[[e,0,0],[0,t,0],[0,0,1]];V(this,S(n,this.m_),!0)},q.transform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,S(o,this.m_),!0)},q.setTransform=function(e,t,n,r,i,s){var o=[[e,t,0],[n,r,0],[i,s,1]];V(this,o,!0)},q.drawText_=function(e,n,r,i,s){var u=this.m_,a=1e3,f=0,l=a,c={x:0,y:0},p=[],d=H(P(this.font),this.element_),v=B(d),m=this.element_.currentStyle,g=this.textAlign.toLowerCase();switch(g){case"left":case"center":case"right":break;case"end":g=m.direction=="ltr"?"right":"left";break;case"start":g=m.direction=="rtl"?"right":"left";break;default:g="left"}switch(this.textBaseline){case"hanging":case"top":c.y=d.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":c.y=-d.size/2.25}switch(g){case"right":f=a,l=.05;break;case"center":f=l=a/2}var y=W(this,n+c.x,r+c.y);p.push(''),s?U(this,p):z(this,p,{x:-f,y:0},{x:l,y:d.size});var b=u[0][0].toFixed(3)+","+u[1][0].toFixed(3)+","+u[0][1].toFixed(3)+","+u[1][1].toFixed(3)+",0,0",w=t(y.x/o)+","+t(y.y/o);p.push('','',''),this.element_.insertAdjacentHTML("beforeEnd",p.join(""))},q.fillText=function(e,t,n,r){this.drawText_(e,t,n,r,!1)},q.strokeText=function(e,t,n,r){this.drawText_(e,t,n,r,!0)},q.measureText=function(e){if(!this.textMeasureEl_){var t='';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";try{this.textMeasureEl_.style.font=this.font}catch(r){}return this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},q.clip=function(){},q.arcTo=function(){},q.createPattern=function(e,t){return new J(e,t)},$.prototype.addColorStop=function(e,t){t=M(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var Y=G.prototype=new Error;Y.INDEX_SIZE_ERR=1,Y.DOMSTRING_SIZE_ERR=2,Y.HIERARCHY_REQUEST_ERR=3,Y.WRONG_DOCUMENT_ERR=4,Y.INVALID_CHARACTER_ERR=5,Y.NO_DATA_ALLOWED_ERR=6,Y.NO_MODIFICATION_ALLOWED_ERR=7,Y.NOT_FOUND_ERR=8,Y.NOT_SUPPORTED_ERR=9,Y.INUSE_ATTRIBUTE_ERR=10,Y.INVALID_STATE_ERR=11,Y.SYNTAX_ERR=12,Y.INVALID_MODIFICATION_ERR=13,Y.NAMESPACE_ERR=14,Y.INVALID_ACCESS_ERR=15,Y.VALIDATION_ERR=16,Y.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=I,CanvasGradient=$,CanvasPattern=J,DOMException=G}(),G_vmlCanvasManager}),define("zrender/tool/util",["require","../dep/excanvas"],function(e){function u(e){return e&&e.nodeType===1&&typeof e.nodeName=="string"}function a(e){if(typeof e=="object"&&e!==null){var t=e;if(e instanceof Array){t=[];for(var n=0,r=e.length;n1)for(var e in arguments)console.log(arguments[e])}}),define("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),define("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),i=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=e.match(/(iPod)(.*OS\s([\d_]+))?/),u=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),a=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),f=a&&e.match(/TouchPad/),l=e.match(/Kindle\/([\d.]+)/),c=e.match(/Silk\/([\d._]+)/),h=e.match(/(BlackBerry).*Version\/([\d.]+)/),p=e.match(/(BB10).*Version\/([\d.]+)/),d=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),v=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),g=e.match(/Firefox\/([\d.]+)/),y=e.match(/MSIE ([\d.]+)/),b=r&&e.match(/Mobile\//)&&!m,w=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m,y=e.match(/MSIE\s([\d.]+)/);if(n.webkit=!!r)n.version=r[1];return i&&(t.android=!0,t.version=i[2]),u&&!o&&(t.ios=t.iphone=!0,t.version=u[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipod=!0,t.version=o[3]?o[3].replace(/_/g,"."):null),a&&(t.webos=!0,t.version=a[2]),f&&(t.touchpad=!0),h&&(t.blackberry=!0,t.version=h[2]),p&&(t.bb10=!0,t.version=p[2]),d&&(t.rimtabletos=!0,t.version=d[2]),v&&(n.playbook=!0),l&&(t.kindle=!0,t.version=l[1]),c&&(n.silk=!0,n.version=c[1]),!c&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),g&&(n.firefox=!0,n.version=g[1]),y&&(n.ie=!0,n.version=y[1]),b&&(e.match(/Safari/)||!!t.ios)&&(n.safari=!0),w&&(n.webview=!0),y&&(n.ie=!0,n.version=y[1]),t.tablet=!!(s||v||i&&!e.match(/Mobile/)||g&&e.match(/Tablet/)||y&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!!(!t.tablet&&!t.ipod&&(i||u||a||h||p||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||g&&e.match(/Mobile/)||y&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),define("zrender/mixin/Eventful",["require"],function(e){var t=function(){this._handlers={}};return t.prototype.one=function(e,t,n){var r=this._handlers;return!t||!e?this:(r[e]||(r[e]=[]),r[e].push({h:t,one:!0,ctx:n||this}),this)},t.prototype.bind=function(e,t,n){var r=this._handlers;return!t||!e?this:(r[e]||(r[e]=[]),r[e].push({h:t,one:!1,ctx:n||this}),this)},t.prototype.unbind=function(e,t){var n=this._handlers;if(!e)return this._handlers={},this;if(t){if(n[e]){var r=[];for(var i=0,s=n[e].length;i3&&(t=Array.prototype.slice.call(t,1));var r=this._handlers[e],i=r.length;for(var s=0;s4&&(t=Array.prototype.slice.call(t,1,t.length-1));var r=t[t.length-1],i=this._handlers[e],s=i.length;for(var o=0;o0?1.1:1/1.1,i=!1,s=this._mouseX,o=this._mouseY;this.painter.eachBuildinLayer(function(t){var u=t.position;if(t.zoomable){t.__zoom=t.__zoom||1;var a=t.__zoom;a*=n,a=Math.max(Math.min(t.maxZoom,a),t.minZoom),n=a/t.__zoom,t.__zoom=a,u[0]-=(s-u[0])*(n-1),u[1]-=(o-u[1])*(n-1),t.scale[0]*=n,t.scale[1]*=n,t.dirty=!0,i=!0,r.stop(e)}}),i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,u.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(!l(e))return;if(this.painter.isLoading())return;e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=r.getX(e),this._mouseY=r.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover();if(!this._hasfound){if(!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)this._processOutShape(e),this._processDragLeave(e);this._lastHover=null,this.storage.delHover(),this.painter.clearHover()}var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget),this._clickThreshold++;else if(this._isMouseDown){var s=!1;this.painter.eachBuildinLayer(function(e){e.panable&&(i="move",e.position[0]+=t,e.position[1]+=n,s=!0,e.dirty=!0)}),s&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,u.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){if(!l(e))return;e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)while(t&&t.nodeType!=9){if(t==this.root){this._mousemoveHandler(e);return}t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(u.GLOBALOUT,e)},mousedown:function(e){if(!l(e))return;this._clickThreshold=0;if(this._lastDownButton==2){this._lastDownButton=e.button,this._mouseDownTarget=null;return}this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,u.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){if(!l(e))return;e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,u.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){if(!l(e))return;e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobileFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){if(!l(e))return;e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&r.stop(e)},touchend:function(e){if(!l(e))return;e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;u--){var a=t[u];n!==a.zlevel&&(r=this.painter.getLayer(a.zlevel,r),i[0]=this._mouseX,i[1]=this._mouseY,r.needTransform&&(o.invert(e,r.transform),s.applyTransform(i,i,e)));if(this._findHover(a,i[0],i[1]))break}}}();var m=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return v.prototype._mobileFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t-n&&en||e<-n}function l(e,t,n,r,i){var s=1-i;return s*s*(s*e+3*i*t)+i*i*(i*r+3*s*n)}function c(e,t,n,r,i){var s=1-i;return 3*(((t-e)*s+2*(n-t)*i)*s+(r-n)*i*i)}function h(e,t,n,s,o,u){var f=s+3*(t-n)-e,l=3*(n-t*2+e),c=3*(t-e),h=e-o,p=l*l-3*f*c,d=l*c-9*f*h,v=c*c-3*l*h,m=0;if(a(p)&&a(d))if(a(l))u[0]=0;else{var g=-c/l;g>=0&&g<=1&&(u[m++]=g)}else{var y=d*d-4*p*v;if(a(y)){var b=d/p,g=-l/f+b,w=-b/2;g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w)}else if(y>0){var E=Math.sqrt(y),S=p*l+1.5*f*(-d+E),x=p*l+1.5*f*(-d-E);S<0?S=-Math.pow(-S,i):S=Math.pow(S,i),x<0?x=-Math.pow(-x,i):x=Math.pow(x,i);var g=(-l-(S+x))/(3*f);g>=0&&g<=1&&(u[m++]=g)}else{var T=(2*p*l-3*f*d)/(2*Math.sqrt(p*p*p)),N=Math.acos(T)/3,C=Math.sqrt(p),k=Math.cos(N),g=(-l-2*C*k)/(3*f),w=(-l+C*(k+r*Math.sin(N)))/(3*f),L=(-l+C*(k-r*Math.sin(N)))/(3*f);g>=0&&g<=1&&(u[m++]=g),w>=0&&w<=1&&(u[m++]=w),L>=0&&L<=1&&(u[m++]=L)}}return m}function p(e,t,n,r,i){var s=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,u=3*t-3*e,l=0;if(a(o)){if(f(s)){var c=-u/s;c>=0&&c<=1&&(i[l++]=c)}}else{var h=s*s-4*o*u;if(a(h))i[0]=-s/(2*o);else if(h>0){var p=Math.sqrt(h),c=(-s+p)/(2*o),d=(-s-p)/(2*o);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function d(e,t,n,r,i,s){var o=(t-e)*i+e,u=(n-t)*i+t,a=(r-n)*i+n,f=(u-o)*i+o,l=(a-u)*i+u,c=(l-f)*i+f;s[0]=e,s[1]=o,s[2]=f,s[3]=c,s[4]=c,s[5]=l,s[6]=a,s[7]=r}function v(e,r,i,a,f,c,h,p,d,v,m){var g,y=.005,b=Infinity;s[0]=d,s[1]=v;for(var w=0;w<1;w+=.05){o[0]=l(e,i,f,h,w),o[1]=l(r,a,c,p,w);var E=t.distSquare(s,o);E=0&&E=0&&c<=1&&(i[l++]=c)}}else{var h=o*o-4*s*u;if(a(h)){var c=-o/(2*s);c>=0&&c<=1&&(i[l++]=c)}else if(h>0){var p=Math.sqrt(h),c=(-o+p)/(2*s),d=(-o-p)/(2*s);c>=0&&c<=1&&(i[l++]=c),d>=0&&d<=1&&(i[l++]=d)}}return l}function b(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function w(e,t,n,r,i){var s=(t-e)*r+e,o=(n-t)*r+t,u=(o-s)*r+s;i[0]=e,i[1]=s,i[2]=u,i[3]=u,i[4]=o,i[5]=n}function E(e,r,i,a,f,l,c,h,p){var d,v=.005,g=Infinity;s[0]=c,s[1]=h;for(var y=0;y<1;y+=.05){o[0]=m(e,i,f,y),o[1]=m(r,a,l,y);var b=t.distSquare(s,o);b=0&&bt+u&&o>r+u||oe+u&&s>n+u||st+h&&c>i+h&&c>o+h&&c>a+h||ce+h&&l>r+h&&l>s+h&&l>u+h||lt+l&&f>i+l&&f>o+l||fe+l&&a>r+l&&a>s+l||an||h+c=f)return!0;if(s){var p=r;r=l(i),i=l(p)}else r=l(r),i=l(i);r>i&&(i+=f);var d=Math.atan2(a,u);return d<0&&(d+=f),d>=r&&d<=i||d+f>=r&&d+f<=i}function b(e,t,n,r){var t=Math.max(t,10);for(var i=0,s=e.length-1;in*n}function E(e,t,n,r,i,s){return i>=e&&i<=e+n&&s>=t&&s<=t+r}function S(e,t,n,r,i){return(r-e)*(r-e)+(i-t)*(i-t)t&&s>r||si?o:0}function L(){var e=k[0];k[0]=k[1],k[1]=e}function A(e,t,r,i,s,o,u,a,f,l){if(l>t&&l>i&&l>o&&l>a||l1&&L(),d=n.cubicAt(t,i,o,a,k[0]),p>1&&(v=n.cubicAt(t,i,o,a,k[1]))),p==2?gt&&a>i&&a>o||a=0&&l<=1){var c=0,h=n.quadraticAt(t,i,o,l);for(var p=0;pn||u<-n)return 0;var a=Math.sqrt(n*n-u*u);C[0]=-a,C[1]=a;if(Math.abs(r-i)>=f){r=0,i=f;var c=s?1:-1;return o>=C[0]+e&&o<=C[1]+e?c:0}if(s){var a=r;r=l(i),i=l(a)}else r=l(r),i=l(i);r>i&&(i+=f);var h=0;for(var p=0;p<2;p++){var d=C[p];if(d+e>o){var v=Math.atan2(u,d),c=s?1:-1;v<0&&(v=f+v);if(v>=r&&v<=i||v+f>=r&&v+f<=i)v>Math.PI/2&&v0){p&&(s+=N(o,u,a,f,r,i));if(s!==0)return!0}a=w[w.length-2],f=w[w.length-1],l=!1,c&&b.command!=="A"&&(c=!1,o=a,u=f)}switch(b.command){case"M":o=w[0],u=w[1];break;case"L":if(h&&v(o,u,w[0],w[1],t,r,i))return!0;p&&(s+=N(o,u,w[0],w[1],r,i)),o=w[0],u=w[1];break;case"C":if(h&&m(o,u,w[0],w[1],w[2],w[3],w[4],w[5],t,r,i))return!0;p&&(s+=A(o,u,w[0],w[1],w[2],w[3],w[4],w[5],r,i)),o=w[4],u=w[5];break;case"Q":if(h&&g(o,u,w[0],w[1],w[2],w[3],t,r,i))return!0;p&&(s+=O(o,u,w[0],w[1],w[2],w[3],r,i)),o=w[2],u=w[3];break;case"A":var E=w[0],S=w[1],x=w[2],T=w[3],C=w[4],k=w[5],L=Math.cos(C)*x+E,_=Math.sin(C)*T+S;c?(c=!1,a=L,f=_):s+=N(o,u,L,_);var D=(r-E)*T/x+E;if(h&&y(E,S,T,C,C+k,1-w[7],t,D,i))return!0;p&&(s+=M(E,S,T,C,C+k,1-w[7],D,i)),o=Math.cos(C+k)*x+E,u=Math.sin(C+k)*T+S;break;case"z":if(h&&v(o,u,a,f,t,r,i))return!0;l=!0}}return p&&(s+=N(o,u,a,f,r,i)),s!==0}function D(e,n){var s=e+":"+n;if(i[s])return i[s];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var u=0;for(var f=0,l=e.length;fa&&(o=0,i={}),u}function P(e,n){var i=e+":"+n;if(s[i])return s[i];r=r||t.getContext(),r.save(),n&&(r.font=n),e=(e+"").split("\n");var o=(r.measureText("国").width+2)*e.length;return r.restore(),s[i]=o,++u>a&&(u=0,s={}),o}var t=e("./util"),n=e("./curve"),r,i={},s={},o=0,u=0,a=5e3,f=Math.PI*2,C=[-1,-1,-1],k=[-1,-1];return{isInside:c,isOutside:d,getTextWidth:D,getTextHeight:P,isInsidePath:_,isInsidePolygon:T,isInsideSector:x,isInsideCircle:S,isInsideLine:v,isInsideRect:E,isInsidePolyline:b,isInsideCubicStroke:m,isInsideQuadraticStroke:g}}),define("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){function o(e){return e>-s&&es||e<-s}var t=e("../tool/matrix"),n=e("../tool/vector"),r=[0,0],i=t.translate,s=5e-5,a=function(){this.position||(this.position=[0,0]),typeof this.rotation=="undefined"&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return a.prototype={constructor:a,updateNeedTransform:function(){this.needLocalTransform=u(this.rotation[0])||u(this.position[0])||u(this.position[1])||u(this.scale[0]-1)||u(this.scale[1]-1)},updateTransform:function(){this.updateNeedTransform();var e=this.parent&&this.parent.needTransform;this.needTransform=this.needLocalTransform||e;if(!this.needTransform)return;var n=this.transform||t.create();t.identity(n);if(this.needLocalTransform){var s=this.scale;if(u(s[0])||u(s[1])){r[0]=-s[2]||0,r[1]=-s[3]||0;var o=u(r[0])||u(r[1]);o&&i(n,n,r),t.scale(n,n,s),o&&(r[0]=-r[0],r[1]=-r[1],i(n,n,r))}if(this.rotation instanceof Array){if(this.rotation[0]!==0){r[0]=-this.rotation[1]||0,r[1]=-this.rotation[2]||0;var o=u(r[0])||u(r[1]);o&&i(n,n,r),t.rotate(n,n,this.rotation[0]),o&&(r[0]=-r[0],r[1]=-r[1],i(n,n,r))}}else this.rotation!==0&&t.rotate(n,n,this.rotation);(u(this.position[0])||u(this.position[1]))&&i(n,n,this.position)}e&&(this.needLocalTransform?t.mul(n,this.parent.transform,n):t.copy(n,this.parent.transform)),this.transform=n,this.invTransform=this.invTransform||t.create(),t.invert(this.invTransform,n)},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=n.create();return function(r){this.transform||(this.transform=t.create());var i=this.transform;n.sub(e,r,this.position);if(o(e[0])&&o(e[1]))return;n.normalize(e,e);var s=this.scale;i[2]=e[0]*s[1],i[3]=e[1]*s[1],i[0]=e[1]*s[0],i[1]=-e[0]*s[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform()}}(),decomposeTransform:function(){if(!this.transform)return;var e=this.transform,t=e[0]*e[0]+e[1]*e[1],n=this.position,r=this.scale,i=this.rotation;u(t-1)&&(t=Math.sqrt(t));var s=e[2]*e[2]+e[3]*e[3];u(s-1)&&(s=Math.sqrt(s)),n[0]=e[4],n[1]=e[5],r[0]=t,r[1]=s,r[2]=r[3]=0,i[0]=Math.atan2(-e[1]/s,e[0]/t),i[1]=i[2]=0},transformCoordToLocal:function(e,t){var r=[e,t];return this.needTransform&&this.invTransform&&n.applyTransform(r,r,this.invTransform),r}},a}),define("zrender/tool/color",["require","../tool/util"],function(e){function f(e){r=e}function l(){r=i}function c(e,t){return e|=0,t=t||r,t[e%t.length]}function h(e){s=e}function p(){o=s}function d(){return s}function v(e,r,i,s,o,u,a){n||(n=t.getContext());var f=n.createRadialGradient(e,r,i,s,o,u);for(var l=0,c=a.length;l1)for(var i=0,s=r-1;i1?Math.ceil(e):e});if(t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=q(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(e.length===3&&e.push(1),e[3]=R(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function w(e){e=_(e),e.indexOf("rgba")<0&&(e=S(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){n<3?e|=0:e=+e,t[n++]=e}),t}function E(e,t){if(!U(e))return e;var n=F(e),r=n[3];return typeof r=="undefined"&&(r=1),e.indexOf("hsb")>-1?n=z(n):e.indexOf("hsl")>-1&&(n=W(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=V(n):t.indexOf("hsl")>-1&&(n=$(n)),n[3]=r,b(n,t)}function S(e){return E(e,"rgba")}function x(e){return E(e,"rgb")}function T(e){return E(e,"hex")}function N(e){return E(e,"hsva")}function C(e){return E(e,"hsv")}function k(e){return E(e,"hsba")}function L(e){return E(e,"hsb")}function A(e){return E(e,"hsla")}function O(e){return E(e,"hsl")}function M(e){for(var t in a)if(T(a[t])===T(e))return t;return null}function _(e){return String(e).replace(/\s+/g,"")}function D(e){a[e]&&(e=a[e]),e=_(e),e=e.replace(/hsv/i,"hsb");if(/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(e&3840)<<8,n=(e&240)<<4,r=e&15;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(r<<4)+r).toString(16).slice(1)}return e}function P(e,t){if(!U(e))return e;var n=t>0?1:-1;typeof t=="undefined"&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=x(e);var r=F(e);for(var i=0;i<3;i++)n===1?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0;return"rgb("+r.join(",")+")"}function H(e){if(!U(e))return e;var t=F(S(e));return t=q(t,function(e){return 255-e}),b(t,"rgb")}function B(e,t,n){if(!U(e)||!U(t))return e;typeof n=="undefined"&&(n=.5),n=1-R(n,[0,1]);var r=n*2-1,i=F(S(e)),s=F(S(t)),o=i[3]-s[3],u=((r*o===-1?r:(r+o)/(1+r*o))+1)/2,a=1-u,f=[];for(var l=0;l<3;l++)f[l]=i[l]*u+s[l]*a;var c=i[3]*n+s[3]*(1-n);return c=Math.max(0,Math.min(1,c)),i[3]===1&&s[3]===1?b(f,"rgb"):(f[3]=c,b(f,"rgba"))}function j(){return"#"+(Math.random().toString(16)+"0000").slice(2,8)}function F(e){e=D(e);var t=e.match(u);if(t===null)throw new Error("The color format error");var n,r,i=[],s;if(t[2])n=t[2].replace("#","").split(""),s=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],i=q(s,function(e){return R(parseInt(e,16),[0,255])});else if(t[4]){var o=t[4].split(",");r=o[3],s=o.slice(0,3),i=q(s,function(e){return e=Math.floor(e.indexOf("%")>0?parseInt(e,0)*2.55:e),R(e,[0,255])}),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}else if(t[5]||t[6]){var a=(t[5]||t[6]).split(","),f=parseInt(a[0],0)/360,l=a[1],c=a[2];r=a[3],i=q([l,c],function(e){return R(parseFloat(e)/100,[0,1])}),i.unshift(f),typeof r!="undefined"&&i.push(R(parseFloat(r),[0,1]))}return i}function I(e,t){if(!U(e))return e;t===null&&(t=1);var n=F(S(e));return n[3]=R(Number(t).toFixed(4),[0,1]),b(n,"rgba")}function q(e,t){if(typeof t!="function")throw new TypeError;var n=e?e.length:0;for(var r=0;r=t[1]&&(e=t[1]),e}function U(e){return e instanceof Array||typeof e=="string"}function z(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u=t*6;u===6&&(u=0);var a=u|0,f=r*(1-n),l=r*(1-n*(u-a)),c=r*(1-n*(1-(u-a))),h=0,p=0,d=0;a===0?(h=r,p=c,d=f):a===1?(h=l,p=r,d=f):a===2?(h=f,p=r,d=c):a===3?(h=f,p=l,d=r):a===4?(h=c,p=f,d=r):(h=r,p=f,d=l),i=h*255,s=p*255,o=d*255}return[i,s,o]}function W(e){var t=e[0],n=e[1],r=e[2],i,s,o;if(n===0)i=r*255,s=r*255,o=r*255;else{var u;r<.5?u=r*(1+n):u=r+n-n*r;var a=2*r-u;i=255*X(a,u,t+1/3),s=255*X(a,u,t),o=255*X(a,u,t-1/3)}return[i,s,o]}function X(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function V(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=s,a,f;if(o===0)a=0,f=0;else{f=o/s;var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}function $(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=s-i,u=(s+i)/2,a,f;if(o===0)a=0,f=0;else{u<.5?f=o/(s+i):f=o/(2-s-i);var l=((s-t)/6+o/2)/o,c=((s-n)/6+o/2)/o,h=((s-r)/6+o/2)/o;t===s?a=h-c:n===s?a=1/3+l-h:r===s&&(a=2/3+c-l),a<0&&(a+=1),a>1&&(a-=1)}return a*=360,f*=100,u*=100,[a,f,u]}var t=e("../tool/util"),n,r=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],i=r,s="rgba(255,255,0,0.5)",o=s,u=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,a={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:f,resetPalette:l,getColor:c,getHighlightColor:d,customHighlight:h,resetHighlight:p,getRadialGradient:v,getLinearGradient:m,getGradientColors:y,getStepColors:g,reverse:H,mix:B,lift:P,trim:_,random:j,toRGB:x,toRGBA:S,toHex:T,toHSL:O,toHSLA:A,toHSB:L,toHSBA:k,toHSV:C,toHSVA:N,toName:M,toColor:b,toArray:w,alpha:I,getData:F}}),define("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/area","../tool/color","../tool/area"],function(e){function a(t,n,r,i,s,o,u){s&&(t.font=s),t.textAlign=o,t.textBaseline=u;var a=f(n,r,i,s,o,u);n=(n+"").split("\n");var l=e("../tool/area").getTextHeight("国",s);switch(u){case"top":i=a.y;break;case"bottom":i=a.y+l;break;default:i=a.y+l/2}for(var c=0,h=n.length;c0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),this.afterBrush(e)},l.prototype.beforeBrush=function(e,t){var n=this.style;return this.brushTypeOnly&&(n.brushType=this.brushTypeOnly),t&&(n=this.getHighlightStyle(n,this.highlightStyle||{},this.brushTypeOnly)),this.brushTypeOnly=="stroke"&&(n.strokeColor=n.strokeColor||n.color),e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n},l.prototype.afterBrush=function(e){e.restore()};var c=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];l.prototype.setContext=function(e,t){for(var n=0,r=c.length;n=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},l.prototype.drawText=function(e,t,n){if(typeof t.text=="undefined"||t.text===!1)return;var r=t.textColor||t.color||t.strokeColor;e.fillStyle=r;var i=10,s,o,u,f,l=t.textPosition||this.textPosition||"top";switch(l){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(n||t).__rect||this.getRect(n||t);switch(l){case"inside":u=c.x+c.width/2,f=c.y+c.height/2,s="center",o="middle",t.brushType!="stroke"&&r==t.color&&(e.fillStyle="#fff");break;case"left":u=c.x-i,f=c.y+c.height/2,s="end",o="middle";break;case"right":u=c.x+c.width+i,f=c.y+c.height/2,s="start",o="middle";break;case"top":u=c.x+c.width/2,f=c.y-i,s="center",o="bottom";break;case"bottom":u=c.x+c.width/2,f=c.y+c.height+i,s="center",o="top"}}break;case"start":case"end":var h=t.pointList||[[t.xStart||0,t.yStart||0],[t.xEnd||0,t.yEnd||0]],p=h.length;if(p<2)return;var d,v,m,g;switch(l){case"start":d=h[1][0],v=h[0][0],m=h[1][1],g=h[0][1];break;case"end":d=h[p-2][0],v=h[p-1][0],m=h[p-2][1],g=h[p-1][1]}u=v,f=g;var y=Math.atan((m-g)/(v-d))/Math.PI*180;v-d<0?y+=180:m-g<0&&(y+=360),i=5,y>=30&&y<=150?(s="center",o="bottom",f-=i):y>150&&y<210?(s="right",o="middle",u-=i):y>=210&&y<=330?(s="center",o="top",f+=i):(s="left",o="middle",u+=i);break;case"specific":u=t.textX||0,f=t.textY||0,s="start",o="middle"}u!=null&&f!=null&&a(e,t.text,u,f,t.textFont,t.textAlign||s,t.textBaseline||o)},l.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},l.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},i.merge(l.prototype,o.prototype,!0),i.merge(l.prototype,u.prototype,!0),l}),define("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),n=e("./Base"),r=function(e){n.call(this,e)};return r.prototype={type:"text",brush:function(e,n){var r=this.style;n&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));if(typeof r.text=="undefined"||r.text===!1)return;e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r.textFont&&(e.font=r.textFont),e.textAlign=r.textAlign||"start",e.textBaseline=r.textBaseline||"middle";var i=(r.text+"").split("\n"),s=t.getTextHeight("国",r.textFont),o=this.getRect(r),u=r.x,a;r.textBaseline=="top"?a=o.y:r.textBaseline=="bottom"?a=o.y+s:a=o.y+s/2;for(var f=0,l=i.length;fi&&(c=u+a,u*=i/c,a*=i/c),f+l>i&&(c=f+l,f*=i/c,l*=i/c),a+f>s&&(c=a+f,a*=s/c,f*=s/c),u+l>s&&(c=u+l,u*=s/c,l*=s/c),e.moveTo(n+u,r),e.lineTo(n+i-a,r),a!==0&&e.quadraticCurveTo(n+i,r,n+i,r+a),e.lineTo(n+i,r+s-f),f!==0&&e.quadraticCurveTo(n+i,r+s,n+i-f,r+s),e.lineTo(n+l,r+s),l!==0&&e.quadraticCurveTo(n,r+s,n,r+s-l),e.lineTo(n,r+u),u!==0&&e.quadraticCurveTo(n,r,n+u,r)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function o(e){this.setOptions(e)}var t=e("../tool/util"),n=e("../shape/Text"),r=e("../shape/Rectangle"),i="Loading...",s="normal 16px Arial";return o.prototype.createTextShape=function(e){return new n({highlightStyle:t.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:i,textAlign:"center",textBaseline:"middle",textFont:s,color:"#333",brushType:"fill"},e,!0)})},o.prototype.createBackgroundShape=function(e){return new r({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},o.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},o.prototype._start=function(){return setInterval(function(){},1e4)},o.prototype.stop=function(){clearInterval(this.loadingTimer)},o.prototype.setOptions=function(e){this.options=e||{}},o.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},o.prototype.getLocation=function(e,t,n){var r=e.x!=null?e.x:"center";switch(r){case"center":r=Math.floor((this.canvasWidth-t)/2);break;case"left":r=0;break;case"right":r=this.canvasWidth-t}var i=e.y!=null?e.y:"center";switch(i){case"center":i=Math.floor((this.canvasHeight-n)/2);break;case"top":i=0;break;case"bottom":i=this.canvasHeight-n}return{x:r,y:i,width:t,height:n}},o}),define("zrender/Layer",["require","./mixin/Transformable","./tool/util","./config"],function(e){function s(){return!1}function o(e,t,n){var r=document.createElement(t),s=n.getWidth(),o=n.getHeight();return r.style.position="absolute",r.style.left=0,r.style.top=0,r.style.width=s+"px",r.style.height=o+"px",r.width=s*i.devicePixelRatio,r.height=o*i.devicePixelRatio,r.setAttribute("data-zr-dom-id",e),r}var t=e("./mixin/Transformable"),n=e("./tool/util"),r=window.G_vmlCanvasManager,i=e("./config"),u=function(e,n){this.id=e,this.dom=o(e,"canvas",n),this.dom.onselectstart=s,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.dom.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",this.dom.className=i.elementClassName,r&&r.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=n,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=Infinity,this.minZoom=0,t.call(this)};return u.prototype.initContext=function(){this.ctx=this.dom.getContext("2d");var e=i.devicePixelRatio;e!=1&&this.ctx.scale(e,e)},u.prototype.createBackBuffer=function(){if(r)return;this.domBack=o("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d");var e=i.devicePixelRatio;e!=1&&this.ctxBack.scale(e,e)},u.prototype.resize=function(e,t){var n=i.devicePixelRatio;this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*n),this.dom.setAttribute("height",t*n),n!=1&&this.ctx.scale(n,n),this.domBack&&(this.domBack.setAttribute("width",e*n),this.domBack.setAttribute("height",t*n),n!=1&&this.ctxBack.scale(n,n))},u.prototype.clear=function(){var e=this.dom,t=this.ctx,n=e.width,s=e.height,o=this.clearColor&&!r,u=this.motionBlur&&!r,a=this.lastFrameAlpha,f=i.devicePixelRatio;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/f,s/f)),t.clearRect(0,0,n/f,s/f),o&&(t.save(),t.fillStyle=this.clearColor,t.fillRect(0,0,n/f,s/f),t.restore());if(u){var l=this.domBack;t.save(),t.globalAlpha=a,t.drawImage(l,0,0,n/f,s/f),t.restore()}},n.merge(u.prototype,t.prototype),u}),define("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"image",brush:function(e,t,n){var r=this.style||{};t&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));var i=r.image,s=this;this._imageCache||(this._imageCache={});if(typeof i=="string"){var o=i;this._imageCache[o]?i=this._imageCache[o]:(i=new Image,i.onload=function(){i.onload=null,s.modSelf(),n()},i.src=o,this._imageCache[o]=i)}if(i){if(i.nodeName.toUpperCase()=="IMG")if(window.ActiveXObject){if(i.readyState!="complete")return}else if(!i.complete)return;var u=r.width||i.width,a=r.height||i.height,f=r.x,l=r.y;if(!i.width||!i.height)return;e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e);if(r.sWidth&&r.sHeight){var c=r.sx||0,h=r.sy||0;e.drawImage(i,c,h,r.sWidth,r.sHeight,f,l,u,a)}else if(r.sx&&r.sy){var c=r.sx,h=r.sy,p=u-c,d=a-h;e.drawImage(i,c,h,p,d,f,l,u,a)}else e.drawImage(i,f,l,u,a);r.width||(r.width=u),r.height||(r.height=a),this.style.width||(this.style.width=u),this.style.height||(this.style.height=a),this.drawText(e,r,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(n,t),n}),define("zrender/Painter",["require","./config","./tool/util","./tool/log","./loadingEffect/Base","./Layer","./shape/Image"],function(e){function o(){return!1}function u(){}function a(e){return e?e.isBuildin?!0:typeof e.resize!="function"||typeof e.refresh!="function"?!1:!0:!1}var t=e("./config"),n=e("./tool/util"),r=e("./tool/log"),i=e("./loadingEffect/Base"),s=e("./Layer"),f=function(e,n){this.root=e,e.style["-webkit-tap-highlight-color"]="transparent",e.style["-webkit-user-select"]="none",e.style["user-select"]="none",e.style["-webkit-touch-callout"]="none",this.storage=n,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var r=document.createElement("div");this._domRoot=r,r.style.position="relative",r.style.overflow="hidden",r.style.width=this._width+"px",r.style.height=this._height+"px",e.appendChild(r),this._layers={},this._zlevelList=[],this._layerConfig={},this._loadingEffect=new i({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=document.createElement("div"),this._bgDom.style.cssText=["position:absolute;left:0px;top:0px;width:",this._width,"px;height:",this._height+"px;","-webkit-user-select:none;user-select;none;","-webkit-touch-callout:none;"].join(""),this._bgDom.setAttribute("data-zr-dom-id","bg"),this._bgDom.className=t.elementClassName,r.appendChild(this._bgDom),this._bgDom.onselectstart=o;var u=new s("_zrender_hover_",this);this._layers.hover=u,r.appendChild(u.dom),u.initContext(),u.dom.onselectstart=o,u.dom.style["-webkit-user-select"]="none",u.dom.style["user-select"]="none",u.dom.style["-webkit-touch-callout"]="none",this.refreshNextFrame=null};return f.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},f.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);this._paintList(n,t);for(var r=0;r0&&e>this._zlevelList[0]){for(s=0;se)break;i=this._layers[this._zlevelList[s]]}this._zlevelList.splice(s+1,0,e);var o=i?i.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(t.dom,o.nextSibling):o.parentNode.appendChild(t.dom),this._layers[e]=t},f.prototype.eachLayer=function(e,t){for(var n=0;n=0&&this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof s&&e.delChildrenFromStorage(this._storage))},s.prototype.clearChildren=function(){for(var e=0;e0},s.prototype.addRoot=function(e){if(this._elements[e.id])return;e instanceof n&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},s.prototype.delRoot=function(e){if(typeof e=="undefined"){for(var r=0;r=0&&(this.delFromMap(o.id),this._roots.splice(u,1),o instanceof n&&o.delChildrenFromStorage(this))},s.prototype.addToMap=function(e){return e instanceof n&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},s.prototype.get=function(e){return this._elements[e]},s.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof n&&(t._storage=null)),this},s.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},s}),define("zrender/animation/easing",[],function(){var e={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:-0.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:-0.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?-0.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)))},ElasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin((e-t)*2*Math.PI/r)+1)},ElasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-0.5*n*Math.pow(2,10*(e-=1))*Math.sin((e-t)*2*Math.PI/r):n*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*2*Math.PI/r)*.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(t){return 1-e.BounceOut(1-t)},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(t){return t<.5?e.BounceIn(t*2)*.5:e.BounceOut(t*2-1)*.5+.5}};return e}),define("zrender/animation/Clip",["require","./easing"],function(e){function n(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+this._life*1e3,this.loop=typeof e.loop=="undefined"?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var t=e("./easing");return n.prototype={step:function(e){var n=(e-this._startTime)/this._life;if(n<0)return;n=Math.min(n,1);var r=typeof this.easing=="string"?t[this.easing]:this.easing,i=typeof r=="function"?r(n):n;return this.fire("frame",i),n==1?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var n=0,r=this._targetPool.length;n=0&&this._clips.splice(t,1)},_update:function(){var e=(new Date).getTime(),t=e-this._time,n=this._clips,r=n.length,i=[],s=[];for(var o=0;o=0;T--)if(S[T]<=t)break;T=Math.min(T,v-2)}else{for(T=C;Tt)break;T=Math.min(T-1,v-2)}C=T,k=t;var n=S[T+1]-S[T];if(n===0)return;A=(t-S[T])/n;if(o){M=x[T],O=x[T===0?T:T-1],_=x[T>v-2?v-1:T+1],D=x[T>v-3?v-1:T+2];if(y)p(O,M,_,D,A,A*A,A*A*A,s(e,f),w);else{var u;b?(u=p(O,M,_,D,A,A*A,A*A*A,P,1),u=m(P)):u=d(O,M,_,D,A,A*A,A*A*A),i(e,f,u)}}else if(y)c(x[T],x[T+1],A,s(e,f),w);else{var u;b?(c(x[T],x[T+1],A,P,1),u=m(P)):u=l(x[T],x[T+1],A),i(e,f,u)}for(T=0;T=0&&c.splice(n,1)});return c.push(h),h}n("Element not existed")},c.prototype.stopAnimation=function(e){if(e.__animators){var t=e.__animators,n=t.length;for(var r=0;ri&&(i=t[s]);e.maxr=i;var u;return e.brushType=="stroke"||e.brushType=="fill"?u=e.lineWidth||1:u=0,e.__rect={x:-i-u+n,y:-i-u+r,width:2*i+3*u,height:2*i+3*u},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Trochoid",["require","./Base","../tool/math","../tool/util"],function(e){var t=e("./Base"),n=function(e){this.brushTypeOnly="stroke",t.call(this,e)};return n.prototype={type:"trochoid",buildPath:function(t,n){var r,i,s,o,u=n.r,a=n.r0,f=n.d,l=n.x,c=n.y,h=n.location=="out"?1:-1,p=e("../tool/math");if(n.location&&u<=a){alert("参数错误");return}var d=0,v=1,m;r=(u+h*a)*p.cos(0)-h*f*p.cos(0)+l,i=(u+h*a)*p.sin(0)-f*p.sin(0)+c,t.moveTo(r,i);do d++;while(a*d%(u+h*a)!==0);do m=Math.PI/180*v,s=(u+h*a)*p.cos(m)-h*f*p.cos((u/a+h)*m)+l,o=(u+h*a)*p.sin(m)-f*p.sin((u/a+h)*m)+c,t.lineTo(s,o),v++;while(v<=a*d/(u+h*a)*360)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.r,n=e.r0,r=e.d,i=e.location=="out"?1:-1,s=t+r+i*n,o=e.x,u=e.y,a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:-s-a+o,y:-s-a+u,width:2*s+2*a,height:2*s+2*a},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"circle",buildPath:function(e,t){e.moveTo(t.x+t.r,t.y),e.arc(t.x,t.y,t.r,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function r(e,t,n){if(e.length===0)return;var r=e[0][0],i=e[0][0],s=e[0][1],o=e[0][1];for(var u=1;ui&&(i=a[0]),a[1]o&&(o=a[1])}t[0]=r,t[1]=s,n[0]=i,n[1]=o}function i(e,t,r,i,s,o){var u=[];n.cubicExtrema(e[0],t[0],r[0],i[0],u);for(var a=0;a=Math.PI*2){l[0]=e-r,l[1]=n-r,c[0]=e+r,c[1]=n+r;return}o[0]=Math.cos(i)*r+e,o[1]=Math.sin(i)*r+n,u[0]=Math.cos(s)*r+e,u[1]=Math.sin(s)*r+n,t.min(l,o,u),t.max(c,o,u),i%=Math.PI*2,i<0&&(i+=Math.PI*2),s%=Math.PI*2,s<0&&(s+=Math.PI*2),i>s&&!f?s+=Math.PI*2:ii&&(a[0]=Math.cos(p)*r+e,a[1]=Math.sin(p)*r+n,t.min(l,a,l),t.max(c,a,c))};return r.cubeBezier=i,r.quadraticBezier=s,r.arc=f,r}),define("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=e("../tool/computeBoundingBox"),r=e("../tool/vector"),i=e("./Base"),s=r.create(),o=r.create(),u=r.create(),a=r.create(),f=function(e){i.call(this,e)};return f.prototype={type:"sector",buildPath:function(e,n){var r=n.x,i=n.y,s=n.r0||0,o=n.r,u=n.startAngle,a=n.endAngle,f=n.clockWise||!1;u=t.degreeToRadian(u),a=t.degreeToRadian(a),f||(u=-u,a=-a);var l=t.cos(u),c=t.sin(u);e.moveTo(l*s+r,c*s+i),e.lineTo(l*o+r,c*o+i),e.arc(r,i,o,u,a,!f),e.lineTo(t.cos(a)*s+r,t.sin(a)*s+i),s!==0&&e.arc(r,i,s,a,u,f),e.closePath();return},getRect:function(e){if(e.__rect)return e.__rect;var i=e.x,f=e.y,l=e.r0||0,c=e.r,h=t.degreeToRadian(e.startAngle),p=t.degreeToRadian(e.endAngle),d=e.clockWise;return d||(h=-h,p=-p),l>1?n.arc(i,f,l,h,p,!d,s,u):(s[0]=u[0]=i,s[1]=u[1]=f),n.arc(i,f,c,h,p,!d,o,a),r.min(s,s,o),r.max(u,u,a),e.__rect={x:s[0],y:s[1],width:u[0]-s[0],height:u[1]-s[1]},e.__rect}},e("../tool/util").inherits(f,i),f}),define("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,Math.PI*2,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,Math.PI*2,!0);return},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:e.r*2+t,height:e.r*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,r=t.x,i=t.y,s=t.a,o=t.b,u=s*n,a=o*n;e.moveTo(r-s,i),e.bezierCurveTo(r-s,i-a,r-u,i-o,r,i-o),e.bezierCurveTo(r+u,i-o,r+s,i-a,r+s,i),e.bezierCurveTo(r+s,i+a,r+u,i+o,r,i+o),e.bezierCurveTo(r-u,i+o,r-s,i+a,r-s,i),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:e.a*2+t,height:e.b*2+t},e.__rect}},e("../tool/util").inherits(n,t),n}),define("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),n=function(e,t){this.command=e,this.points=t||null},r=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return r.prototype.fastBoundingRect=function(){var e=this._min,n=this._max;e[0]=e[1]=Infinity,n[0]=n[1]=-Infinity;for(var r=0;r4?a*r(2*i/s)/r(i/s):a/3);var l=i/s,c=-i/2,h=o+a*r(c),p=u+a*n(c);c+=l;var d=t.pointList=[];d.push([h,p]);for(var v=0,m=s*2-1,g;vs-2?s-1:c+1],m=e[c>s-3?s-1:c+2]);var g=h*h,y=h*g;o.push([n(p[0],d[0],v[0],m[0],h,g,y),n(p[1],d[1],v[1],m[1],h,g,y)])}return o}}),define("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,r,i){var s=[],o=[],u=[],a=[],f,l,c=!!i,h,p;if(c){h=[Infinity,Infinity],p=[-Infinity,-Infinity];for(var d=0,v=e.length;dn&&(n=s[o][0]),s[o][1]i&&(i=s[o][1]);var a;return e.brushType=="stroke"||e.brushType=="fill"?a=e.lineWidth||1:a=0,e.__rect={x:Math.round(t-a/2),y:Math.round(r-a/2),width:n-t+a,height:i-r+a},e.__rect}},e("../tool/util").inherits(s,t),s}),define("zrender/shape/Polyline",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),r=e("./util/smoothBezier"),i=e("./util/dashedLineTo"),s=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return s.prototype={type:"polyline",buildPath:function(e,t){var r=t.pointList;if(r.length<2)return;var s=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&t.smooth!=="spline"){t.controlPointList||this.updateControlPoints(t);var o=t.controlPointList;e.moveTo(r[0][0],r[0][1]);var u,a,f;for(var l=0;l0&&p[0]===""&&p.shift();for(var d=0;d0){if(isNaN(p[0]))break;var v=null,m=[],g,y,b,w,E,S,x,T,N=f,C=l;switch(h){case"l":f+=p.shift(),l+=p.shift(),v="L",m.push(f,l);break;case"L":f=p.shift(),l=p.shift(),m.push(f,l);break;case"m":f+=p.shift(),l+=p.shift(),v="M",m.push(f,l),h="l";break;case"M":f=p.shift(),l=p.shift(),v="M",m.push(f,l),h="L";break;case"h":f+=p.shift(),v="L",m.push(f,l);break;case"H":f=p.shift(),v="L",m.push(f,l);break;case"v":l+=p.shift(),v="L",m.push(f,l);break;case"V":l=p.shift(),v="L",m.push(f,l);break;case"C":m.push(p.shift(),p.shift(),p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"c":m.push(f+p.shift(),l+p.shift(),f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"S":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,p.shift(),p.shift()),f=p.shift(),l=p.shift(),v="C",m.push(f,l);break;case"s":g=f,y=l,b=a[a.length-1],b.command==="C"&&(g=f+(f-b.points[2]),y=l+(l-b.points[3])),m.push(g,y,f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="C",m.push(f,l);break;case"Q":m.push(p.shift(),p.shift()),f=p.shift(),l=p.shift(),m.push(f,l);break;case"q":m.push(f+p.shift(),l+p.shift()),f+=p.shift(),l+=p.shift(),v="Q",m.push(f,l);break;case"T":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f=p.shift(),l=p.shift(),v="Q",m.push(g,y,f,l);break;case"t":g=f,y=l,b=a[a.length-1],b.command==="Q"&&(g=f+(f-b.points[0]),y=l+(l-b.points[1])),f+=p.shift(),l+=p.shift(),v="Q",m.push(g,y,f,l);break;case"A":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f=p.shift(),l=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S);break;case"a":w=p.shift(),E=p.shift(),S=p.shift(),x=p.shift(),T=p.shift(),N=f,C=l,f+=p.shift(),l+=p.shift(),v="A",m=this._convertPoint(N,C,f,l,x,T,w,E,S)}for(var k=0,L=m.length;k1&&(a*=Math.sqrt(d),f*=Math.sqrt(d));var v=Math.sqrt((a*a*f*f-a*a*p*p-f*f*h*h)/(a*a*p*p+f*f*h*h));i===u&&(v*=-1),isNaN(v)&&(v=0);var m=v*a*p/f,g=v*-f*h/a,y=(e+n)/2+Math.cos(c)*m-Math.sin(c)*g,b=(t+r)/2+Math.sin(c)*m+Math.cos(c)*g,w=o([1,0],[(h-m)/a,(p-g)/f]),E=[(h-m)/a,(p-g)/f],S=[(-1*h-m)/a,(-1*p-g)/f],x=o(E,S);return s(E,S)<=-1&&(x=Math.PI),s(E,S)>=1&&(x=0),u===0&&x>0&&(x-=2*Math.PI),u===1&&x<0&&(x+=2*Math.PI),[y,b,a,f,w,x,c,u]},buildPath:function(e,t){var n=t.path,r=t.x||0,i=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,r,i);var s=t.pathArray,o=t.pointList=[],u=[];for(var a=0,f=s.length;a0&&o.push(u),u=[]);var l=s[a].points;for(var c=0,h=l.length;c0&&o.push(u);for(var a=0,f=s.length;ag?m:g,x=m>g?1:m/g,T=m>g?g/m:1;e.translate(d,v),e.rotate(w),e.scale(x,T),e.arc(0,0,S,y,y+b,1-E),e.scale(1/x,1/T),e.rotate(-w),e.translate(-d,-v);break;case"z":e.closePath()}}return},getRect:function(e){if(e.__rect)return e.__rect;var t;e.brushType=="stroke"||e.brushType=="fill"?t=e.lineWidth||1:t=0;var n=Number.MAX_VALUE,r=Number.MIN_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,o=e.x||0,u=e.y||0,a=e.pathArray||this.buildPathArray(e.path);for(var f=0;fr&&(r=l[c])):(l[c]+us&&(s=l[c]))}var h;return n===Number.MAX_VALUE||r===Number.MIN_VALUE||i===Number.MAX_VALUE||s===Number.MIN_VALUE?h={x:0,y:0,width:0,height:0}:h={x:Math.round(n-t/2),y:Math.round(i-t/2),width:r-n+t,height:s-i+t},e.__rect=h,h}},e("../tool/util").inherits(u,t),u}),define("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function s(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Rectangle");return n.inherits(s,t),s.prototype._start=function(e,t){var s=n.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),o=this.createTextShape(s.textStyle),u=this.createBackgroundShape(s.backgroundColor),a=s.effectOption,f=new i({highlightStyle:n.clone(a)});f.highlightStyle.color=a.color||r.getLinearGradient(a.x,a.y,a.x+a.width,a.y+a.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]);if(s.progress!=null){e(u),f.highlightStyle.width=this.adjust(s.progress,[0,1])*s.effectOption.width,e(f),e(o),t();return}return f.highlightStyle.width=0,setInterval(function(){e(u),f.highlightStyle.width=h&&(c[n].len=Math.ceil(Math.random()*400),r.xStart=-400,r.xEnd=-400+c[n].len,r.yStart=Math.ceil(Math.random()*p),r.yEnd=r.yStart),r.xStart+=c[n].animationX,r.xEnd+=c[n].animationX,e(c[n])}e(o),t()},a.timeInterval)},s}),define("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function o(e){t.call(this,e)}var t=e("./Base"),n=e("../tool/util"),r=e("../tool/color"),i=e("../shape/Ring"),s=e("../shape/Sector");return n.inherits(o,t),o.prototype._start=function(e,t){var o=n.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),u=o.effect,a=o.textStyle;a.x==null&&(a.x=u.x),a.y==null&&(a.y=u.y+(u.r0+u.r)/2-5);var f=this.createTextShape(o.textStyle),l=this.createBackgroundShape(o.backgroundColor),c=u.x,h=u.y,p=u.r0+6,d=u.r-6,v=u.color,m=r.lift(v,.1),g=new i({highlightStyle:n.clone(u)}),y=[],b=r.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),w=15,E=240;for(var S=0;S<16;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2]],[1,b[S*2+1]]])})),E-=w;E=360;for(var S=0;S<4;S++)y.push(new s({highlightStyle:{x:c,y:h,r0:p,r:d,startAngle:E-w,endAngle:E,brushType:"fill",color:m},_color:r.getLinearGradient(c+p*Math.cos(E,!0),h-p*Math.sin(E,!0),c+p*Math.cos(E-w,!0),h-p*Math.sin(E-w,!0),[[0,b[S*2+32]],[1,b[S*2+33]]])})),E-=w;var x=0;if(o.progress!=null){e(l),x=this.adjust(o.progress,[0,1]).toFixed(2)*100/5,g.highlightStyle.text=x*5+"%",e(g);for(var S=0;S<20;S++)y[S].highlightStyle.color=S=20?-20:1,e(g);for(var n=0;n<20;n++)y[n].highlightStyle.color=n