1 line
214 KiB
JavaScript
1 line
214 KiB
JavaScript
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(window,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=15)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(1),a=i(7),s=i(17),o=i(18),h=i(19),l=i(20);var u;!function(t){t[t.IMMED=0]="IMMED",t[t.TICK=1]="TICK",t[t.ANIMATED=2]="ANIMATED"}(u=e.zrenderUpdateType||(e.zrenderUpdateType={}));class c{constructor(t,e,i){this.zr=null,this.animatePropsQueue=[],this.lastAnimatePropsQueue=[],this.propsQueue=[],this.isLastUpdateInterrupt=!1,this.viewModel=e,this.zr=c.zrender.init(t),this.animations=new h.Animations(i.animation),this.globalShape=new s.GlobalShape(this),this.offscreen=new l.OffScreen(this.globalShape.id,this),this.viewOption=i,this.container=t,this.containerWidth=t.offsetWidth,this.containerHeight=t.offsetHeight,this.zr.add(this.globalShape.getZrenderShape())}setAttribute(t,e,i){let a=this.viewOption.animation.enableAnimation,s=t instanceof r.Shape?t.zrenderShape:t.getZrenderShape();if(null!==s){if(void 0===i&&(i=a?u.ANIMATED:u.TICK),i===u.TICK||i===u.ANIMATED){let t=i===u.ANIMATED?this.animatePropsQueue:this.propsQueue,r=t.find(t=>s.id===t.zrenderShape.id);r?n.Util.extends(r.props,e):t.push({zrenderShape:s,props:e})}else s.attr(e);this.offscreen.update(t.id,e)}}renderZrenderShapes(t,e){let i,s;for(s=0;s<t.length;s++)i=t[s],i.mountState===r.mountState.NEEDMOUNT&&(null===i.zrenderShape?i.zrenderShape=i.createZrenderShape():i instanceof a.Text&&i.updateText(),this.globalShape.add(i),i.updateZrenderShape("hide",{type:u.IMMED}),i.mountState=r.mountState.MOUNTED,i.visible=!0,i.updateZrenderShape("show")),i.zrenderShape.svShape=i,i.zrenderShape.attr("z",i.option.zIndex);e.length&&e.map(t=>{t.mountState===r.mountState.NEEDUNMOUNT&&(t.mountState=r.mountState.UNMOUNTED,t.visible=!1,t.updateZrenderShape("hide",{fn:(t=>()=>{this.globalShape.remove(t),n.Util.removeFromList(this.viewModel.getShapeList(),e=>t.id===e.id)})(t)}),this.getOffScreen().remove(t.id))})}updateZrenderShapes(t){let e=this.viewOption.animation;this.propsQueue.length&&(this.propsQueue.map(t=>{Object.keys(t.props).map(e=>{"callback"!==e&&t.zrenderShape.attr(e,t.props[e])}),t.props.callback&&t.props.callback()}),this.propsQueue.length=0,!1===e.enableAnimation&&t&&t()),setTimeout(()=>{if(this.animatePropsQueue.length){this.lastAnimatePropsQueue=this.animatePropsQueue,this.animatePropsQueue=[];let i=this.lastAnimatePropsQueue,r=i.length;i.map((n,a)=>{n.zrenderShape.animateTo(n.props,e.duration,e.timingFunction,()=>{a===r-1&&!1===this.isLastUpdateInterrupt&&(i.length=0,t&&t()),n.props.callback&&n.props.callback()})})}},0)}skipUpdateZrenderShapes(t){this.lastAnimatePropsQueue.length&&(this.isLastUpdateInterrupt=!0,this.lastAnimatePropsQueue.map(t=>{t.zrenderShape.stopAnimation(!0),t.props.callback&&t.props.callback()}),t&&t(),this.lastAnimatePropsQueue.length=0,this.isLastUpdateInterrupt=!1)}resizeGlobalShape(t){if(this.viewModel.isViewUpdating)return;let e="auto"===t.width?this.container.offsetWidth:t.width,i="auto"===t.height?this.container.offsetHeight:t.height,r=this.globalShape.getBound();e===this.containerWidth&&i===this.containerHeight&&!1===t.force||(this.containerWidth=e,this.containerHeight=i,this.zr.resize(t),this.setGlobalShapePosition(r),this.setGlobalShapeScale(r),this.updateZrenderShapes())}setGlobalShapePosition(t){let e,i,r=this.viewOption.position,n=this.viewModel.isFirstRender,a=t.x+t.width/2,s=t.y+t.height/2;void 0!==r&&!1!==r&&(Array.isArray(r)&&(e=r[0]-a,i=r[1]-s),"auto"===r&&(e=this.containerWidth/2-a,i=this.containerHeight/2-s),this.globalShape.translate(e,i,n?u.TICK:u.ANIMATED))}setGlobalShapeScale(t){let e,i,r=this.viewOption.scale,n=this.viewModel.isFirstRender;if(void 0!==r&&!1!==r){if(Array.isArray(r)&&(r[0]>4&&(r[0]=4),r[0]<.25&&(r[0]=.25),r[1]>4&&(r[1]=4),r[1]<.25&&(r[1]=.25),e=r[0],i=r[1]),"auto"===r){let r,n,a=this.globalShape.getScale(),s=t.width,o=t.height,h=.75;s-this.containerWidth>o-this.containerHeight?(n=s,r=this.containerWidth):(n=o,r=this.containerHeight);let l=r*h/n;e=a[0]*l,i=a[1]*l,e>1&&(e=1),i>1&&(i=1),e<.25&&(e=.25),i<.25&&(i=.25)}this.globalShape.scale(e,i,n?u.TICK:u.ANIMATED)}}toggleAutoPosition(t){this.viewOption.position=t}toggleAutoScale(t){this.viewOption.scale=t}getAnimationProps(t,e){return this.animations[e](t)}getOffScreen(){return this.offscreen}getGlobalShape(){return this.globalShape}getContainer(){return this.container}getContainerWidth(){return this.containerWidth}getContainerHeight(){return this.containerHeight}getZrender(){return this.zr}clear(){this.animatePropsQueue.length=0,this.propsQueue.length=0,this.globalShape.clear()}}e.Renderer=c,c.zrender=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(3);e.Util={generateId:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){let e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),extends(t,i){null!=i&&("object"!=typeof t||Array.isArray(t)||Object.keys(i).map(r=>{null===i[r]||"object"!=typeof i[r]||Array.isArray(i[r])?t[r]=i[r]:(void 0===t[r]&&(t[r]={}),e.Util.extends(t[r],i[r]))}))},merge(t,i){null!=i&&Object.keys(i).map(r=>{void 0!==t[r]&&void 0!==i[r]&&("object"!=typeof i[r]||Array.isArray(i[r])?t[r]=i[r]:null===t[r]||"object"!=typeof t[r]||Array.isArray(t[r])?t[r]=i[r]:e.Util.merge(t[r],i[r]))})},removeFromList(t,e){for(let i=0;i<t.length;i++)e(t[i])&&t.splice(i,1)&&i--},findInList:(t,e)=>t[t.findIndex(e)],sign:t=>t<0?-1:1,getPathCenter(t){let e=-1/0,i=1/0,r=-1/0,n=1/0;return t.map(t=>{t[0]>e&&(e=t[0]),t[0]<i&&(i=t[0]),t[1]>r&&(r=t[1]),t[1]<n&&(n=t[1])}),[(e+i)/2,(r+n)/2]},assert(t,e){if(t)throw e},anchor2position(t,e,i,n,a,s,o){let h="function"==typeof s?s(i,n,o):s;return a?r.Vector.rotation(a,[t+h[0],e+h[1]],[t,e]):[t+h[0],e+h[1]]},getClassName:t=>t.prototype.constructor.toString().split(" ")[1],textParser(t){let e=/\[[^\]]*\]/g;if(e.test(t)){return t.match(e).map(t=>t.replace(/\[|\]/g,""))}return t},clamp:(t,e,i)=>t<=e&&t>=i?t:t>e?e:t<i?i:void 0}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(1);var n;!function(t){t[t.NEEDMOUNT=0]="NEEDMOUNT",t[t.MOUNTED=1]="MOUNTED",t[t.NEEDUNMOUNT=2]="NEEDUNMOUNT",t[t.UNMOUNTED=3]="UNMOUNTED"}(n=e.mountState||(e.mountState={}));e.Shape=class{constructor(t,e,i){this.id="",this.type="shape",this.name=null,this.zrenderShape=null,this.x=0,this.y=0,this.visible=!1,this.rotation=0,this.width=0,this.height=0,this.style=null,this.draggable=!1,this.prevX=0,this.prevY=0,this.prevVisible=!1,this.prevRotation=0,this.prevWidth=0,this.prevHeight=0,this.prevStyle=null,this.baseStyle={fill:"#000",text:"",textFill:"#000",fontSize:15,fontWeight:null,stroke:null,opacity:1,lineWidth:1,transformText:!0},this.option={content:null,size:[0,0],zIndex:1,show:"scale"},this.renderer=null,this.parentShape=null,this.visited=!1,this.isDirty=!1,this.mountState=n.NEEDMOUNT,this.element=null,this.animationsTable={position:"position",translate:"translate",rotation:"rotation",show:"scale",hide:"scale",size:"size",style:"style"},this.id=t,this.name=e,this.option=this.defaultOption(this.option),this.style=this.defaultStyle(this.baseStyle),this.prevStyle=this.defaultStyle(this.baseStyle),this.applyShapeOption(i)}defaultOption(t){return t}defaultStyle(t){return Object.assign({},t)}getBaseAnchors(){let t=this.width/2,e=this.height/2;return{0:[0,-e],1:[t,0],2:[0,e],3:[-t,0],4:[0,0]}}defaultAnchors(t,e,i){return t}restoreData(){this.x=0,this.y=0,this.rotation=0,this.width=0,this.height=0,this.visible=!1,this.style=this.defaultStyle(this.baseStyle)}applyShapeOption(t){r.Util.merge(this.option,t),r.Util.merge(this.style,t.style),t.size&&(Array.isArray(t.size)?(this.width=t.size[0],this.height=t.size[1]):this.width=this.height=t.size),"circle"!==this.name&&"isogon"!==this.name||(this.height=this.width),t.show&&(Array.isArray(t.show)?(this.animationsTable.show=t.show[0],this.animationsTable.hide=t.show[1]):(this.animationsTable.show=t.show,this.animationsTable.hide=t.show)),this.style.text=this.option.content}getBound(t=!0){return this.renderer.getOffScreen().getShapeBound(this.id,t)}updateSize(t){}updateZrenderShape(t,e){if(null===this.zrenderShape)return;let i=this.renderer.getAnimationProps(this,this.animationsTable[t]);if(void 0===e&&(e={type:void 0,fn:()=>{}}),e.fn&&(i.callback=e.fn),"composite"===this.type||"polyLine"===this.name){let t=this.zrenderShape.getBoundingRect(),e=[t.x+t.width/2,t.y+t.height/2];this.zrenderShape.attr("origin",e),this.renderer.getOffScreen().update(this.id,"origin",e)}this.renderer.setAttribute(this,i,e.type)}createZrenderShape(){}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Vector={add:(t,e)=>[t[0]+e[0],t[1]+e[1]],subtract:(t,e)=>[t[0]-e[0],t[1]-e[1]],dot:(t,e)=>t[0]*e[0]+t[1]*e[1],scale:(t,e)=>[t[0]*e,t[1]*e],length:t=>Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),rotation(t,e,i=[0,0]){if(0===t)return e;t=-t;let r=Math.cos(t),n=Math.sin(t),a=[e[0]-i[0],e[1]-i[1]],s=[0,0];return s[0]=i[0]+(a[0]*r-a[1]*n),s[1]=i[1]+(a[0]*n+a[1]*r),s},tangent:t=>[-t[1],t[0]],normalize(t){let i=e.Vector.length(t);return 0===i?[0,0]:1===i?t:[t[0]/i,t[1]/i]},location:(t,i,r)=>e.Vector.add(t,e.Vector.scale(e.Vector.normalize(i),r)),negative:t=>e.Vector.scale(t,-1)}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(3);e.Bound={fromPoints(t){let e=-1/0,i=1/0,r=-1/0,n=1/0;return t.map(t=>{t[0]>e&&(e=t[0]),t[0]<i&&(i=t[0]),t[1]>r&&(r=t[1]),t[1]<n&&(n=t[1])}),{x:i,y:n,width:e-i,height:r-n}},toPoints:t=>[[t.x,t.y],[t.x+t.width,t.y],[t.x+t.width,t.y+t.height],[t.x,t.y+t.height]],union:(...t)=>t.length>1?t.reduce((t,e)=>{let i=t.x<e.x?t.x:e.x,r=t.x+t.width<e.x+e.width?e.x+e.width:t.x+t.width,n=t.y<e.y?t.y:e.y;return{x:i,y:n,width:r-i,height:(t.y+t.height<e.y+e.height?e.y+e.height:t.y+t.height)-n}}):t[0],intersect(t,e){let i,r,n,a,s,o;return t.x<e.x+e.width&&t.x+t.width>e.x&&(i=t.x<e.x?e.x:t.x,n=t.x+t.width<e.x+e.width?t.x+t.width:e.x+e.width,s=n-i),t.y<e.y+e.height&&t.y+t.height>e.y&&(r=t.y<e.y?e.y:t.y,a=t.y<e.y?t.y+t.height:e.y+e.height,o=a-r),s&&o?{x:i,y:r,width:s,height:o}:null},rotation(t,i){let n=t.x+t.width/2,a=t.y+t.height/2;return e.Bound.fromPoints(e.Bound.toPoints(t).map(t=>r.Vector.rotation(i,t,[n,a])))},isOverlap(t,e){let i=t.x+t.width,r=t.y+t.height,n=e.x+e.width,a=e.y+e.height;return t.x<n&&e.x<i&&t.y<a&&e.y<r}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0),a=i(3);class s extends r.Shape{constructor(t,e,i){super(t,e,i),this.type="composite",this.subShapes=[]}addSubShape(t){Object.keys(t).map(e=>{if(!t[e])return;let i={label:e,shape:null,shapeName:t[e].shapeName,draw:t[e].draw,init:t[e].init},r=this.subShapes.findIndex(t=>t.label===e);r>=0?this.subShapes[r]=Object.assign(Object.assign({},this.subShapes[r]),t[e]):this.subShapes.push(i)})}getSubShape(t){return this.subShapes.find(e=>e.label===t).shape}updateSubShapes(){this.subShapes.map(t=>{t.shape.applyShapeOption({style:this.style}),t.init&&t.shape.applyShapeOption(t.init(this.option,this.style)),t.draw(this,t.shape),t.shape.x-=this.x,t.shape.y-=this.y,t.shape.isDirty=this.isDirty,t.shape.element=this.element,this.rotation&&this.subShapes.map(t=>{let e=a.Vector.rotation(this.rotation,[t.shape.x,t.shape.y],[-this.width/2,-this.height/2]);t.shape.x=e[0],t.shape.y=e[1],t.shape.rotation=this.rotation})})}createZrenderShape(){let t=new n.Renderer.zrender.Group({position:[this.x,this.y],z:this.option.zIndex});return this.subShapes.map(e=>{let i=e.shape.createZrenderShape();null===e.shape.zrenderShape&&(e.shape.zrenderShape=i),this.zrenderShape?(i.shapeId=e.shape.id,t.add(i)):t.add(e.shape.zrenderShape)}),t}}e.Composite=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Interaction=class{constructor(t,e,i){this.name=t,this.interactionModel=e,this.engine=i,this.elementList=i.getElementList(),this.renderer=i.getRenderer(),this.zr=this.renderer.getZrender(),this.isEnable=!0}setOptionVal(t){this.optionValue=t}update(){}init(){}trigger(t){}handler(t){return null}finish(t){}triggerCondition(){return!0}emitHandler(t){this.isEnable&&this.interactionModel.handler(this.name,t)}emitTrigger(t){this.isEnable&&this.triggerCondition()&&this.trigger(t)}emitFinish(t){this.isEnable&&this.finish(t)}setData(t,e){this.interactionModel.dataStore[t]=e}getData(t){return this.interactionModel.dataStore[t]}toggleEnable(t){this.isEnable=t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0);class a extends r.Shape{constructor(t,e,i){super(t,e,i)}defaultOption(t){return Object.assign(Object.assign({},t),{zIndex:2})}defaultStyle(t){return Object.assign(Object.assign({},t),{textBackgroundColor:"#fff",textBorderRadius:0,textPadding:[4,4,4,4]})}updateTextSize(){let t=this.getBound(!1);this.width=t.width,this.height=t.height}updateText(){let t={position:[this.x,this.y],origin:[this.width/2,this.height/2],rotation:this.rotation};this.renderer.setAttribute(this,t,n.zrenderUpdateType.IMMED)}createZrenderShape(){let t=new n.Renderer.zrender.Text({style:this.style,z:this.option.zIndex}),e=new n.Renderer.zrender.Text({style:this.style,z:this.option.zIndex});return this.renderer.getOffScreen().add(e,this.id),this.updateTextSize(),this.updateText(),t}}e.Text=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0),a=i(1),s=i(4);class o extends r.Shape{constructor(t,e,i){super(t,e,i),this.path=[],this.prevPath=[],this.animationsTable=Object.assign(Object.assign({},this.animationsTable),{path:"path"})}restoreData(){super.restoreData(),this.path=[]}defaultStyle(t){return Object.assign(Object.assign({},t),{smooth:0,lineDash:null})}getBound(){return s.Bound.fromPoints(this.path)}createZrenderShape(){return new n.Renderer.zrender.Polyline({position:[this.x,this.y],origin:a.Util.getPathCenter(this.path),shape:{points:this.path,smooth:this.style.smooth},style:this.style,z:this.option.zIndex})}}e.PolyLine=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(4);e.Element=class{constructor(t){this.name="element",this.x=0,this.y=0,this.rotation=0,this.width=0,this.height=0,this.style={},this.anchors=null,this.lastX=0,this.lastY=0,this.shape=null,this.effectLinks=[],this.effectRefer=null,this.isObsolete=!1,this.isDragged=!1,Object.keys(t).map(e=>{this[e]=t[e]})}getBound(){let t=this.width,e=this.height,i={x:this.x-t/2,y:this.y-e/2,width:t,height:e};return this.rotation?r.Bound.rotation(i,this.rotation):i}onLinkTo(t,e){}onLinkFrom(t,e){}onUnlinkTo(t){}onUnlinkFrom(t){}onRefer(t,e,i){}onUnrefer(t){}onChange(t){}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(16),n=i(1),a=i(22),s=i(25),o=i(9),h=i(26),l=i(27),u=i(28);class c{constructor(t,e){this.name="engine",this.sources=null,this.stringifySources=null,this.dataModel=null,this.viewModel=null,this.interactionModel=null,this.sourcesProxy=null,this.defaultOption=null,this.structOption={element:o.Element,link:[],pointer:[]},this.viewOption={element:{},link:{},pointer:{},layout:{},animation:{enableSkip:!0,enableAnimation:!0,timingFunction:"quinticOut",duration:1e3},position:"auto",scale:"auto"},this.interactOption={zoomView:!0,moveView:!1,drag:!1,focus:!1,frameSelect:!1},this.proxySources=null,n.Util.assert(!t,"HTML元素不存在"),this.id=n.Util.generateId(),this.name=e.name,this.viewModel=new r.ViewModel(this,t),this.dataModel=new a.DataModel(this,this.viewModel),this.interactionModel=new u.InteractionModel(this),this.sourcesProxy=new l.SourcesProxy(this),this.defaultOption=e.defaultOption,this.initViewOption(e.defaultOption.struct),this.applyOptions(e.defaultOption,!1)}reset(){this.dataModel.resetData(),this.viewModel.resetData()}initViewOption(t){t.element&&"object"==typeof t.element&&(this.viewOption.element={},Object.keys(t.element).forEach(t=>{this.viewOption.element[t]={}})),t.link&&Array.isArray(t.link)&&t.link.forEach(t=>{this.viewOption.link[t]=new s.DefaultLinkOption}),t.pointer&&Array.isArray(t.pointer)&&t.pointer.forEach(t=>{this.viewOption.pointer[t]=new s.DefaultPointerOption})}updateEngine(t){this.reset(),this.beforeUpdate(),this.viewModel.isViewUpdating=!0,this.dataModel.constructElements(t),this.dataModel.layoutElements(this.render.bind(this),this.viewModel.renderer.getContainerWidth(),this.viewModel.renderer.getContainerHeight()),this.dataModel.updateShapes(),this.viewModel.reconciliation(),this.viewModel.renderShapes(!0)}updateElement(t,e=!1){void 0===e&&(e=this.viewOption.animation.enableAnimation),void 0===t&&(t=this.dataModel.getElementList());let i=this.viewOption.animation.enableAnimation;this.viewOption.animation.enableAnimation=e,this.dataModel.updateShapes(t),this.viewModel.reconciliation(!0),this.viewModel.renderShapes(!1),this.viewOption.animation.enableAnimation=i}source(t,e=!1){if(!this.viewOption.animation.enableSkip&&this.viewModel.isViewUpdating)return;if(void 0===t)return;let i=JSON.stringify(t);return i!==this.stringifySources?(this.sources=t,this.stringifySources=i,this.viewModel.structuralUpdate=!0,this.updateEngine(t),!1===e&&this.proxySources&&this.sourcesProxy.revoke(this.proxySources),e&&t!==this.proxySources?(this.proxySources=this.sourcesProxy.proxy(t),this.proxySources):void 0):void 0}applyOptions(t,e=!0){t&&0!==Object.keys(t).length&&(t.struct&&n.Util.extends(this.structOption,t.struct),t.view&&Object.keys(t.view).forEach(e=>{Array.isArray(this.viewOption[e])||"object"!=typeof this.viewOption[e]?this.viewOption[e]=t.view[e]:n.Util.extends(this.viewOption[e],t.view[e])}),t.interact&&(Object.keys(t.interact).forEach(e=>{this.interactOption[e]=t.interact[e]}),this.interactionModel.applyInteractions(this.interactOption)),!1!==e&&null!==this.sources&&this.updateEngine(this.sources))}clear(){this.dataModel.resetData(),this.viewModel.resetData(),this.viewModel.clearShapes(),this.stringifySources=null,this.proxySources&&(this.sourcesProxy.revoke(this.proxySources),this.proxySources=null)}getRenderer(){return this.viewModel.renderer}getElementList(){return this.dataModel.getElementList()}getId(){return this.id}getName(){return this.name}getDefaultOption(){return this.defaultOption}isViewUpdating(){return this.viewModel.isViewUpdating}link(t,e,i,r=null){this.dataModel.addLink(t,e,i,r)}refer(t,e,i){this.dataModel.addPointer(t,e,i)}text(t,e){return this.viewModel.createShape("staticText#"+this.viewModel.staticTextId++,"text",{content:t,style:e})}group(...t){return new h.Group(...t)}resize(t){void 0===t?t={width:"auto",height:"auto",force:!1}:(t.width=t.width||"auto",t.height=t.height||"auto",t.force=void 0!==t.force&&t.force),this.viewModel.renderer.resizeGlobalShape(t)}render(t,e,i){}beforeUpdate(){}afterUpdate(){}}e.Engine=c,c.ShapesTable={},e.RegisterShape=function(t,e){c.ShapesTable[e]=t,t.prototype.name=e}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0);class a extends r.Shape{constructor(t,e,i){super(t,e,i)}updateSize(t){this.updateZrenderShape("position")}createZrenderShape(){return new n.Renderer.zrender.Rect({position:[this.x,this.y],rotation:this.rotation,shape:{x:-this.width/2,y:-this.height/2,width:this.width,height:this.height},style:this.style,z:this.option.zIndex})}}e.Rect=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0);class a extends r.Shape{constructor(t,e,i){super(t,e,i)}defaultOption(t){return Object.assign(Object.assign({},t),{edges:5})}createZrenderShape(){return new n.Renderer.zrender.Isogon({position:[this.x,this.y],rotation:this.rotation,shape:{x:0,y:0,n:this.option.edges,r:this.width/2},style:this.style,z:this.option.zIndex})}}e.Isogon=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2),n=i(0);class a extends r.Shape{constructor(t,e,i){super(t,e,i)}createZrenderShape(){return new n.Renderer.zrender.Circle({position:[this.x,this.y],rotation:this.rotation,shape:{cx:0,cy:0,r:this.width/2},style:this.style,z:this.option.zIndex})}}e.Circle=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(8),n=i(0),a=i(1);class s extends r.PolyLine{constructor(t,e,i){super(t,e,i),this.controlPoint=null,this.animationsTable=Object.assign(Object.assign({},this.animationsTable),{path:"curve"})}defaultOption(t){return Object.assign(Object.assign({},t),{curveness:.2})}calcControlPoint(t,e){return this.controlPoint?this.controlPoint:[(t.x+e.x)/2-(t.y-e.y)*this.option.curveness,(t.y+e.y)/2-(e.x-t.x)*this.option.curveness]}restoreData(){super.restoreData(),this.controlPoint=null}createZrenderShape(){let t=this.path[0][0],e=this.path[0][1],i=this.path[1][0],r=this.path[1][1];return new n.Renderer.zrender.BezierCurve({origin:a.Util.getPathCenter(this.path),shape:{x1:t,y1:e,x2:i,y2:r,cpx1:this.controlPoint[0],cpy1:this.controlPoint[1]},style:this.style,z:this.option.zIndex})}}e.Curve=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(10),n=i(1),a=i(5),s=i(9),o=i(13),h=i(12),l=i(8),u=i(11),c=i(7),d=i(4),p=i(34),f=i(35),g=i(36),v=i(37),m=i(14),y=i(3);r.RegisterShape(a.Composite,"composite"),r.RegisterShape(o.Circle,"circle"),r.RegisterShape(h.Isogon,"isogon"),r.RegisterShape(l.PolyLine,"polyLine"),r.RegisterShape(u.Rect,"rect"),r.RegisterShape(c.Text,"text"),r.RegisterShape(p.Arrow,"arrow"),r.RegisterShape(m.Curve,"curve"),r.RegisterShape(f.Line,"line"),r.RegisterShape(g.Node,"node"),r.RegisterShape(v.DualNode,"dualNode"),e.SV={Engine:r.Engine,Util:n.Util,Bound:d.Bound,Vector:y.Vector,Element:s.Element,Composite:a.Composite,registerShape:r.RegisterShape,create(t,e,i){e.id=n.Util.generateId();let r=new e(t);return i&&r.applyOptions(i,!1),r}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(10),n=i(0),a=i(21),s=i(2),o=i(1),h=i(5),l=i(7);e.ViewModel=class{constructor(t,e){this.engine=t,this.shapeContainer={},this.shapeList=[],this.removeList=[],this.staticTextId=0,this.isViewUpdating=!1,this.isFirstRender=!0,this.structuralUpdate=!1,this.reconciler=new a.Reconciler(this),this.renderer=new n.Renderer(e,this,t.viewOption)}createShape(t,e,i){let n=null,a=null;"string"==typeof e?(n=r.Engine.ShapesTable[e],a=e):(n=e,a=n.prototype.constructor.name.toLowerCase()),o.Util.assert(void 0===n,"图形 "+a+" 未注册!");let s=this.reuseShape(t,a,i);return null===s&&(s=new n(t,a,i)),s instanceof h.Composite&&this.createCompositeSubShapes(s),s.renderer=this.renderer,this.shapeList.push(s),"text"===a&&null===s.zrenderShape&&(s.zrenderShape=s.createZrenderShape()),s}createCompositeSubShapes(t){t.subShapes.map((e,i)=>{let r={style:{}};o.Util.extends(r,t.option),o.Util.extends(r.style,t.style),e.init&&o.Util.extends(r,e.init(t.option,t.style)),e.shape=this.createShape(t.id+"#"+i,e.shapeName,r),e.shape.parentShape=t})}addShape(t){let e=this.shapeContainer,i=t.name;void 0===e[i]&&(e[i]=[]),e[i].push(t)}removeShape(t){o.Util.removeFromList(this.shapeContainer[t.name],e=>e.id===t.id),t.mountState=s.mountState.NEEDUNMOUNT,0===this.shapeContainer[t.name].length&&delete this.shapeContainer[t.name],this.removeList.push(t)}reuseShape(t,e,i){if(void 0===this.shapeContainer[e])return null;let r=this.shapeContainer[e].find(e=>e.id===t);return r?(r.restoreData(),r.applyShapeOption(i),r.visible=!0,r instanceof l.Text&&r.updateTextSize(),r):null}reconciliation(t=!1){if(this.shapeList.forEach(t=>{t instanceof h.Composite&&t.isDirty&&t.updateSubShapes()}),t)for(let t=0;t<this.shapeList.length;t++)this.reconciler.reconcileShape(this.shapeList[t],this.shapeList[t]);else this.isFirstRender?this.shapeList.forEach(t=>{this.addShape(t)}):this.reconciler.reconcileShapeList(this.shapeContainer,this.shapeList)}renderShapes(t=!0){if(this.isViewUpdating&&this.renderer.skipUpdateZrenderShapes(this.afterUpdate.bind(this)),this.structuralUpdate&&this.renderer.renderZrenderShapes(this.shapeList,this.removeList),t){let t=this.renderer.getGlobalShape();this.renderer.setGlobalShapePosition(t.getBound()),this.renderer.setGlobalShapeScale(t.getBound())}this.renderer.updateZrenderShapes(this.afterUpdate.bind(this)),this.isFirstRender&&(this.isFirstRender=!1)}resetData(){Object.keys(this.shapeContainer).map(t=>{this.shapeContainer[t].map(t=>t.visited&&(t.visited=!1))}),this.staticTextId=0,this.shapeList.length=0,this.removeList.length=0}clearShapes(){this.shapeContainer={},this.shapeList.length=0,this.removeList.length=0,this.renderer.clear()}getShapeList(){return this.shapeList.filter(t=>t.mountState!==s.mountState.NEEDUNMOUNT)}getShape(t){return this.shapeList.find(e=>e.id===t)}afterUpdate(){this.renderer.getGlobalShape().updateOriginToCenter(),this.structuralUpdate=!1,this.isViewUpdating=!1,this.shapeList.forEach(t=>{t.isDirty=!1}),this.engine.afterUpdate()}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(0);e.GlobalShape=class{constructor(t){this.renderer=null,this.zrenderGroup=null,this.renderer=t,this.zrenderGroup=new r.Renderer.zrender.Group,this.id=this.zrenderGroup.id.toString()}add(t){Array.isArray(t)?t.map(t=>this.add(t)):null===t.parentShape&&(this.zrenderGroup.add(t.zrenderShape),"text"!==t.name&&this.renderer.getOffScreen().add(t.createZrenderShape(),t.id))}remove(t){t instanceof Array?t.map(t=>this.remove(t)):(this.zrenderGroup.remove(t.zrenderShape),t.zrenderShape=null)}clear(){this.zrenderGroup.removeAll()}scale(t,e,i=r.zrenderUpdateType.ANIMATED){let n={scale:[t,e]};this.renderer.setAttribute(this,n,i)}translate(t,e,i=r.zrenderUpdateType.ANIMATED){let n=this.getPosition(),a={position:[n[0]+t,n[1]+e]};this.renderer.setAttribute(this,a,i)}getPosition(){return this.zrenderGroup.position}getScale(){return this.zrenderGroup.scale}getOrigin(){return this.renderer.getOffScreen().getOrigin()}getBound(){return this.renderer.getOffScreen().getBound()}getNaiveBound(){return this.renderer.getOffScreen().getNaiveBound()}getZrenderShape(){return this.zrenderGroup}updateOriginToCenter(){this.renderer.getOffScreen().updateOriginToCenter();let[t,e]=this.getOrigin(),[i,r]=this.getPosition();if(this.zrenderGroup.attr("origin",[t,e]),void 0!==this.originX&&void 0!==this.originY){let n,a,[s,o]=this.getScale();n=(this.originX-t)*(1-s),a=(this.originY-e)*(1-o),this.zrenderGroup.attr("position",[i+n,r+a])}this.originX=t,this.originY=e}}},function(t,e,i){!function(t){"use strict";function e(){return r++}var i,r=2311,n="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);return 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),{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),a={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},s={"[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},o=Object.prototype.toString,h=Array.prototype,l=h.forEach,u=h.filter,c=h.slice,d=h.map,p=h.reduce,f={};function g(t){if(null==t||"object"!=typeof t)return t;var e=t,i=o.call(t);if("[object Array]"===i){if(!N(t)){e=[];for(var r=0,n=t.length;r<n;r++)e[r]=g(t[r])}}else if(s[i]){if(!N(t)){var h=t.constructor;if(t.constructor.from)e=h.from(t);else for(e=new h(t.length),r=0,n=t.length;r<n;r++)e[r]=g(t[r])}}else if(!a[i]&&!N(t)&&!E(t))for(var l in e={},t)t.hasOwnProperty(l)&&(e[l]=g(t[l]));return e}function v(t,e,i){if(!L(e)||!L(t))return i?g(e):t;for(var r in e)if(e.hasOwnProperty(r)){var n=t[r],a=e[r];!L(a)||!L(n)||O(a)||O(n)||E(a)||E(n)||z(a)||z(n)||N(a)||N(n)?!i&&r in t||(t[r]=g(e[r])):v(n,a,i)}return t}function m(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function y(t,e,i){for(var r in e)e.hasOwnProperty(r)&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r]);return t}function _(){return f.createCanvas()}function x(){return i=i||_().getContext("2d")}function b(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i}return-1}function w(t,e){var i=t.prototype;function r(){}for(var n in r.prototype=e.prototype,t.prototype=new r,i)i.hasOwnProperty(n)&&(t.prototype[n]=i[n]);(t.prototype.constructor=t).superClass=e}function S(t,e,i){y(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,i)}function k(t){if(t)return"string"!=typeof t&&"number"==typeof t.length}function P(t,e,i){if(t&&e)if(t.forEach&&t.forEach===l)t.forEach(e,i);else if(t.length===+t.length)for(var r=0,n=t.length;r<n;r++)e.call(i,t[r],r,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(i,t[a],a,t)}function M(t,e,i){if(t&&e){if(t.map&&t.map===d)return t.map(e,i);for(var r=[],n=0,a=t.length;n<a;n++)r.push(e.call(i,t[n],n,t));return r}}function T(t,e){var i=c.call(arguments,2);return function(){return t.apply(e,i.concat(c.call(arguments)))}}function O(t){return"[object Array]"===o.call(t)}function A(t){return"function"==typeof t}function C(t){return"[object String]"===o.call(t)}function L(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function z(t){return!!a[o.call(t)]}function E(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function D(t,e){return null!=t?t:e}function I(t,e,i){return null!=t?t:null!=e?e:i}function R(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function B(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}f.createCanvas=function(){return document.createElement("canvas")};var F="__ec_primitive__";function N(t){return t[F]}function j(t){var e=O(t);this.data={};var i=this;function r(t,r){e?i.set(t,r):i.set(r,t)}t instanceof j?t.each(r):t&&P(t,r)}function U(){}j.prototype={constructor:j,get:function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},set:function(t,e){return this.data[t]=e},each:function(t,e){for(var i in void 0!==e&&(t=T(t,e)),this.data)this.data.hasOwnProperty(i)&&t(this.data[i],i)},removeKey:function(t){delete this.data[t]}};var V=(Object.freeze||Object)({$override:function(t,e){"createCanvas"===t&&(i=null),f[t]=e},clone:g,merge:v,mergeAll:function(t,e){for(var i=t[0],r=1,n=t.length;r<n;r++)i=v(i,t[r],e);return i},extend:m,defaults:y,createCanvas:_,getContext:x,indexOf:b,inherits:w,mixin:S,isArrayLike:k,each:P,map:M,reduce:function(t,e,i,r){if(t&&e){if(t.reduce&&t.reduce===p)return t.reduce(e,i,r);for(var n=0,a=t.length;n<a;n++)i=e.call(r,i,t[n],n,t);return i}},filter:function(t,e,i){if(t&&e){if(t.filter&&t.filter===u)return t.filter(e,i);for(var r=[],n=0,a=t.length;n<a;n++)e.call(i,t[n],n,t)&&r.push(t[n]);return r}},find:function(t,e,i){if(t&&e)for(var r=0,n=t.length;r<n;r++)if(e.call(i,t[r],r,t))return t[r]},bind:T,curry:function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},isArray:O,isFunction:A,isString:C,isObject:L,isBuiltInObject:z,isTypedArray:function(t){return!!s[o.call(t)]},isDom:E,eqNaN:function(t){return t!=t},retrieve:function(t){for(var e=0,i=arguments.length;e<i;e++)if(null!=arguments[e])return arguments[e]},retrieve2:D,retrieve3:I,slice:function(){return Function.call.apply(c,arguments)},normalizeCssArray:R,assert:function(t,e){if(!t)throw new Error(e)},trim:B,setAsPrimitive:function(t){t[F]=!0},isPrimitive:N,createHashMap:function(t){return new j(t)},concatArray:function(t,e){for(var i=new t.constructor(t.length+e.length),r=0;r<t.length;r++)i[r]=t[r];var n=t.length;for(r=0;r<e.length;r++)i[r+n]=e[r];return i},noop:U}),H="undefined"==typeof Float32Array?Array:Float32Array;function W(t,e){var i=new H(2);return null==t&&(t=0),null==e&&(e=0),i[0]=t,i[1]=e,i}function X(t){var e=new H(2);return e[0]=t[0],e[1]=t[1],e}function Y(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Z(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function q(t){return Math.sqrt(Q(t))}var G=q;function Q(t){return t[0]*t[0]+t[1]*t[1]}var $=Q;function K(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function J(t,e){var i=q(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}function tt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var et=tt;function it(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var rt=it;function nt(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n+i[4],t[1]=i[1]*r+i[3]*n+i[5],t}function at(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function st(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}var ot=(Object.freeze||Object)({create:W,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:X,set:function(t,e,i){return t[0]=e,t[1]=i,t},add:Y,scaleAndAdd:function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t},sub:Z,len:q,length:G,lenSquare:Q,lengthSquare:$,mul:function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t},div:function(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:K,normalize:J,distance:tt,dist:et,distanceSquare:it,distSquare:rt,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:function(t,e,i,r){return t[0]=e[0]+r*(i[0]-e[0]),t[1]=e[1]+r*(i[1]-e[1]),t},applyTransform:nt,min:at,max:st});function ht(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function lt(t,e){return{target:t,topTarget:e&&e.topTarget}}function ut(t){this._$handlers={},this._$eventProcessor=t}ht.prototype={constructor:ht,_dragStart:function(t){var e=t.target;e&&e.draggable&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(lt(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,r=t.offsetY,n=i-this._x,a=r-this._y;this._x=i,this._y=r,e.drift(n,a,t),this.dispatchToElement(lt(e,t),"drag",t.event);var s=this.findHover(i,r,e).target,o=this._dropTarget;e!==(this._dropTarget=s)&&(o&&s!==o&&this.dispatchToElement(lt(o,t),"dragleave",t.event),s&&s!==o&&this.dispatchToElement(lt(s,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(lt(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(lt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var ct=Array.prototype.slice;function dt(t,e,i,r,n,a){var s=t._$handlers;if("function"==typeof i&&(n=r,r=i,i=null),!r||!e)return t;i=function(t,e){var i=t._$eventProcessor;return null!=e&&i&&i.normalizeQuery&&(e=i.normalizeQuery(e)),e}(t,i),s[e]||(s[e]=[]);for(var o=0;o<s[e].length;o++)if(s[e][o].h===r)return t;var h={h:r,one:a,query:i,ctx:n||t,callAtLast:r.zrEventfulCallAtLast},l=s[e].length-1,u=s[e][l];return u&&u.callAtLast?s[e].splice(l,0,h):s[e].push(h),t}ut.prototype={constructor:ut,one:function(t,e,i,r){return dt(this,t,e,i,r,!0)},on:function(t,e,i,r){return dt(this,t,e,i,r,!1)},isSilent:function(t){var e=this._$handlers;return!e[t]||!e[t].length},off:function(t,e){var i=this._$handlers;if(!t)return this._$handlers={},this;if(e){if(i[t]){for(var r=[],n=0,a=i[t].length;n<a;n++)i[t][n].h!==e&&r.push(i[t][n]);i[t]=r}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this},trigger:function(t){var e=this._$handlers[t],i=this._$eventProcessor;if(e){var r=arguments,n=r.length;3<n&&(r=ct.call(r,1));for(var a=e.length,s=0;s<a;){var o=e[s];if(i&&i.filter&&null!=o.query&&!i.filter(t,o.query))s++;else{switch(n){case 1:o.h.call(o.ctx);break;case 2:o.h.call(o.ctx,r[1]);break;case 3:o.h.call(o.ctx,r[1],r[2]);break;default:o.h.apply(o.ctx,r)}o.one?(e.splice(s,1),a--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(t),this},triggerWithContext:function(t){var e=this._$handlers[t],i=this._$eventProcessor;if(e){var r=arguments,n=r.length;4<n&&(r=ct.call(r,1,r.length-1));for(var a=r[r.length-1],s=e.length,o=0;o<s;){var h=e[o];if(i&&i.filter&&null!=h.query&&!i.filter(t,h.query))o++;else{switch(n){case 1:h.h.call(a);break;case 2:h.h.call(a,r[1]);break;case 3:h.h.call(a,r[1],r[2]);break;default:h.h.apply(a,r)}h.one?(e.splice(o,1),s--):o++}}}return i&&i.afterTrigger&&i.afterTrigger(t),this}};var pt=Math.log(2);function ft(t,e,i,r,n,a){var s=r+"-"+n,o=t.length;if(a.hasOwnProperty(s))return a[s];if(1===e){var h=Math.round(Math.log((1<<o)-1&~n)/pt);return t[i][h]}for(var l=r|1<<i,u=i+1;r&1<<u;)u++;for(var c=0,d=0,p=0;d<o;d++){var f=1<<d;f&n||(c+=(p%2?-1:1)*t[i][d]*ft(t,e-1,u,l,n|f,a),p++)}return a[s]=c}var gt="undefined"!=typeof window&&!!window.addEventListener,vt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,mt="___zrEVENTSAVED",yt=[];function _t(t,e,i,r){return i=i||{},r||!n.canvasSupported?xt(t,e,i):n.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):xt(t,e,i),i}function xt(t,e,i){if(t.getBoundingClientRect&&n.domSupported){var r=e.clientX,a=e.clientY;if("CANVAS"===t.nodeName.toUpperCase()){var s=t.getBoundingClientRect();return i.zrX=r-s.left,void(i.zrY=a-s.top)}var o=t[mt]||(t[mt]={}),h=function(t,e){for(var i=e.transformer,r=e.srcCoords,n=!0,a=[],s=[],o=0;o<4;o++){var h=t[o].getBoundingClientRect(),l=2*o,u=h.left,c=h.top;a.push(u,c),n&=r&&u===r[l]&&c===r[1+l],s.push(t[o].offsetLeft,t[o].offsetTop)}return n?i:(e.srcCoords=a,e.transformer=function(t,e){var i=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],r={},n=ft(i,8,0,0,0,r);if(0!==n){for(var a=[],s=0;s<8;s++)for(var o=0;o<8;o++)null==a[o]&&(a[o]=0),a[o]+=((s+o)%2?-1:1)*ft(i,7,0===s?1:0,1<<s,1<<o,r)/n*e[s];return function(t,e,i){var r=e*a[6]+i*a[7]+1;t[0]=(e*a[0]+i*a[1]+a[2])/r,t[1]=(e*a[3]+i*a[4]+a[5])/r}}}(a,s))}(function(t,e){var i=e.markers;if(i)return i;i=e.markers=[];for(var r=["left","right"],n=["top","bottom"],a=0;a<4;a++){var s=document.createElement("div"),o=a%2,h=(a>>1)%2;s.style.cssText=["position:absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","width:0","height:0",r[o]+":0",n[h]+":0",r[1-o]+":auto",n[1-h]+":auto",""].join("!important;"),t.appendChild(s),i.push(s)}return i}(t,o),o);if(h)return h(yt,r,a),i.zrX=yt[0],void(i.zrY=yt[1])}i.zrX=i.zrY=0}function bt(t){return t||window.event}function wt(t,e,i){if(null!=(e=bt(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&&_t(t,n,e,i)}else _t(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&&vt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function St(){this._track=[]}var kt=gt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Pt(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}St.prototype={constructor:St,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,s=r.length;a<s;a++){var o=r[a],h=_t(i,o,{});n.points.push([h.zrX,h.zrY]),n.touches.push(o)}this._track.push(n)}},_recognize:function(t){for(var e in Mt)if(Mt.hasOwnProperty(e)){var i=Mt[e](this._track,t);if(i)return i}}};var Mt={pinch:function(t,e){var i=t.length;if(i){var r=(t[i-1]||{}).points,n=(t[i-2]||{}).points||r;if(n&&1<n.length&&r&&1<r.length){var a=Pt(r)/Pt(n);isFinite(a)||(a=1),e.pinchScale=a;var s=function(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}(r);return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function Tt(){kt(this.event)}function Ot(){}function At(t,e,i,r){ut.call(this),this.storage=t,this.painter=e,this.painterRoot=r,i=i||new Ot,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,ht.call(this),this.setHandlerProxy(i)}Ot.prototype.dispose=function(){};var Ct=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"];function Lt(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){for(var r,n=t;n;){if(n.clipPath&&!n.clipPath.contain(e,i))return!1;n.silent&&(r=!0),n=n.parent}return!r||"silent"}return!1}function zt(t,e,i){var r=t.painter;return e<0||e>r.getWidth()||i<0||i>r.getHeight()}At.prototype={constructor:At,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(P(Ct,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,i=t.zrY,r=zt(this,e,i),n=this._hovered,a=n.target;a&&!a.__zr&&(a=(n=this.findHover(n.x,n.y)).target);var s=this._hovered=r?{x:e,y:i}:this.findHover(e,i),o=s.target,h=this.proxy;h.setCursor&&h.setCursor(o?o.cursor:"default"),a&&o!==a&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(s,"mousemove",t),o&&o!==a&&this.dispatchToElement(s,"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:Tt}}(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 s;if(r[a]!==i&&!r[a].ignore&&(s=Lt(r[a],t,e))&&(n.topTarget||(n.topTarget=r[a]),"silent"!==s)){n.target=r[a];break}}return n},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new St);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)}}},P(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){At.prototype[t]=function(e){var i,r,n=e.zrX,a=e.zrY,s=zt(this,n,a);if("mouseup"===t&&s||(r=(i=this.findHover(n,a)).target),"mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||4<et(this._downPoint,[e.zrX,e.zrY]))return;this._downPoint=null}this.dispatchToElement(i,t,e)}})),S(At,ut),S(At,ht);var Et="undefined"==typeof Float32Array?Array:Float32Array;function Dt(){var t=new Et(6);return It(t),t}function It(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Rt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Bt(t,e,i){var r=e[0]*i[0]+e[2]*i[1],n=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],s=e[1]*i[2]+e[3]*i[3],o=e[0]*i[4]+e[2]*i[5]+e[4],h=e[1]*i[4]+e[3]*i[5]+e[5];return t[0]=r,t[1]=n,t[2]=a,t[3]=s,t[4]=o,t[5]=h,t}function Ft(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}function Nt(t,e,i){var r=e[0],n=e[2],a=e[4],s=e[1],o=e[3],h=e[5],l=Math.sin(i),u=Math.cos(i);return t[0]=r*u+s*l,t[1]=-r*l+s*u,t[2]=n*u+o*l,t[3]=-n*l+u*o,t[4]=u*a+l*h,t[5]=u*h-l*a,t}function jt(t,e,i){var r=i[0],n=i[1];return t[0]=e[0]*r,t[1]=e[1]*n,t[2]=e[2]*r,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*n,t}function Ut(t,e){var i=e[0],r=e[2],n=e[4],a=e[1],s=e[3],o=e[5],h=i*s-a*r;return h?(h=1/h,t[0]=s*h,t[1]=-a*h,t[2]=-r*h,t[3]=i*h,t[4]=(r*o-s*n)*h,t[5]=(a*n-i*o)*h,t):null}var Vt=(Object.freeze||Object)({create:Dt,identity:It,copy:Rt,mul:Bt,translate:Ft,rotate:Nt,scale:jt,invert:Ut,clone:function(t){var e=Dt();return Rt(e,t),e}}),Ht=It;function Wt(t){return 5e-5<t||t<-5e-5}function Xt(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null}var Yt=Xt.prototype;Yt.transform=null,Yt.needLocalTransform=function(){return Wt(this.rotation)||Wt(this.position[0])||Wt(this.position[1])||Wt(this.scale[0]-1)||Wt(this.scale[1]-1)};var Zt=[];Yt.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),r=this.transform;if(i||e){r=r||Dt(),i?this.getLocalTransform(r):Ht(r),e&&(i?Bt(r,t.transform,r):Rt(r,t.transform)),this.transform=r;var n=this.globalScaleRatio;if(null!=n&&1!==n){this.getGlobalScale(Zt);var a=Zt[0]<0?-1:1,s=Zt[1]<0?-1:1,o=((Zt[0]-a)*n+a)/Zt[0]||0,h=((Zt[1]-s)*n+s)/Zt[1]||0;r[0]*=o,r[1]*=o,r[2]*=h,r[3]*=h}this.invTransform=this.invTransform||Dt(),Ut(this.invTransform,r)}else r&&Ht(r)},Yt.getLocalTransform=function(t){return Xt.getLocalTransform(this,t)},Yt.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},Yt.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var qt=[],Gt=Dt();Yt.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],r=this.position,n=this.scale;Wt(e-1)&&(e=Math.sqrt(e)),Wt(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},Yt.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Bt(qt,t.invTransform,e),e=qt);var i=this.origin;i&&(i[0]||i[1])&&(Gt[4]=i[0],Gt[5]=i[1],Bt(qt,e,Gt),qt[4]-=i[0],qt[5]-=i[1],e=qt),this.setLocalTransform(e)}},Yt.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1])):(t[0]=1,t[1]=1),t},Yt.transformCoordToLocal=function(t,e){var i=[t,e],r=this.invTransform;return r&&nt(i,i,r),i},Yt.transformCoordToGlobal=function(t,e){var i=[t,e],r=this.transform;return r&&nt(i,i,r),i},Xt.getLocalTransform=function(t,e){Ht(e=e||[]);var i=t.origin,r=t.scale||[1,1],n=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),jt(e,e,r),n&&Nt(e,e,n),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var Qt={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(e=!i||i<1?(i=1,.1):.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){return t*t*(2.70158*t-1.70158)},backOut:function(t){return--t*t*(2.70158*t+1.70158)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)},bounceIn:function(t){return 1-Qt.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*Qt.bounceIn(2*t):.5*Qt.bounceOut(2*t-1)+.5}};function $t(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function Kt(){this.head=null,this.tail=null,this._len=0}$t.prototype={constructor:$t,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var r=this.easing,n="string"==typeof r?Qt[r]:r,a="function"==typeof n?n(i):i;return this.fire("frame",a),1===i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var Jt=Kt.prototype;function te(t){this._list=new Kt,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null}Jt.insert=function(t){var e=new ee(t);return this.insertEntry(e),e},Jt.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},Jt.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},Jt.len=function(){return this._len},Jt.clear=function(){this.head=this.tail=null,this._len=0};var ee=function(t){this.value=t,this.next,this.prev},ie=te.prototype;ie.put=function(t,e){var i=this._list,r=this._map,n=null;if(null==r[t]){var a=i.len(),s=this._lastRemovedEntry;if(a>=this._maxSize&&0<a){var o=i.head;i.remove(o),delete r[o.key],n=o.value,this._lastRemovedEntry=o}s?s.value=e:s=new ee(e),s.key=t,i.insertEntry(s),r[t]=s}return n},ie.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},ie.clear=function(){this._list.clear(),this._map={}};var re={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function ne(t){return(t=Math.round(t))<0?0:255<t?255:t}function ae(t){return t<0?0:1<t?1:t}function se(t){return t.length&&"%"===t.charAt(t.length-1)?ne(parseFloat(t)/100*255):ne(parseInt(t,10))}function oe(t){return t.length&&"%"===t.charAt(t.length-1)?ae(parseFloat(t)/100):ae(parseFloat(t))}function he(t,e,i){return i<0?i+=1:1<i&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function le(t,e,i){return t+(e-t)*i}function ue(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var de=new te(20),pe=null;function fe(t,e){pe&&ce(pe,e),pe=de.put(t,pe||e.slice())}function ge(t,e){if(t){e=e||[];var i=de.get(t);if(i)return ce(e,i);var r,n=(t+="").replace(/ /g,"").toLowerCase();if(n in re)return ce(e,re[n]),fe(t,e),e;if("#"===n.charAt(0))return 4===n.length?0<=(r=parseInt(n.substr(1),16))&&r<=4095?(ue(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),fe(t,e),e):void ue(e,0,0,0,1):7===n.length?0<=(r=parseInt(n.substr(1),16))&&r<=16777215?(ue(e,(16711680&r)>>16,(65280&r)>>8,255&r,1),fe(t,e),e):void ue(e,0,0,0,1):void 0;var a=n.indexOf("("),s=n.indexOf(")");if(-1!==a&&s+1===n.length){var o=n.substr(0,a),h=n.substr(a+1,s-(a+1)).split(","),l=1;switch(o){case"rgba":if(4!==h.length)return void ue(e,0,0,0,1);l=oe(h.pop());case"rgb":return 3!==h.length?void ue(e,0,0,0,1):(ue(e,se(h[0]),se(h[1]),se(h[2]),l),fe(t,e),e);case"hsla":return 4!==h.length?void ue(e,0,0,0,1):(h[3]=oe(h[3]),ve(h,e),fe(t,e),e);case"hsl":return 3!==h.length?void ue(e,0,0,0,1):(ve(h,e),fe(t,e),e);default:return}}ue(e,0,0,0,1)}}function ve(t,e){var i=(parseFloat(t[0])%360+360)%360/360,r=oe(t[1]),n=oe(t[2]),a=n<=.5?n*(r+1):n+r-n*r,s=2*n-a;return ue(e=e||[],ne(255*he(s,a,i+1/3)),ne(255*he(s,a,i)),ne(255*he(s,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function me(t){var e=ge(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function ye(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),s=e[n],o=e[a],h=r-n;return i[0]=ne(le(s[0],o[0],h)),i[1]=ne(le(s[1],o[1],h)),i[2]=ne(le(s[2],o[2],h)),i[3]=ae(le(s[3],o[3],h)),i}}var _e=ye;function xe(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),s=ge(e[n]),o=ge(e[a]),h=r-n,l=we([ne(le(s[0],o[0],h)),ne(le(s[1],o[1],h)),ne(le(s[2],o[2],h)),ae(le(s[3],o[3],h))],"rgba");return i?{color:l,leftIndex:n,rightIndex:a,value:r}:l}}var be=xe;function we(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 Se=(Object.freeze||Object)({parse:ge,lift:function(t,e){var i=ge(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,255<i[r]?i[r]=255:t[r]<0&&(i[r]=0);return we(i,4===i.length?"rgba":"rgb")}},toHex:me,fastLerp:ye,fastMapToColor:_e,lerp:xe,mapToColor:be,modifyHSL:function(t,e,i,r){if(t=ge(t))return t=function(t){if(t){var e,i,r=t[0]/255,n=t[1]/255,a=t[2]/255,s=Math.min(r,n,a),o=Math.max(r,n,a),h=o-s,l=(o+s)/2;if(0==h)i=e=0;else{i=l<.5?h/(o+s):h/(2-o-s);var u=((o-r)/6+h/2)/h,c=((o-n)/6+h/2)/h,d=((o-a)/6+h/2)/h;r===o?e=d-c:n===o?e=1/3+u-d:a===o&&(e=2/3+c-u),e<0&&(e+=1),1<e&&(e-=1)}var p=[360*e,i,l];return null!=t[3]&&p.push(t[3]),p}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:360<t?360:t}(e)),null!=i&&(t[1]=oe(i)),null!=r&&(t[2]=oe(r)),we(ve(t),"rgba")},modifyAlpha:function(t,e){if((t=ge(t))&&null!=e)return t[3]=ae(e),we(t,"rgba")},stringify:we}),ke=Array.prototype.slice;function Pe(t,e){return t[e]}function Me(t,e,i){t[e]=i}function Te(t,e,i){return(e-t)*i+t}function Oe(t,e,i){return.5<i?e:t}function Ae(t,e,i,r,n){var a=t.length;if(1===n)for(var s=0;s<a;s++)r[s]=Te(t[s],e[s],i);else{var o=a&&t[0].length;for(s=0;s<a;s++)for(var h=0;h<o;h++)r[s][h]=Te(t[s][h],e[s][h],i)}}function Ce(t,e,i){var r=t.length,n=e.length;if(r!==n)if(n<r)t.length=n;else for(var a=r;a<n;a++)t.push(1===i?e[a]:ke.call(e[a]));var s=t[0]&&t[0].length;for(a=0;a<t.length;a++)if(1===i)isNaN(t[a])&&(t[a]=e[a]);else for(var o=0;o<s;o++)isNaN(t[a][o])&&(t[a][o]=e[a][o])}function Le(t,e,i){if(t===e)return!0;var r=t.length;if(r!==e.length)return!1;if(1===i){for(var n=0;n<r;n++)if(t[n]!==e[n])return!1}else{var a=t[0].length;for(n=0;n<r;n++)for(var s=0;s<a;s++)if(t[n][s]!==e[n][s])return!1}return!0}function ze(t,e,i,r,n,a,s,o,h){var l=t.length;if(1===h)for(var u=0;u<l;u++)o[u]=Ee(t[u],e[u],i[u],r[u],n,a,s);else{var c=t[0].length;for(u=0;u<l;u++)for(var d=0;d<c;d++)o[u][d]=Ee(t[u][d],e[u][d],i[u][d],r[u][d],n,a,s)}}function Ee(t,e,i,r,n,a,s){var o=.5*(i-t),h=.5*(r-e);return(2*(e-i)+o+h)*s+(-3*(e-i)-2*o-h)*a+o*n+e}function De(t){if(k(t)){var e=t.length;if(k(t[0])){for(var i=[],r=0;r<e;r++)i.push(ke.call(t[r]));return i}return ke.call(t)}return t}function Ie(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function Re(t,e,i,r,n,a){var s=t._getter,o=t._setter,h="spline"===e,l=r.length;if(l){var u,c=k(r[0].value),d=!1,p=!1,f=c?function(t){var e=t[t.length-1].value;return k(e&&e[0])?2:1}(r):0;r.sort((function(t,e){return t.time-e.time})),u=r[l-1].time;for(var g=[],v=[],m=r[0].value,y=!0,_=0;_<l;_++){g.push(r[_].time/u);var x=r[_].value;if(c&&Le(x,m,f)||!c&&x===m||(y=!1),"string"==typeof(m=x)){var b=ge(x);b?(x=b,d=!0):p=!0}v.push(x)}if(a||!y){var w=v[l-1];for(_=0;_<l-1;_++)c?Ce(v[_],w,f):!isNaN(v[_])||isNaN(w)||p||d||(v[_]=w);c&&Ce(s(t._target,n),w,f);var S,P,M,T,O,A=0,C=0;if(d)var L=[0,0,0,0];var z=new $t({target:t._target,life:u,loop:t._loop,delay:t._delay,onframe:function(t,e){var i;if(e<0)i=0;else if(e<C){for(i=Math.min(A+1,l-1);0<=i&&!(g[i]<=e);i--);i=Math.min(i,l-2)}else{for(i=A;i<l&&!(g[i]>e);i++);i=Math.min(i-1,l-2)}C=e;var r=g[(A=i)+1]-g[i];if(0!=r)if(S=(e-g[i])/r,h)if(M=v[i],P=v[0===i?i:i-1],T=v[l-2<i?l-1:i+1],O=v[l-3<i?l-1:i+2],c)ze(P,M,T,O,S,S*S,S*S*S,s(t,n),f);else{if(d)a=ze(P,M,T,O,S,S*S,S*S*S,L,1),a=Ie(L);else{if(p)return Oe(M,T,S);a=Ee(P,M,T,O,S,S*S,S*S*S)}o(t,n,a)}else if(c)Ae(v[i],v[i+1],S,s(t,n),f);else{var a;if(d)Ae(v[i],v[i+1],S,L,1),a=Ie(L);else{if(p)return Oe(v[i],v[i+1],S);a=Te(v[i],v[i+1],S)}o(t,n,a)}},ondestroy:i});return e&&"spline"!==e&&(z.easing=e),z}}}function Be(t,e,i,r){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||Pe,this._setter=r||Me,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]}Be.prototype={when:function(t,e){var i=this._tracks;for(var r in e)if(e.hasOwnProperty(r)){if(!i[r]){i[r]=[];var n=this._getter(this._target,r);if(null==n)continue;0!==t&&i[r].push({time:0,value:De(n)})}i[r].push({time:t,value:e[r]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,i=0;i<e;i++)t[i].call(this)},start:function(t,e){function i(){--a||n._doneCallback()}var r,n=this,a=0;for(var s in this._tracks)if(this._tracks.hasOwnProperty(s)){var o=Re(this,t,i,this._tracks[s],s,e);o&&(this._clipList.push(o),a++,this.animation&&this.animation.addClip(o),r=o)}if(r){var h=r.onframe;r.onframe=function(t,e){h(t,e);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](t,e)}}return a||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,i=this.animation,r=0;r<e.length;r++){var n=e[r];t&&n.onframe(this._target,1),i&&i.removeClip(n)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}};var Fe=1;"undefined"!=typeof window&&(Fe=Math.max(window.devicePixelRatio||1,1));var Ne=Fe;function je(){this.animators=[]}var Ue=function(){};function Ve(t,e,i,r,n,a,s,o){C(r)?(a=n,n=r,r=0):A(n)?(a=n,n="linear",r=0):A(r)?(a=r,r=0):i=A(i)?(a=i,500):i||500,t.stopAnimation(),function t(e,i,r,n,a,s,o){var h={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=r[u]?L(n[u])&&!k(n[u])?t(e,i?i+"."+u:u,r[u],n[u],a,s,o):(o?(h[u]=r[u],He(e,i,u,n[u])):h[u]=n[u],l++):null==n[u]||o||He(e,i,u,n[u]));0<l&&e.animate(i,!1).when(null==a?500:a,h).delay(s||0)}(t,"",t,e,i,r,o);var h=t.animators.slice(),l=h.length;function u(){--l||a&&a()}l||a&&a();for(var c=0;c<h.length;c++)h[c].done(u).start(n,s)}function He(t,e,i,r){if(e){var n={};n[e]={},n[e][i]=r,t.attr(n)}else t.attr(i,r)}je.prototype={constructor:je,animate:function(t,e){var i,r=!1,n=this,a=this.__zr;if(t){var s=t.split("."),o=n;r="shape"===s[0];for(var h=0,l=s.length;h<l;h++)o=o&&o[s[h]];o&&(i=o)}else i=n;if(i){var u=n.animators,c=new Be(i,e);return c.during((function(t){n.dirty(r)})).done((function(){u.splice(b(u,c),1)})),u.push(c),a&&a.animation.addAnimator(c),c}Ue('Property "'+t+'" is not existed in element '+n.id)},stopAnimation:function(t){for(var e=this.animators,i=e.length,r=0;r<i;r++)e[r].stop(t);return e.length=0,this},animateTo:function(t,e,i,r,n,a){Ve(this,t,e,i,r,n,a)},animateFrom:function(t,e,i,r,n,a){Ve(this,t,e,i,r,n,a,!0)}};var We=function(t){Xt.call(this,t),ut.call(this,t),je.call(this,t),this.id=t.id||e()};We.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;(i=i||(this.transform=[1,0,0,1,0,0]))[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];(i=i||(this[t]=[]))[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(L(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),(this.clipPath=t).__zr=e,(t.__clipTarget=this).dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.addAnimator(e[i]);this.clipPath&&this.clipPath.addSelfToZr(t)},removeSelfFromZr:function(t){this.__zr=null;var e=this.animators;if(e)for(var i=0;i<e.length;i++)t.animation.removeAnimator(e[i]);this.clipPath&&this.clipPath.removeSelfFromZr(t)}},S(We,je),S(We,Xt),S(We,ut);var Xe,Ye,Ze,qe,Ge=nt,Qe=Math.min,$e=Math.max;function Ke(t,e,i,r){i<0&&(t+=i,i=-i),r<0&&(e+=r,r=-r),this.x=t,this.y=e,this.width=i,this.height=r}function Je(t){for(var e in We.call(this,t=t||{}),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0}function ti(t,e,i,r){var n=e+1;if(n===i)return 1;if(r(t[n++],t[e])<0){for(;n<i&&r(t[n],t[n-1])<0;)n++;!function(t,e,i){for(i--;e<i;){var r=t[e];t[e++]=t[i],t[i--]=r}}(t,e,n)}else for(;n<i&&0<=r(t[n],t[n-1]);)n++;return n-e}function ei(t,e,i,r,n){for(r===e&&r++;r<i;r++){for(var a,s=t[r],o=e,h=r;o<h;)n(s,t[a=o+h>>>1])<0?h=a:o=1+a;var l=r-o;switch(l){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;0<l;)t[o+l]=t[o+l-1],l--}t[o]=s}}function ii(t,e,i,r,n,a){var s=0,o=0,h=1;if(0<a(t,e[i+n])){for(o=r-n;h<o&&0<a(t,e[i+n+h]);)(h=1+((s=h)<<1))<=0&&(h=o);o<h&&(h=o),s+=n,h+=n}else{for(o=n+1;h<o&&a(t,e[i+n-h])<=0;)(h=1+((s=h)<<1))<=0&&(h=o);o<h&&(h=o);var l=s;s=n-h,h=n-l}for(s++;s<h;){var u=s+(h-s>>>1);0<a(t,e[i+u])?s=u+1:h=u}return h}function ri(t,e,i,r,n,a){var s=0,o=0,h=1;if(a(t,e[i+n])<0){for(o=n+1;h<o&&a(t,e[i+n-h])<0;)(h=1+((s=h)<<1))<=0&&(h=o);o<h&&(h=o);var l=s;s=n-h,h=n-l}else{for(o=r-n;h<o&&0<=a(t,e[i+n+h]);)(h=1+((s=h)<<1))<=0&&(h=o);o<h&&(h=o),s+=n,h+=n}for(s++;s<h;){var u=s+(h-s>>>1);a(t,e[i+u])<0?h=u:s=u+1}return h}function ni(t,e){var i,r,n=7,a=0,s=[];function o(o){var h=i[o],l=r[o],u=i[o+1],c=r[o+1];r[o]=l+c,o===a-3&&(i[o+1]=i[o+2],r[o+1]=r[o+2]),a--;var d=ri(t[u],t,h,l,0,e);h+=d,0!=(l-=d)&&0!==(c=ii(t[h+l-1],t,u,c,c-1,e))&&(l<=c?function(i,r,a,o){var h=0;for(h=0;h<r;h++)s[h]=t[i+h];var l=0,u=a,c=i;if(t[c++]=t[u++],0!=--o){if(1===r){for(h=0;h<o;h++)t[c+h]=t[u+h];return t[c+o]=s[l]}for(var d,p,f,g=n;;){p=d=0,f=!1;do{if(e(t[u],s[l])<0){if(t[c++]=t[u++],p++,(d=0)==--o){f=!0;break}}else if(t[c++]=s[l++],d++,p=0,1==--r){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=ri(t[u],s,l,r,0,e))){for(h=0;h<d;h++)t[c+h]=s[l+h];if(c+=d,l+=d,(r-=d)<=1){f=!0;break}}if(t[c++]=t[u++],0==--o){f=!0;break}if(0!==(p=ii(s[l],t,u,o,0,e))){for(h=0;h<p;h++)t[c+h]=t[u+h];if(c+=p,u+=p,0==(o-=p)){f=!0;break}}if(t[c++]=s[l++],1==--r){f=!0;break}g--}while(7<=d||7<=p);if(f)break;g<0&&(g=0),g+=2}if((n=g)<1&&(n=1),1===r){for(h=0;h<o;h++)t[c+h]=t[u+h];t[c+o]=s[l]}else{if(0===r)throw new Error;for(h=0;h<r;h++)t[c+h]=s[l+h]}}else for(h=0;h<r;h++)t[c+h]=s[l+h]}(h,l,u,c):function(i,r,a,o){var h=0;for(h=0;h<o;h++)s[h]=t[a+h];var l=i+r-1,u=o-1,c=a+o-1,d=0,p=0;if(t[c--]=t[l--],0!=--r){if(1===o){for(p=1+(c-=r),d=1+(l-=r),h=r-1;0<=h;h--)t[p+h]=t[d+h];return t[c]=s[u]}for(var f=n;;){var g=0,v=0,m=!1;do{if(e(s[u],t[l])<0){if(t[c--]=t[l--],g++,(v=0)==--r){m=!0;break}}else if(t[c--]=s[u--],v++,g=0,1==--o){m=!0;break}}while((g|v)<f);if(m)break;do{if(0!=(g=r-ri(s[u],t,i,r,r-1,e))){for(r-=g,p=1+(c-=g),d=1+(l-=g),h=g-1;0<=h;h--)t[p+h]=t[d+h];if(0===r){m=!0;break}}if(t[c--]=s[u--],1==--o){m=!0;break}if(0!=(v=o-ii(t[l],s,0,o,o-1,e))){for(o-=v,p=1+(c-=v),d=1+(u-=v),h=0;h<v;h++)t[p+h]=s[d+h];if(o<=1){m=!0;break}}if(t[c--]=t[l--],0==--r){m=!0;break}f--}while(7<=g||7<=v);if(m)break;f<0&&(f=0),f+=2}if((n=f)<1&&(n=1),1===o){for(p=1+(c-=r),d=1+(l-=r),h=r-1;0<=h;h--)t[p+h]=t[d+h];t[c]=s[u]}else{if(0===o)throw new Error;for(d=c-(o-1),h=0;h<o;h++)t[d+h]=s[h]}}else for(d=c-(o-1),h=0;h<o;h++)t[d+h]=s[h]}(h,l,u,c))}i=[],r=[],this.mergeRuns=function(){for(;1<a;){var t=a-2;if(1<=t&&r[t-1]<=r[t]+r[t+1]||2<=t&&r[t-2]<=r[t]+r[t-1])r[t-1]<r[t+1]&&t--;else if(r[t]>r[t+1])break;o(t)}},this.forceMergeRuns=function(){for(;1<a;){var t=a-2;0<t&&r[t-1]<r[t+1]&&t--,o(t)}},this.pushRun=function(t,e){i[a]=t,r[a]=e,a+=1}}function ai(t,e,i,r){i=i||0;var n=(r=r||t.length)-i;if(!(n<2)){var a=0;if(n<32)ei(t,i,r,i+(a=ti(t,i,r,e)),e);else{var s=new ni(t,e),o=function(t){for(var e=0;32<=t;)e|=1&t,t>>=1;return t+e}(n);do{if((a=ti(t,i,r,e))<o){var h=n;o<h&&(h=o),ei(t,i,i+h,i+a,e),a=h}s.pushRun(i,a),s.mergeRuns(),n-=a,i+=a}while(0!==n);s.forceMergeRuns()}}}function si(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function oi(){this._roots=[],this._displayList=[],this._displayListLen=0}Ke.prototype={constructor:Ke,union:function(t){var e=Qe(t.x,this.x),i=Qe(t.y,this.y);this.width=$e(t.x+t.width,this.x+this.width)-e,this.height=$e(t.y+t.height,this.y+this.height)-i,this.x=e,this.y=i},applyTransform:(Xe=[],Ye=[],Ze=[],qe=[],function(t){if(t){Xe[0]=Ze[0]=this.x,Xe[1]=qe[1]=this.y,Ye[0]=qe[0]=this.x+this.width,Ye[1]=Ze[1]=this.y+this.height,Ge(Xe,Xe,t),Ge(Ye,Ye,t),Ge(Ze,Ze,t),Ge(qe,qe,t),this.x=Qe(Xe[0],Ye[0],Ze[0],qe[0]),this.y=Qe(Xe[1],Ye[1],Ze[1],qe[1]);var e=$e(Xe[0],Ye[0],Ze[0],qe[0]),i=$e(Xe[1],Ye[1],Ze[1],qe[1]);this.width=e-this.x,this.height=i-this.y}}),calculateTransform:function(t){var e=t.width/this.width,i=t.height/this.height,r=Dt();return Ft(r,r,[-this.x,-this.y]),jt(r,r,[e,i]),Ft(r,r,[t.x,t.y]),r},intersect:function(t){if(!t)return!1;t instanceof Ke||(t=Ke.create(t));var e=this,i=e.x,r=e.x+e.width,n=e.y,a=e.y+e.height,s=t.x,o=t.x+t.width,h=t.y,l=t.y+t.height;return!(r<s||o<i||a<h||l<n)},contain:function(t,e){var i=this;return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Ke(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}}},Je.prototype={constructor:Je,isGroup:!0,type:"group",silent:!(Ke.create=function(t){return new Ke(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<e.length;i++)if(e[i].name===t)return e[i]},childCount:function(){return this._children.length},add:function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},addBefore:function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var i=this._children,r=i.indexOf(e);0<=r&&(i.splice(r,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t);var e=(t.parent=this).__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof Je&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,r=this._children,n=b(r,t);return n<0||(r.splice(n,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof Je&&t.delChildrenFromStorage(i)),e&&e.refresh()),this},removeAll:function(){var t,e,i=this._children,r=this.__storage;for(e=0;e<i.length;e++)t=i[e],r&&(r.delFromStorage(t),t instanceof Je&&t.delChildrenFromStorage(r)),t.parent=null;return i.length=0,this},eachChild:function(t,e){for(var i=this._children,r=0;r<i.length;r++){var n=i[r];t.call(e,n,r)}return this},traverse:function(t,e){for(var i=0;i<this._children.length;i++){var r=this._children[i];t.call(e,r),"group"===r.type&&r.traverse(t,e)}return this},addChildrenToStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToStorage(i),i instanceof Je&&i.addChildrenToStorage(t)}},delChildrenFromStorage:function(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromStorage(i),i instanceof Je&&i.delChildrenFromStorage(t)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(t){for(var e=null,i=new Ke(0,0,0,0),r=t||this._children,n=[],a=0;a<r.length;a++){var s=r[a];if(!s.ignore&&!s.invisible){var o=s.getBoundingRect(),h=s.getLocalTransform(n);h?(i.copy(o),i.applyTransform(h),(e=e||i.clone()).union(i)):(e=e||o.clone()).union(o)}}return e||i}},w(Je,We),oi.prototype={constructor:oi,traverse:function(t,e){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(t,e)},getDisplayList:function(t,e){return e=e||!1,t&&this.updateDisplayList(e),this._displayList},updateDisplayList:function(t){this._displayListLen=0;for(var e=this._roots,i=this._displayList,r=0,a=e.length;r<a;r++)this._updateAndAddDisplayable(e[r],null,t);i.length=this._displayListLen,n.canvasSupported&&ai(i,si)},_updateAndAddDisplayable:function(t,e,i){if(!t.ignore||i){t.beforeUpdate(),t.__dirty&&t.update(),t.afterUpdate();var r=t.clipPath;if(r){e=e?e.slice():[];for(var n=r,a=t;n;)n.parent=a,n.updateTransform(),e.push(n),n=(a=n).clipPath}if(t.isGroup){for(var s=t._children,o=0;o<s.length;o++){var h=s[o];t.__dirty&&(h.__dirty=!0),this._updateAndAddDisplayable(h,e,i)}t.__dirty=!1}else t.__clipPaths=e,this._displayList[this._displayListLen++]=t}},addRoot:function(t){t.__storage!==this&&(t instanceof Je&&t.addChildrenToStorage(this),this.addToStorage(t),this._roots.push(t))},delRoot:function(t){if(null==t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Je&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(t instanceof Array){e=0;for(var r=t.length;e<r;e++)this.delRoot(t[e])}else{var n=b(this._roots,t);0<=n&&(this.delFromStorage(t),this._roots.splice(n,1),t instanceof Je&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:si};var hi={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},li=function(t,e,i){return hi.hasOwnProperty(e)?i*t.dpr:i},ui=0,ci=1,di=2,pi=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],fi=function(t){this.extendFrom(t,!1)};function gi(t,e,i){var r=null==e.x?0:e.x,n=null==e.x2?1:e.x2,a=null==e.y?0:e.y,s=null==e.y2?0:e.y2;return e.global||(r=r*i.width+i.x,n=n*i.width+i.x,a=a*i.height+i.y,s=s*i.height+i.y),r=isNaN(r)?0:r,n=isNaN(n)?1:n,a=isNaN(a)?0:a,s=isNaN(s)?0:s,t.createLinearGradient(r,a,n,s)}function vi(t,e,i){var r=i.width,n=i.height,a=Math.min(r,n),s=null==e.x?.5:e.x,o=null==e.y?.5:e.y,h=null==e.r?.5:e.r;return e.global||(s=s*r+i.x,o=o*n+i.y,h*=a),t.createRadialGradient(s,o,0,s,o,h)}for(var mi=fi.prototype={constructor:fi,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){var r=this,n=i&&i.style,a=!n||t.__attrCachedBy!==ci;t.__attrCachedBy=ci;for(var s=0;s<pi.length;s++){var o=pi[s],h=o[0];!a&&r[h]===n[h]||(t[h]=li(t,h,r[h]||o[1]))}if(!a&&r.fill===n.fill||(t.fillStyle=r.fill),!a&&r.stroke===n.stroke||(t.strokeStyle=r.stroke),!a&&r.opacity===n.opacity||(t.globalAlpha=null==r.opacity?1:r.opacity),!a&&r.blend===n.blend||(t.globalCompositeOperation=r.blend||"source-over"),this.hasStroke()){var l=r.lineWidth;t.lineWidth=l/(this.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1)}},hasFill:function(){var t=this.fill;return null!=t&&"none"!==t},hasStroke:function(){var t=this.stroke;return null!=t&&"none"!==t&&0<this.lineWidth},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var r=("radial"===e.type?vi:gi)(t,e,i),n=e.colorStops,a=0;a<n.length;a++)r.addColorStop(n[a].offset,n[a].color);return r}},yi=0;yi<pi.length;yi++){var _i=pi[yi];_i[0]in mi||(mi[_i[0]]=_i[1])}function xi(t,e){this.image=t,this.repeat=e,this.type="pattern"}function bi(){return!1}function wi(t,e,i){var r=_(),n=e.getWidth(),a=e.getHeight(),s=r.style;return s&&(s.position="absolute",s.left=0,s.top=0,s.width=n+"px",s.height=a+"px",r.setAttribute("data-zr-dom-id",t)),r.width=n*i,r.height=a*i,r}function Si(t,e,i){var r;i=i||Ne,"string"==typeof t?r=wi(t,e,i):L(t)&&(t=(r=t).id),this.id=t;var n=(this.dom=r).style;n&&(r.onselectstart=bi,n["-webkit-user-select"]="none",n["user-select"]="none",n["-webkit-touch-callout"]="none",n["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",n.padding=0,n.margin=0,n["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=e,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i}fi.getGradient=mi.getGradient,Si.prototype={constructor:Si,__dirty:!0,__used:!(xi.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")}),__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var t=this.dpr;this.domBack=wi("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},resize:function(t,e){var i=this.dpr,r=this.dom,n=r.style,a=this.domBack;n&&(n.width=t+"px",n.height=e+"px"),r.width=t*i,r.height=e*i,a&&(a.width=t*i,a.height=e*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(t,e){var i,r=this.dom,n=this.ctx,a=r.width,s=r.height,o=(e=e||this.clearColor,this.motionBlur&&!t),h=this.lastFrameAlpha,l=this.dpr;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,a/l,s/l)),n.clearRect(0,0,a,s),e&&"transparent"!==e&&(e.colorStops?(i=e.__canvasGradient||fi.getGradient(n,e,{x:0,y:0,width:a,height:s}),e.__canvasGradient=i):e.image&&(i=xi.prototype.getCanvasPattern.call(e,n)),n.save(),n.fillStyle=i||e,n.fillRect(0,0,a,s),n.restore()),o){var u=this.domBack;n.save(),n.globalAlpha=h,n.drawImage(u,0,0,a,s),n.restore()}}};var ki="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)},Pi=new te(50);function Mi(t){if("string"!=typeof t)return t;var e=Pi.get(t);return e&&e.image}function Ti(t,e,i,r,n){if(t){if("string"!=typeof t)return t;if(e&&e.__zrImageSrc===t||!i)return e;var a=Pi.get(t),s={hostEl:i,cb:r,cbPayload:n};return a?Ai(e=a.image)||a.pending.push(s):((e=new Image).onload=e.onerror=Oi,Pi.put(t,e.__cachedImgObj={image:e,pending:[s]}),e.src=e.__zrImageSrc=t),e}return e}function Oi(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var i=t.pending[e],r=i.cb;r&&r(this,i.cbPayload),i.hostEl.dirty()}t.pending.length=0}function Ai(t){return t&&t.width&&t.height}var Ci={},Li=0,zi=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Ei="12px sans-serif",Di={};function Ii(t,e){var i=t+":"+(e=e||Ei);if(Ci[i])return Ci[i];for(var r,n,a=(t+"").split("\n"),s=0,o=0,h=a.length;o<h;o++)s=Math.max((r=a[o],n=e,Di.measureText(r,n)).width,s);return 5e3<Li&&(Li=0,Ci={}),Li++,Ci[i]=s}function Ri(t,e,i,r,n,a,s,o){return s?function(t,e,i,r,n,a,s,o){var h=Yi(t,{rich:s,truncate:o,font:e,textAlign:i,textPadding:n,textLineHeight:a}),l=h.outerWidth,u=h.outerHeight;return new Ke(Bi(0,l,i),Fi(0,u,r),l,u)}(t,e,i,r,n,a,s,o):function(t,e,i,r,n,a,s){var o=Xi(t,e,n,a,s),h=Ii(t,e);n&&(h+=n[1]+n[3]);var l=o.outerHeight,u=new Ke(Bi(0,h,i),Fi(0,l,r),h,l);return u.lineHeight=o.lineHeight,u}(t,e,i,r,n,a,o)}function Bi(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Fi(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function Ni(t,e,i){var r=e.textPosition,n=e.textDistance,a=i.x,s=i.y;n=n||0;var o=i.height,h=i.width,l=o/2,u="left",c="top";switch(r){case"left":a-=n,s+=l,u="right",c="middle";break;case"right":a+=n+h,s+=l,c="middle";break;case"top":a+=h/2,s-=n,u="center",c="bottom";break;case"bottom":a+=h/2,s+=o+n,u="center";break;case"inside":a+=h/2,s+=l,u="center",c="middle";break;case"insideLeft":a+=n,s+=l,c="middle";break;case"insideRight":a+=h-n,s+=l,u="right",c="middle";break;case"insideTop":a+=h/2,s+=n,u="center";break;case"insideBottom":a+=h/2,s+=o-n,u="center",c="bottom";break;case"insideTopLeft":a+=n,s+=n;break;case"insideTopRight":a+=h-n,s+=n,u="right";break;case"insideBottomLeft":a+=n,s+=o-n,c="bottom";break;case"insideBottomRight":a+=h-n,s+=o-n,u="right",c="bottom"}return(t=t||{}).x=a,t.y=s,t.textAlign=u,t.textVerticalAlign=c,t}function ji(t,e,i,r,n){if(!e)return"";var a=(t+"").split("\n");n=Ui(e,i,r,n);for(var s=0,o=a.length;s<o;s++)a[s]=Vi(a[s],n);return a.join("\n")}function Ui(t,e,i,r){(r=m({},r)).font=e,i=D(i,"..."),r.maxIterations=D(r.maxIterations,2);var n=r.minChar=D(r.minChar,0);r.cnCharWidth=Ii("国",e);var a=r.ascCharWidth=Ii("a",e);r.placeholder=D(r.placeholder,"");for(var s=t=Math.max(0,t-1),o=0;o<n&&a<=s;o++)s-=a;var h=Ii(i,e);return s<h&&(i="",h=0),s=t-h,r.ellipsis=i,r.ellipsisWidth=h,r.contentWidth=s,r.containerWidth=t,r}function Vi(t,e){var i=e.containerWidth,r=e.font,n=e.contentWidth;if(!i)return"";var a=Ii(t,r);if(a<=i)return t;for(var s=0;;s++){if(a<=n||s>=e.maxIterations){t+=e.ellipsis;break}var o=0===s?Hi(t,n,e.ascCharWidth,e.cnCharWidth):0<a?Math.floor(t.length*n/a):0;a=Ii(t=t.substr(0,o),r)}return""===t&&(t=e.placeholder),t}function Hi(t,e,i,r){for(var n=0,a=0,s=t.length;a<s&&n<e;a++){var o=t.charCodeAt(a);n+=0<=o&&o<=127?i:r}return a}function Wi(t){return Ii("国",t)}function Xi(t,e,i,r,n){null!=t&&(t+="");var a=D(r,Wi(e)),s=t?t.split("\n"):[],o=s.length*a,h=o,l=!0;if(i&&(h+=i[0]+i[2]),t&&n){l=!1;var u=n.outerHeight,c=n.outerWidth;if(null!=u&&u<h)t="",s=[];else if(null!=c)for(var d=Ui(c-(i?i[1]+i[3]:0),e,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),p=0,f=s.length;p<f;p++)s[p]=Vi(s[p],d)}return{lines:s,height:o,outerHeight:h,lineHeight:a,canCacheByTextString:l}}function Yi(t,e){var i={lines:[],width:0,height:0};if(null!=t&&(t+=""),!t)return i;for(var r,n=zi.lastIndex=0;null!=(r=zi.exec(t));){var a=r.index;n<a&&Zi(i,t.substring(n,a)),Zi(i,r[2],r[1]),n=zi.lastIndex}n<t.length&&Zi(i,t.substring(n,t.length));var s=i.lines,o=0,h=0,l=[],u=e.textPadding,c=e.truncate,d=c&&c.outerWidth,p=c&&c.outerHeight;u&&(null!=d&&(d-=u[1]+u[3]),null!=p&&(p-=u[0]+u[2]));for(var f=0;f<s.length;f++){for(var g=s[f],v=0,m=0,y=0;y<g.tokens.length;y++){var _=(A=g.tokens[y]).styleName&&e.rich[A.styleName]||{},x=A.textPadding=_.textPadding,b=A.font=_.font||e.font,w=A.textHeight=D(_.textHeight,Wi(b));if(x&&(w+=x[0]+x[2]),A.height=w,A.lineHeight=I(_.textLineHeight,e.textLineHeight,w),A.textAlign=_&&_.textAlign||e.textAlign,A.textVerticalAlign=_&&_.textVerticalAlign||"middle",null!=p&&o+A.lineHeight>p)return{lines:[],width:0,height:0};A.textWidth=Ii(A.text,b);var S=_.textWidth,k=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))A.percentWidth=S,l.push(A),S=0;else{if(k){S=A.textWidth;var P=_.textBackgroundColor,M=P&&P.image;M&&Ai(M=Mi(M))&&(S=Math.max(S,M.width*w/M.height))}var T=x?x[1]+x[3]:0;S+=T;var O=null!=d?d-m:null;null!=O&&O<S&&(!k||O<T?(A.text="",A.textWidth=S=0):(A.text=ji(A.text,O-T,b,c.ellipsis,{minChar:c.minChar}),A.textWidth=Ii(A.text,b),S=A.textWidth+T))}m+=A.width=S,_&&(v=Math.max(v,A.lineHeight))}g.width=m,o+=g.lineHeight=v,h=Math.max(h,m)}for(i.outerWidth=i.width=D(e.textWidth,h),i.outerHeight=i.height=D(e.textHeight,o),u&&(i.outerWidth+=u[1]+u[3],i.outerHeight+=u[0]+u[2]),f=0;f<l.length;f++){var A,C=(A=l[f]).percentWidth;A.width=parseInt(C,10)/100*h}return i}function Zi(t,e,i){for(var r=""===e,n=e.split("\n"),a=t.lines,s=0;s<n.length;s++){var o=n[s],h={styleName:i,text:o,isLineHolder:!o&&!r};if(s)a.push({tokens:[h]});else{var l=(a[a.length-1]||(a[0]={tokens:[]})).tokens,u=l.length;1===u&&l[0].isLineHolder?l[0]=h:!o&&u&&!r||l.push(h)}}}function qi(t,e){var i,r,n,a,s,o=e.x,h=e.y,l=e.width,u=e.height,c=e.r;l<0&&(o+=l,l=-l),u<0&&(h+=u,u=-u),"number"==typeof c?i=r=n=a=c:c instanceof Array?1===c.length?i=r=n=a=c[0]:2===c.length?(i=n=c[0],r=a=c[1]):3===c.length?(i=c[0],r=a=c[1],n=c[2]):(i=c[0],r=c[1],n=c[2],a=c[3]):i=r=n=a=0,l<i+r&&(i*=l/(s=i+r),r*=l/s),l<n+a&&(n*=l/(s=n+a),a*=l/s),u<r+n&&(r*=u/(s=r+n),n*=u/s),u<i+a&&(i*=u/(s=i+a),a*=u/s),t.moveTo(o+i,h),t.lineTo(o+l-r,h),0!==r&&t.arc(o+l-r,h+r,r,-Math.PI/2,0),t.lineTo(o+l,h+u-n),0!==n&&t.arc(o+l-n,h+u-n,n,0,Math.PI/2),t.lineTo(o+a,h+u),0!==a&&t.arc(o+a,h+u-a,a,Math.PI/2,Math.PI),t.lineTo(o,h+i),0!==i&&t.arc(o+i,h+i,i,Math.PI,1.5*Math.PI)}Di.measureText=function(t,e){var i=x();return i.font=e||Ei,i.measureText(t)};var Gi=Ei,Qi={left:1,right:1,center:1},$i={top:1,bottom:1,middle:1},Ki=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],Ji={},tr={};function er(t){return ir(t),P(t.rich,ir),t}function ir(t){if(t){t.font=function(t){var e=(t.fontSize||t.fontFamily)&&[t.fontStyle,t.fontWeight,(t.fontSize||12)+"px",t.fontFamily||"sans-serif"].join(" ");return e&&B(e)||t.textFont||t.font}(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||Qi[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||$i[i]?i:"top",t.textPadding&&(t.textPadding=R(t.textPadding))}}function rr(t,e,i,r,n,a){r.rich?function(t,e,i,r,n,a){9!==a&&(e.__attrCachedBy=ui);var s=t.__textCotentBlock;s&&!t.__dirtyText||(s=t.__textCotentBlock=Yi(i,r)),function(t,e,i,r,n){var a=i.width,s=i.outerWidth,o=i.outerHeight,h=r.textPadding,l=lr(tr,t,r,n),u=l.baseX,c=l.baseY,d=l.textAlign,p=l.textVerticalAlign;nr(e,r,n,u,c);var f=Bi(u,s,d),g=Fi(c,o,p),v=f,m=g;h&&(v+=h[3],m+=h[0]);var y=v+a;sr(r)&&or(t,e,r,f,g,s,o);for(var _=0;_<i.lines.length;_++){for(var x,b=i.lines[_],w=b.tokens,S=w.length,k=b.lineHeight,P=b.width,M=0,T=v,O=y,A=S-1;M<S&&(!(x=w[M]).textAlign||"left"===x.textAlign);)ar(t,e,x,r,k,m,T,"left"),P-=x.width,T+=x.width,M++;for(;0<=A&&"right"===(x=w[A]).textAlign;)ar(t,e,x,r,k,m,O,"right"),P-=x.width,O-=x.width,A--;for(T+=(a-(T-v)-(y-O)-P)/2;M<=A;)ar(t,e,x=w[M],r,k,m,T+x.width/2,"center"),T+=x.width,M++;m+=k}}(t,e,s,r,n)}(t,e,i,r,n,a):function(t,e,i,r,n,a){var s,o=sr(r),h=!1,l=e.__attrCachedBy===di;9!==a?(a&&(s=a.style,h=!o&&l&&s),e.__attrCachedBy=o?ui:di):l&&(e.__attrCachedBy=ui);var u=r.font||Gi;h&&u===(s.font||Gi)||(e.font=u);var c=t.__computedFont;t.__styleFont!==u&&(t.__styleFont=u,c=t.__computedFont=e.font);var d=r.textPadding,p=r.textLineHeight,f=t.__textCotentBlock;f&&!t.__dirtyText||(f=t.__textCotentBlock=Xi(i,c,d,p,r.truncate));var g=f.outerHeight,v=f.lines,m=f.lineHeight,y=lr(tr,t,r,n),_=y.baseX,x=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;nr(e,r,n,_,x);var S=Fi(x,g,w),k=_,P=S;if(o||d){var M=Ii(i,c);d&&(M+=d[1]+d[3]);var T=Bi(_,M,b);o&&or(t,e,r,T,S,M,g),d&&(k=fr(_,b,d),P+=d[0])}e.textAlign=b,e.textBaseline="middle",e.globalAlpha=r.opacity||1;for(var O=0;O<Ki.length;O++){var A=Ki[O],C=A[0],L=A[1],z=r[C];h&&z===s[C]||(e[L]=li(e,L,z||A[2]))}P+=m/2;var E=r.textStrokeWidth,D=h?s.textStrokeWidth:null,I=!h||E!==D,R=!h||I||r.textStroke!==s.textStroke,B=cr(r.textStroke,E),F=dr(r.textFill);if(B&&(I&&(e.lineWidth=E),R&&(e.strokeStyle=B)),F&&(h&&r.textFill===s.textFill||(e.fillStyle=F)),1===v.length)B&&e.strokeText(v[0],k,P),F&&e.fillText(v[0],k,P);else for(O=0;O<v.length;O++)B&&e.strokeText(v[O],k,P),F&&e.fillText(v[O],k,P),P+=m}(t,e,i,r,n,a)}function nr(t,e,i,r,n){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(r=i.width/2+i.x,n=i.height/2+i.y):a&&(r=a[0]+i.x,n=a[1]+i.y),t.translate(r,n),t.rotate(-e.textRotation),t.translate(-r,-n)}}function ar(t,e,i,r,n,a,s,o){var h=r.rich[i.styleName]||{};h.text=i.text;var l=i.textVerticalAlign,u=a+n/2;"top"===l?u=a+i.height/2:"bottom"===l&&(u=a+n-i.height/2),!i.isLineHolder&&sr(h)&&or(t,e,h,"right"===o?s-i.width:"center"===o?s-i.width/2:s,u-i.height/2,i.width,i.height);var c=i.textPadding;c&&(s=fr(s,o,c),u-=i.height/2-c[2]-i.textHeight/2),ur(e,"shadowBlur",I(h.textShadowBlur,r.textShadowBlur,0)),ur(e,"shadowColor",h.textShadowColor||r.textShadowColor||"transparent"),ur(e,"shadowOffsetX",I(h.textShadowOffsetX,r.textShadowOffsetX,0)),ur(e,"shadowOffsetY",I(h.textShadowOffsetY,r.textShadowOffsetY,0)),ur(e,"textAlign",o),ur(e,"textBaseline","middle"),ur(e,"font",i.font||Gi);var d=cr(h.textStroke||r.textStroke,f),p=dr(h.textFill||r.textFill),f=D(h.textStrokeWidth,r.textStrokeWidth);d&&(ur(e,"lineWidth",f),ur(e,"strokeStyle",d),e.strokeText(i.text,s,u)),p&&(ur(e,"fillStyle",p),e.fillText(i.text,s,u))}function sr(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function or(t,e,i,r,n,a,s){var o=i.textBackgroundColor,h=i.textBorderWidth,l=i.textBorderColor,u=C(o);if(ur(e,"shadowBlur",i.textBoxShadowBlur||0),ur(e,"shadowColor",i.textBoxShadowColor||"transparent"),ur(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),ur(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),u||h&&l){e.beginPath();var c=i.textBorderRadius;c?qi(e,{x:r,y:n,width:a,height:s,r:c}):e.rect(r,n,a,s),e.closePath()}if(u)if(ur(e,"fillStyle",o),null!=i.fillOpacity){var d=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=d}else e.fill();else if(L(o)){var p=o.image;(p=Ti(p,null,t,hr,o))&&Ai(p)&&e.drawImage(p,r,n,a,s)}h&&l&&(ur(e,"lineWidth",h),ur(e,"strokeStyle",l),null!=i.strokeOpacity?(d=e.globalAlpha,e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=d):e.stroke())}function hr(t,e){e.image=t}function lr(t,e,i,r){var n=i.x||0,a=i.y||0,s=i.textAlign,o=i.textVerticalAlign;if(r){var h=i.textPosition;if(h instanceof Array)n=r.x+pr(h[0],r.width),a=r.y+pr(h[1],r.height);else{var l=e&&e.calculateTextPosition?e.calculateTextPosition(Ji,i,r):Ni(Ji,i,r);n=l.x,a=l.y,s=s||l.textAlign,o=o||l.textVerticalAlign}var u=i.textOffset;u&&(n+=u[0],a+=u[1])}return(t=t||{}).baseX=n,t.baseY=a,t.textAlign=s,t.textVerticalAlign=o,t}function ur(t,e,i){return t[e]=li(t,e,i),t[e]}function cr(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function dr(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function pr(t,e){return"string"==typeof t?0<=t.lastIndexOf("%")?parseFloat(t)/100*e:parseFloat(t):t}function fr(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function gr(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function vr(){}var mr=new Ke;function yr(t){for(var e in We.call(this,t=t||{}),t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new fi(t.style,this),this._rect=null,this.__clipPaths=null}function _r(t){yr.call(this,t)}yr.prototype={constructor:yr,type:"displayable",__dirty:!0,invisible:!(vr.prototype={constructor:vr,drawRectText:function(t,e){var i=this.style;e=i.textRect||e,this.__dirty&&er(i);var r=i.text;if(null!=r&&(r+=""),gr(r,i)){t.save();var n=this.transform;i.transformText?this.setTransform(t):n&&(mr.copy(e),mr.applyTransform(n),e=mr),rr(this,t,r,i,e,9),t.restore()}}}),z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(t){},afterBrush:function(t){},brush:function(t,e){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var i=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?We.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new fi(t,this),this.dirty(!1),this},calculateTextPosition:null},w(yr,We),S(yr,vr),_r.prototype={constructor:_r,type:"image",brush:function(t,e){var i=this.style,r=i.image;i.bind(t,this,e);var n=this._image=Ti(r,this._image,this,this.onload);if(n&&Ai(n)){var a=i.x||0,s=i.y||0,o=i.width,h=i.height,l=n.width/n.height;if(null==o&&null!=h?o=h*l:null==h&&null!=o?h=o/l:null==o&&null==h&&(o=n.width,h=n.height),this.setTransform(t),i.sWidth&&i.sHeight){var u=i.sx||0,c=i.sy||0;t.drawImage(n,u,c,i.sWidth,i.sHeight,a,s,o,h)}else if(i.sx&&i.sy){var d=o-(u=i.sx),p=h-(c=i.sy);t.drawImage(n,u,c,d,p,a,s,o,h)}else t.drawImage(n,a,s,o,h);null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new Ke(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},w(_r,yr);var xr=314159;function br(t){return parseInt(t,10)}var wr=new Ke(0,0,0,0),Sr=new Ke(0,0,0,0);function kr(t,e,i){this.type="canvas";var r=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=i=m({},i||{}),this.dpr=i.devicePixelRatio||Ne,this._singleCanvas=r;var n=(this.root=t).style;n&&(n["-webkit-tap-highlight-color"]="transparent",n["-webkit-user-select"]=n["user-select"]=n["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var a=this._zlevelList=[],s=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,r){var o=t.width,h=t.height;null!=i.width&&(o=i.width),null!=i.height&&(h=i.height),this.dpr=i.devicePixelRatio||1,t.width=o*this.dpr,t.height=h*this.dpr,this._width=o,this._height=h;var l=new Si(t,this,this.dpr);l.__builtin__=!0,l.initContext(),(s[xr]=l).zlevel=xr,a.push(xr),this._domRoot=t}else{this._width=this._getSize(0),this._height=this._getSize(1);var u=this._domRoot=function(t,e){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);t.appendChild(u)}this._hoverlayer=null,this._hoverElements=[]}function Pr(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,ut.call(this)}kr.prototype={constructor:kr,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(t){var e=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,t,this._redrawId);for(var r=0;r<i.length;r++){var n=i[r],a=this._layers[n];if(!a.__builtin__&&a.refresh){var s=0===r?this._backgroundColor:null;a.refresh(s)}}return this.refreshHover(),this},addHover:function(t,e){if(!t.__hoverMir){var i=new t.constructor({style:t.style,shape:t.shape,z:t.z,z2:t.z2,silent:t.silent});return(i.__from=t).__hoverMir=i,e&&i.setStyle(e),this._hoverElements.push(i),i}},removeHover:function(t){var e=t.__hoverMir,i=this._hoverElements,r=b(i,e);0<=r&&i.splice(r,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i<e.length;i++){var r=e[i].__from;r&&(r.__hoverMir=null)}e.length=0},refreshHover:function(){var t=this._hoverElements,e=t.length,i=this._hoverlayer;if(i&&i.clear(),e){ai(t,this.storage.displayableSortFunc);var r={};(i=i||(this._hoverlayer=this.getLayer(1e5))).ctx.save();for(var n=0;n<e;){var a=t[n],s=a.__from;s&&s.__zr?(n++,s.invisible||(a.transform=s.transform,a.invTransform=s.invTransform,a.__clipPaths=s.__clipPaths,this._doPaintEl(a,i,!0,r))):(t.splice(n,1),s.__hoverMir=null,e--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(1e5)},_paintList:function(t,e,i){if(this._redrawId===i){e=e||!1,this._updateLayerStatus(t);var r=this._doPaintList(t,e);if(this._needsManuallyCompositing&&this._compositeManually(),!r){var n=this;ki((function(){n._paintList(t,e,i)}))}}},_compositeManually:function(){var t=this.getLayer(xr).ctx,e=this._domRoot.width,i=this._domRoot.height;t.clearRect(0,0,e,i),this.eachBuiltinLayer((function(r){r.virtual&&t.drawImage(r.dom,0,0,e,i)}))},_doPaintList:function(t,e){for(var i=[],r=0;r<this._zlevelList.length;r++){var a=this._zlevelList[r];(h=this._layers[a]).__builtin__&&h!==this._hoverlayer&&(h.__dirty||e)&&i.push(h)}for(var s=!0,o=0;o<i.length;o++){var h,l=(h=i[o]).ctx,u={};l.save();var c=e?h.__startIndex:h.__drawIndex,d=!e&&h.incremental&&Date.now,p=d&&Date.now(),f=h.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(h.__startIndex===h.__endIndex)h.clear(!1,f);else if(c===h.__startIndex){var g=t[c];g.incremental&&g.notClear&&!e||h.clear(!1,f)}-1===c&&(console.error("For some unknown reason. drawIndex is -1"),c=h.__startIndex);for(var v=c;v<h.__endIndex;v++){var m=t[v];if(this._doPaintEl(m,h,e,u),m.__dirty=m.__dirtyText=!1,d&&15<Date.now()-p)break}h.__drawIndex=v,h.__drawIndex<h.__endIndex&&(s=!1),u.prevElClipPaths&&l.restore(),l.restore()}return n.wxa&&P(this._layers,(function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()})),s},_doPaintEl:function(t,e,i,r){var n=e.ctx,a=t.transform;if((e.__dirty||i)&&!t.invisible&&0!==t.style.opacity&&(!a||a[0]||a[3])&&(!t.culling||!function(t,e,i){return wr.copy(t.getBoundingRect()),t.transform&&wr.applyTransform(t.transform),Sr.width=e,Sr.height=i,!wr.intersect(Sr)}(t,this._width,this._height))){var s=t.__clipPaths,o=r.prevElClipPaths;o&&!function(t,e){if(t===e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!0;return!1}(s,o)||(o&&(n.restore(),r.prevElClipPaths=null,r.prevEl=null),s&&(n.save(),function(t,e){for(var i=0;i<t.length;i++){var r=t[i];r.setTransform(e),e.beginPath(),r.buildPath(e,r.shape),e.clip(),r.restoreTransform(e)}}(s,n),r.prevElClipPaths=s)),t.beforeBrush&&t.beforeBrush(n),t.brush(n,r.prevEl||null),(r.prevEl=t).afterBrush&&t.afterBrush(n)}},getLayer:function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=xr);var i=this._layers[t];return i||((i=new Si("zr_"+t,this,this.dpr)).zlevel=t,i.__builtin__=!0,this._layerConfig[t]&&v(i,this._layerConfig[t],!0),e&&(i.virtual=e),this.insertLayer(t,i),i.initContext()),i},insertLayer:function(t,e){var i=this._layers,r=this._zlevelList,n=r.length,a=null,s=-1,o=this._domRoot;if(i[t])Ue("ZLevel "+t+" has been used already");else if(function(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}(e)){if(0<n&&t>r[0]){for(s=0;s<n-1&&!(r[s]<t&&r[s+1]>t);s++);a=i[r[s]]}if(r.splice(s+1,0,t),!(i[t]=e).virtual)if(a){var h=a.dom;h.nextSibling?o.insertBefore(e.dom,h.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom)}else Ue("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,r,n=this._zlevelList;for(r=0;r<n.length;r++)i=n[r],t.call(e,this._layers[i],i)},eachBuiltinLayer:function(t,e){var i,r,n,a=this._zlevelList;for(n=0;n<a.length;n++)r=a[n],(i=this._layers[r]).__builtin__&&t.call(e,i,r)},eachOtherLayer:function(t,e){var i,r,n,a=this._zlevelList;for(n=0;n<a.length;n++)r=a[n],(i=this._layers[r]).__builtin__||t.call(e,i,r)},getLayers:function(){return this._layers},_updateLayerStatus:function(t){function e(t){r&&(r.__endIndex!==t&&(r.__dirty=!0),r.__endIndex=t)}if(this.eachBuiltinLayer((function(t,e){t.__dirty=t.__used=!1})),this._singleCanvas)for(var i=1;i<t.length;i++)if((a=t[i]).zlevel!==t[i-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}var r=null,n=0;for(i=0;i<t.length;i++){var a,s,o=(a=t[i]).zlevel;a.incremental?((s=this.getLayer(o+.001,this._needsManuallyCompositing)).incremental=!0,n=1):s=this.getLayer(o+(0<n?.01:0),this._needsManuallyCompositing),s.__builtin__||Ue("ZLevel "+o+" has been used by unkown layer "+s.id),s!==r&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,e(i),r=s),a.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}e(i),this.eachBuiltinLayer((function(t,e){!t.__used&&0<t.getElementCount()&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?v(i[t],e,!0):i[t]=e;for(var r=0;r<this._zlevelList.length;r++){var n=this._zlevelList[r];n!==t&&n!==t+.01||v(this._layers[n],i[t],!0)}}},delLayer:function(t){var e=this._layers,i=this._zlevelList,r=e[t];r&&(r.dom.parentNode.removeChild(r.dom),delete e[t],i.splice(b(i,t),1))},resize:function(t,e){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var r=this._opts;if(null!=t&&(r.width=t),null!=e&&(r.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||e!==this._height){for(var n in i.style.width=t+"px",i.style.height=e+"px",this._layers)this._layers.hasOwnProperty(n)&&this._layers[n].resize(t,e);P(this._progressiveLayers,(function(i){i.resize(t,e)})),this.refresh(!0)}this._width=t,this._height=e}else{if(null==t||null==e)return;this._width=t,this._height=e,this.getLayer(xr).resize(t,e)}return this},clearLayer:function(t){var e=this._layers[t];e&&e.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[xr].dom;var e=new Si("image",this,t.pixelRatio||this.dpr);if(e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor),t.pixelRatio<=this.dpr){this.refresh();var i=e.dom.width,r=e.dom.height,n=e.ctx;this.eachLayer((function(t){t.__builtin__?n.drawImage(t.dom,0,0,i,r):t.renderToCanvas&&(e.ctx.save(),t.renderToCanvas(e.ctx),e.ctx.restore())}))}else for(var a={},s=this.storage.getDisplayList(!0),o=0;o<s.length;o++){var h=s[o];this._doPaintEl(h,e,!0,a)}return e.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],r=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var s=this.root,o=document.defaultView.getComputedStyle(s);return(s[r]||br(o[i])||br(s.style[i]))-(br(o[n])||0)-(br(o[a])||0)|0},pathToImage:function(t,e){e=e||this.dpr;var i=document.createElement("canvas"),r=i.getContext("2d"),n=t.getBoundingRect(),a=t.style,s=a.shadowBlur*e,o=a.shadowOffsetX*e,h=a.shadowOffsetY*e,l=a.hasStroke()?a.lineWidth:0,u=Math.max(l/2,s-o),c=Math.max(l/2,o+s),d=Math.max(l/2,s-h),p=Math.max(l/2,h+s),f=n.width+u+c,g=n.height+d+p;i.width=f*e,i.height=g*e,r.scale(e,e),r.clearRect(0,0,f,g),r.dpr=e;var v={position:t.position,rotation:t.rotation,scale:t.scale};t.position=[u-n.x,d-n.y],t.rotation=0,t.scale=[1,1],t.updateTransform(),t&&t.brush(r);var m=new _r({style:{x:0,y:0,image:i}});return null!=v.position&&(m.position=t.position=v.position),null!=v.rotation&&(m.rotation=t.rotation=v.rotation),null!=v.scale&&(m.scale=t.scale=v.scale),m}},Pr.prototype={constructor:Pr,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),i=0;i<e.length;i++)this.addClip(e[i])},removeClip:function(t){var e=b(this._clips,t);0<=e&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i<e.length;i++)this.removeClip(e[i]);t.animation=null},_update:function(){for(var t=(new Date).getTime()-this._pausedTime,e=t-this._time,i=this._clips,r=i.length,n=[],a=[],s=0;s<r;s++){var o=i[s],h=o.step(t,e);h&&(n.push(h),a.push(o))}for(s=0;s<r;)i[s]._needsRemove?(i[s]=i[r-1],i.pop(),r--):s++;for(r=n.length,s=0;s<r;s++)a[s].fire(n[s]);this._time=t,this.onframe(e),this.trigger("frame",e),this.stage.update&&this.stage.update()},_startLoop:function(){var t=this;this._running=!0,ki((function e(){t._running&&(ki(e),t._paused||t._update())}))},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(t,e){var i=new Be(t,(e=e||{}).loop,e.getter,e.setter);return this.addAnimator(i),i}},S(Pr,ut);var Mr,Tr,Or=n.domSupported,Ar=(Tr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Mr=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:M(Mr,(function(t){var e=t.replace("mouse","pointer");return Tr.hasOwnProperty(e)?e:t}))}),Cr=["mousemove","mouseup"],Lr=["pointermove","pointerup"];function zr(t){return"mousewheel"===t&&n.browser.firefox?"DOMMouseScroll":t}function Er(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Dr(t){t&&(t.zrByTouch=!0)}function Ir(t,e){for(var i=!1;(e=e&&e.parentNode)&&9!==e.nodeType&&!(i=e===t.painterRoot););return i}function Rr(t,e){this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}var Br=Rr.prototype;Br.stopPropagation=Br.stopImmediatePropagation=Br.preventDefault=U;var Fr={mousedown:function(t){t=wt(this.dom,t),this._mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=wt(this.dom,t);var e=this._mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||Vr(this,!0),this.trigger("mousemove",t)},mouseup:function(t){t=wt(this.dom,t),Vr(this,!1),this.trigger("mouseup",t)},mouseout:function(t){t=wt(this.dom,t),this._pointerCapturing&&(t.zrEventControl="no_globalout");var e=t.toElement||t.relatedTarget;t.zrIsToLocalDOM=Ir(this,e),this.trigger("mouseout",t)},touchstart:function(t){Dr(t=wt(this.dom,t)),this._lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Fr.mousemove.call(this,t),Fr.mousedown.call(this,t)},touchmove:function(t){Dr(t=wt(this.dom,t)),this.handler.processGesture(t,"change"),Fr.mousemove.call(this,t)},touchend:function(t){Dr(t=wt(this.dom,t)),this.handler.processGesture(t,"end"),Fr.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&Fr.click.call(this,t)},pointerdown:function(t){Fr.mousedown.call(this,t)},pointermove:function(t){Er(t)||Fr.mousemove.call(this,t)},pointerup:function(t){Fr.mouseup.call(this,t)},pointerout:function(t){Er(t)||Fr.mouseout.call(this,t)}};P(["click","mousewheel","dblclick","contextmenu"],(function(t){Fr[t]=function(e){e=wt(this.dom,e),this.trigger(t,e)}}));var Nr={pointermove:function(t){Er(t)||Nr.mousemove.call(this,t)},pointerup:function(t){Nr.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this._pointerCapturing;Vr(this,!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function jr(t,e,i,r){t.mounted[e]=i,t.listenerOpts[e]=r,function(t,e,i,r){gt?t.addEventListener(e,i,r):t.attachEvent("on"+e,i)}(t.domTarget,zr(e),i,r)}function Ur(t){var e,i,r,n,a=t.mounted;for(var s in a)a.hasOwnProperty(s)&&(e=t.domTarget,i=zr(s),r=a[s],n=t.listenerOpts[s],gt?e.removeEventListener(i,r,n):e.detachEvent("on"+i,r));t.mounted={}}function Vr(t,e){if(t._mayPointerCapture=null,Or&&t._pointerCapturing^e){t._pointerCapturing=e;var i=t._globalHandlerScope;e?function(t,e){function i(i){jr(e,i,(function(r){r=bt(r),Ir(t,r.target)||(r=function(t,e){return wt(t.dom,new Rr(t,e),!0)}(t,r),e.domHandlers[i].call(t,r))}),{capture:!0})}n.pointerEventsSupported?P(Lr,i):n.touchEventsSupported||P(Cr,i)}(t,i):Ur(i)}}function Hr(t,e){this.domTarget=t,this.domHandlers=e,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function Wr(t,e){ut.call(this),this.dom=t,this.painterRoot=e,this._localHandlerScope=new Hr(t,Fr),Or&&(this._globalHandlerScope=new Hr(document,Nr)),this._pointerCapturing=!1,this._mayPointerCapture=null,function(t,e){var i=e.domHandlers;n.pointerEventsSupported?P(Ar.pointer,(function(r){jr(e,r,(function(e){i[r].call(t,e)}))})):(n.touchEventsSupported&&P(Ar.touch,(function(r){jr(e,r,(function(n){i[r].call(t,n),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),P(Ar.mouse,(function(r){jr(e,r,(function(n){n=bt(n),e.touching||i[r].call(t,n)}))})))}(this,this._localHandlerScope)}var Xr=Wr.prototype;Xr.dispose=function(){Ur(this._localHandlerScope),Or&&Ur(this._globalHandlerScope)},Xr.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},S(Wr,ut);var Yr=!n.canvasSupported,Zr={canvas:kr},qr={};function Gr(t,e){Zr[t]=e}function Qr(t,e,i){i=i||{},this.dom=e,this.id=t;var r=this,a=new oi,s=i.renderer;if(Yr){if(!Zr.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");s="vml"}else s&&Zr[s]||(s="canvas");var o=new Zr[s](e,a,i,t);this.storage=a,this.painter=o;var h=n.node||n.worker?null:new Wr(o.getViewportRoot(),o.root);this.handler=new At(a,o,h,o.root),this.animation=new Pr({stage:{update:T(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=a.delFromStorage,u=a.addToStorage;a.delFromStorage=function(t){l.call(a,t),t&&t.removeSelfFromZr(r)},a.addToStorage=function(t){u.call(a,t),t.addSelfToZr(r)}}Qr.prototype={constructor:Qr,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this._needsRefresh=!0},setBackgroundColor:function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var t;this._needsRefresh&&(t=!0,this.refreshImmediately()),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately()),t&&this.trigger("rendered")},addHover:function(t,e){if(this.painter.addHover){var i=this.painter.addHover(t,e);return this.refreshHover(),i}},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,i){this.handler.on(t,e,i)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,function(t){delete qr[t]}(this.id)}};var $r=Math.pow,Kr=Math.sqrt,Jr=Kr(3),tn=W(),en=W(),rn=W();function nn(t){return-1e-8<t&&t<1e-8}function an(t){return 1e-8<t||t<-1e-8}function sn(t,e,i,r,n){var a=1-n;return a*a*(a*t+3*n*e)+n*n*(n*r+3*a*i)}function on(t,e,i,r,n){var a=1-n;return 3*(((e-t)*a+2*(i-e)*n)*a+(r-i)*n*n)}function hn(t,e,i,r,n){var a=6*i-12*e+6*t,s=9*e+3*r-3*t-9*i,o=3*e-3*t,h=0;if(nn(s))an(a)&&0<=(u=-o/a)&&u<=1&&(n[h++]=u);else{var l=a*a-4*s*o;if(nn(l))n[0]=-a/(2*s);else if(0<l){var u,c=Kr(l),d=(-a-c)/(2*s);0<=(u=(-a+c)/(2*s))&&u<=1&&(n[h++]=u),0<=d&&d<=1&&(n[h++]=d)}}return h}function ln(t,e,i,r,n,a){var s=(e-t)*n+t,o=(i-e)*n+e,h=(r-i)*n+i,l=(o-s)*n+s,u=(h-o)*n+o,c=(u-l)*n+l;a[0]=t,a[1]=s,a[2]=l,a[3]=c,a[4]=c,a[5]=u,a[6]=h,a[7]=r}function un(t,e,i,r){var n=1-r;return n*(n*t+2*r*e)+r*r*i}function cn(t,e,i,r){return 2*((1-r)*(e-t)+r*(i-e))}function dn(t,e,i){var r=t+i-2*e;return 0==r?.5:(t-e)/r}function pn(t,e,i,r,n){var a=(e-t)*r+t,s=(i-e)*r+e,o=(s-a)*r+a;n[0]=t,n[1]=a,n[2]=o,n[3]=o,n[4]=s,n[5]=i}var fn=Math.min,gn=Math.max,vn=Math.sin,mn=Math.cos,yn=2*Math.PI,_n=W(),xn=W(),bn=W();function wn(t,e,i,r,n,a){n[0]=fn(t,i),n[1]=fn(e,r),a[0]=gn(t,i),a[1]=gn(e,r)}var Sn=[],kn=[];function Pn(t,e,i,r,n,a,s,o,h,l){var u,c=hn,d=sn,p=c(t,i,n,s,Sn);for(h[0]=1/0,h[1]=1/0,l[0]=-1/0,l[1]=-1/0,u=0;u<p;u++){var f=d(t,i,n,s,Sn[u]);h[0]=fn(f,h[0]),l[0]=gn(f,l[0])}for(p=c(e,r,a,o,kn),u=0;u<p;u++){var g=d(e,r,a,o,kn[u]);h[1]=fn(g,h[1]),l[1]=gn(g,l[1])}h[0]=fn(t,h[0]),l[0]=gn(t,l[0]),h[0]=fn(s,h[0]),l[0]=gn(s,l[0]),h[1]=fn(e,h[1]),l[1]=gn(e,l[1]),h[1]=fn(o,h[1]),l[1]=gn(o,l[1])}function Mn(t,e,i,r,n,a,s,o,h){var l=at,u=st,c=Math.abs(n-a);if(c%yn<1e-4&&1e-4<c)return o[0]=t-i,o[1]=e-r,h[0]=t+i,void(h[1]=e+r);if(_n[0]=mn(n)*i+t,_n[1]=vn(n)*r+e,xn[0]=mn(a)*i+t,xn[1]=vn(a)*r+e,l(o,_n,xn),u(h,_n,xn),(n%=yn)<0&&(n+=yn),(a%=yn)<0&&(a+=yn),a<n&&!s?a+=yn:n<a&&s&&(n+=yn),s){var d=a;a=n,n=d}for(var p=0;p<a;p+=Math.PI/2)n<p&&(bn[0]=mn(p)*i+t,bn[1]=vn(p)*r+e,l(o,bn,o),u(h,bn,h))}var Tn={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},On=[],An=[],Cn=[],Ln=[],zn=Math.min,En=Math.max,Dn=Math.cos,In=Math.sin,Rn=Math.sqrt,Bn=Math.abs,Fn="undefined"!=typeof Float32Array,Nn=function(t){this._saveData=!t,this._saveData&&(this.data=[]),this._ctx=null};function jn(t,e,i,r,n,a,s){if(0===n)return!1;var o,h=n;if(e+h<s&&r+h<s||s<e-h&&s<r-h||t+h<a&&i+h<a||a<t-h&&a<i-h)return!1;if(t===i)return Math.abs(a-t)<=h/2;var l=(o=(e-r)/(t-i))*a-s+(t*r-i*e)/(t-i);return l*l/(o*o+1)<=h/2*h/2}function Un(t,e,i,r,n,a,s,o,h,l,u){if(0===h)return!1;var c=h;return!(e+c<u&&r+c<u&&a+c<u&&o+c<u||u<e-c&&u<r-c&&u<a-c&&u<o-c||t+c<l&&i+c<l&&n+c<l&&s+c<l||l<t-c&&l<i-c&&l<n-c&&l<s-c)&&function(t,e,i,r,n,a,s,o,h,l,u){var c,d,p,f,g,v=.005,m=1/0;tn[0]=h,tn[1]=l;for(var y=0;y<1;y+=.05)en[0]=sn(t,i,n,s,y),en[1]=sn(e,r,a,o,y),(f=rt(tn,en))<m&&(c=y,m=f);m=1/0;for(var _=0;_<32&&!(v<1e-4);_++)d=c-v,p=c+v,en[0]=sn(t,i,n,s,d),en[1]=sn(e,r,a,o,d),f=rt(en,tn),0<=d&&f<m?(c=d,m=f):(rn[0]=sn(t,i,n,s,p),rn[1]=sn(e,r,a,o,p),g=rt(rn,tn),p<=1&&g<m?(c=p,m=g):v*=.5);return Kr(m)}(t,e,i,r,n,a,s,o,l,u)<=c/2}function Vn(t,e,i,r,n,a,s,o,h){if(0===s)return!1;var l=s;return!(e+l<h&&r+l<h&&a+l<h||h<e-l&&h<r-l&&h<a-l||t+l<o&&i+l<o&&n+l<o||o<t-l&&o<i-l&&o<n-l)&&function(t,e,i,r,n,a,s,o,h){var l,u=.005,c=1/0;tn[0]=s,tn[1]=o;for(var d=0;d<1;d+=.05)en[0]=un(t,i,n,d),en[1]=un(e,r,a,d),(v=rt(tn,en))<c&&(l=d,c=v);c=1/0;for(var p=0;p<32&&!(u<1e-4);p++){var f=l-u,g=l+u;en[0]=un(t,i,n,f),en[1]=un(e,r,a,f);var v=rt(en,tn);if(0<=f&&v<c)l=f,c=v;else{rn[0]=un(t,i,n,g),rn[1]=un(e,r,a,g);var m=rt(rn,tn);g<=1&&m<c?(l=g,c=m):u*=.5}}return Kr(c)}(t,e,i,r,n,a,o,h)<=l/2}Nn.prototype={constructor:Nn,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(t,e,i){i=i||0,this._ux=Bn(i/Ne/t)||0,this._uy=Bn(i/Ne/e)||0},getContext:function(){return this._ctx},beginPath:function(t){return(this._ctx=t)&&t.beginPath(),t&&(this.dpr=t.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(t,e){return this.addData(Tn.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},lineTo:function(t,e){var i=Bn(t-this._xi)>this._ux||Bn(e-this._yi)>this._uy||this._len<5;return this.addData(Tn.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(Tn.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(Tn.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(Tn.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=Dn(n)*i+t,this._yi=In(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(Tn.R,t,e,i,r),this},closePath:function(){this.addData(Tn.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;i<t.length;i++)e+=t[i];this._dashSum=e}return this},setLineDashOffset:function(t){return this._dashOffset=t,this},len:function(){return this._len},setData:function(t){var e=t.length;this.data&&this.data.length===e||!Fn||(this.data=new Float32Array(e));for(var i=0;i<e;i++)this.data[i]=t[i];this._len=e},appendPath:function(t){t instanceof Array||(t=[t]);for(var e=t.length,i=0,r=this._len,n=0;n<e;n++)i+=t[n].len();for(Fn&&this.data instanceof Float32Array&&(this.data=new Float32Array(r+i)),n=0;n<e;n++)for(var a=t[n].data,s=0;s<a.length;s++)this.data[r++]=a[s];this._len=r},addData:function(t){if(this._saveData){var e=this.data;this._len+arguments.length>e.length&&(this._expandData(),e=this.data);for(var i=0;i<arguments.length;i++)e[this._len++]=arguments[i];this._prevCmd=t}},_expandData:function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(t,e){var i,r,n=this._dashSum,a=this._dashOffset,s=this._lineDash,o=this._ctx,h=this._xi,l=this._yi,u=t-h,c=e-l,d=Rn(u*u+c*c),p=h,f=l,g=s.length;for(a<0&&(a=n+a),p-=(a%=n)*(u/=d),f-=a*(c/=d);0<u&&p<=t||u<0&&t<=p||0===u&&(0<c&&f<=e||c<0&&e<=f);)p+=u*(i=s[r=this._dashIdx]),f+=c*i,this._dashIdx=(r+1)%g,0<u&&p<h||u<0&&h<p||0<c&&f<l||c<0&&l<f||o[r%2?"moveTo":"lineTo"](0<=u?zn(p,t):En(p,t),0<=c?zn(f,e):En(f,e));u=p-t,c=f-e,this._dashOffset=-Rn(u*u+c*c)},_dashedBezierTo:function(t,e,i,r,n,a){var s,o,h,l,u,c=this._dashSum,d=this._dashOffset,p=this._lineDash,f=this._ctx,g=this._xi,v=this._yi,m=sn,y=0,_=this._dashIdx,x=p.length,b=0;for(d<0&&(d=c+d),d%=c,s=0;s<1;s+=.1)o=m(g,t,i,n,s+.1)-m(g,t,i,n,s),h=m(v,e,r,a,s+.1)-m(v,e,r,a,s),y+=Rn(o*o+h*h);for(;_<x&&!(d<(b+=p[_]));_++);for(s=(b-d)/y;s<=1;)l=m(g,t,i,n,s),u=m(v,e,r,a,s),_%2?f.moveTo(l,u):f.lineTo(l,u),s+=p[_]/y,_=(_+1)%x;_%2!=0&&f.lineTo(n,a),o=n-l,h=a-u,this._dashOffset=-Rn(o*o+h*h)},_dashedQuadraticTo:function(t,e,i,r){var n=i,a=r;i=(i+2*t)/3,r=(r+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,r,n,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,Fn&&(this.data=new Float32Array(t)))},getBoundingRect:function(){On[0]=On[1]=Cn[0]=Cn[1]=Number.MAX_VALUE,An[0]=An[1]=Ln[0]=Ln[1]=-Number.MAX_VALUE;for(var t,e,i,r,n,a,s,o,h,l,u,c,d,p,f=this.data,g=0,v=0,m=0,y=0,_=0;_<f.length;){var x=f[_++];switch(1===_&&(m=g=f[_],y=v=f[_+1]),x){case Tn.M:g=m=f[_++],v=y=f[_++],Cn[0]=m,Cn[1]=y,Ln[0]=m,Ln[1]=y;break;case Tn.L:wn(g,v,f[_],f[_+1],Cn,Ln),g=f[_++],v=f[_++];break;case Tn.C:Pn(g,v,f[_++],f[_++],f[_++],f[_++],f[_],f[_+1],Cn,Ln),g=f[_++],v=f[_++];break;case Tn.Q:t=g,e=v,i=f[_++],r=f[_++],n=f[_],a=f[_+1],s=Cn,o=Ln,l=h=void 0,l=un,u=gn(fn((h=dn)(t,i,n),1),0),c=gn(fn(h(e,r,a),1),0),d=l(t,i,n,u),p=l(e,r,a,c),s[0]=fn(t,n,d),s[1]=fn(e,a,p),o[0]=gn(t,n,d),o[1]=gn(e,a,p),g=f[_++],v=f[_++];break;case Tn.A:var b=f[_++],w=f[_++],S=f[_++],k=f[_++],P=f[_++],M=f[_++]+P;_+=1;var T=1-f[_++];1===_&&(m=Dn(P)*S+b,y=In(P)*k+w),Mn(b,w,S,k,P,M,T,Cn,Ln),g=Dn(M)*S+b,v=In(M)*k+w;break;case Tn.R:wn(m=g=f[_++],y=v=f[_++],m+f[_++],y+f[_++],Cn,Ln);break;case Tn.Z:g=m,v=y}at(On,On,Cn),st(An,An,Ln)}return 0===_&&(On[0]=On[1]=An[0]=An[1]=0),new Ke(On[0],On[1],An[0]-On[0],An[1]-On[1])},rebuildPath:function(t){for(var e,i,r,n,a,s,o=this.data,h=this._ux,l=this._uy,u=this._len,c=0;c<u;){var d=o[c++];switch(1===c&&(e=r=o[c],i=n=o[c+1]),d){case Tn.M:e=r=o[c++],i=n=o[c++],t.moveTo(r,n);break;case Tn.L:a=o[c++],s=o[c++],(Bn(a-r)>h||Bn(s-n)>l||c===u-1)&&(t.lineTo(a,s),r=a,n=s);break;case Tn.C:t.bezierCurveTo(o[c++],o[c++],o[c++],o[c++],o[c++],o[c++]),r=o[c-2],n=o[c-1];break;case Tn.Q:t.quadraticCurveTo(o[c++],o[c++],o[c++],o[c++]),r=o[c-2],n=o[c-1];break;case Tn.A:var p=o[c++],f=o[c++],g=o[c++],v=o[c++],m=o[c++],y=o[c++],_=o[c++],x=o[c++],b=v<g?g:v,w=v<g?1:g/v,S=v<g?v/g:1,k=m+y;.001<Math.abs(g-v)?(t.translate(p,f),t.rotate(_),t.scale(w,S),t.arc(0,0,b,m,k,1-x),t.scale(1/w,1/S),t.rotate(-_),t.translate(-p,-f)):t.arc(p,f,b,m,k,1-x),1===c&&(e=Dn(m)*g+p,i=In(m)*v+f),r=Dn(k)*g+p,n=In(k)*v+f;break;case Tn.R:e=r=o[c],i=n=o[c+1],t.rect(o[c++],o[c++],o[c++],o[c++]);break;case Tn.Z:t.closePath(),r=e,n=i}}}},Nn.CMD=Tn;var Hn=2*Math.PI;function Wn(t){return(t%=Hn)<0&&(t+=Hn),t}var Xn=2*Math.PI;function Yn(t,e,i,r,n,a,s,o,h){if(0===s)return!1;var l=s;o-=t,h-=e;var u=Math.sqrt(o*o+h*h);if(i<u-l||u+l<i)return!1;if(Math.abs(r-n)%Xn<1e-4)return!0;if(a){var c=r;r=Wn(n),n=Wn(c)}else r=Wn(r),n=Wn(n);n<r&&(n+=Xn);var d=Math.atan2(h,o);return d<0&&(d+=Xn),r<=d&&d<=n||r<=d+Xn&&d+Xn<=n}function Zn(t,e,i,r,n,a){if(e<a&&r<a||a<e&&a<r)return 0;if(r===e)return 0;var s=r<e?1:-1,o=(a-e)/(r-e);1!=o&&0!=o||(s=r<e?.5:-.5);var h=o*(i-t)+t;return h===n?1/0:n<h?s:0}var qn=Nn.CMD,Gn=2*Math.PI,Qn=[-1,-1,-1],$n=[-1,-1];function Kn(t,e,i,r,n,a,s,o,h,l){if(e<l&&r<l&&a<l&&o<l||l<e&&l<r&&l<a&&l<o)return 0;var u,c=function(t,e,i,r,n,a){var s=r+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),l=t-n,u=o*o-3*s*h,c=o*h-9*s*l,d=h*h-3*o*l,p=0;if(nn(u)&&nn(c))nn(o)?a[0]=0:0<=(k=-h/o)&&k<=1&&(a[p++]=k);else{var f=c*c-4*u*d;if(nn(f)){var g=c/u,v=-g/2;0<=(k=-o/s+g)&&k<=1&&(a[p++]=k),0<=v&&v<=1&&(a[p++]=v)}else if(0<f){var m=Kr(f),y=u*o+1.5*s*(-c+m),_=u*o+1.5*s*(-c-m);0<=(k=(-o-((y=y<0?-$r(-y,1/3):$r(y,1/3))+(_=_<0?-$r(-_,1/3):$r(_,1/3))))/(3*s))&&k<=1&&(a[p++]=k)}else{var x=(2*u*o-3*s*c)/(2*Kr(u*u*u)),b=Math.acos(x)/3,w=Kr(u),S=Math.cos(b),k=(-o-2*w*S)/(3*s),P=(v=(-o+w*(S+Jr*Math.sin(b)))/(3*s),(-o+w*(S-Jr*Math.sin(b)))/(3*s));0<=k&&k<=1&&(a[p++]=k),0<=v&&v<=1&&(a[p++]=v),0<=P&&P<=1&&(a[p++]=P)}}return p}(e,r,a,o,l,Qn);if(0===c)return 0;for(var d,p,f=0,g=-1,v=0;v<c;v++){var m=Qn[v],y=0===m||1===m?.5:1;sn(t,i,n,s,m)<h||(g<0&&(g=hn(e,r,a,o,$n),$n[1]<$n[0]&&1<g&&(u=$n[0],$n[0]=$n[1],$n[1]=u),d=sn(e,r,a,o,$n[0]),1<g&&(p=sn(e,r,a,o,$n[1]))),2===g?m<$n[0]?f+=d<e?y:-y:m<$n[1]?f+=p<d?y:-y:f+=o<p?y:-y:m<$n[0]?f+=d<e?y:-y:f+=o<d?y:-y)}return f}function Jn(t,e,i,r,n,a,s,o){if(e<o&&r<o&&a<o||o<e&&o<r&&o<a)return 0;var h=function(t,e,i,r,n){var a=t-2*e+i,s=2*(e-t),o=t-r,h=0;if(nn(a))an(s)&&0<=(u=-o/s)&&u<=1&&(n[h++]=u);else{var l=s*s-4*a*o;if(nn(l))0<=(u=-s/(2*a))&&u<=1&&(n[h++]=u);else if(0<l){var u,c=Kr(l),d=(-s-c)/(2*a);0<=(u=(-s+c)/(2*a))&&u<=1&&(n[h++]=u),0<=d&&d<=1&&(n[h++]=d)}}return h}(e,r,a,o,Qn);if(0===h)return 0;var l=dn(e,r,a);if(0<=l&&l<=1){for(var u=0,c=un(e,r,a,l),d=0;d<h;d++){var p=0===Qn[d]||1===Qn[d]?.5:1;un(t,i,n,Qn[d])<s||(Qn[d]<l?u+=c<e?p:-p:u+=a<c?p:-p)}return u}return p=0===Qn[0]||1===Qn[0]?.5:1,un(t,i,n,Qn[0])<s?0:a<e?p:-p}function ta(t,e,i,r,n,a,s,o){if(i<(o-=e)||o<-i)return 0;var h=Math.sqrt(i*i-o*o);Qn[0]=-h,Qn[1]=h;var l=Math.abs(r-n);if(l<1e-4)return 0;if(l%Gn<1e-4){n=Gn;var u=a?1:-1;return s>=Qn[r=0]+t&&s<=Qn[1]+t?u:0}a?(h=r,r=Wn(n),n=Wn(h)):(r=Wn(r),n=Wn(n)),n<r&&(n+=Gn);for(var c=0,d=0;d<2;d++){var p=Qn[d];if(s<p+t){var f=Math.atan2(o,p);u=a?1:-1,f<0&&(f=Gn+f),(r<=f&&f<=n||r<=f+Gn&&f+Gn<=n)&&(f>Math.PI/2&&f<1.5*Math.PI&&(u=-u),c+=u)}}return c}function ea(t,e,i,r,n){for(var a=0,s=0,o=0,h=0,l=0,u=0;u<t.length;){var c=t[u++];switch(c===qn.M&&1<u&&(i||(a+=Zn(s,o,h,l,r,n))),1===u&&(h=s=t[u],l=o=t[u+1]),c){case qn.M:s=h=t[u++],o=l=t[u++];break;case qn.L:if(i){if(jn(s,o,t[u],t[u+1],e,r,n))return!0}else a+=Zn(s,o,t[u],t[u+1],r,n)||0;s=t[u++],o=t[u++];break;case qn.C:if(i){if(Un(s,o,t[u++],t[u++],t[u++],t[u++],t[u],t[u+1],e,r,n))return!0}else a+=Kn(s,o,t[u++],t[u++],t[u++],t[u++],t[u],t[u+1],r,n)||0;s=t[u++],o=t[u++];break;case qn.Q:if(i){if(Vn(s,o,t[u++],t[u++],t[u],t[u+1],e,r,n))return!0}else a+=Jn(s,o,t[u++],t[u++],t[u],t[u+1],r,n)||0;s=t[u++],o=t[u++];break;case qn.A:var d=t[u++],p=t[u++],f=t[u++],g=t[u++],v=t[u++],m=t[u++];u+=1;var y=1-t[u++],_=Math.cos(v)*f+d,x=Math.sin(v)*g+p;1<u?a+=Zn(s,o,_,x,r,n):(h=_,l=x);var b=(r-d)*g/f+d;if(i){if(Yn(d,p,g,v,v+m,y,e,b,n))return!0}else a+=ta(d,p,g,v,v+m,y,b,n);s=Math.cos(v+m)*f+d,o=Math.sin(v+m)*g+p;break;case qn.R:if(h=s=t[u++],l=o=t[u++],_=h+t[u++],x=l+t[u++],i){if(jn(h,l,_,l,e,r,n)||jn(_,l,_,x,e,r,n)||jn(_,x,h,x,e,r,n)||jn(h,x,h,l,e,r,n))return!0}else a+=Zn(_,l,_,x,r,n),a+=Zn(h,x,h,l,r,n);break;case qn.Z:if(i){if(jn(s,o,h,l,e,r,n))return!0}else a+=Zn(s,o,h,l,r,n);s=h,o=l}}return i||function(t,e){return Math.abs(t-e)<1e-4}(o,l)||(a+=Zn(s,o,h,l,r,n)||0),0!==a}var ia=xi.prototype.getCanvasPattern,ra=Math.abs,na=new Nn(!0);function aa(t){yr.call(this,t),this.path=null}function sa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}aa.prototype={constructor:aa,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(t,e){var i,r=this.style,n=this.path||na,a=r.hasStroke(),s=r.hasFill(),o=r.fill,h=r.stroke,l=s&&!!o.colorStops,u=a&&!!h.colorStops,c=s&&!!o.image,d=a&&!!h.image;r.bind(t,this,e),this.setTransform(t),this.__dirty&&(l&&(i=i||this.getBoundingRect(),this._fillGradient=r.getGradient(t,o,i)),u&&(i=i||this.getBoundingRect(),this._strokeGradient=r.getGradient(t,h,i))),l?t.fillStyle=this._fillGradient:c&&(t.fillStyle=ia.call(o,t)),u?t.strokeStyle=this._strokeGradient:d&&(t.strokeStyle=ia.call(h,t));var p=r.lineDash,f=r.lineDashOffset,g=!!t.setLineDash,v=this.getGlobalScale();if(n.setScale(v[0],v[1],this.segmentIgnoreThreshold),this.__dirtyPath||p&&!g&&a?(n.beginPath(t),p&&!g&&(n.setLineDash(p),n.setLineDashOffset(f)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),s)if(null!=r.fillOpacity){var m=t.globalAlpha;t.globalAlpha=r.fillOpacity*r.opacity,n.fill(t),t.globalAlpha=m}else n.fill(t);p&&g&&(t.setLineDash(p),t.lineDashOffset=f),a&&(null!=r.strokeOpacity?(m=t.globalAlpha,t.globalAlpha=r.strokeOpacity*r.opacity,n.stroke(t),t.globalAlpha=m):n.stroke(t)),p&&g&&t.setLineDash([]),null!=r.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new Nn},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var r=this.path;r=r||(this.path=new Nn),this.__dirtyPath&&(r.beginPath(),this.buildPath(r,this.shape,!1)),t=r.getBoundingRect()}if(this._rect=t,e.hasStroke()){var n=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){n.copy(t);var a=e.lineWidth,s=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),1e-10<s&&(n.width+=a/s,n.height+=a/s,n.x-=a/s/2,n.y-=a/s/2)}return n}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),r=this.getBoundingRect(),n=this.style;if(t=i[0],e=i[1],r.contain(t,e)){var a=this.path.data;if(n.hasStroke()){var s=n.lineWidth,o=n.strokeNoScale?this.getLineScale():1;if(1e-10<o&&(n.hasFill()||(s=Math.max(s,this.strokeContainThreshold)),function(t,e,i,r){return ea(t,e,!0,i,r)}(a,s/o,t,e)))return!0}if(n.hasFill())return function(t,e,i){return ea(t,0,!1,e,i)}(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):yr.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(L(t))for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&1e-10<ra(t[0]-1)&&1e-10<ra(t[3]-1)?Math.sqrt(ra(t[0]*t[3]-t[2]*t[1])):1}},aa.extend=function(t){function e(e){aa.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var r=this.shape;for(var n in i)!r.hasOwnProperty(n)&&i.hasOwnProperty(n)&&(r[n]=i[n])}t.init&&t.init.call(this,e)}for(var i in w(e,aa),t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},w(aa,yr);var oa=Nn.CMD,ha=[[],[],[]],la=Math.sqrt,ua=Math.atan2,ca=Math.sqrt,da=Math.sin,pa=Math.cos,fa=Math.PI,ga=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(sa(t)*sa(e))},va=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ga(t,e))};function ma(t,e,i,r,n,a,s,o,h,l,u){var c=h*(fa/180),d=pa(c)*(t-i)/2+da(c)*(e-r)/2,p=-1*da(c)*(t-i)/2+pa(c)*(e-r)/2,f=d*d/(s*s)+p*p/(o*o);1<f&&(s*=ca(f),o*=ca(f));var g=(n===a?-1:1)*ca((s*s*(o*o)-s*s*(p*p)-o*o*(d*d))/(s*s*(p*p)+o*o*(d*d)))||0,v=g*s*p/o,m=g*-o*d/s,y=(t+i)/2+pa(c)*v-da(c)*m,_=(e+r)/2+da(c)*v+pa(c)*m,x=va([1,0],[(d-v)/s,(p-m)/o]),b=[(d-v)/s,(p-m)/o],w=[(-1*d-v)/s,(-1*p-m)/o],S=va(b,w);ga(b,w)<=-1&&(S=fa),1<=ga(b,w)&&(S=0),0===a&&0<S&&(S-=2*fa),1===a&&S<0&&(S+=2*fa),u.addData(l,y,_,s,o,x,S,c,a)}var ya=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,_a=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function xa(t,e){var i=function(t){if(!t)return new Nn;for(var e,i=0,r=0,n=i,a=r,s=new Nn,o=Nn.CMD,h=t.match(ya),l=0;l<h.length;l++){for(var u,c=h[l],d=c.charAt(0),p=c.match(_a)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var v=0;v<f;){var m,y,_,x,b,w,S,k=i,P=r;switch(d){case"l":i+=p[v++],r+=p[v++],u=o.L,s.addData(u,i,r);break;case"L":i=p[v++],r=p[v++],u=o.L,s.addData(u,i,r);break;case"m":i+=p[v++],r+=p[v++],u=o.M,s.addData(u,i,r),n=i,a=r,d="l";break;case"M":i=p[v++],r=p[v++],u=o.M,s.addData(u,i,r),n=i,a=r,d="L";break;case"h":i+=p[v++],u=o.L,s.addData(u,i,r);break;case"H":i=p[v++],u=o.L,s.addData(u,i,r);break;case"v":r+=p[v++],u=o.L,s.addData(u,i,r);break;case"V":r=p[v++],u=o.L,s.addData(u,i,r);break;case"C":u=o.C,s.addData(u,p[v++],p[v++],p[v++],p[v++],p[v++],p[v++]),i=p[v-2],r=p[v-1];break;case"c":u=o.C,s.addData(u,p[v++]+i,p[v++]+r,p[v++]+i,p[v++]+r,p[v++]+i,p[v++]+r),i+=p[v-2],r+=p[v-1];break;case"S":m=i,y=r;var M=s.len(),T=s.data;e===o.C&&(m+=i-T[M-4],y+=r-T[M-3]),u=o.C,k=p[v++],P=p[v++],i=p[v++],r=p[v++],s.addData(u,m,y,k,P,i,r);break;case"s":m=i,y=r,M=s.len(),T=s.data,e===o.C&&(m+=i-T[M-4],y+=r-T[M-3]),u=o.C,k=i+p[v++],P=r+p[v++],i+=p[v++],r+=p[v++],s.addData(u,m,y,k,P,i,r);break;case"Q":k=p[v++],P=p[v++],i=p[v++],r=p[v++],u=o.Q,s.addData(u,k,P,i,r);break;case"q":k=p[v++]+i,P=p[v++]+r,i+=p[v++],r+=p[v++],u=o.Q,s.addData(u,k,P,i,r);break;case"T":m=i,y=r,M=s.len(),T=s.data,e===o.Q&&(m+=i-T[M-4],y+=r-T[M-3]),i=p[v++],r=p[v++],u=o.Q,s.addData(u,m,y,i,r);break;case"t":m=i,y=r,M=s.len(),T=s.data,e===o.Q&&(m+=i-T[M-4],y+=r-T[M-3]),i+=p[v++],r+=p[v++],u=o.Q,s.addData(u,m,y,i,r);break;case"A":_=p[v++],x=p[v++],b=p[v++],w=p[v++],S=p[v++],ma(k=i,P=r,i=p[v++],r=p[v++],w,S,_,x,b,u=o.A,s);break;case"a":_=p[v++],x=p[v++],b=p[v++],w=p[v++],S=p[v++],ma(k=i,P=r,i+=p[v++],r+=p[v++],w,S,_,x,b,u=o.A,s)}}"z"!==d&&"Z"!==d||(u=o.Z,s.addData(u),i=n,r=a),e=u}return s.toStatic(),s}(t);return(e=e||{}).buildPath=function(t){if(t.setData)t.setData(i.data),(e=t.getContext())&&t.rebuildPath(e);else{var e=t;i.rebuildPath(e)}},e.applyTransform=function(t){(function(t,e){var i,r,n,a,s,o=t.data,h=oa.M,l=oa.C,u=oa.L,c=oa.R,d=oa.A,p=oa.Q;for(a=n=0;n<o.length;){switch(i=o[n++],a=n,r=0,i){case h:case u:r=1;break;case l:r=3;break;case p:r=2;break;case d:var f=e[4],g=e[5],v=la(e[0]*e[0]+e[1]*e[1]),m=la(e[2]*e[2]+e[3]*e[3]),y=ua(-e[1]/m,e[0]/v);o[n]*=v,o[n++]+=f,o[n]*=m,o[n++]+=g,o[n++]*=v,o[n++]*=m,o[n++]+=y,o[n++]+=y,a=n+=2;break;case c:_[0]=o[n++],_[1]=o[n++],nt(_,_,e),o[a++]=_[0],o[a++]=_[1],_[0]+=o[n++],_[1]+=o[n++],nt(_,_,e),o[a++]=_[0],o[a++]=_[1]}for(s=0;s<r;s++){var _;(_=ha[s])[0]=o[n++],_[1]=o[n++],nt(_,_,e),o[a++]=_[0],o[a++]=_[1]}}})(i,t),this.dirty(!0)},e}function ba(t,e){return new aa(xa(t,e))}var wa=(Object.freeze||Object)({createFromString:ba,extendFromString:function(t,e){return aa.extend(xa(t,e))},mergePath:function(t,e){for(var i=[],r=t.length,n=0;n<r;n++){var a=t[n];a.path||a.createPathProxy(),a.__dirtyPath&&a.buildPath(a.path,a.shape,!0),i.push(a.path)}var s=new aa(e);return s.createPathProxy(),s.buildPath=function(t){t.appendPath(i);var e=t.getContext();e&&t.rebuildPath(e)},s}}),Sa=function(t){yr.call(this,t)};Sa.prototype={constructor:Sa,type:"text",brush:function(t,e){var i=this.style;this.__dirty&&er(i),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var r=i.text;null!=r&&(r+=""),gr(r,i)?(this.setTransform(t),rr(this,t,r,i,null,e),this.restoreTransform(t)):t.__attrCachedBy=ui},getBoundingRect:function(){var t=this.style;if(this.__dirty&&er(t),!this._rect){var e=t.text;null!=e?e+="":e="";var i=Ri(t.text+"",t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich);if(i.x+=t.x||0,i.y+=t.y||0,cr(t.textStroke,t.textStrokeWidth)){var r=t.textStrokeWidth;i.x-=r/2,i.y-=r/2,i.width+=r,i.height+=r}this._rect=i}return this._rect}},w(Sa,yr);var ka=aa.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(t,e,i){i&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI,!0)}}),Pa=Math.round;function Ma(t,e,i){var r=Pa(2*t);return(r+Pa(e))%2==0?r/2:(r+(i?1:-1))/2}var Ta={},Oa=aa.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var i,r,n,a;this.subPixelOptimize?(function(t,e,i){var r=i&&i.lineWidth;if(e&&r){var n=e.x,a=e.y,s=e.width,o=e.height;t.x=Ma(n,r,!0),t.y=Ma(a,r,!0),t.width=Math.max(Ma(n+s,r,!1)-t.x,0===s?0:1),t.height=Math.max(Ma(a+o,r,!1)-t.y,0===o?0:1)}}(Ta,e,this.style),i=Ta.x,r=Ta.y,n=Ta.width,a=Ta.height,Ta.r=e.r,e=Ta):(i=e.x,r=e.y,n=e.width,a=e.height),e.r?qi(t,e):t.rect(i,r,n,a),t.closePath()}}),Aa=aa.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=e.rx,a=e.ry,s=.5522848*n,o=.5522848*a;t.moveTo(i-n,r),t.bezierCurveTo(i-n,r-o,i-s,r-a,i,r-a),t.bezierCurveTo(i+s,r-a,i+n,r-o,i+n,r),t.bezierCurveTo(i+n,r+o,i+s,r+a,i,r+a),t.bezierCurveTo(i-s,r+a,i-n,r+o,i-n,r),t.closePath()}}),Ca={},La=aa.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,n,a;a=this.subPixelOptimize?(function(t,e,i){var r=i&&i.lineWidth;if(e&&r){var n=e.x1,a=e.x2,s=e.y1,o=e.y2;Pa(2*n)===Pa(2*a)?t.x1=t.x2=Ma(n,r,!0):(t.x1=n,t.x2=a),Pa(2*s)===Pa(2*o)?t.y1=t.y2=Ma(s,r,!0):(t.y1=s,t.y2=o)}}(Ca,e,this.style),i=Ca.x1,r=Ca.y1,n=Ca.x2,Ca.y2):(i=e.x1,r=e.y1,n=e.x2,e.y2);var s=e.percent;0!==s&&(t.moveTo(i,r),s<1&&(n=i*(1-s)+n*s,a=r*(1-s)+a*s),t.lineTo(n,a))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});function za(t,e,i,r,n,a,s){var o=.5*(i-t),h=.5*(r-e);return(2*(e-i)+o+h)*s+(-3*(e-i)-2*o-h)*a+o*n+e}function Ea(t,e,i){var r=e.points,n=e.smooth;if(r&&2<=r.length){if(n&&"spline"!==n){var a=function(t,e,i,r){var n,a,s,o,h=[],l=[],u=[],c=[];if(r){s=[1/0,1/0],o=[-1/0,-1/0];for(var d=0,p=t.length;d<p;d++)at(s,s,t[d]),st(o,o,t[d]);at(s,s,r[0]),st(o,o,r[1])}for(d=0,p=t.length;d<p;d++){var f=t[d];if(i)n=t[d?d-1:p-1],a=t[(d+1)%p];else{if(0===d||d===p-1){h.push(X(t[d]));continue}n=t[d-1],a=t[d+1]}Z(l,a,n),K(l,l,e);var g=tt(f,n),v=tt(f,a),m=g+v;0!==m&&(g/=m,v/=m),K(u,l,-g),K(c,l,v);var y=Y([],f,u),_=Y([],f,c);r&&(st(y,y,s),at(y,y,o),st(_,_,s),at(_,_,o)),h.push(y),h.push(_)}return i&&h.push(h.shift()),h}(r,n,i,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var s=r.length,o=0;o<(i?s:s-1);o++){var h=a[2*o],l=a[2*o+1],u=r[(o+1)%s];t.bezierCurveTo(h[0],h[1],l[0],l[1],u[0],u[1])}}else{"spline"===n&&(r=function(t,e){for(var i=t.length,r=[],n=0,a=1;a<i;a++)n+=tt(t[a-1],t[a]);var s=n/2;for(s=s<i?i:s,a=0;a<s;a++){var o,h,l,u=a/(s-1)*(e?i:i-1),c=Math.floor(u),d=u-c,p=t[c%i];l=e?(o=t[(c-1+i)%i],h=t[(c+1)%i],t[(c+2)%i]):(o=t[0===c?c:c-1],h=t[i-2<c?i-1:c+1],t[i-3<c?i-1:c+2]);var f=d*d,g=d*f;r.push([za(o[0],p[0],h[0],l[0],d,f,g),za(o[1],p[1],h[1],l[1],d,f,g)])}return r}(r,i)),t.moveTo(r[0][0],r[0][1]),o=1;for(var c=r.length;o<c;o++)t.lineTo(r[o][0],r[o][1])}i&&t.closePath()}}function Da(t){this.colorStops=t||[]}var Ia=aa.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){Ea(t,e,!0)}}),Ra=aa.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){Ea(t,e,!1)}});function Ba(t,e,i,r,n,a){this.x=null==t?0:t,this.y=null==e?0:e,this.x2=null==i?1:i,this.y2=null==r?0:r,this.type="linear",this.global=a||!1,Da.call(this,n)}Da.prototype={constructor:Da,addColorStop:function(t,e){this.colorStops.push({offset:t,color:e})}},Ba.prototype={constructor:Ba},w(Ba,Da);var Fa=/[\s,]+/;function Na(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Na.prototype.parse=function(t,e){e=e||{};var i=function(t){for(C(t)&&(t=(new DOMParser).parseFromString(t,"text/xml")),9===t.nodeType&&(t=t.firstChild);"svg"!==t.nodeName.toLowerCase()||1!==t.nodeType;)t=t.nextSibling;return t}(t);if(!i)throw new Error("Illegal svg");var r=new Je;this._root=r;var n=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||e.width),s=parseFloat(i.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),Xa(i,r,null,!0);for(var o,h,l=i.firstChild;l;)this._parseNode(l,r),l=l.nextSibling;if(n){var u=B(n).split(Fa);4<=u.length&&(o={x:parseFloat(u[0]||0),y:parseFloat(u[1]||0),width:parseFloat(u[2]),height:parseFloat(u[3])})}if(o&&null!=a&&null!=s&&(h=function(t,e,i){var r=e/t.width,n=i/t.height,a=Math.min(r,n);return{scale:[a,a],position:[-(t.x+t.width/2)*a+e/2,-(t.y+t.height/2)*a+i/2]}}(o,a,s),!e.ignoreViewBox)){var c=r;(r=new Je).add(c),c.scale=h.scale.slice(),c.position=h.position.slice()}return e.ignoreRootClip||null==a||null==s||r.setClipPath(new Oa({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:o,viewBoxTransform:h}},Na.prototype._parseNode=function(t,e){var i,r,n=t.nodeName.toLowerCase();if("defs"===n?this._isDefine=!0:"text"===n&&(this._isText=!0),this._isDefine){if(r=Ua[n]){var a=r.call(this,t),s=t.getAttribute("id");s&&(this._defs[s]=a)}}else(r=ja[n])&&(i=r.call(this,t,e),e.add(i));for(var o=t.firstChild;o;)1===o.nodeType&&this._parseNode(o,i),3===o.nodeType&&this._isText&&this._parseText(o,i),o=o.nextSibling;"defs"===n?this._isDefine=!1:"text"===n&&(this._isText=!1)},Na.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,r=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(r)}var n=new Sa({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Va(e,n),Xa(t,n,this._defs);var a=n.style.fontSize;a&&a<9&&(n.style.fontSize=9,n.scale=n.scale||[1,1],n.scale[0]*=a/9,n.scale[1]*=a/9);var s=n.getBoundingRect();return this._textX+=s.width,e.add(n),n};var ja={g:function(t,e){var i=new Je;return Va(e,i),Xa(t,i,this._defs),i},rect:function(t,e){var i=new Oa;return Va(e,i),Xa(t,i,this._defs),i.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),i},circle:function(t,e){var i=new ka;return Va(e,i),Xa(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new La;return Va(e,i),Xa(t,i,this._defs),i.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),i},ellipse:function(t,e){var i=new Aa;return Va(e,i),Xa(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),i},polygon:function(t,e){var i=t.getAttribute("points");i=i&&Ha(i);var r=new Ia({shape:{points:i||[]}});return Va(e,r),Xa(t,r,this._defs),r},polyline:function(t,e){var i=new aa;Va(e,i),Xa(t,i,this._defs);var r=t.getAttribute("points");return r=r&&Ha(r),new Ra({shape:{points:r||[]}})},image:function(t,e){var i=new _r;return Va(e,i),Xa(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,r=t.getAttribute("y")||0,n=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(n),this._textY=parseFloat(r)+parseFloat(a);var s=new Je;return Va(e,s),Xa(t,s,this._defs),s},tspan:function(t,e){var i=t.getAttribute("x"),r=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=r&&(this._textY=parseFloat(r));var n=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0,s=new Je;return Va(e,s),Xa(t,s,this._defs),this._textX+=n,this._textY+=a,s},path:function(t,e){var i=ba(t.getAttribute("d")||"");return Va(e,i),Xa(t,i,this._defs),i}},Ua={lineargradient:function(t){var e=new Ba(parseInt(t.getAttribute("x1")||0,10),parseInt(t.getAttribute("y1")||0,10),parseInt(t.getAttribute("x2")||10,10),parseInt(t.getAttribute("y2")||0,10));return function(t,e){for(var i=t.firstChild;i;){if(1===i.nodeType){var r=i.getAttribute("offset");r=0<r.indexOf("%")?parseInt(r,10)/100:r?parseFloat(r):0;var n=i.getAttribute("stop-color")||"#000000";e.addColorStop(r,n)}i=i.nextSibling}}(t,e),e},radialgradient:function(t){}};function Va(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),y(e.__inheritedStyle,t.__inheritedStyle))}function Ha(t){for(var e=B(t).split(Fa),i=[],r=0;r<e.length;r+=2){var n=parseFloat(e[r]),a=parseFloat(e[r+1]);i.push([n,a])}return i}var Wa={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-align":"textAlign","alignment-baseline":"textBaseline"};function Xa(t,e,i,r){var n=e.__inheritedStyle||{},a="text"===e.type;if(1===t.nodeType&&(function(t,e){var i=t.getAttribute("transform");if(i){i=i.replace(/,/g," ");var r=null,n=[];i.replace(qa,(function(t,e,i){n.push(e,i)}));for(var a=n.length-1;0<a;a-=2){var s=n[a],o=n[a-1];switch(r=r||Dt(),o){case"translate":s=B(s).split(Fa),Ft(r,r,[parseFloat(s[0]),parseFloat(s[1]||0)]);break;case"scale":s=B(s).split(Fa),jt(r,r,[parseFloat(s[0]),parseFloat(s[1]||s[0])]);break;case"rotate":s=B(s).split(Fa),Nt(r,r,parseFloat(s[0]));break;case"skew":s=B(s).split(Fa),console.warn("Skew transform is not supported yet");break;case"matrix":s=B(s).split(Fa),r[0]=parseFloat(s[0]),r[1]=parseFloat(s[1]),r[2]=parseFloat(s[2]),r[3]=parseFloat(s[3]),r[4]=parseFloat(s[4]),r[5]=parseFloat(s[5])}}e.setLocalTransform(r)}}(t,e),m(n,function(t){var e=t.getAttribute("style"),i={};if(!e)return i;var r,n={};for(Ga.lastIndex=0;null!=(r=Ga.exec(e));)n[r[1]]=r[2];for(var a in Wa)Wa.hasOwnProperty(a)&&null!=n[a]&&(i[Wa[a]]=n[a]);return i}(t)),!r))for(var s in Wa)if(Wa.hasOwnProperty(s)){var o=t.getAttribute(s);null!=o&&(n[Wa[s]]=o)}var h=a?"textFill":"fill",l=a?"textStroke":"stroke";e.style=e.style||new fi;var u=e.style;null!=n.fill&&u.set(h,Za(n.fill,i)),null!=n.stroke&&u.set(l,Za(n.stroke,i)),P(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(t){var e="lineWidth"===t&&a?"textStrokeWidth":t;null!=n[t]&&u.set(e,parseFloat(n[t]))})),n.textBaseline&&"auto"!==n.textBaseline||(n.textBaseline="alphabetic"),"alphabetic"===n.textBaseline&&(n.textBaseline="bottom"),"start"===n.textAlign&&(n.textAlign="left"),"end"===n.textAlign&&(n.textAlign="right"),P(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(t){null!=n[t]&&u.set(t,n[t])})),n.lineDash&&(e.style.lineDash=B(n.lineDash).split(Fa)),u[l]&&"none"!==u[l]&&(e[l]=!0),e.__inheritedStyle=n}var Ya=/url\(\s*#(.*?)\)/;function Za(t,e){var i=e&&t&&t.match(Ya);return i?e[B(i[1])]:t}var qa=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g,Ga=/([^\s:;]+)\s*:\s*([^:;]+)/g,Qa=aa.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,i=0;i<e.length;i++)t=t||e[i].__dirtyPath;this.__dirtyPath=t,this.__dirty=this.__dirty||t},beforeBrush:function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),i=0;i<t.length;i++)t[i].path||t[i].createPathProxy(),t[i].path.setScale(e[0],e[1],t[i].segmentIgnoreThreshold)},buildPath:function(t,e){for(var i=e.paths||[],r=0;r<i.length;r++)i[r].buildPath(t,i[r].shape,!0)},afterBrush:function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),aa.prototype.getBoundingRect.call(this)}});function $a(t){yr.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}$a.prototype.incremental=!0,$a.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},$a.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},$a.prototype.addDisplayables=function(t,e){e=e||!1;for(var i=0;i<t.length;i++)this.addDisplayable(t[i],e)},$a.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},$a.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++)(e=this._displayables[t]).parent=this,e.update(),e.parent=null;for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},$a.prototype.brush=function(t,e){for(var i=this._cursor;i<this._displayables.length;i++)(r=this._displayables[i]).beforeBrush&&r.beforeBrush(t),r.brush(t,i===this._cursor?null:this._displayables[i-1]),r.afterBrush&&r.afterBrush(t);for(this._cursor=i,i=0;i<this._temporaryDisplayables.length;i++){var r;(r=this._temporaryDisplayables[i]).beforeBrush&&r.beforeBrush(t),r.brush(t,0===i?null:this._temporaryDisplayables[i-1]),r.afterBrush&&r.afterBrush(t)}this._temporaryDisplayables=[],this.notClear=!0};var Ka=[];$a.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new Ke(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var i=this._displayables[e],r=i.getBoundingRect().clone();i.needLocalTransform()&&r.applyTransform(i.getLocalTransform(Ka)),t.union(r)}this._rect=t}return this._rect},$a.prototype.contain=function(t,e){var i=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(i[0],i[1]))for(var r=0;r<this._displayables.length;r++)if(this._displayables[r].contain(t,e))return!0;return!1},w($a,yr);var Ja=aa.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.cx,r=e.cy,n=Math.max(e.r,0),a=e.startAngle,s=e.endAngle,o=e.clockwise,h=Math.cos(a),l=Math.sin(a);t.moveTo(h*n+i,l*n+r),t.arc(i,r,n,a,s,!o)}}),ts=[];function es(t,e,i){var r=t.cpx2,n=t.cpy2;return null===r||null===n?[(i?on:sn)(t.x1,t.cpx1,t.cpx2,t.x2,e),(i?on:sn)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(i?cn:un)(t.x1,t.cpx1,t.x2,e),(i?cn:un)(t.y1,t.cpy1,t.y2,e)]}function is(t,e,i,r,n){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==i?.5:i,this.type="radial",this.global=n||!1,Da.call(this,r)}var rs,ns=aa.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.x1,r=e.y1,n=e.x2,a=e.y2,s=e.cpx1,o=e.cpy1,h=e.cpx2,l=e.cpy2,u=e.percent;0!==u&&(t.moveTo(i,r),null==h||null==l?(u<1&&(pn(i,s,n,u,ts),s=ts[1],n=ts[2],pn(r,o,a,u,ts),o=ts[1],a=ts[2]),t.quadraticCurveTo(s,o,n,a)):(u<1&&(ln(i,s,h,n,u,ts),s=ts[1],h=ts[2],n=ts[3],ln(r,o,l,a,u,ts),o=ts[1],l=ts[2],a=ts[3]),t.bezierCurveTo(s,o,h,l,n,a)))},pointAt:function(t){return es(this.shape,t,!1)},tangentAt:function(t){var e=es(this.shape,t,!0);return J(e,e)}}),as=aa.extend({type:"droplet",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=e.width,a=e.height;t.moveTo(i,r+n),t.bezierCurveTo(i+n,r+n,i+3*n/2,r-n/3,i,r-a),t.bezierCurveTo(i-3*n/2,r-n/3,i-n,r+n,i,r+n),t.closePath()}}),ss=aa.extend({type:"heart",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=e.width,a=e.height;t.moveTo(i,r),t.bezierCurveTo(i+n/2,r-2*a/3,i+2*n,r+a/3,i,r+a),t.bezierCurveTo(i-2*n,r+a/3,i-n/2,r-2*a/3,i,r)}}),os=Math.PI,hs=Math.sin,ls=Math.cos,us=aa.extend({type:"isogon",shape:{x:0,y:0,r:0,n:0},buildPath:function(t,e){var i=e.n;if(i&&!(i<2)){var r=e.x,n=e.y,a=e.r,s=2*os/i,o=-os/2;t.moveTo(r+a*ls(o),n+a*hs(o));for(var h=0,l=i-1;h<l;h++)o+=s,t.lineTo(r+a*ls(o),n+a*hs(o));t.closePath()}}}),cs=aa.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=2*Math.PI;t.moveTo(i+e.r,r),t.arc(i,r,e.r,0,n,!1),t.moveTo(i+e.r0,r),t.arc(i,r,e.r0,0,n,!0)}}),ds=Math.sin,ps=Math.cos,fs=Math.PI/180,gs=aa.extend({type:"rose",shape:{cx:0,cy:0,r:[],k:0,n:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,n,a=e.r,s=e.k,o=e.n,h=e.cx,l=e.cy;t.moveTo(h,l);for(var u=0,c=a.length;u<c;u++){n=a[u];for(var d=0;d<=360*o;d++)i=n*ds(s/o*d%360*fs)*ps(d*fs)+h,r=n*ds(s/o*d%360*fs)*ds(d*fs)+l,t.lineTo(i,r)}}}),vs=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]],ms=aa.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:(rs=aa.prototype.brush,n.browser.ie&&11<=n.browser.version?function(){var t,e=this.__clipPaths,i=this.style;if(e)for(var r=0;r<e.length;r++){var n=e[r],a=n&&n.shape,s=n&&n.type;if(a&&("sector"===s&&a.startAngle===a.endAngle||"rect"===s&&(!a.width||!a.height))){for(var o=0;o<vs.length;o++)vs[o][2]=i[vs[o][0]],i[vs[o][0]]=vs[o][1];t=!0;break}}if(rs.apply(this,arguments),t)for(o=0;o<vs.length;o++)i[vs[o][0]]=vs[o][2]}:rs),buildPath:function(t,e){var i=e.cx,r=e.cy,n=Math.max(e.r0||0,0),a=Math.max(e.r,0),s=e.startAngle,o=e.endAngle,h=e.clockwise,l=Math.cos(s),u=Math.sin(s);t.moveTo(l*n+i,u*n+r),t.lineTo(l*a+i,u*a+r),t.arc(i,r,a,s,o,!h),t.lineTo(Math.cos(o)*n+i,Math.sin(o)*n+r),0!==n&&t.arc(i,r,n,o,s,h),t.closePath()}}),ys=Math.PI,_s=Math.cos,xs=Math.sin,bs=aa.extend({type:"star",shape:{cx:0,cy:0,n:3,r0:null,r:0},buildPath:function(t,e){var i=e.n;if(i&&!(i<2)){var r=e.cx,n=e.cy,a=e.r,s=e.r0;null==s&&(s=4<i?a*_s(2*ys/i)/_s(ys/i):a/3);var o=ys/i,h=-ys/2,l=r+a*_s(h),u=n+a*xs(h);h+=o,t.moveTo(l,u);for(var c,d=0,p=2*i-1;d<p;d++)c=d%2==0?s:a,t.lineTo(r+c*_s(h),n+c*xs(h)),h+=o;t.closePath()}}}),ws=Math.cos,Ss=Math.sin,ks=aa.extend({type:"trochoid",shape:{cx:0,cy:0,r:0,r0:0,d:0,location:"out"},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,n,a,s=e.r,o=e.r0,h=e.d,l=e.cx,u=e.cy,c="out"===e.location?1:-1;if(!(e.location&&s<=o)){var d,p=0,f=1;for(i=(s+c*o)*ws(0)-c*h*ws(0)+l,r=(s+c*o)*Ss(0)-h*Ss(0)+u,t.moveTo(i,r);o*++p%(s+c*o)!=0;);for(;d=Math.PI/180*f,n=(s+c*o)*ws(d)-c*h*ws((s/o+c)*d)+l,a=(s+c*o)*Ss(d)-h*Ss((s/o+c)*d)+u,t.lineTo(n,a),++f<=o*p/(s+c*o)*360;);}}});function Ps(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}is.prototype={constructor:is},w(is,Da);var Ms=Nn.CMD,Ts=Array.prototype.join,Os="none",As=Math.round,Cs=Math.sin,Ls=Math.cos,zs=Math.PI,Es=2*Math.PI,Ds=180/zs;function Is(t){return As(1e4*t)/1e4}function Rs(t){return t<1e-4&&-1e-4<t}function Bs(t,e){e&&Fs(t,"transform","matrix("+Ts.call(e,",")+")")}function Fs(t,e,i){i&&("linear"===i.type||"radial"===i.type)||t.setAttribute(e,i)}function Ns(t,e,i,r){if(function(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==Os}(e,i)){var n=i?e.textFill:e.fill;Fs(t,"fill",n="transparent"===n?Os:n),Fs(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else Fs(t,"fill",Os);if(function(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==Os}(e,i)){var a=i?e.textStroke:e.stroke;Fs(t,"stroke",a="transparent"===a?Os:a),Fs(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?r.getLineScale():1)),Fs(t,"paint-order",i?"stroke":"fill"),Fs(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity),e.lineDash?(Fs(t,"stroke-dasharray",e.lineDash.join(",")),Fs(t,"stroke-dashoffset",As(e.lineDashOffset||0))):Fs(t,"stroke-dasharray",""),e.lineCap&&Fs(t,"stroke-linecap",e.lineCap),e.lineJoin&&Fs(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&Fs(t,"stroke-miterlimit",e.miterLimit)}else Fs(t,"stroke",Os)}var js={brush:function(t){var e=t.style,i=t.__svgEl;i||(i=Ps("path"),t.__svgEl=i),t.path||t.createPathProxy();var r=t.path;if(t.__dirtyPath){r.beginPath(),r.subPixelOptimize=!1,t.buildPath(r,t.shape),t.__dirtyPath=!1;var n=function(t){for(var e=[],i=t.data,r=t.len(),n=0;n<r;){var a="",s=0;switch(i[n++]){case Ms.M:a="M",s=2;break;case Ms.L:a="L",s=2;break;case Ms.Q:a="Q",s=4;break;case Ms.C:a="C",s=6;break;case Ms.A:var o=i[n++],h=i[n++],l=i[n++],u=i[n++],c=i[n++],d=i[n++],p=i[n++],f=i[n++],g=Math.abs(d),v=Rs(g-Es)||(f?Es<=d:Es<=-d),m=0<d?d%Es:d%Es+Es,y=!1;y=!!v||!Rs(g)&&zs<=m==!!f;var _=Is(o+l*Ls(c)),x=Is(h+u*Cs(c));v&&(d=f?Es-1e-4:1e-4-Es,y=!0,9===n&&e.push("M",_,x));var b=Is(o+l*Ls(c+d)),w=Is(h+u*Cs(c+d));e.push("A",Is(l),Is(u),As(p*Ds),+y,+f,b,w);break;case Ms.Z:a="Z";break;case Ms.R:b=Is(i[n++]),w=Is(i[n++]);var S=Is(i[n++]),k=Is(i[n++]);e.push("M",b,w,"L",b+S,w,"L",b+S,w+k,"L",b,w+k,"L",b,w)}a&&e.push(a);for(var P=0;P<s;P++)e.push(Is(i[n++]))}return e.join(" ")}(r);n.indexOf("NaN")<0&&Fs(i,"d",n)}Ns(i,e,!1,t),Bs(i,t.transform),null!=e.text?Zs(t,t.getBoundingRect()):Gs(t)}},Us={brush:function(t){var e=t.style,i=e.image;if(i instanceof HTMLImageElement&&(i=i.src),i){var r=e.x||0,n=e.y||0,a=e.width,s=e.height,o=t.__svgEl;o||(o=Ps("image"),t.__svgEl=o),i!==t.__imageSrc&&(function(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink","href",i)}(o,0,i),t.__imageSrc=i),Fs(o,"width",a),Fs(o,"height",s),Fs(o,"x",r),Fs(o,"y",n),Bs(o,t.transform),null!=e.text?Zs(t,t.getBoundingRect()):Gs(t)}}},Vs={},Hs=new Ke,Ws={},Xs=[],Ys={left:"start",right:"end",center:"middle",middle:"middle"},Zs=function(t,e){var i=t.style,r=t.transform,n=t instanceof Sa||i.transformText;t.__dirty&&er(i);var a=i.text;if(null!=a&&(a+=""),gr(a,i)){null==a&&(a=""),!n&&r&&(Hs.copy(e),Hs.applyTransform(r),e=Hs);var s=t.__textSvgEl;s||(s=Ps("text"),t.__textSvgEl=s);var o=s.style,h=i.font||Ei,l=s.__computedFont;h!==s.__styleFont&&(o.font=s.__styleFont=h,l=s.__computedFont=o.font);var u=i.textPadding,c=i.textLineHeight,d=t.__textCotentBlock;d&&!t.__dirtyText||(d=t.__textCotentBlock=Xi(a,l,u,c,i.truncate));var p=d.outerHeight,f=d.lineHeight;lr(Ws,t,i,e);var g=Ws.baseX,v=Ws.baseY,m=Ws.textAlign||"left",y=Ws.textVerticalAlign;!function(t,e,i,r,n,a,s){It(Xs),e&&i&&Rt(Xs,i);var o=r.textRotation;if(n&&o){var h=r.textOrigin;"center"===h?(a=n.width/2+n.x,s=n.height/2+n.y):h&&(a=h[0]+n.x,s=h[1]+n.y),Xs[4]-=a,Xs[5]-=s,Nt(Xs,Xs,o),Xs[4]+=a,Xs[5]+=s}Bs(t,Xs)}(s,n,r,i,e,g,v);var _=g,x=Fi(v,p,y);u&&(_=function(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}(g,m,u),x+=u[0]),x+=f/2,Ns(s,i,!0,t);var b=d.canCacheByTextString,w=t.__tspanList||(t.__tspanList=[]),S=w.length;if(b&&t.__canCacheByTextString&&t.__text===a){if(t.__dirtyText&&S)for(var k=0;k<S;++k)qs(w[k],m,_,x+k*f)}else{t.__text=a,t.__canCacheByTextString=b;var P=d.lines,M=P.length;for(k=0;k<M;k++){var T=w[k],O=P[k];T?T.__zrText!==O&&(T.innerHTML="",T.appendChild(document.createTextNode(O))):(T=w[k]=Ps("tspan"),s.appendChild(T),T.appendChild(document.createTextNode(O))),qs(T,m,_,x+k*f)}if(M<S){for(;k<S;k++)s.removeChild(w[k]);w.length=M}}}};function qs(t,e,i,r){Fs(t,"dominant-baseline","middle"),Fs(t,"text-anchor",Ys[e]),Fs(t,"x",i),Fs(t,"y",r)}function Gs(t){t&&t.__textSvgEl&&(t.__textSvgEl.parentNode&&t.__textSvgEl.parentNode.removeChild(t.__textSvgEl),t.__textSvgEl=null,t.__tspanList=[],t.__text=null)}function Qs(){}function $s(t,e){for(var i=0,r=e.length,n=0,a=0;i<r;i++){var s=e[i];if(s.removed){for(o=[],h=a;h<a+s.count;h++)o.push(h);s.indices=o,a+=s.count}else{for(var o=[],h=n;h<n+s.count;h++)o.push(h);s.indices=o,n+=s.count,s.added||(a+=s.count)}}return e}Vs.drawRectText=Zs,Vs.brush=function(t){null!=t.style.text?Zs(t,!1):Gs(t)},Qs.prototype={diff:function(t,e,i){i=i||function(t,e){return t===e},this.equals=i;var r=this;t=t.slice();var n=(e=e.slice()).length,a=t.length,s=1,o=n+a,h=[{newPos:-1,components:[]}],l=this.extractCommon(h[0],e,t,0);if(h[0].newPos+1>=n&&a<=l+1){for(var u=[],c=0;c<e.length;c++)u.push(c);return[{indices:u,count:e.length}]}function d(){for(var i=-1*s;i<=s;i+=2){var o,l=h[i-1],u=h[i+1],c=(u?u.newPos:0)-i;l&&(h[i-1]=void 0);var d=l&&l.newPos+1<n,p=u&&0<=c&&c<a;if(d||p){if(!d||p&&l.newPos<u.newPos?(o={newPos:(f=u).newPos,components:f.components.slice(0)},r.pushComponent(o.components,void 0,!0)):((o=l).newPos++,r.pushComponent(o.components,!0,void 0)),c=r.extractCommon(o,e,t,i),o.newPos+1>=n&&a<=c+1)return $s(0,o.components);h[i]=o}else h[i]=void 0}var f;s++}for(;s<=o;){var p=d();if(p)return p}},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,s=t.newPos,o=s-r,h=0;s+1<n&&o+1<a&&this.equals(e[s+1],i[o+1]);)s++,o++,h++;return h&&t.components.push({count:h}),t.newPos=s,o},tokenize:function(t){return t.slice()},join:function(t){return t.slice()}};var Ks=new Qs;function Js(t,e,i,r,n){this._zrId=t,this._svgRoot=e,this._tagNames="string"==typeof i?[i]:i,this._markLabel=r,this._domName=n||"_dom",this.nextId=0}function to(t,e){Js.call(this,t,e,["linearGradient","radialGradient"],"__gradient_in_use__")}function eo(t,e){Js.call(this,t,e,"clipPath","__clippath_in_use__")}function io(t,e){Js.call(this,t,e,["filter"],"__filter_in_use__","_shadowDom")}function ro(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY||t.textShadowBlur||t.textShadowOffsetX||t.textShadowOffsetY)}function no(t){return parseInt(t,10)}function ao(t,e){return e&&t&&e.parentNode!==t}function so(t,e,i){if(ao(t,e)&&i){var r=i.nextSibling;r?t.insertBefore(e,r):t.appendChild(e)}}function oo(t,e){if(ao(t,e)){var i=t.firstChild;i?t.insertBefore(e,i):t.appendChild(e)}}function ho(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function lo(t){return t.__textSvgEl}function uo(t){return t.__svgEl}function co(t,e,i,r){this.root=t,this.storage=e,this._opts=i=m({},i||{});var n=Ps("svg");n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("version","1.1"),n.setAttribute("baseProfile","full"),n.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new to(r,n),this.clipPathManager=new eo(r,n),this.shadowManager=new io(r,n);var a=document.createElement("div");a.style.cssText="overflow:hidden;position:relative",this._svgRoot=n,this._viewport=a,t.appendChild(a),a.appendChild(n),this.resize(i.width,i.height),this._visibleList=[]}Js.prototype.createElement=Ps,Js.prototype.getDefs=function(t){var e=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?t?((i=e.insertBefore(this.createElement("defs"),e.firstChild)).contains||(i.contains=function(t){var e=i.children;if(!e)return!1;for(var r=e.length-1;0<=r;--r)if(e[r]===t)return!0;return!1}),i):null:i[0]},Js.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var r=this.add(t);r&&(t[this._domName]=r)}}},Js.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},Js.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},Js.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return P(this._tagNames,(function(i){var r=t.getElementsByTagName(i);e=e.concat([].slice.call(r))})),e},Js.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;P(t,(function(t){t[e._markLabel]="0"}))},Js.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},Js.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this.getDoms(),i=this;P(e,(function(e){"1"!==e[i._markLabel]&&t.removeChild(e)}))}},Js.prototype.getSvgProxy=function(t){return t instanceof aa?js:t instanceof _r?Us:t instanceof Sa?Vs:js},Js.prototype.getTextSvgElement=function(t){return t.__textSvgEl},Js.prototype.getSvgElement=function(t){return t.__svgEl},w(to,Js),to.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;P(["fill","stroke"],(function(r){if(e.style[r]&&("linear"===e.style[r].type||"radial"===e.style[r].type)){var n,a=e.style[r],s=i.getDefs(!0);a._dom?(n=a._dom,s.contains(a._dom)||i.addDom(n)):n=i.add(a),i.markUsed(e);var o=n.getAttribute("id");t.setAttribute(r,"url(#"+o+")")}}))}},to.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return Ue("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},to.prototype.update=function(t){var e=this;Js.prototype.update.call(this,t,(function(){var i=t.type,r=t._dom.tagName;"linear"===i&&"linearGradient"===r||"radial"===i&&"radialGradient"===r?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))}))},to.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void Ue("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,r=0,n=i.length;r<n;++r){var a=this.createElement("stop");a.setAttribute("offset",100*i[r].offset+"%");var s=i[r].color;if(s.indexOf(!1)){var o=ge(s)[3],h=me(s);a.setAttribute("stop-color","#"+h),a.setAttribute("stop-opacity",o)}else a.setAttribute("stop-color",i[r].color);e.appendChild(a)}t._dom=e},to.prototype.markUsed=function(t){if(t.style){var e=t.style.fill;e&&e._dom&&Js.prototype.markUsed.call(this,e._dom),(e=t.style.stroke)&&e._dom&&Js.prototype.markUsed.call(this,e._dom)}},w(eo,Js),eo.prototype.update=function(t){var e=this.getSvgElement(t);e&&this.updateDom(e,t.__clipPaths,!1);var i=this.getTextSvgElement(t);i&&this.updateDom(i,t.__clipPaths,!0),this.markUsed(t)},eo.prototype.updateDom=function(t,e,i){if(e&&0<e.length){var r,n,a=this.getDefs(!0),s=e[0],o=i?"_textDom":"_dom";s[o]?(n=s[o].getAttribute("id"),r=s[o],a.contains(r)||a.appendChild(r)):(n="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(r=this.createElement("clipPath")).setAttribute("id",n),a.appendChild(r),s[o]=r);var h=this.getSvgProxy(s);if(s.transform&&s.parent.invTransform&&!i){var l=Array.prototype.slice.call(s.transform);Bt(s.transform,s.parent.invTransform,s.transform),h.brush(s),s.transform=l}else h.brush(s);var u=this.getSvgElement(s);r.innerHTML="",r.appendChild(u.cloneNode()),t.setAttribute("clip-path","url(#"+n+")"),1<e.length&&this.updateDom(r,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},eo.prototype.markUsed=function(t){var e=this;t.__clipPaths&&P(t.__clipPaths,(function(t){t._dom&&Js.prototype.markUsed.call(e,t._dom),t._textDom&&Js.prototype.markUsed.call(e,t._textDom)}))},w(io,Js),io.prototype.addWithoutUpdate=function(t,e){if(e&&ro(e.style)){var i;e._shadowDom?(i=e._shadowDom,this.getDefs(!0).contains(e._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var r=i.getAttribute("id");t.style.filter="url(#"+r+")"}},io.prototype.add=function(t){var e=this.createElement("filter");return t._shadowDomId=t._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+t._shadowDomId),this.updateDom(t,e),this.addDom(e),e},io.prototype.update=function(t,e){if(ro(e.style)){var i=this;Js.prototype.update.call(this,e,(function(){i.updateDom(e,e._shadowDom)}))}else this.remove(t,e)},io.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(t),t.style.filter="")},io.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var r,n,a,s,o=t.style,h=t.scale&&t.scale[0]||1,l=t.scale&&t.scale[1]||1;if(o.shadowBlur||o.shadowOffsetX||o.shadowOffsetY)r=o.shadowOffsetX||0,n=o.shadowOffsetY||0,a=o.shadowBlur,s=o.shadowColor;else{if(!o.textShadowBlur)return void this.removeDom(e,o);r=o.textShadowOffsetX||0,n=o.textShadowOffsetY||0,a=o.textShadowBlur,s=o.textShadowColor}i.setAttribute("dx",r/h),i.setAttribute("dy",n/l),i.setAttribute("flood-color",s);var u=a/2/h+" "+a/2/l;i.setAttribute("stdDeviation",u),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),t._shadowDom=e},io.prototype.markUsed=function(t){t._shadowDom&&Js.prototype.markUsed.call(this,t._shadowDom)},co.prototype={constructor:co,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i,r=this._svgRoot,n=this._visibleList,a=t.length,s=[];for(e=0;e<a;e++){var o=t[e],h=(i=o)instanceof aa?js:i instanceof _r?Us:i instanceof Sa?Vs:js,l=uo(o)||lo(o);o.invisible||(o.__dirty&&(h&&h.brush(o),this.clipPathManager.update(o),o.style&&(this.gradientManager.update(o.style.fill),this.gradientManager.update(o.style.stroke),this.shadowManager.update(l,o)),o.__dirty=!1),s.push(o))}var u,c=function(t,e,i){return Ks.diff(t,e,void 0)}(n,s);for(e=0;e<c.length;e++)if((f=c[e]).removed)for(var d=0;d<f.count;d++){l=uo(o=n[f.indices[d]]);var p=lo(o);ho(r,l),ho(r,p)}for(e=0;e<c.length;e++){var f;if((f=c[e]).added)for(d=0;d<f.count;d++)l=uo(o=s[f.indices[d]]),p=lo(o),u?so(r,l,u):oo(r,l),l?so(r,p,l):u?so(r,p,u):oo(r,p),so(r,p,l),u=p||l||u,this.gradientManager.addWithoutUpdate(l||p,o),this.shadowManager.addWithoutUpdate(l||p,o),this.clipPathManager.markUsed(o);else if(!f.removed)for(d=0;d<f.count;d++)l=uo(o=s[f.indices[d]]),p=lo(o),l=uo(o),p=lo(o),this.gradientManager.markUsed(o),this.gradientManager.addWithoutUpdate(l||p,o),this.shadowManager.markUsed(o),this.shadowManager.addWithoutUpdate(l||p,o),this.clipPathManager.markUsed(o),p&&so(r,p,l),u=l||p||u}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=s},_getDefs:function(t){var e,i=this._svgRoot;return 0!==(e=this._svgRoot.getElementsByTagName("defs")).length?e[0]:t?((e=i.insertBefore(Ps("defs"),i.firstChild)).contains||(e.contains=function(t){var i=e.children;if(!i)return!1;for(var r=i.length-1;0<=r;--r)if(i[r]===t)return!0;return!1}),e):null},resize:function(t,e){var i=this._viewport;i.style.display="none";var r=this._opts;if(null!=t&&(r.width=t),null!=e&&(r.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var n=i.style;n.width=t+"px",n.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],r=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var s=this.root,o=document.defaultView.getComputedStyle(s);return(s[r]||no(o[i])||no(s.style[i]))-(no(o[n])||0)-(no(o[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},P(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(t){co.prototype[t]=function(t){return function(){Ue('In SVG mode painter not support method "'+t+'"')}}(t)})),Gr("svg",co);var po,fo="urn:schemas-microsoft-com:vml",go="undefined"==typeof window?null:window,vo=!1,mo=go&&go.document;function yo(t){return po(t)}if(mo&&!n.canvasSupported)try{mo.namespaces.zrvml||mo.namespaces.add("zrvml",fo),po=function(t){return mo.createElement("<zrvml:"+t+' class="zrvml">')}}catch(t){po=function(t){return mo.createElement("<"+t+' xmlns="'+fo+'" class="zrvml">')}}var _o,xo=Nn.CMD,bo=Math.round,wo=Math.sqrt,So=Math.abs,ko=Math.cos,Po=Math.sin,Mo=Math.max;if(!n.canvasSupported){var To=",",Oo="progid:DXImageTransform.Microsoft",Ao=21600,Co=Ao/2,Lo=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=Ao+","+Ao,t.coordorigin="0,0"},zo=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},Eo=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},Do=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},Io=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},Ro=pr,Bo=function(t,e,i){var r=ge(e);i=+i,isNaN(i)&&(i=1),r&&(t.color=zo(r[0],r[1],r[2]),t.opacity=i*r[3])},Fo=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 Da&&Do(t,a),a=a||yo(e),n?function(t,e,i){var r,n=e.fill;if(null!=n)if(n instanceof Da){var a,s=0,o=[0,0],h=0,l=1,u=i.getBoundingRect(),c=u.width,d=u.height;if("linear"===n.type){a="gradient";var p=i.transform,f=[n.x*c,n.y*d],g=[n.x2*c,n.y2*d];p&&(nt(f,f,p),nt(g,g,p));var v=g[0]-f[0],m=g[1]-f[1];(s=180*Math.atan2(v,m)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{a="gradientradial",f=[n.x*c,n.y*d],p=i.transform;var y=i.scale,_=c,x=d;o=[(f[0]-u.x)/_,(f[1]-u.y)/x],p&&nt(f,f,p),_/=y[0]*Ao,x/=y[1]*Ao;var b=Mo(_,x);h=0/b,l=2*n.r/b-h}var w=n.colorStops.slice();w.sort((function(t,e){return t.offset-e.offset}));for(var S=w.length,k=[],P=[],M=0;M<S;M++){var T=w[M],O=(r=ge(T.color),[zo(r[0],r[1],r[2]),r[3]]);P.push(T.offset*l+h+" "+O[0]),0!==M&&M!==S-1||k.push(O)}if(2<=S){var A=k[0][0],C=k[1][0],L=k[0][1]*e.opacity,z=k[1][1]*e.opacity;t.type=a,t.method="none",t.focus="100%",t.angle=s,t.color=A,t.color2=C,t.colors=P.join(","),t.opacity=z,t.opacity2=L}"radial"===a&&(t.focusposition=o.join(","))}else Bo(t,n,e.opacity)}(a,i,r):function(t,e){e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof Da||Bo(t,e.stroke,e.opacity)}(a,i),Eo(t,a)):(t[n?"filled":"stroked"]="false",Do(t,a))},No=[[],[],[]];aa.prototype.brushVML=function(t){var e=this.style,i=this._vmlEl;i||(i=yo("shape"),Lo(i),this._vmlEl=i),Fo(i,"fill",e,this),Fo(i,"stroke",e,this);var r=this.transform,n=null!=r,a=i.getElementsByTagName("stroke")[0];if(a){var s=e.lineWidth;if(n&&!e.strokeNoScale){var o=r[0]*r[3]-r[1]*r[2];s*=wo(So(o))}a.weight=s+"px"}var h=this.path||(this.path=new Nn);this.__dirtyPath&&(h.beginPath(),h.subPixelOptimize=!1,this.buildPath(h,this.shape),h.toStatic(),this.__dirtyPath=!1),i.path=function(t,e){var i,r,n,a,s,o,h=xo.M,l=xo.C,u=xo.L,c=xo.A,d=xo.Q,p=[],f=t.data,g=t.len();for(a=0;a<g;){switch(r="",i=0,n=f[a++]){case h:r=" m ",i=1,s=f[a++],o=f[a++],No[0][0]=s,No[0][1]=o;break;case u:r=" l ",i=1,s=f[a++],o=f[a++],No[0][0]=s,No[0][1]=o;break;case d:case l:r=" c ",i=3;var v,m,y=f[a++],_=f[a++],x=f[a++],b=f[a++];n===d?(x=((v=x)+2*y)/3,b=((m=b)+2*_)/3,y=(s+2*y)/3,_=(o+2*_)/3):(v=f[a++],m=f[a++]),No[0][0]=y,No[0][1]=_,No[1][0]=x,No[1][1]=b,s=No[2][0]=v,o=No[2][1]=m;break;case c:var w=0,S=0,k=1,P=1,M=0;e&&(w=e[4],S=e[5],k=wo(e[0]*e[0]+e[1]*e[1]),P=wo(e[2]*e[2]+e[3]*e[3]),M=Math.atan2(-e[1]/P,e[0]/k));var T=f[a++],O=f[a++],A=f[a++],C=f[a++],L=f[a++]+M,z=f[a++]+L+M;a++;var E=f[a++],D=T+ko(L)*A,I=O+Po(L)*C,R=(y=T+ko(z)*A,_=O+Po(z)*C,E?" wa ":" at ");Math.abs(D-y)<1e-4&&(.01<Math.abs(z-L)?E&&(D+=.0125):Math.abs(I-O)<1e-4?E&&D<T||!E&&T<D?_-=.0125:_+=.0125:E&&I<O||!E&&O<I?y+=.0125:y-=.0125),p.push(R,bo(((T-A)*k+w)*Ao-Co),To,bo(((O-C)*P+S)*Ao-Co),To,bo(((T+A)*k+w)*Ao-Co),To,bo(((O+C)*P+S)*Ao-Co),To,bo((D*k+w)*Ao-Co),To,bo((I*P+S)*Ao-Co),To,bo((y*k+w)*Ao-Co),To,bo((_*P+S)*Ao-Co)),s=y,o=_;break;case xo.R:var B=No[0],F=No[1];B[0]=f[a++],B[1]=f[a++],F[0]=B[0]+f[a++],F[1]=B[1]+f[a++],e&&(nt(B,B,e),nt(F,F,e)),B[0]=bo(B[0]*Ao-Co),F[0]=bo(F[0]*Ao-Co),B[1]=bo(B[1]*Ao-Co),F[1]=bo(F[1]*Ao-Co),p.push(" m ",B[0],To,B[1]," l ",F[0],To,B[1]," l ",F[0],To,F[1]," l ",B[0],To,F[1]);break;case xo.Z:p.push(" x ")}if(0<i){p.push(r);for(var N=0;N<i;N++){var j=No[N];e&&nt(j,j,e),p.push(bo(j[0]*Ao-Co),To,bo(j[1]*Ao-Co),N<i-1?To:"")}}}return p.join("")}(h,this.transform),i.style.zIndex=Io(this.zlevel,this.z,this.z2),Eo(t,i),null!=e.text?this.drawRectText(t,this.getBoundingRect()):this.removeRectText(t)},aa.prototype.onRemove=function(t){Do(t,this._vmlEl),this.removeRectText(t)},aa.prototype.onAdd=function(t){Eo(t,this._vmlEl),this.appendRectText(t)},_r.prototype.brushVML=function(t){var e,i,r=this.style,n=r.image;if(function(t){return"object"==typeof t&&t.tagName&&"IMG"===t.tagName.toUpperCase()}(n)){var a=n.src;if(a===this._imageSrc)e=this._imageWidth,i=this._imageHeight;else{var s=n.runtimeStyle,o=s.width,h=s.height;s.width="auto",s.height="auto",e=n.width,i=n.height,s.width=o,s.height=h,this._imageSrc=a,this._imageWidth=e,this._imageHeight=i}n=a}else n===this._imageSrc&&(e=this._imageWidth,i=this._imageHeight);if(n){var l=r.x||0,u=r.y||0,c=r.width,d=r.height,p=r.sWidth,f=r.sHeight,g=r.sx||0,v=r.sy||0,m=p&&f,y=this._vmlEl;y||(y=mo.createElement("div"),Lo(y),this._vmlEl=y);var _,x=y.style,b=!1,w=1,S=1;if(this.transform&&(_=this.transform,w=wo(_[0]*_[0]+_[1]*_[1]),S=wo(_[2]*_[2]+_[3]*_[3]),b=_[1]||_[2]),b){var k=[l,u],P=[l+c,u],M=[l,u+d],T=[l+c,u+d];nt(k,k,_),nt(P,P,_),nt(M,M,_),nt(T,T,_);var O=Mo(k[0],P[0],M[0],T[0]),A=Mo(k[1],P[1],M[1],T[1]),C=[];C.push("M11=",_[0]/w,To,"M12=",_[2]/S,To,"M21=",_[1]/w,To,"M22=",_[3]/S,To,"Dx=",bo(l*w+_[4]),To,"Dy=",bo(u*S+_[5])),x.padding="0 "+bo(O)+"px "+bo(A)+"px 0",x.filter=Oo+".Matrix("+C.join("")+", SizingMethod=clip)"}else _&&(l=l*w+_[4],u=u*S+_[5]),x.filter="",x.left=bo(l)+"px",x.top=bo(u)+"px";var L=this._imageEl,z=this._cropEl;L||(L=mo.createElement("div"),this._imageEl=L);var E=L.style;if(m){if(e&&i)E.width=bo(w*e*c/p)+"px",E.height=bo(S*i*d/f)+"px";else{var D=new Image,I=this;D.onload=function(){D.onload=null,e=D.width,i=D.height,E.width=bo(w*e*c/p)+"px",E.height=bo(S*i*d/f)+"px",I._imageWidth=e,I._imageHeight=i,I._imageSrc=n},D.src=n}z||((z=mo.createElement("div")).style.overflow="hidden",this._cropEl=z);var R=z.style;R.width=bo((c+g*c/p)*w),R.height=bo((d+v*d/f)*S),R.filter=Oo+".Matrix(Dx="+-g*c/p*w+",Dy="+-v*d/f*S+")",z.parentNode||y.appendChild(z),L.parentNode!==z&&z.appendChild(L)}else E.width=bo(w*c)+"px",E.height=bo(S*d)+"px",y.appendChild(L),z&&z.parentNode&&(y.removeChild(z),this._cropEl=null);var B="",F=r.opacity;F<1&&(B+=".Alpha(opacity="+bo(100*F)+") "),B+=Oo+".AlphaImageLoader(src="+n+", SizingMethod=scale)",E.filter=B,y.style.zIndex=Io(this.zlevel,this.z,this.z2),Eo(t,y),null!=r.text&&this.drawRectText(t,this.getBoundingRect())}},_r.prototype.onRemove=function(t){Do(t,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(t)},_r.prototype.onAdd=function(t){Eo(t,this._vmlEl),this.appendRectText(t)};var jo,Uo="normal",Vo={},Ho=0,Wo=document.createElement("div");_o=function(t,e){var i=mo;jo||((jo=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",mo.body.appendChild(jo));try{jo.style.font=e}catch(t){}return jo.innerHTML="",jo.appendChild(i.createTextNode(t)),{width:jo.offsetWidth}},Di.measureText=_o;for(var Xo=new Ke,Yo=function(t,e,i,r){var n=this.style;this.__dirty&&er(n);var a=n.text;if(null!=a&&(a+=""),a){if(n.rich){var s=Yi(a,n);a=[];for(var o=0;o<s.lines.length;o++){for(var h=s.lines[o].tokens,l=[],u=0;u<h.length;u++)l.push(h[u].text);a.push(l.join(""))}a=a.join("\n")}var c,d,p=n.textAlign,f=n.textVerticalAlign,g=function(t){var e=Vo[t];if(!e){100<Ho&&(Ho=0,Vo={});var i,r=Wo.style;try{r.font=t,i=r.fontFamily.split(",")[0]}catch(t){}e={style:r.fontStyle||Uo,variant:r.fontVariant||Uo,weight:r.fontWeight||Uo,size:0|parseFloat(r.fontSize||12),family:i||"Microsoft YaHei"},Vo[t]=e,Ho++}return e}(n.font),v=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||Ri(a,v,p,f,n.textPadding,n.textLineHeight);var m=this.transform;if(m&&!r&&(Xo.copy(e),Xo.applyTransform(m),e=Xo),r)c=e.x,d=e.y;else{var y=n.textPosition;if(y instanceof Array)c=e.x+Ro(y[0],e.width),d=e.y+Ro(y[1],e.height),p=p||"left";else{var _=this.calculateTextPosition?this.calculateTextPosition({},n,e):Ni({},n,e);c=_.x,d=_.y,p=p||_.textAlign,f=f||_.textVerticalAlign}}c=Bi(c,i.width,p),d=Fi(d,i.height,f),d+=i.height/2;var x,b,w,S=yo,k=this._textVmlEl;k?b=(x=(w=k.firstChild).nextSibling).nextSibling:(k=S("line"),x=S("path"),b=S("textpath"),w=S("skew"),b.style["v-text-align"]="left",Lo(k),x.textpathok=!0,b.on=!0,k.from="0 0",k.to="1000 0.05",Eo(k,w),Eo(k,x),Eo(k,b),this._textVmlEl=k);var P=[c,d],M=k.style;m&&r?(nt(P,P,m),w.on=!0,w.matrix=m[0].toFixed(3)+To+m[2].toFixed(3)+To+m[1].toFixed(3)+To+m[3].toFixed(3)+",0,0",w.offset=(bo(P[0])||0)+","+(bo(P[1])||0),w.origin="0 0",M.left="0px",M.top="0px"):(w.on=!1,M.left=bo(c)+"px",M.top=bo(d)+"px"),b.string=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")}(a);try{b.style.font=v}catch(t){}Fo(k,"fill",{fill:n.textFill,opacity:n.opacity},this),Fo(k,"stroke",{stroke:n.textStroke,opacity:n.opacity,lineDash:n.lineDash||null},this),k.style.zIndex=Io(this.zlevel,this.z,this.z2),Eo(t,k)}},Zo=function(t){Do(t,this._textVmlEl),this._textVmlEl=null},qo=function(t){Eo(t,this._textVmlEl)},Go=[vr,yr,_r,aa,Sa],Qo=0;Qo<Go.length;Qo++){var $o=Go[Qo].prototype;$o.drawRectText=Yo,$o.removeRectText=Zo,$o.appendRectText=qo}Sa.prototype.brushVML=function(t){var e=this.style;null!=e.text?this.drawRectText(t,{x:e.x||0,y:e.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(t)},Sa.prototype.onRemove=function(t){this.removeRectText(t)},Sa.prototype.onAdd=function(t){this.appendRectText(t)}}function Ko(t){return parseInt(t,10)}function Jo(t,e){!function(){if(!vo&&mo){vo=!0;var t=mo.styleSheets;t.length<31?mo.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}(),this.root=t,this.storage=e;var i=document.createElement("div"),r=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",r.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=r,this._vmlViewport=i,this.resize();var n=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){n.call(e,t),t&&t.onRemove&&t.onRemove(r)},e.addToStorage=function(t){t.onAdd&&t.onAdd(r),a.call(e,t)},this._firstPaint=!0}Jo.prototype={constructor:Jo,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0,!0);this._paintList(t)},_paintList:function(t){for(var e=this._vmlRoot,i=0;i<t.length;i++){var r=t[i];r.invisible||r.ignore?(r.__alreadyNotVisible||r.onRemove(e),r.__alreadyNotVisible=!0):(r.__alreadyNotVisible&&r.onAdd(e),r.__alreadyNotVisible=!1,r.__dirty&&(r.beforeBrush&&r.beforeBrush(),(r.brushVML||r.brush).call(r,e),r.afterBrush&&r.afterBrush())),r.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(e),this._firstPaint=!1)},resize:function(t,e){if(t=null==t?this._getWidth():t,e=null==e?this._getHeight():e,this._width!==t||this._height!==e){this._width=t,this._height=e;var i=this._vmlViewport.style;i.width=t+"px",i.height=e+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var t=this.root,e=t.currentStyle;return(t.clientWidth||Ko(e.width))-Ko(e.paddingLeft)-Ko(e.paddingRight)|0},_getHeight:function(){var t=this.root,e=t.currentStyle;return(t.clientHeight||Ko(e.height))-Ko(e.paddingTop)-Ko(e.paddingBottom)|0}},P(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(t){Jo.prototype[t]=function(t){return function(){Ue('In IE8.0 VML mode painter not support method "'+t+'"')}}(t)})),Gr("vml",Jo),t.version="4.2.0",t.init=function(t,i){var r=new Qr(e(),t,i);return qr[r.id]=r},t.dispose=function(t){if(t)t.dispose();else{for(var e in qr)qr.hasOwnProperty(e)&&qr[e].dispose();qr={}}return this},t.getInstance=function(t){return qr[t]},t.registerPainter=Gr,t.matrix=Vt,t.vector=ot,t.color=Se,t.path=wa,t.util=V,t.parseSVG=function(t,e){return(new Na).parse(t,e)},t.Group=Je,t.Path=aa,t.Image=_r,t.CompoundPath=Qa,t.Text=Sa,t.IncrementalDisplayable=$a,t.Arc=Ja,t.BezierCurve=ns,t.Circle=ka,t.Droplet=as,t.Ellipse=Aa,t.Heart=ss,t.Isogon=us,t.Line=La,t.Polygon=Ia,t.Polyline=Ra,t.Rect=Oa,t.Ring=cs,t.Rose=gs,t.Sector=ms,t.Star=bs,t.Trochoid=ks,t.LinearGradient=Ba,t.RadialGradient=is,t.Pattern=xi,t.BoundingRect=Ke}(e)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(11),n=i(12),a=i(13);e.Animations=class{constructor(t){this.fadeOffset=60,this.option=t}position(t){return{shape:{x:-t.width/2,y:-t.height/2}}}translate(t){return{position:[t.x,t.y]}}rotation(t){return{rotation:t.rotation}}scale(t){return t.parentShape?{style:{opacity:t.visible?t.style.opacity:0}}:{scale:t.visible?[1,1]:[0,0],style:{opacity:t.visible?t.style.opacity:0}}}fade(t){return{style:{opacity:t.visible?t.style.opacity:0}}}fadeTop(t){return{position:[t.x,t.visible?t.y:t.y-this.fadeOffset],style:{opacity:t.visible?t.style.opacity:0}}}fadeRight(t){return{position:[t.visible?t.x:t.x+this.fadeOffset,t.y],style:{opacity:t.visible?t.style.opacity:0}}}fadeBottom(t){return{position:[t.x,t.visible?t.y:t.y+this.fadeOffset],style:{opacity:t.visible?t.style.opacity:0}}}fadeLeft(t){return{position:[t.visible?t.x:t.x-this.fadeOffset,t.y],style:{opacity:t.visible?t.style.opacity:0}}}size(t){return t instanceof r.Rect?{shape:{width:t.width,height:t.height}}:t instanceof n.Isogon||t instanceof a.Circle?{shape:{r:t.width/2}}:{}}style(t){return t.style.text&&t.zrenderShape.attr("style",{text:t.style.text}),{style:t.style}}path(t){return{shape:{points:t.path}}}curve(t){return{shape:{x1:t.path[0][0],y1:t.path[0][1],x2:t.path[1][0],y2:t.path[1][1],cpx1:t.controlPoint[0],cpy1:t.controlPoint[1]}}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(0);e.OffScreen=class{constructor(t,e){this.zrenderShape=null,this.zrenderShape=new r.Renderer.zrender.Group,this.zrenderShape.shapeId=t,this.renderer=e}add(t,e){t.shapeId=e,t.copy=!0,this.zrenderShape.add(t)}remove(t){let e=this.zrenderShape.children();for(let i=0;i<e.length;i++)if(e[i].shapeId===t)return void this.zrenderShape.remove(e[i])}update(t,e,i){const r=n=>{for(let a=0;a<n.length;a++){let s=n[a];if(s.shapeId===t)return void this.updateAttributes(s,e,i);"function"==typeof s.children&&r(s.children())}};t===this.zrenderShape.shapeId?this.updateAttributes(this.zrenderShape,e,i):r(this.zrenderShape.children())}getBound(){let t=this.zrenderShape.getBoundingRect();return this.zrenderShape.updateTransform(),t.applyTransform(this.zrenderShape.transform),t}getNaiveBound(){return this.zrenderShape.getBoundingRect()}getShapeBound(t,e=!0){const i=r=>{for(let n=0;n<r.length;n++){let a=r[n];if(a.shapeId===t){let t=a.getBoundingRect();return e&&(a.updateTransform(),t.applyTransform(a.transform)),t}if(a.children){let t=i(a.children());if(t)return t}}};return i(this.zrenderShape.children())}getChildren(){return this.zrenderShape.children()}getZrenderShape(t){const e=i=>{for(let r=0;r<i.length;r++){let n=i[r];if(n.shapeId===t)return n;if("function"==typeof n.children){let t=e(n.children());if(t)return t}}};return e(this.zrenderShape.children())}getOffscreenShape(){return this.zrenderShape}getOrigin(){return this.zrenderShape.origin}getPosition(){return[this.zrenderShape.position[0],this.zrenderShape.position[1]]}getScale(){return this.zrenderShape.scale}clear(){this.zrenderShape.removeAll()}updateAttributes(t,e,i){"object"==typeof e?Object.keys(e).map(i=>{t.attr(i,e[i])}):t.attr(e,i)}updateOriginToCenter(){let t,e,[i,r]=this.zrenderShape.position,n=this.getNaiveBound();if(t=n.x+n.width/2,e=n.y+n.height/2,this.zrenderShape.attr("origin",[t,e]),void 0!==this.originX&&void 0!==this.originY){let n,a,[s,o]=this.zrenderShape.scale;n=(this.originX-t)*(1-s),a=(this.originY-e)*(1-o),this.zrenderShape.attr("position",[i+n,r+a])}this.originX=t,this.originY=e}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(8);var n;!function(t){t[t.ADD=0]="ADD",t[t.REMOVE=1]="REMOVE",t[t.POSITION=2]="POSITION",t[t.ROTATION=3]="ROTATION",t[t.SIZE=4]="SIZE",t[t.STYLE=5]="STYLE"}(n=e.patchType||(e.patchType={}));e.Reconciler=class{constructor(t){this.viewModel=t}reconcileStyle(t,e){let i=[];return Object.keys(e).map(r=>{e[r]!==t[r]&&i.push({name:r,old:t[r],new:e[r]})}),i}reconcileShape(t,e){let i=[];!1===t.isDirty&&!1===e.isDirty||(t instanceof r.PolyLine&&e instanceof r.PolyLine?JSON.stringify(t.prevPath)!==JSON.stringify(e.path)&&i.push({type:n.POSITION,newShape:e,oldShape:t}):t.prevX===e.x&&t.prevY===e.y||i.push({type:n.POSITION,newShape:e,oldShape:t}),t.prevRotation!==e.rotation&&i.push({type:n.ROTATION,newShape:e,oldShape:t}),t.prevWidth===e.width&&t.prevHeight===e.height||i.push({type:n.SIZE,newShape:e,oldShape:t}),this.reconcileStyle(t.prevStyle,e.style).length&&i.push({type:n.STYLE,newShape:e,oldShape:t}),this.patch(i))}reconcileShapeList(t,e){let i=[];for(let r=0;r<e.length;r++){let a=e[r],s=a.name;if(void 0===t[s])i.push({type:n.ADD,newShape:a,oldShape:null});else{let e=t[s].find(t=>t.id===a.id);e?(e.visited=!0,this.reconcileShape(e,a)):i.push({type:n.ADD,newShape:a,oldShape:null})}}Object.keys(t).forEach(e=>{t[e].forEach(t=>{!1===t.visited&&i.push({type:n.REMOVE,newShape:null,oldShape:t})})}),this.patch(i)}patch(t){let e,i,a,s;for(s=0;s<t.length;s++){switch(e=t[s],i=e.newShape,a=e.oldShape,e.type){case n.ADD:this.viewModel.addShape(i);break;case n.REMOVE:this.viewModel.removeShape(a);break;case n.POSITION:i instanceof r.PolyLine&&a instanceof r.PolyLine?(a.prevPath=i.path,a.updateZrenderShape("path")):(a.prevX=i.x,a.prevY=i.y,a.updateZrenderShape("translate"));break;case n.ROTATION:a.prevRotation=i.rotation,a.updateZrenderShape("rotation");break;case n.SIZE:a.prevWidth=i.width,a.prevHeight=i.height,a.updateSize(),a.updateZrenderShape("size");break;case n.STYLE:a.prevStyle=JSON.parse(JSON.stringify(i.style)),a.updateZrenderShape("style")}a&&a.element&&a.element.onChange(e.type)}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(9),n=i(1),a=i(23),s=i(24);e.DataModel=class{constructor(t,e){this.engine=t,this.elementList=[],this.elementContainer={},this.skipLayoutElementIds=[],this.engine=t,this.viewModel=e,this.linkModel=new a.LinkModel(this,e,this.engine.viewOption.link),this.pointerModel=new s.PointerModel(this,e,this.engine.viewOption.pointer)}constructElements(t){Array.isArray(t)?(this.elementContainer.element=[],t.map(t=>{t&&this.elementContainer.element.push(this.createElement(t,"element"))})):Object.keys(t).map(e=>{this.elementContainer[e]=[],t[e].map(t=>{t&&this.elementContainer[e].push(this.createElement(t,e))})}),this.linkModel.constructLinks(this.engine.structOption.link,this.elementContainer,this.elementList),this.pointerModel.constructPointers(this.engine.structOption.pointer,this.elementList)}layoutElements(t,e,i){let r=this.elementContainer;1===Object.keys(r).length&&r.element&&(r=r.element),t(r,e,i);for(let t=0;t<this.elementList.length;t++){let e=this.elementList[t];this.skipLayoutElementIds.find(t=>t===e.elementId)&&(e.x=e.shape.prevX,e.y=e.shape.prevY),e.lastX=e.x,e.lastY=e.y}this.linkModel.drawLinks(),this.pointerModel.drawPointers()}updateShapes(t=[]){let e=t.length?t:this.elementList;for(let t=0;t<e.length;t++){let i=e[t],r=i.shape;if(!i.isObsolete){i.isDragged&&this.skipLayoutElementIds.push(i.elementId),r.x=i.x,r.y=i.y,r.width=i.width,r.height=i.height,r.rotation=i.rotation,r.style=i.style,r.isDirty=!0;for(let t=0;t<i.effectLinks.length;t++){let e=i.effectLinks[t];this.linkModel.updateLinkPos(e,i),e.linkShape.isDirty=!0,e.labelShape&&(e.labelShape.isDirty=!0)}if(i.effectRefer){let t=i.effectRefer;this.pointerModel.updateReferPos(t),t.pointerShape.isDirty=!0,t.labelShapes.forEach(t=>{t.isDirty=!0}),t.commaShapes.forEach(t=>{t.isDirty=!0})}i.lastX=i.x,i.lastY=i.y}}}getElements(){return this.elementContainer}getElementList(){return this.elementList}createElement(t,e){let i=this.engine.structOption.element,a=e+"#"+t.id,s=null,o=null,h=this.engine.viewOption;s="object"==typeof i?i[e]:i,void 0===s&&(s=r.Element),o=new s(t),o.elementId=a,o.name=e;let l=null,u=null,c=null,d=null;return l=h.element,void 0===l.shape&&(l=l[o.name]),c=l.shape,n.Util.assert(void 0===c,`(${e}) 未指定 shape!`),u=Array.isArray(l.content)?l.content.map(t=>this.parserElementContent(o,t)):this.parserElementContent(o,l.content),d=this.viewModel.createShape(o.elementId,c,Object.assign(Object.assign({},l),{content:u})),o.shape=d,o.width=d.width,o.height=d.height,o.rotation=d.rotation,o.style=d.style,o.layoutOption=h.layout,d.element=o,this.elementList.push(o),o}parserElementContent(t,e){if(e){let i=n.Util.textParser(e);if(Array.isArray(i)){i.map(e=>t[e]).map((t,r)=>{e=e.replace("["+i[r]+"]",t)})}return e}e=null}addLink(t,e,i,r=null,n=null){t[i]&&!Array.isArray(t[i])?t[i]=[t[i],e]:t[i]&&Array.isArray(t[i])?t[i].push(e):t[i]=e,this.linkModel.addLinkPair({element:t,target:e,linkName:i,label:r?r.toString():null,anchorPair:n,sourceLinkTarget:null})}addPointer(t,e,i){this.pointerModel.addPointerPair(t,e,i)}resetData(){this.elementList.forEach(t=>{t.isObsolete=!0}),this.elementList.length=0,this.elementContainer={},this.linkModel.clear(),this.pointerModel.clear()}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(1),n=i(4),a=i(3);e.LinkModel=class{constructor(t,e,i){this.lastLinkPairs=[],this.linkPairs=[],this.labelList=[],this.labelAvoidLevel=2,this.dataModel=t,this.viewModel=e,this.linkOptions=i}constructLinks(t,e,i){0!==t.length&&(t.forEach(t=>{for(let r=0;r<i.length;r++){let n=i[r],a=n[t],s=this.linkOptions[t].label,o=null;null!=a&&(Array.isArray(a)?n[t]=[...a].map((i,r)=>(o=this.fetchTargetElements(e,n,i),this.addLinkPair({element:n,target:o,linkName:t,anchorPair:null,label:s,index:r,sourceLinkTarget:i}),o)):(o=this.fetchTargetElements(e,n,a),this.addLinkPair({element:n,target:o,linkName:t,anchorPair:null,label:s,sourceLinkTarget:a}),n[t]=o))}}),this.applyCanceledLink(i),this.lastLinkPairs=this.linkPairs)}addLinkPair(t){if(null===t.target)return;let{element:e,target:i,linkName:r,label:n,index:a,anchorPair:s,sourceLinkTarget:o}=t,h={id:`${e.elementId}-${i.elementId}`,linkName:r,linkShape:null,element:e,target:i,anchorPair:s,anchorPosPair:null,label:n,labelShape:null,index:a,linkShapeStyle:{},sourceLinkTarget:o};this.linkPairs.push(h),e.effectLinks.push(h),i.effectLinks.push(h),e.onLinkTo(i,{style:h.linkShapeStyle,name:r,index:a,label:n}),i.onLinkFrom(e,{style:h.linkShapeStyle,name:r,index:a,label:n})}drawLinks(){for(let t=0;t<this.linkPairs.length;t++){let e,i,n=this.linkPairs[t],{id:a,element:s,target:o,linkName:h,anchorPair:l,index:u,linkShapeStyle:c}=n,d=this.linkOptions[h],p=null,f=null;n.label=this.labelSolver(n.label,n.sourceLinkTarget),n.label&&(f=this.viewModel.createShape(`${s.elementId}-${o.elementId}-label`,"text",{show:d.show,content:n.label,style:d.labelStyle}),this.labelList.push(f),n.labelShape=f),p=this.viewModel.createShape(a,"line",d),r.Util.extends(p.style,c),null==l&&(l=this.getAnchorPair(s,o,h,u)),(!l||void 0!==l[0]&&void 0!==l[1])&&(l?(e=this.getAnchorPos(s,l[0]),i=this.getAnchorPos(o,l[1])):[e,i]=this.getDynamicAnchorPos(s,o),[e,i]=this.anchorAvoid([e,i]),p.start.x=e[0],p.start.y=e[1],p.end.x=i[0],p.end.y=i[1],n.linkShape=p,n.anchorPosPair=[e,i],n.anchorPair=l)}}updateLinkPos(t,e){let i=t.element,r=t.target,n=t.linkShape,a=t.labelShape,s=0,o=0;if(t.anchorPair)t.element===e&&(s=i.x-i.lastX,o=i.y-i.lastY,n.start.x+=s,n.start.y+=o),t.target===e&&(s=r.x-r.lastX,o=r.y-r.lastY,n.end.x+=s,n.end.y+=o);else{let[t,e]=this.getDynamicAnchorPos(i,r);n.start.x=t[0],n.start.y=t[1],n.end.x=e[0],n.end.y=e[1]}a&&!1===a.isDirty&&this.labelAvoid(a,n,[0,1],0)}fetchTargetElements(t,e,i){let r=t[e.name],n=null;return null==i?null:"object"!=typeof i||Array.isArray(i)?(n=r.find(t=>t.id===i),n||null):(r=t[i.element||e.name],void 0===r?Array.isArray(i)?Array.from(new Array(i.length)).map(t=>null):null:(n=r.find(t=>t.id===i.target),n||null))}getAnchorPair(t,e,i,r){let n=this.contactSolver(this.linkOptions[i].contact,r);return n?[this.getElementAnchor(t,n[0]),this.getElementAnchor(e,n[1])]:null}contactSolver(t,e){return t?Array.isArray(t[0])?void 0===e?t[0]:t[e]:"function"==typeof t&&void 0!==e?t(e):t:null}anchorAvoid(t){let e=this.linkPairs.find(e=>!!e.anchorPosPair&&(e.anchorPosPair[0].toString()===t[1].toString()&&e.anchorPosPair[1].toString()===t[0].toString()));if(e){let i=a.Vector.tangent(a.Vector.subtract(t[1],t[0])),r=a.Vector.tangent(a.Vector.subtract(e.anchorPosPair[1],e.anchorPosPair[0])),n=-6,s=[a.Vector.location(t[0],i,n),a.Vector.location(t[1],i,n)],o=[a.Vector.location(e.anchorPosPair[0],r,n),a.Vector.location(e.anchorPosPair[1],r,n)];return e.linkShape.start.x=o[0][0],e.linkShape.start.y=o[0][1],e.linkShape.end.x=o[1][0],e.linkShape.end.y=o[1][1],e.anchorPosPair=o,s}return t}labelSolver(t,e){if(!t)return null;if(t&&null===e)return t;let i=t,n=r.Util.textParser(t);if(Array.isArray(n)){let t=n.map(t=>{let i=e[t];return void 0===i?null:i});for(let e=0;e<t.length;e++){if(null===t[e])return null;i=i.replace("["+n[e]+"]",t[e])}return i}return n}labelAvoid(t,e,i,r){let a,s,o,h=!1;for(a=(i[1]+i[0])/2,s=e.pointAt(a),t.x=s[0]-t.width,t.y=s[1]-t.height,o=0;o<this.labelList.length;o++)if(t!==this.labelList[o]&&n.Bound.isOverlap(t.getBound(),this.labelList[o].getBound())){h=!0;break}if(h&&r<=this.labelAvoidLevel){let n=[i[0],a],s=[a,i[1]],o=this.labelAvoid(t,e,n,r+1);return o||(o=this.labelAvoid(t,e,s,r+1)),o}return!0}getElementAnchor(t,e){let i=t.anchors,r=t.shape.defaultAnchors(t.shape.getBaseAnchors(),t.shape.width,t.shape.height);return i&&Object.keys(i).map(t=>{r[t]=i[t]}),r[e]}getDynamicAnchorPos(t,e){let i=[t.x,t.y],r=(t.width>t.height?t.width:t.height)/2,n=[e.x,e.y],s=(e.width>e.height?e.width:e.height)/2,o=a.Vector.subtract(i,n);return[a.Vector.location(i,a.Vector.negative(o),r),a.Vector.location(n,o,s)]}getAnchorPos(t,e){let i=t.x,n=t.y,a=t.shape.width/2,s=t.shape.height/2;return r.Util.anchor2position(i,n,2*a,2*s,t.rotation,e)}applyCanceledLink(t){if(0===this.lastLinkPairs.length)return;let e,i=this.lastLinkPairs.length;for(let r=0;r<i;r++)if(e=this.lastLinkPairs[r],void 0===this.linkPairs.find(t=>t.id===e.id)){let i=t.find(t=>t.elementId===e.element.elementId),r=t.find(t=>t.elementId===e.target.elementId);i&&i.onUnlinkTo(e.linkName),r&&r.onUnlinkFrom(e.linkName)}}clear(){this.linkPairs=[],this.labelList.length=0}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(1);e.PointerModel=class{constructor(t,e,i){this.lastPointerPairs=[],this.pointerPairs=[],this.dataModel=t,this.viewModel=e,this.pointerOptions=i}constructPointers(t,e){0!==t.length&&(t.forEach(t=>{for(let i=0;i<e.length;i++){let r=e[i];r[t]&&this.addPointerPair(r,t,r[t])}}),this.applyCanceledRefer(e),this.lastPointerPairs=this.pointerPairs)}addPointerPair(t,e,i){if(Array.isArray(i)){const r=i.map(i=>{let r={id:e+"#"+i,pointerShape:null,label:i,labelShapes:[],commaShapes:[],target:t,pointerName:e,branchPairs:null,masterPair:null,pointerShapeStyle:{}};return t.onRefer(r.pointerShapeStyle,e,i),r});let n=r.shift();r.map(t=>t.masterPair=n),n.branchPairs=r,n.pointerShape=null,this.pointerPairs.push(n,...r),t.effectRefer=n}else{let r={id:e+"#"+i,pointerShape:null,label:i,labelShapes:[],commaShapes:[],target:t,pointerName:e,branchPairs:null,masterPair:null,pointerShapeStyle:{}};this.pointerPairs.push(r),t.effectRefer=r,t.onRefer(r.pointerShapeStyle,e,i)}}drawPointers(){const t={top:(t,e,i)=>[0,-e/2-i],right:(t,e,i)=>[t/2+i,0],bottom:(t,e,i)=>[0,e/2+i],left:(t,e,i)=>[-t/2-i,0]};for(let e=0;e<this.pointerPairs.length;e++){let i=this.pointerPairs[e],{id:n,target:a,pointerName:s,label:o}=i,h=this.pointerOptions[s],{labelInterval:l,offset:u,length:c,position:d,labelStyle:p,show:f}=h,g=null,v=[];if(i.masterPair)continue;let m=a.x,y=a.y,_=a.width,x=a.height,b=a.rotation,w=t[d],S=r.Util.anchor2position(m,y,_,x,b,w,u+c),k=r.Util.anchor2position(m,y,_,x,b,w,u);g=this.viewModel.createShape(n,"line",this.pointerOptions[s]),g.start.x=S[0],g.start.y=S[1],g.end.x=k[0],g.end.y=k[1],r.Util.extends(g.style,i.pointerShapeStyle),i.pointerShape=g,v.push(this.viewModel.createShape(s+"-"+o+"-text","text",{style:p,content:o,show:f})),i.branchPairs&&v.push(...i.branchPairs.map(t=>this.viewModel.createShape(s+"-"+t.label+"-text","text",{style:p,content:t.label,show:f})));let P=0;v.map((t,e)=>{let r="left"===d?-1:1,n=0===e?g.style.lineWidth+4:l;t.y=S[1],t.x=S[0]+r*(P+n),P=P+t.width+n,e>0&&h.showComma&&i.commaShapes.push(this.drawComma(t,h))}),i.labelShapes=v}}drawComma(t,e){let i=t.id+"-comma",r=this.viewModel.createShape(i,"text",{content:",",show:e.show,style:Object.assign(Object.assign({},e.labelStyle),{textBackgroundColor:"transparent",textFill:"#000",textPadding:[0,0,0,0],fontSize:20})}),n=r.style.fontSize;return r.x=t.x-e.labelInterval/2-n/8,r.y=t.y+t.height/2-n/2,r}updateReferPos(t){if(t.masterPair)return;let e=t.pointerShape,i=t.labelShapes,r=t.target,n=t.commaShapes,a=r.x-r.lastX,s=r.y-r.lastY;e.start.x+=a,e.start.y+=s,e.end.x+=a,e.end.y+=s,i.map(t=>{t.x+=a,t.y+=s}),n.map(t=>{t.x+=a,t.y+=s})}applyCanceledRefer(t){if(0===this.lastPointerPairs.length)return;let e,i=this.lastPointerPairs.length;for(let r=0;r<i;r++)if(e=this.lastPointerPairs[r],void 0===this.pointerPairs.find(t=>t.id===e.id)){let i=t.find(t=>t.elementId===e.target.elementId);i&&i.onUnrefer(e.pointerName)}}clear(){this.pointerPairs=[]}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.DefaultLinkOption=class{constructor(){this.markers=null,this.curveness=0,this.contact=null,this.label=null,this.style={fill:"#000",lineWidth:2},this.labelStyle={textBackgroundColor:"rgba(0, 0, 0, 1)",textFill:"#fff"},this.show="scale"}};e.DefaultPointerOption=class{constructor(){this.length=30,this.offset=15,this.labelInterval=10,this.position="top",this.markers="arrow",this.labelStyle={textBackgroundColor:"rgba(0, 0, 0, 1)",textFill:"#fff",textPadding:[4,4,4,4]},this.style={fill:"#666",lineWidth:4},this.showComma=!0,this.show="scale"}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(1),n=i(4),a=i(3);class s{constructor(...t){this.elements=[],this.elementId=r.Util.generateId(),t&&this.add(...t)}add(...t){t.map(t=>{this.elements.push(t)})}remove(t){r.Util.removeFromList(this.elements,e=>e.elementId===t.elementId)}getBound(){return n.Bound.union(...this.elements.map(t=>t.getBound()))}getWidth(){return this.getBound().width}getHeight(){return this.getBound().height}translate(t,e){this.elements.map(i=>{i instanceof s?i.translate(t,e):(i.x+=t,i.y+=e)})}rotate(t,e){if(0===t)return;let{x:i,y:r,width:n,height:o}=this.getBound(),h=i+n/2,l=r+o/2;e&&(h=e[0],l=e[1]),this.elements.map(e=>{if(e instanceof s)e.rotate(t,[h,l]);else{let i=a.Vector.rotation(t,[e.x,e.y],[h,l]);e.x=i[0],e.y=i[1],e.rotation=t}})}clear(){this.elements.length=0}}e.Group=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SourcesProxy=class{constructor(t){this.revocableObject=null,this.updateEngineRequest=0,this.updateEngineDelayCount=0,this.engine=t}proxy(t){return Object.keys(t).map(e=>{"object"==typeof t[e]&&null!==t[e]&&(t[e]=this.proxy(t[e]))}),this.revocableObject=Proxy.revocable(t,{set:(t,e,i)=>(this.updateEngineRequest++,this.updateEngine(),Reflect.set(t,e,i)),deleteProperty:(t,e)=>(this.updateEngineRequest++,this.updateEngine(),Reflect.deleteProperty(t,e)),defineProperty:(t,e,i)=>(this.updateEngineRequest++,this.updateEngine(),Reflect.defineProperty(t,e,i))}),this.revocableObject.proxy}revoke(t){this.revocableObject.revoke(t)}updateEngine(){requestAnimationFrame(()=>{this.updateEngineDelayCount++,this.updateEngineDelayCount===this.updateEngineRequest&&(this.engine.source(this.engine.proxySources,!0),this.updateEngineRequest=this.updateEngineDelayCount=0)})}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(29),n=i(30),a=i(31),s=i(32),o=i(33);e.InteractionModel=class{constructor(t){this.interactionConstructorMap={zoomView:r.Zoom,moveView:n.Move,drag:a.Drag,focus:s.Focus,frameSelect:o.Zone},this.interactionMap={},this.dataStore={selectedElements:null},this.engine=t}applyInteractions(t){Object.keys(t).map(e=>{if(void 0===this.interactionMap[e]){if(!t[e])return;let i=this.interactionConstructorMap[e];if(void 0===i)return;let r=new i(e,this,this.engine);this.interactionMap[e]=r,r.setOptionVal(t[e]),r.init()}else this.interactionMap[e].setOptionVal(t[e]),this.interactionMap[e].update(),t[e]?this.interactionMap[e].toggleEnable(!0):this.interactionMap[e].toggleEnable(!1)})}getInteraction(t){return this.interactionMap[t]}trigger(t,e){this.interactionMap[t]&&this.interactionMap[t].isEnable&&this.interactionMap[t].trigger(e)}handler(t,e){if(!1===this.engine.isViewUpdating()&&this.interactionMap[t]&&this.interactionMap[t].isEnable){let i=this.interactionMap[t].handler(e);if(!1===i||void 0===i)return;this.engine.updateElement(Array.isArray(i)?i:[],!1)}}finish(t,e){this.interactionMap[t]&&this.interactionMap[t].isEnable&&this.interactionMap[t].finish(e)}getData(t){return this.dataStore[t]}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(6),n=i(1),a=i(0);class s extends r.Interaction{constructor(){super(...arguments),this.zoomDelta=.25,this.maxZoomValue=4,this.minZoomValue=.25}init(){let t=this.optionValue,e=this.renderer.getContainer();Array.isArray(t)&&this.clampZoomRange(t),e.addEventListener("mousewheel",t=>this.emitTrigger(t))}update(){let t=this.optionValue;Array.isArray(t)&&this.clampZoomRange(t)}handler(t){if(this.getData("moving"))return;let e=this.renderer.getGlobalShape(),[i,r]=e.getScale();return i+=t*this.zoomDelta,r+=t*this.zoomDelta,i=n.Util.clamp(i,this.maxZoomValue,this.minZoomValue),r=n.Util.clamp(r,this.maxZoomValue,this.minZoomValue),i!==this.minZoomValue&&i!==this.maxZoomValue&&r!==this.minZoomValue&&r!==this.maxZoomValue?(e.scale(i,r,a.zrenderUpdateType.TICK),this.renderer.toggleAutoScale(!1),!0):void 0}trigger(t){this.emitHandler(t.wheelDelta>0?1:-1)}triggerCondition(){return!this.getData("enableFrameSelect")}clampZoomRange(t){this.minZoomValue=t[0],this.maxZoomValue=t[1],this.minZoomValue=n.Util.clamp(this.minZoomValue,0,1/0),this.maxZoomValue=n.Util.clamp(this.maxZoomValue,0,1/0)}}e.Zoom=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(6),n=i(0);class a extends r.Interaction{constructor(){super(...arguments),this.enableMove=!1}init(){this.container=this.renderer.getContainer(),this.container.addEventListener("mousedown",t=>this.emitTrigger(t)),this.container.addEventListener("mousemove",t=>this.emitHandler(t)),this.container.addEventListener("mouseup",()=>this.emitFinish()),this.container.addEventListener("mouseleave",()=>this.emitFinish())}trigger(t){this.globalShape=this.renderer.getGlobalShape(),this.curX=t.clientX,this.curY=t.clientY,this.moveFactorX=1,this.moveFactorY=1,this.enableMove=!0,this.setData("moving",!0)}handler(t){if(!1===this.enableMove)return;let e=t.clientX,i=t.clientY,r=(e-this.curX)*this.moveFactorX,a=(i-this.curY)*this.moveFactorY;return this.curX=e,this.curY=i,this.globalShape.translate(r,a,n.zrenderUpdateType.TICK),!0}finish(){this.enableMove&&(this.enableMove=!1,this.renderer.toggleAutoPosition(!1),this.setData("moving",!1))}triggerCondition(){return!this.getData("dragging")&&!this.getData("enableFrameSelect")}}e.Move=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(6);class n extends r.Interaction{constructor(){super(...arguments),this.draggableShapes={},this.curDraggableShapes=[]}init(){let t=this.renderer.getContainer();this.zr.on("mousedown",t=>this.emitTrigger(t)),t.addEventListener("mousemove",t=>{let e=t.offsetX,i=t.offsetY;this.emitHandler({x:e,y:i})}),this.zr.on("mouseup",()=>this.emitFinish()),this.globalShape=this.renderer.getGlobalShape()}trigger(t){let e=t.offsetX,i=t.offsetY,r=this.optionValue,n=this.getData("selectedElements"),a=[];if(n)a=Array.isArray(r)?n.filter(t=>r.find(e=>e===t.name)):n;else{let e=t.topTarget,i=e?e.svShape.element:null;if(null==e||null===i)return;if(Array.isArray(r)&&void 0===r.find(t=>t===i.name))return;a=[i]}a.forEach(t=>{void 0===this.draggableShapes[t.elementId]&&(this.draggableShapes[t.elementId]={lastX:0,lastY:0,element:null}),t.isDragged=!0,this.draggableShapes[t.elementId].lastX=e,this.draggableShapes[t.elementId].lastY=i,this.draggableShapes[t.elementId].element=t,this.curDraggableShapes.push(this.draggableShapes[t.elementId])}),this.setData("dragging",!0)}handler(t){if(!this.getData("dragging"))return;let e=t.x,i=t.y,r=this.globalShape.getScale();for(let t=0;t<this.curDraggableShapes.length;t++){let n=this.curDraggableShapes[t],a=e-n.lastX,s=i-n.lastY,o=n.element;o.x+=a/r[0],o.y+=s/r[1],o.isDragged=!0,n.lastX=e,n.lastY=i}return this.curDraggableShapes.map(t=>t.element)}finish(){this.curDraggableShapes.length=0,this.setData("dragging",!1),this.renderer.toggleAutoScale(!1),this.renderer.toggleAutoPosition(!1)}triggerCondition(){return!this.getData("enableFrameSelect")}getDraggableZrenderShape(t,e){let i=[];return!0===e?i=t:t.forEach(t=>{e.find(e=>e===t.name)&&i.push(t)}),i.map(t=>t.shape.zrenderShape)}}e.Drag=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(6),n=i(1);class a extends r.Interaction{constructor(){super(...arguments),this.lastFocusElements=[],this.curFocusElements=[]}init(){this.zr.on("mousedown",t=>this.emitTrigger(t))}trigger(t){let e=this.getData("selectedElements");if(e)this.emitHandler(e);else{let e=t.target,i=e?e.svShape.element:null;if(void 0===e){if(0===this.curFocusElements.length)return;return void this.emitHandler(null)}if(null===i)return;if(this.lastFocusElements.length&&this.lastFocusElements.find(t=>t.element.elementId===i.elementId))return;this.emitHandler([i])}}handler(t){let e=[];if(null===t)return e=this.curFocusElements,this.restoreLast(e),this.curFocusElements=[],this.lastFocusElements=[],e.map(t=>t.element);{let e=[];return this.lastFocusElements.length&&(this.restoreLast(this.lastFocusElements),e.push(...this.lastFocusElements)),this.curFocusElements=[],t.forEach(t=>{let e=this.optionValue;this.curFocusElements.push({element:t,originStyle:JSON.stringify(t.style)}),n.Util.merge(t.style,e)}),this.lastFocusElements=this.curFocusElements,e.push(...this.curFocusElements),e.map(t=>t.element)}}triggerCondition(){return!this.getData("enableFrameSelect")}restoreLast(t){t.forEach(t=>{t.element.style=JSON.parse(t.originStyle)})}}e.Focus=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(6),n=i(0);class a extends r.Interaction{constructor(){super(...arguments),this.selectRect=null,this.finishSizing=!1,this.frameSelecting=!1,this.enableMoveRect=!1}init(){let t=this.renderer.getContainer();t.addEventListener("mousedown",t=>this.emitTrigger(t)),t.addEventListener("mousemove",t=>this.emitHandler(t)),t.addEventListener("mouseup",()=>this.emitFinish()),this.globalShape=this.renderer.getGlobalShape(),this.selectRect=new n.Renderer.zrender.Rect({position:[0,0],shape:{x:0,y:0,width:0,height:0},style:this.optionValue,z:2}),this.renderer.getZrender().add(this.selectRect),this.selectRect.hide(),this.setData("enableFrameSelect",!0)}update(){!1===this.optionValue||void 0===this.optionValue?(this.restoreSelect(),this.setData("enableFrameSelect",!1)):this.setData("enableFrameSelect",!0)}trigger(t){let e=t.offsetX,i=t.offsetY;if(this.finishSizing){if(this.selectRect.contain(e,i))return this.lastRectX=e,this.lastRectY=i,this.enableMoveRect=!0,void this.interactionModel.trigger("drag",{offsetX:e,offsetY:i});this.restoreSelect()}this.selectRect.attr("shape",{x:e,y:i}),this.selectRect.attr("style",this.optionValue),this.downX=e,this.downY=i,this.selectRect.show(),this.frameSelecting=!0}handler(t){if(!this.frameSelecting)return;let e=t.offsetX,i=t.offsetY;if(this.finishSizing)this.moveRect(e,i);else{let t=e-this.downX,r=i-this.downY;this.selectRect.attr("shape",{width:t,height:r})}return!1}finish(){if(this.getData("enableFrameSelect")){if(this.frameSelecting){if(!1===this.finishSizing){let t=this.calcSelectedElements();this.finishSizing=!0,this.setData("selectedElements",t),this.interactionModel.trigger("focus")}}else this.finishSizing=!1;this.enableMoveRect&&(this.enableMoveRect=!1)}}moveRect(t,e){if(!this.enableMoveRect)return;let i=t-this.lastRectX,r=e-this.lastRectY,n=this.selectRect.shape.x,a=this.selectRect.shape.y;this.lastRectX=t,this.lastRectY=e,this.selectRect.attr("shape",{x:n+i,y:a+r}),this.interactionModel.handler("drag",{x:t,y:e})}restoreSelect(){this.selectRect.hide(),this.selectRect.attr("shape",{width:0,height:0}),this.finishSizing=!1,this.frameSelecting=!1,this.setData("selectedElements",null),this.interactionModel.finish("drag")}calcSelectedElements(){let{x:t,y:e,width:i,height:r}=this.selectRect.getBoundingRect();return this.globalShape.getZrenderShape().updateTransform(),this.elementList.filter(n=>{let a=n.shape.zrenderShape,s=null;return a.updateTransform(),s=a.getBoundingRect(),s.applyTransform(a.transform),s.x>=t&&s.y>=e&&s.x+s.width<=t+i&&s.y+s.height<=e+r})}}e.Zone=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(2);let n=i(0).Renderer.zrender.Path.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var i=e.height,r=e.width,n=e.x,a=e.y,s=r/3*2;t.moveTo(n,a),t.lineTo(n+s,a+i),t.lineTo(n,a+i/4*3),t.lineTo(n-s,a+i),t.lineTo(n,a),t.closePath()}});class a extends r.Shape{constructor(t,e,i){super(t,e,i)}createZrenderShape(){return new n({position:[this.x,this.y],rotation:this.rotation,shape:{x:0,y:-this.height/2,width:this.width,height:this.height},style:this.style,z:this.option.zIndex})}}e.Arrow=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(5),n=i(1),a=i(14);class s extends r.Composite{constructor(t,e,i){let r,n;super(t,e,i),this.start={x:0,y:0},this.end={x:0,y:0},this.option.markers&&("string"==typeof this.option.markers?n=this.option.markers:(r=this.option.markers[0],n=this.option.markers[1])),this.addSubShape({line:{shapeName:this.option.curveness?"curve":"polyLine",init:(t,e)=>({style:{stroke:e.fill,fill:null}}),draw:(t,e)=>{let i=t.start,r=t.end;e.path=[[i.x,i.y],[r.x,r.y]],e instanceof a.Curve&&(e.controlPoint=e.calcControlPoint(i,r))}},fromMarker:r?{shapeName:r,init:()=>({zIndex:2}),draw:(t,e)=>{let i=t.start;e.x=i.x,e.y=i.y,e.rotation=t.tangentAt(0)+Math.PI,e.width=t.getSubShape("line").style.lineWidth+5,e.height=e.width}}:null,toMarker:n?{shapeName:n,init:()=>({zIndex:2}),draw:(t,e)=>{let i=t.end;e.x=i.x,e.y=i.y,e.rotation=t.tangentAt(1),e.width=t.getSubShape("line").style.lineWidth+5,e.height=e.width}}:null})}defaultOption(t){return Object.assign(Object.assign({},t),{curveness:0,markers:"",zIndex:0})}defaultStyle(t){return Object.assign(Object.assign({},t),{smooth:0,lineDash:null})}pointAt(t){let e=this.getSubShape("line"),i=this.start.x,r=this.start.y,n=this.end.x,a=this.end.y;if("polyLine"===e.name)return[i*(1-t)+n*t,r*(1-t)+a*t];if("curve"===e.name){let[s,o]=e.calcControlPoint(this.start,this.end);return[(1-t)*((1-t)*i+2*t*s)+Math.pow(t,2)*n,(1-t)*((1-t)*r+2*t*o)+Math.pow(t,2)*a]}}tangentAt(t){let e=this.getSubShape("line"),i=this.start.x,r=this.start.y,a=this.end.x,s=this.end.y;if("polyLine"===e.name){if(a===i)return r<s?Math.PI:-Math.PI;return-Math.atan((s-r)/(a-i))+.5*n.Util.sign(i-a)*Math.PI}if("curve"===e.name){let[n,o]=e.calcControlPoint(this.start,this.end),h=2*((1-t)*(n-i)+t*(a-n)),l=2*((1-t)*(o-r)+t*(s-o));return 1.5*Math.PI-Math.atan2(l,h)}}}e.Line=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(5);class n extends r.Composite{constructor(t,e,i){super(t,e,i),this.addSubShape({block:{shapeName:"rect",draw:(t,e)=>{let i=t.width/6;e.y=t.y,e.x=t.x-i,e.height=t.height,e.width=4*i}},fieldBlock:{shapeName:"rect",init:(t,e)=>({zIndex:-1,content:"^",style:{fill:e.fieldColor,textFill:e.fieldEmpty?"#000":"rgba(0, 0, 0, 0)"}}),draw:(t,e)=>{let i=t.width/6;e.y=t.y,e.x=t.x+2*i,e.width=t.width/3,e.height=t.height}}})}defaultStyle(t){return Object.assign(Object.assign({},t),{fieldColor:"#eee",fieldEmpty:!0})}defaultAnchors(t,e){return Object.assign(Object.assign({},t),{1:[e/3,0]})}}e.Node=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=i(5),n={shapeName:"rect",init:(t,e)=>({zIndex:-1,content:"^",style:{fill:"#eee",textFill:e.leftFieldEmpty?"#000":"rgba(0, 0, 0, 0)"}}),draw:(t,e)=>{let i=t.width/8;e.y=t.y,e.x=t.x-3*i,e.width=t.width/4,e.height=t.height}};class a extends r.Composite{constructor(t,e,i){super(t,e,i),this.addSubShape({block:{shapeName:"rect",draw:(t,e)=>{let i=t.width/4;e.y=t.y,e.x=t.x,e.height=t.height,e.width=2*i}},leftFieldBlock:Object.assign({},n),rightFieldBlock:Object.assign(Object.assign({},n),{init:(t,e)=>({zIndex:-1,content:"^",style:{fill:e.fieldColor,textFill:e.rightFieldEmpty?"#000":"rgba(0, 0, 0, 0)"}}),draw:(t,e)=>{let i=t.width/8;e.y=t.y,e.x=t.x+3*i,e.width=t.width/4,e.height=t.height}})})}defaultStyle(t){return Object.assign(Object.assign({},t),{fieldColor:"#eee",leftFieldEmpty:!0,rightFieldEmpty:!0})}defaultAnchors(t,e){return Object.assign(Object.assign({},t),{1:[e*(3/8),0],3:[3/8*-e,0]})}}e.DualNode=a}])})); |