2&&(n.push([i].concat(a.splice(0,2))),o="l",i="m"==i?"l":"L"),"o"==o&&1==a.length&&n.push([i,a[0]]),"r"==o)n.push([i].concat(a));else for(;a.length>=e[o]&&(n.push([i].concat(a.splice(0,e[o]))),e[o]););}),n},c=function(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4==i?a[3]={x:+t[0],y:+t[1]}:r-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[r-2],y:+t[r-1]}:r-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n},h=function(t,e,n,i,r){if(null==r&&null==i&&(i=n),t=+t,e=+e,n=+n,i=+i,null!=r)var a=Math.PI/180,o=t+n*Math.cos(-i*a),s=t+n*Math.cos(-r*a),u=e+n*Math.sin(-i*a),c=e+n*Math.sin(-r*a),h=[["M",o,u],["A",n,n,0,+(r-i>180),0,s,c]];else h=[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return h},l=function(t){if(t=u(t),!t||!t.length)return[["M",0,0]];var e,n=[],i=0,r=0,a=0,o=0,s=0;"M"==t[0][0]&&(i=+t[0][1],r=+t[0][2],a=i,o=r,s++,n[0]=["M",i,r]);for(var l,d,f=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),g=s,p=t.length;g1&&(m=Math.sqrt(m),n*=m,i*=m);var y=n*n,w=i*i,b=(a==o?-1:1)*Math.sqrt(Math.abs((y*w-y*x*x-w*v*v)/(y*x*x+w*v*v))),_=b*n*x/i+(t+s)/2,M=b*-i*v/n+(e+u)/2,S=Math.asin(((e-M)/i).toFixed(9)),A=Math.asin(((u-M)/i).toFixed(9));S=t<_?Math.PI-S:S,A=s<_?Math.PI-A:A,S<0&&(S=2*Math.PI+S),A<0&&(A=2*Math.PI+A),o&&S>A&&(S-=2*Math.PI),!o&&A>S&&(A-=2*Math.PI)}var P=A-S;if(Math.abs(P)>l){var T=A,E=s,C=u;A=S+l*(o&&A>S?1:-1),s=_+n*Math.cos(A),u=M+i*Math.sin(A),f=g(s,u,n,i,r,0,o,E,C,[A,T,_,M])}P=A-S;var I=Math.cos(S),k=Math.sin(S),B=Math.cos(A),F=Math.sin(A),O=Math.tan(P/4),N=4/3*n*O,z=4/3*i*O,R=[t,e],D=[t+N*k,e-z*I],G=[s+N*F,u-z*B],j=[s,u];if(D[0]=2*R[0]-D[0],D[1]=2*R[1]-D[1],c)return[D,G,j].concat(f);f=[D,G,j].concat(f).join().split(",");for(var Y=[],X=0,L=f.length;X7){t[e].shift();for(var r=t[e];r.length;)c[e]="A",i&&(h[e]="A"),t.splice(e++,0,["C"].concat(r.splice(0,6)));t.splice(e,1),m=Math.max(n.length,i&&i.length||0)}},u=function(t,e,r,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[o][1],r.y=t[o][2],m=Math.max(n.length,i&&i.length||0))},c=[],h=[],p="",v="",x=0,m=Math.max(n.length,i&&i.length||0);x1?1:u<0?0:u;for(var c=u/2,h=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,g=0;gMath.max(r,o)||Math.max(e,i)Math.max(a,s))){var u=(t*i-e*n)*(r-o)-(t-n)*(r*s-a*o),c=(t*i-e*n)*(a-s)-(e-i)*(r*s-a*o),h=(t-n)*(a-s)-(e-i)*(r-o);if(h){var l=u/h,d=c/h,f=+l.toFixed(2),g=+d.toFixed(2);if(!(f<+Math.min(t,n).toFixed(2)||f>+Math.max(t,n).toFixed(2)||f<+Math.min(r,o).toFixed(2)||f>+Math.max(r,o).toFixed(2)||g<+Math.min(e,i).toFixed(2)||g>+Math.max(e,i).toFixed(2)||g<+Math.min(a,s).toFixed(2)||g>+Math.max(a,s).toFixed(2)))return{x:l,y:d}}}},M=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},S=function(t,e,n,i,r){if(r)return[["M",+t+ +r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]];var a=[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]];return a.toString=toString,a},v=function(t,e,n,i){return null==t&&(t=e=n=i=0),null==e&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:i,h:i,x2:t+n,y2:e+i,cx:t+n/2,cy:e+i/2,r1:Math.min(n,i)/2,r2:Math.max(n,i)/2,r0:Math.sqrt(n*n+i*i)/2,path:S(t,e,n,i),vb:[t,e,n,i].join(" ")}},A=function(t,e){return t=v(t),e=v(e),M(e,t.x,t.y)||M(e,t.x2,t.y)||M(e,t.x,t.y2)||M(e,t.x2,t.y2)||M(t,e.x,e.y)||M(t,e.x2,e.y)||M(t,e.x,e.y2)||M(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)},P=function(t,e,n,r,a,o,s,u){i.isArray(t)||(t=[t,e,n,r,a,o,s,u]);var c=b.apply(null,t);return v(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},T=function(t,e,n,i,a,o,s,u,c){var h=1-c,l=Math.pow(h,3),d=Math.pow(h,2),f=c*c,g=f*c,p=l*t+3*d*c*n+3*h*c*c*a+g*s,v=l*e+3*d*c*i+3*h*c*c*o+g*u,x=t+2*c*(n-t)+f*(a-2*n+t),m=e+2*c*(i-e)+f*(o-2*i+e),y=n+2*c*(a-n)+f*(s-2*a+n),w=i+2*c*(o-i)+f*(u-2*o+i),b=h*t+c*n,_=h*e+c*i,M=h*a+c*s,S=h*o+c*u,A=90-180*Math.atan2(x-y,m-w)/r;return{x:p,y:v,m:{x:x,y:m},n:{x:y,y:w},start:{x:b,y:_},end:{x:M,y:S},alpha:A}},E=function(t,e,n){var i=P(t),r=P(e);if(!A(i,r))return n?0:[];for(var a=w.apply(0,t),o=w.apply(0,e),s=~~(a/8),u=~~(o/8),c=[],h=[],l={},d=n?0:[],f=0;f=0&&E<=1&&C>=0&&C<=1&&(n?d++:d.push({x:S.x,y:S.y,t1:E,t2:C}))}}return d},C=function(t,e,n){t=p(t),e=p(e);for(var i,r,a,o,s,u,c,h,l,d,f=n?0:[],g=0,v=t.length;g');t.appendChild(n),this.set("canvasDOM",n)}},_setInitSize:function(){this.get("widthStyle")?this.changeSizeByCss(this.get("widthStyle"),this.get("heightStyle")):this.get("width")&&this.changeSize(this.get("width"),this.get("height"))},_getPx:function(t,e){var n=this.get("canvasDOM");n.style[t]=e;var r=i.getBoundingClientRect(n);return"width"===t?r.right-r.left:"height"===t?r.bottom-r.top:void 0},_reSize:function(){var t=this.get("canvasDOM"),e=this.get("widthCanvas"),n=this.get("heightCanvas"),i=this.get("widthStyle"),r=this.get("heightStyle");t.style.width=i,t.style.height=r,t.setAttribute("width",e),t.setAttribute("height",n)},getWidth:function(){var t=this.get("pixelRatio"),e=this.get("width");return e*t},getHeight:function(){var t=this.get("pixelRatio"),e=this.get("height");return e*t},changeSizeByCss:function(t,e){var n=this.get("pixelRatio");t=this._getPx("width",t),e=this._getPx("height",e);var i=t*n,r=e*n;this.set("widthStyle",t),this.set("heightStyle",e),this.set("widthCanvas",i),this.set("heightCanvas",r),this.set("width",t),this.set("height",e),this._reSize()},changeSize:function(t,e){var n=this.get("pixelRatio"),i=t*n,r=e*n;this.set("widthCanvas",i),this.set("heightCanvas",r),this.set("widthStyle",t+"px"),this.set("heightStyle",e+"px"),this.set("width",t),this.set("height",e),this._reSize()},getPointByClient:function(t,e){var n=this.get("el"),i=n.getBoundingClientRect(),r=i.right-i.left,a=i.bottom-i.top;return{x:(t-i.left)*(n.width/r),y:(e-i.top)*(n.height/a)}},getClientByPoint:function(t,e){var n=this.get("el"),i=n.getBoundingClientRect(),r=i.right-i.left,a=i.bottom-i.top;return{clientX:t/(n.width/r)+i.left,clientY:e/(n.height/a)+i.top}},beforeDraw:function(){var t=this.get("context"),e=this.get("el");t&&t.clearRect(0,0,e.width,e.height)},_beginDraw:function(){this.setSilent("toDraw",!0)},_endDraw:function(){this.setSilent("toDraw",!1)},draw:function(){function t(){e.set("animateHandler",i.requestAnimationFrame(function(){e.set("animateHandler",void 0),e.get("toDraw")&&t()})),e.beforeDraw();try{var n=e.get("context");o.superclass.draw.call(e,n)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e._endDraw()}e._endDraw()}var e=this;e.get("destroyed")||(e.get("animateHandler")?this._beginDraw():t())},destroy:function(){var t=this.get("containerDOM"),e=this.get("canvasDOM");e&&t&&t.removeChild(e),o.superclass.destroy.call(this)}}),t.exports=o},function(t,e,n){"use strict";var i=n(1),r=function(t,e,n,i){this.type=t,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=e};i.augment(r,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return i.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),t.exports=r},function(t,e,n){var i=n(1),r=n(94);t.exports={initEventDispatcher:function(){this.__listeners={}},on:function(t,e){var n=this.__listeners;return i.isNull(n[t])&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e),this},off:function(t,e){var n=this.__listeners;return 0===arguments.length?(this.__listeners={},this):1===arguments.length&&i.isString(t)?(n[t]=[],this):2===arguments.length&&i.isString(t)&&i.isFunction(e)?(i.remove(n[t],e),this):void 0},has:function(t,e){var n=this.__listeners;return 0===arguments.length&&!i.isBlank(n)||(!(1!==arguments.length||!n[t]||i.isBlank(n[t]))||!(2!==arguments.length||!n[t]||n[t].indexOf(e)===-1))},trigger:function(t){var e=this,n=e.__listeners,r=n[t.type];if(t.target=e,i.notNull(r)&&r.forEach(function(n){
n.call(e,t)}),t.bubbles){var a=e.get("parent");a&&!t.propagationStopped&&a.trigger(t)}return e},fire:function(t,e){var n=new r(t);i.each(e,function(t,e){n[e]=t}),this.trigger(n)}}},function(t,e,n){"use strict";var i=n(1),r=n(69),a=function(t){this.canvas=t,this.el=t.get("el"),this.current=null,this.pre=null};i.augment(a,{tryTrigger:function(t,e){t.__listeners&&t.trigger(e)},getCurrent:function(t){var e=this.canvas,n=e.getPointByClient(t.clientX,t.clientY);this.point=n,this.pre=this.current,this.current=e.getShape(n.x,n.y)},mousemove:function(t){this.getCurrent(t);var e=this.point,n=this.canvas;if(n.has("canvas-mousemove")){var i=new r("canvas-mousemove",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.pre&&this.pre!==this.current){var a=new r("mouseleave",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.pre,a.target=this.pre,this.tryTrigger(this.pre,a)}if(this.current){var o=new r("mousemove",t,!0,!0);if(o.x=e.x,o.y=e.y,o.clientX=t.clientX,o.clientY=t.clientY,o.currentTarget=this.current,o.target=this.current,this.tryTrigger(this.current,o),this.pre!==this.current){var s=new r("mouseenter",t,!0,!0);s.x=e.x,s.y=e.y,s.clientX=t.clientX,s.clientY=t.clientY,s.currentTarget=this.current,s.target=this.current,this.tryTrigger(this.current,s)}}},mousedown:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-mousedown")){var i=new r("canvas-mousedown",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("mousedown",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},mouseup:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-mouseup")){var i=new r("canvas-mouseup",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("mouseup",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},click:function(t){this.getCurrent(t);var e=this.point,n=this.canvas;if(n.has("canvas-click")){var i=new r("canvas-click",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("click",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},dblclick:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-dblclick")){var i=new r("canvas-dblclick",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("dblclick",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},mouseout:function(t){var e=this.point,n=this.canvas,i=new r("canvas-mouseleave",t,!0,!0);i.x=e.x,i.y=e.y,i.currentTarget=n,this.tryTrigger(n,i)},mouseover:function(t){var e=this.canvas,n=new r("canvas-mouseenter",t,!0,!0);n.currentTarget=e,this.tryTrigger(e,n)}}),t.exports=a},function(t,e,n){function i(t,e,n){for(var i,r=t.length-1;r>=0;r--){var a=t[r];if(a.__cfg.visible&&a.__cfg.capture&&(a.isGroup?i=a.getShape(e,n):a.isHit(e,n)&&(i=a)),i)break}return i}function r(t){if(!t.__cfg&&t!==h){var e=t.superclass.constructor;e&&!e.__cfg&&r(e),t.__cfg={},a.mix(!0,t.__cfg,e.__cfg),a.mix(!0,t.__cfg,t.CFG)}}var a=n(1),o=n(3).Vector3,s=n(39),u=n(48),c={},h=function(t){h.superclass.constructor.call(this,t),this.set("children",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};a.extend(h,s),a.augment(h,{isGroup:!0,canFill:!0,canStroke:!0,getDefaultCfg:function(){return r(this.constructor),a.mix(!0,{},this.constructor.__cfg)},_beforeRenderUI:function(){},_renderUI:function(){},_bindUI:function(){},addShape:function(t,e){var n,i=this.get("canvas");e=e||{};var r=c[t];if(r||(r=a.ucfirst(t),c[t]=r),e.attrs){var o=e.attrs;if("text"===t){var s=i.get("fontFamily");s&&(o.fontFamily=o.fontFamily?o.fontFamily:s)}}return e.canvas=i,e.type=t,n=new u[r](e),this.add(n),n},addGroup:function(t,e){var n,i=this.get("canvas");if(e=a.mix({},e),a.isFunction(t))e?(e.canvas=i,e.parent=this,n=new t(e)):n=new t({canvas:i,parent:this}),this.add(n);else if(a.isObject(t))t.canvas=i,n=new h(t),this.add(n);else{if(void 0!==t)return!1;n=new h,this.add(n)}return n},renderBack:function(t,e){var n=this.get("backShape"),i=this.getBBox(),r=this.get("parent");return a.mix(e,{x:i.minX-t[3],y:i.minY-t[0],width:i.width+t[1]+t[3],height:i.height+t[0]+t[2]}),n?n.attr(e):n=r.addShape("rect",{zIndex:-1,attrs:e}),this.set("backShape",n),r.sort(),n},removeChild:function(t,e){if(arguments.length>=2)this.contain(t)&&t.remove(e);else{if(1===arguments.length){if(!a.isBoolean(t))return this.contain(t)&&t.remove(!0),this;e=t}0===arguments.length&&(e=!0),h.superclass.remove.call(this,e)}return this},add:function(t){var e=this,n=e.get("children");if(a.isArray(t))a.each(t,function(t){var n=t.get("parent");n&&n.removeChild(t,!1),e.__setEvn(t)}),n.push.apply(n,t);else{var i=t,r=i.get("parent");r&&r.removeChild(i,!1),e.__setEvn(i),n.push(i)}return e},contain:function(t){var e=this.get("children");return e.indexOf(t)>-1},getChildByIndex:function(t){var e=this.get("children");return e[t]},getFirst:function(){return this.getChildByIndex(0)},getLast:function(){var t=this.get("children").length-1;return this.getChildByIndex(t)},__setEvn:function(t){var e=this;t.__cfg.parent=e,t.__cfg.context=e.__cfg.context,t.__cfg.canvas=e.__cfg.canvas,t.__cfg.totalMatrix=null;var n=t.__attrs.clip;n&&(n.setSilent("parent",e),n.setSilent("context",e.get("context")));var i=t.__cfg.children;i&&a.each(i,function(e){t.__setEvn(e)})},getBBox:function(){var t=this,e=1/0,n=-(1/0),i=1/0,r=-(1/0),s=t.get("children");a.each(s,function(t){if(t.get("visible")){var a=t.getBBox();if(!a)return!0;var s=new o(a.minX,a.minY,1),u=new o(a.minX,a.maxY,1),c=new o(a.maxX,a.minY,1),h=new o(a.maxX,a.maxY,1);t.apply(s),t.apply(u),t.apply(c),t.apply(h);var l=Math.min(s.x,u.x,c.x,h.x),d=Math.max(s.x,u.x,c.x,h.x),f=Math.min(s.y,u.y,c.y,h.y),g=Math.max(s.y,u.y,c.y,h.y);ln&&(n=d),fr&&(r=g)}});var u={minX:e,minY:i,maxX:n,maxY:r};return u.x=u.minX,u.y=u.minY,u.width=u.maxX-u.minX,u.height=u.maxY-u.minY,u},drawInner:function(t){for(var e=this.get("children"),n=0;n-1?(null===t.get("canvas")&&(t=i.clone(t)),t.set("parent",e.get("parent")),t.set("context",e.get("context")),t.inside=function(n,i){var a=new r(n,i,1);return t.invert(a,e.get("canvas")),t.__isPointInFill(a.x,a.y)},t):null}}},function(t,e,n){function i(t){var e=t.elements;return 1===e[0]&&0===e[1]&&0===e[3]&&1===e[4]&&0===e[6]&&0===e[7]}function r(t){var e=t.elements;return 0===e[1]&&0===e[3]&&0===e[6]&&0===e[7]}function a(t,e){i(e)||(r(e)?(t.elements[0]*=e.elements[0],t.elements[4]*=e.elements[4]):t.multiply(e))}var o=n(1),s=n(3).Matrix3;t.exports={initTransform:function(){this.__m=new s},translate:function(t,e){return this.__m.translate(t,e),this.clearTotalMatrix(),this},rotate:function(t){return this.__m.rotate(t),this.clearTotalMatrix(),this},scale:function(t,e){return this.__m.scale(t,e),this.clearTotalMatrix(),this},rotateAtStart:function(t){var e=this.attr("x"),n=this.attr("y");Math.abs(t)>2*Math.PI&&(t=t/180*Math.PI),this.transform([["t",-e,-n],["r",t],["t",e,n]])},move:function(t,e){var n=this.get("x")||0,i=this.get("y")||0;this.translate(t-n,e-i),this.set("x",t),this.set("y",e)},transform:function(t){var e=this;return o.each(t,function(t){switch(t[0]){case"t":e.translate(t[1],t[2]);break;case"s":e.scale(t[1],t[2]);break;case"r":e.rotate(t[1]);break;case"m":e.__m=s.multiply(t[1],e.__m),e.clearTotalMatrix()}}),e},setTransform:function(t){return this.__m.identity(),this.transform(t)},getMatrix:function(){return this.__m},setMatrix:function(t){return this.__m=t,this.clearTotalMatrix(),this},apply:function(t,e){var n;return n=e?this._getMatrixByRoot(e):this.__m,t.applyMatrix(n),this},_getMatrixByRoot:function(t){var e=this;t=t||e;for(var n=e,i=[];n!==t;)i.unshift(n),n=n.get("parent");i.unshift(n);var r=new s;return o.each(i,function(t){r.multiply(t.__m)}),r},getTotalMatrix:function(){var t=this.__cfg.totalMatrix;if(!t){t=new s;var e=this.__cfg.parent;if(e){var n=e.getTotalMatrix();a(t,n)}a(t,this.__m),this.__cfg.totalMatrix=t}return t},clearTotalMatrix:function(){},invert:function(t){var e=this.getTotalMatrix();if(r(e))t.x/=e.elements[0],t.y/=e.elements[4];else{var n=e.getInverse();t.applyMatrix(n)}return this},resetTransform:function(t){var e=this.__m.to2DObject();i(this.__m)||t.transform(e.a,e.b,e.c,e.d,e.e,e.f)}}},function(t,e){t.exports={xAt:function(t,e,n,i,r){return e*Math.cos(t)*Math.cos(r)-n*Math.sin(t)*Math.sin(r)+i},yAt:function(t,e,n,i,r){return e*Math.sin(t)*Math.cos(r)+n*Math.cos(t)*Math.sin(r)+i},xExtrema:function(t,e,n){return Math.atan(-n/e*Math.tan(t))},yExtrema:function(t,e,n){return Math.atan(n/(e*Math.tan(t)))}}},function(t,e,n){function i(t,e,n){return{x:n.x+t,y:n.y+e}}function r(t,e){return{x:e.x+(e.x-t.x),y:e.y+(e.y-t.y)}}function a(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e){return(t[0]*e[0]+t[1]*e[1])/(a(t)*a(e))}function s(t,e){return(t[0]*e[1]1&&(r*=Math.sqrt(x),a*=Math.sqrt(x));var m=Math.sqrt((r*r*(a*a)-r*r*(v*v)-a*a*(p*p))/(r*r*(v*v)+a*a*(p*p)));n===i&&(m*=-1),isNaN(m)&&(m=0);var y=m*r*v/a,w=m*-a*p/r,b=(l+f)/2+Math.cos(c)*y-Math.sin(c)*w,_=(d+g)/2+Math.sin(c)*y+Math.cos(c)*w,M=s([1,0],[(p-y)/r,(v-w)/a]),S=[(p-y)/r,(v-w)/a],A=[(-1*p-y)/r,(-1*v-w)/a],P=s(S,A);return o(S,A)<=-1&&(P=Math.PI),o(S,A)>=1&&(P=0),0===i&&P>0&&(P-=2*Math.PI),1===i&&P<0&&(P+=2*Math.PI),[t,b,_,r,a,M,P,c,i]}var c=n(1),h=n(8),l=n(7),d=n(16),f=n(22),g=n(101),p=n(3),v=p.Vector2,x=p.Vector3,m=p.Matrix3,y=["m","l","c","a","q","h","v","t","s","z"],w=function(t,e,n){this.preSegment=e,this.isLast=n,this.init(t,e)};c.augment(w,{init:function(t,e){var n=t[0];e=e||{endPoint:{x:0,y:0}};var a,o,s,c,h=y.indexOf(n)>=0,l=h?n.toUpperCase():n,d=t,f=e.endPoint,g=d[1],p=d[2];switch(l){default:break;case"M":c=h?i(g,p,f):{x:g,y:p},this.command="M",this.params=[f,c],this.subStart=c,this.endPoint=c;break;case"L":c=h?i(g,p,f):{x:g,y:p},this.command="L",this.params=[f,c],this.subStart=e.subStart,this.endPoint=c,this.isLast&&(this.endTangent=function(){return new v(c.x-f.x,c.y-f.y)});break;case"H":c=h?i(g,0,f):{x:g,y:f.y},this.command="L",this.params=[f,c],this.subStart=e.subStart,this.endPoint=c,this.endTangent=function(){return new v(c.x-f.x,c.y-f.y)};break;case"V":c=h?i(0,g,f):{x:f.x,y:g},this.command="L",this.params=[f,c],this.subStart=e.subStart,this.endPoint=c,this.endTangent=function(){return new v(c.x-f.x,c.y-f.y)};break;case"Q":h?(a=i(g,p,f),o=i(d[3],d[4],f)):(a={x:g,y:p},o={x:d[3],y:d[4]}),this.command="Q",this.params=[f,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-a.x,o.y-a.y)};break;case"T":o=h?i(g,p,f):{x:g,y:p},"Q"===e.command?(a=r(e.params[1],f),this.command="Q",this.params=[f,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-a.x,o.y-a.y)}):(this.command="TL",this.params=[f,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-f.x,o.y-f.y)});break;case"C":h?(a=i(g,p,f),o=i(d[3],d[4],f),s=i(d[5],d[6],f)):(a={x:g,y:p},o={x:d[3],y:d[4]},s={x:d[5],y:d[6]}),this.command="C",this.params=[f,a,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)};break;case"S":h?(o=i(g,p,f),s=i(d[3],d[4],f)):(o={x:g,y:p},s={x:d[3],y:d[4]}),"C"===e.command?(a=r(e.params[2],f),this.command="C",this.params=[f,a,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)}):(this.command="SQ",this.params=[f,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)});break;case"A":var x=g,m=p,w=d[3],b=d[4],_=d[5];c=h?i(d[6],d[7],f):{x:d[6],y:d[7]},this.command="A",this.params=u(f,c,b,_,x,m,w),this.subStart=e.subStart,this.endPoint=c;break;case"Z":this.command="Z",this.params=[f,e.subStart],this.subStart=e.subStart,this.endPoint=e.subStart}},isInside:function(t,e,n){var i=this,r=i.command,a=i.params,o=i.box;if(o&&!l.box(o.minX,o.maxX,o.minY,o.maxY,t,e))return!1;switch(r){default:break;case"M":return!1;case"TL":case"L":case"Z":return l.line(a[0].x,a[0].y,a[1].x,a[1].y,n,t,e);case"SQ":case"Q":return l.quadraticline(a[0].x,a[0].y,a[1].x,a[1].y,a[2].x,a[2].y,n,t,e);case"C":return l.cubicline(a[0].x,a[0].y,a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y,n,t,e);case"A":var s=a,u=s[1],c=s[2],h=s[3],d=s[4],f=s[5],g=s[6],p=s[7],v=s[8],y=h>d?h:d,w=h>d?1:h/d,b=h>d?d/h:1;s=new x(t,e,1);var _=new m;return _.translate(-u,-c),_.rotate(-p),_.scale(1/w,1/b),s.applyMatrix(_),l.arcline(0,0,y,f,f+g,1-v,n,s.x,s.y)}return!1},draw:function(t){var e,n,i,r=this.command,a=this.params;switch(r){default:break;case"M":t.moveTo(a[1].x,a[1].y);break;case"TL":case"L":t.lineTo(a[1].x,a[1].y);break;case"SQ":case"Q":e=a[1],n=a[2],t.quadraticCurveTo(e.x,e.y,n.x,n.y);break;case"C":e=a[1],n=a[2],i=a[3],t.bezierCurveTo(e.x,e.y,n.x,n.y,i.x,i.y);break;case"A":var o=a,s=o[1],u=o[2],c=s,h=u,l=o[3],d=o[4],f=o[5],g=o[6],p=o[7],v=o[8],x=l>d?l:d,m=l>d?1:l/d,y=l>d?d/l:1;t.translate(c,h),t.rotate(p),t.scale(m,y),t.arc(0,0,x,f,f+g,1-v),t.scale(1/m,1/y),t.rotate(-p),t.translate(-c,-h);break;case"Z":t.closePath()}},getBBox:function(t){var e,n,i,r,a=t/2,o=this.params;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(o[0].x,o[1].x)-a,maxX:Math.max(o[0].x,o[1].x)+a,minY:Math.min(o[0].y,o[1].y)-a,maxY:Math.max(o[0].y,o[1].y)+a};break;case"SQ":case"Q":for(n=f.extrema(o[0].x,o[1].x,o[2].x),i=0,r=n.length;iM&&(M=P)}var T=g.yExtrema(x,h,l),E=1/0,C=-(1/0),I=[y,w];for(i=2*-Math.PI;i<=2*Math.PI;i+=Math.PI){var k=T+i;1===m?yC&&(C=B)}this.box={minX:_-a,maxX:M+a,minY:E-a,maxY:C+a}}}}),t.exports=w},function(t,e){var n=document.createElement("table"),i=document.createElement("tr"),r=/^\s*<(\w+|!)[^>]*>/,a={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:i,th:i,"*":document.createElement("div")};t.exports={getBoundingClientRect:function(t){var e=t.getBoundingClientRect(),n=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:e.top-n,bottom:e.bottom-n,left:e.left-i,right:e.right-i}},getStyle:function(t,e){return window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.currentStyle[e]},modiCSS:function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t},createDom:function(t){var e=r.test(t)&&RegExp.$1;e in a||(e="*");var n=a[e];return t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t,n.childNodes[0]},addEventListener:function(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):void 0}}},function(t,e){t.exports={transform:function(t,e){t=t.clone();for(var n=0,i=e.length;ns?e:t,l={attrs0:{},attrs1:{}},d=!1;return o.each(c,function(s,u){n=t[u],i=e[u],o.isObject(n)||o.isObject(i)||"path"===u&&(r=o.isString(n)?n:o.pathToString(n),a=o.isString(i)?i:o.pathToString(i),r===a||r.indexOf("NaN")!==-1||a.indexOf("NaN")!==-1)||o.isArray(n)&&o.isArray(i)&&o.equalsArray(n,i)||n===i||h[u]||(l.attrs0[u]=n,l.attrs1[u]=i,d=!0)}),!!d&&l}function r(t,e,n){var i,a,s=e.get("children");return o.each(s,function(e){n++,a=e.get("gid"),e.isGroup&&(n=r(t,e,n)),a&&(t[a]={matrix:e.getMatrix().clone(),origin:e},i=e.get("shapeCfg"),i&&(t[a].enterAnimate=e.get("enterAnimate"),t[a].leaveAnimate=e.get("leaveAnimate"),t[a].model=i.origin),e.isShape&&(t[a].attrs=e.getAllAttrs()))}),n}var a=n(3),o=n(4),s=n(23),u=s.Update,c=a.Matrix3,h={text:"text",elements:"elements",rotate:"rotate",textAlign:"textAlign",textBaseline:"textBaseline",fontStyle:"fontStyle",font:"font",fontWeight:"fontWeight",fontFamily:"fontFamily"},l=function(t){o.mix(this,t)};o.augment(l,{canvas:null,map0:null,map1:null,run:function(){this.init(),this.count<5e3&&(this._compare(),this._addTween()),this.canvas.draw()},init:function(){var t=this.canvas,e=this.elementsStash,n={},i=0;e=e?e:{},i=r(n,t,i),this.elementsStash=n,this.map0=e,this.map1=n,this.count=i},_compare:function(){var t=this.map0,e=this.map1,n=[],i=[],r=[];o.each(e,function(e,i){t[i]?e.origin.get("type")===t[i].origin.get("type")&&r.push(i):n.push(i)}),o.each(t,function(t,n){e[n]||i.push(n)}),this.enterElements=n,this.leaveElements=i,this.updateElements=r},_addTween:function(){var t,e,n,r,a,s=this,h=this.enterElements,l=this.leaveElements,d=this.updateElements,f=this.map0,g=this.map1;o.each(h,function(t){a=g[t],a.enterAnimate&&a.enterAnimate(a.origin,f,g)}),o.each(l,function(t){r=f[t],r.leaveAnimate&&(r.origin.getParent().add(r.origin),r.leaveAnimate(r.origin,f,g))}),o.each(d,function(h){a=g[h],r=f[h],e=i(r.attrs,a.attrs),t=c.equal(r.matrix,a.matrix),n={},e&&(a.origin.attr(e.attrs0),o.mix(n,e.attrs1)),t||(a.origin.setMatrix(r.matrix),n.matrix=a.matrix),!e&&t||u(a.origin,n,s)})}}),t.exports=l},function(t,e,n){"use strict";function i(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):void 0}var r=n(4),a=function(t){r.mix(this,t),this.init()};r.augment(a,{graph:null,frontCanvas:null,canvas:null,currentItem:null,dragitem:null,rootGroup:null,lastEventObj:null,currentEventObj:null,el:null,init:function(){var t=this.graph;this.frontCanvas=t.get("frontCanvas"),this.canvas=t.get("canvas"),this._initEvent()},_initEvent:function(){var t=this,e=t.frontCanvas,n=e.get("el");this.el=n,this.domMouseLeave=i(n,"mouseleave",r.wrapBehavior(t,"onDomMouseLeave")),this.domMouseDown=i(n,"mousedown",r.wrapBehavior(t,"onMouseDown")),this.domMouseUp=i(n,"mouseup",r.wrapBehavior(t,"onMouseUp")),this.domMouseMove=i(n,"mousemove",r.wrapBehavior(t,"onMouseMove")),this.domDblClick=i(n,"dblclick",r.wrapBehavior(t,"onDblClick")),this.domMouseWheel=i(n,"mousewheel",r.wrapBehavior(t,"onMouseWheel")),this.domKeyDown=i(n,"keydown",r.wrapBehavior(t,"onKeyDown")),this.domKeyUp=i(n,"keyup",r.wrapBehavior(t,"onKeyUp")),this.domContextMenu=i(n,"contextmenu",r.wrapBehavior(t,"onContextMenu"))},_parsePoint:function(t,e){var n=this.canvas.get("pixelRatio"),i=this.graph,r={x:t/n,y:e/n};return i.invertPoint(r)},_getEventObj:function(t,e){var n,i=this.graph,r=t.clientX,a=t.clientY,o=e.getPointByClient(r,a),s=this._parsePoint(o.x,o.y),u=e.getShape(o.x,o.y),c=i.getItem(u);return c&&(n=c.get("type")),{item:c,itemType:n,shape:u,x:s.x,y:s.y,domX:t.offsetX,domY:t.offsetY,domEvent:t}},getEventObj:function(t){return{item:t.item,itemType:t.itemType,x:t.x,y:t.y,domX:t.domX,domY:t.domY,shape:t.shape,toEvObj:t.toEvObj,frontEvObj:t.frontEvObj,domEvent:t.domEvent}},_processEventObj:function(t){var e,n,i=this.canvas,a=this.frontCanvas,o=this.currentEventObj;o&&r.isObject(o)&&(this.lastEventObj=r.mix({},o)),e=this._getEventObj(t,i),n=this._getEventObj(t,a),n.shape&&(e.shape=n.shape),n.item&&(e.item=n.item,e.itemType=n.item.get("type")),e.frontEvObj=n,this.currentEventObj=e,this.currentItem=e.item},onDomMouseLeave:function(){this.graph.fire("dommouseleave")},onContextMenu:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("contextmenu",this.getEventObj(e))},onDblClick:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("dblclick",this.getEventObj(e))},onKeyUp:function(t){t.preventDefault(),this.graph.fire("keyup",t)},onKeyDown:function(t){t.preventDefault(),this.graph.fire("keydown",t)},onMouseWheel:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("mousewheel",this.getEventObj(e))},onMouseDown:function(t){t.preventDefault(),this._processEventObj(t);var e=this.currentEventObj;this.pressing=!0,this.dragging=!0,this.pressingPoint={x:e.x,y:e.y},0===t.button&&(this.graph.fire("mousedown",this.getEventObj(e)),e.item&&this.graph.fire("itemmousedown",this.getEventObj(e)))},onMouseUp:function(t){t.preventDefault(),this._processEventObj(t);var e=this.currentEventObj;0===t.button&&(this.pressing&&(this.graph.fire("click",this.getEventObj(e)),e.item&&this.graph.fire("itemclick",this.getEventObj(e)),this.pressing=!1),this.dragging&&(this.dragStartPoint&&this.graph.fire("dragend",this.getEventObj(e)),this.dragging=!1),this.graph.fire("mouseup",this.getEventObj(e)),e.item&&this.graph.fire("itemmouseup",this.getEventObj(e)),this.dragStartPoint=null,this.dragItem=null)},onMouseMove:function(t){t.preventDefault(),this._processEventObj(t);var e=this.graph,n=this.currentEventObj,i=this.lastEventObj;this.pressing!==!0||n.x===i.x&&n.y===i.y||(this.pressing=!1),i&&n&&(i.toEvObj=n,n.fromEvObj=i,this.isSame(i,n,"shape")||(i.shape&&e.fire("mouseleave",this.getEventObj(i)),n.shape&&e.fire("mouseenter",this.getEventObj(n))),this.isSame(i,n,"item")||(i.item&&e.fire("itemmouseleave",this.getEventObj(i)),n.item&&e.fire("itemmouseenter",this.getEventObj(n)))),this.dragging&&(this.dragStartPoint?e.fire("dragmove",this.getEventObj(n)):(this.dragStartPoint={x:n.x,y:n.y},this.dragItem=n.item,e.fire("dragstart",this.getEventObj(n)))),n.item&&e.fire("itemhover",this.getEventObj(n)),e.fire("mousemove",this.getEventObj(n))},isSame:function(t,e,n){var i=t[n],r=e[n];return i===r},destroy:function(){var t=this.domMouseUp,e=this.domMouseDown,n=this.domMouseMove,i=this.domDblClick,r=this.domMouseWheel,a=this.domContextMenu,o=this.domKeyDown,s=this.domKeyUp;a&&a.remove(),s&&s.remove(),r&&r.remove(),o&&o.remove(),i&&i.remove(),t&&t.remove(),e&&e.remove(),n&&n.remove()}}),t.exports=a},function(t,e,n){"use strict";var i=n(1),r=function(t){i.mix(this,t),this.init()};i.augment(r,{group:null,visible:!0,gridEl:null,minX:0,minY:0,cell:10,maxX:1e3,maxY:1e3,line:null,init:function(){var t=this,e=t.group,n=t._getPath(),r=i.mix({},t.line);r.path=n;var a=e.addShape("path",{attrs:r,capture:!1});a.set("visible",t.visible),this.gridEl=a},_getPath:function(){for(var t=this,e=t.minX,n=t.minY,i=t.maxX,r=t.maxY,a=t._getCell(),o=Math.ceil(e/a)*a,s=Math.ceil(n/a)*a,u=[],c=0;c<=i-e;c+=a){var h=o+c;u.push(["M",h,n]),u.push(["L",h,r])}for(var l=0;l<=r-n;l+=a){var d=s+l;u.push(["M",e,d]),u.push(["L",i,d])}return u},_getCell:function(){var t=this.cell?this.cell:10;return t},update:function(t){i.mix(this,t);var e=this._getPath(),n=this.gridEl;n.attr("path",e),n.set("visible",this.visible)},destroy:function(){var t=this,e=t.gridEl;e&&e.remove()}}),t.exports=r},function(t,e,n){"use strict";var i=n(4),r=n(25),a=function(t){i.mix(this,t),this.init()};i.augment(a,{graph:null,guides:[],frontGuideGroup:null,backGuideGroup:null,init:function(){var t=this.graph,e=t.get("frontGroup").addGroup(),n=t.get("backGroup").addGroup();this.frontGuideGroup=e,this.backGuideGroup=n},link:function(t){this.guides.push({type:"link",cfg:t})},_link:function(t){var e=this.guides,n=this.graph,a=n.find(t.source),o=n.find(t.target);if(!a||!o)return!1;var s=t.id?t.id:"guide-link-"+e.length,u=this.frontGuideGroup,c=u.addGroup(r,{data:{type:"link",cfg:t},id:s}),h=a.getCenter(),l=o.getCenter(),d=a.getIntersectionByPoint(l),f=o.getIntersectionByPoint(h),g=i.mix({},t,{source:a,target:o,points:[d,f]}),p=t.shape?t.shape:"line";return i.drawEdge(p,g,c),c},draw:function(){var t=this,e=this.guides;i.each(e,function(e){t["_"+e.type](e.cfg)})},save:function(){return this.guides},remove:function(){},clear:function(t){this.frontGuideGroup.clear(t),this.backGuideGroup.clear(t)},destroy:function(){this.frontGuideGroup.clear(),this.backGuideGroup.clear()}}),t.exports=a},function(t,e,n){"use strict";var i=n(4),r=n(5),a=function(t){i.mix(this,t),this.init()};i.augment(a,{graph:null,tooltipDOM:null,titleDOM:null,listDOM:null,tooltipCSS:{border:"none","border-radius":"4px",background:"rgba(33,33,33,0.7)",color:"white","font-size":"14px",margin:0,padding:"8px 16px"},titleCSS:{margin:0},listCSS:{margin:0,"list-style-type":"none",padding:"0px"},title:"",dx:10,dy:10,margin:10,split:": ",timer:setTimeout(function(){}),tooltipHtml:'',titleHtml:'',listHtml:'',liTpl:"{name}{split}{value}",init:function(){this._createDOM(),this._bindEvent()},_createDOM:function(){var t=this.graph,e=t.get("graphContainer"),n=i.createDOM(this.tooltipHtml,this.tooltipCSS),r=i.createDOM(this.titleHtml,this.titleCSS),a=i.createDOM(this.listHtml,this.listCSS);e.appendChild(n),n.appendChild(r),n.appendChild(a),n.hide(),r.innerHTML=this.title,this.titleDOM=r,this.listDOM=a,this.tooltipDOM=n},_bindEvent:function(){var t=this.graph;t.on("itemmouseenter",i.wrapBehavior(this,"onMouseenter")),t.on("itemhover",i.wrapBehavior(this,"onItemhover")),t.on("itemmouseleave",i.wrapBehavior(this,"onMouseleave")),t.on("dommouseleave",i.wrapBehavior(this,"onDomMouseleave"))},_changeContent:function(t){var e=this,n=this.listDOM,r=this.liTpl,a="";t&&(i.isArray(t[0])||(t=[t]),i.each(t,function(t){a+=i.substitute(r,{name:t[0],value:t[1],split:e.split})}),n.innerHTML=a)},_getTop:function(t,e,n){var i=this.dy;return 2*t.height>=e.height?"0px":n=e.width?"0px":e.width-n-i',{position:"relative"});e.appendChild(h);var l=i(u,c,h),d=h.appendChild(o.createDOM('')),f=i(u,c,h),g=f.get("el");l.set("htmlElementContaniner",d),d.style.overflow="hidden",d.style.width=u+"px",d.style.height=c+"px",d.style.position="absolute",d.style.top=0,d.style.left=0,g.style.position="absolute",g.style.top=0,g.style.left=0,h.style["font-family"]=y.fontFamily;var p=a?l.addGroup(b):l.addGroup(),v=f.addGroup(b),x=p.addGroup(),m=p.addGroup(),_=r?m.addGroup(w):m.addGroup(),M=s?m.addGroup(w):m.addGroup(),S=p.addGroup(),A=v.addGroup(),P=v.addGroup(),T=v.addGroup(),E=v.addGroup();p.set("gid","rootGroup"),v.set("gid","frontCanvasRootGroup"),x.set("animate",!1),t.set("rootGroup",p),t.set("itemGroup",m),t.set("backGroup",x),t.set("frontGroup",S),t.set("frontCanvasRootGroup",v),t.set("controlPointRootGroup",E),t.set("delegaRootGroup",P),t.set("activedRectRootGroup",A),t.set("anchorPointRootGroup",T),t.set("nodeGroup",M),t.set("edgeGroup",_),t.set("canvas",l),t.set("frontCanvas",f),t.set("graphContainer",h),t.set("htmlElementContaniner",d),t.set("container",e),t.set("el",g),g.style.outline="none",g.setAttribute("tabIndex",-2),t.on("click",function(){g.focus()})},_initEvent:function(){var t=new p({graph:this,frontCanvas:this.get("frontCanvas"),canvas:this.get("canvas"),rootGroup:this.get("rootGroup")});this.set("eventAssist",t)},_updateGrid:function(){var t=this.get("gridAssist");if(t){var e=this,n=e.get("width"),i=e.get("height"),r=e.invertPoint({x:0,y:0}),a=e.invertPoint({x:n,y:i});t.update({minX:r.x,minY:r.y,maxX:a.x,maxY:a.y})}},_updateCache:function(t,e){var n=this.get("itemCache");n[t]=e},_clearInner:function(){var t=this.get("guideAssist"),e=this.get("animate"),n=!e,i=this.get("htmlElementContaniner");i.innerHTML="",this.get("nodeGroup").clear(n),this.get("edgeGroup").clear(n),this.get("controlPointRootGroup").clear(n),this.get("delegaRootGroup").clear(n),this.get("activedRectRootGroup").clear(n),this.get("anchorPointRootGroup").clear(n),t.clear(n)},_updateEdgeEnd:function(t,e,n){var i=this,r=i.get("itemCache"),a=e[n],o=t.get(n);if(!o||o.get("id")!==a){o&&o.removeEdge(t);var s=r[a];s.addEdge(t),t.set(n,s)}},_doLayout:function(){},_drawInner:function(){this._doLayout(),this._drawItems(),this._drawGuides()},_drawItems:function(){var t=this.get("nodes"),e=this.get("edges");this.addNodes(t),this.addEdges(e)},_drawGuides:function(){var t=this.get("guideAssist");t.draw()},_readSource:function(){},_saveSource:function(){},_readGuides:function(t){var e=this;o.each(t,function(t){e.get("guides").push(t)})},_saveGuides:function(){var t=this.get("guideAssist");return t.save()},_getAllActived:function(){var t=this.getAllActived();return t.sort(function(t,e){var n,i,r=t.get("group"),a=e.get("group");return r&&(n=r.get("parent"),i=n.get("children")),i.indexOf(r)-i.indexOf(a)}),t},addItem:function(t,e){t=o.ucfirst(t);var n="add"+t+"s";return this[n]([e])[0]},removeItem:function(t){var e,n=this,i=n.get("itemCache");if(o.isString(t)&&(t=i[t]),e=t.get("id"),this.fire("itemremove",{item:t}),delete i[e],"node"===t.get("type")){var r=t.get("edges").slice();o.each(r,function(t){delete i[t.get("model").id],n.removeItem(t)})}t.destroy()},updateItem:function(t,e){var n,i,r=this.get("itemCache");if(o.isString(t)&&(t=r[t]),n=t.get("type"),i=t.get("model"),o.mix(i,e),"edge"===n)this._updateEdgeEnd(t,i,"source"),this._updateEdgeEnd(t,i,"target"),t.update();else if("node"===n){t.update();var a=t.get("edges");o.each(a,function(t){t.update()})}return this.fire("itemupdate",{item:t,updateModel:e}),t},css:function(t){var e=this.get("el");o.each(t,function(t,n){e.style[n]=t})},update:function(){},remove:function(){},addNodes:function(t){var e=this,n=e.get("nodeGroup"),i=e.get("itemCache"),r=[];return o.each(t,function(t){var a=t.id;if(o.isNull(a)&&(a=o.guid(),t.id=a),i[a])throw new Error("id: "+a+" \u5df2\u5b58\u5728\uff01id: "+a+" already exist!");var s=n.addGroup(_,{id:a,type:"node"}),u=new M({id:a,graph:e,group:s,model:t,mapper:e.get("nodeMapper"),delegaRootGroup:e.get("delegaRootGroup"),controlPointRootGroup:e.get("controlPointRootGroup"),activedRectRootGroup:e.get("activedRectRootGroup"),anchorPointRootGroup:e.get("anchorPointRootGroup")});e._updateCache(a,u),r.push(u),u.draw(),e.get("items").push(u)}),r},read:function(t){var e=this;o.each(t,function(t,n){e["_read"+o.ucfirst(n)](t)})},save:function(){return{source:this._saveSource(),guides:this._saveGuides()}},addEdges:function(t){var e=this,n=e.get("itemCache"),i=e.get("edgeGroup"),r=[];return o.each(t,function(t){var a=t.id,s=n[t.source],u=n[t.target];if(!s||!u)throw new Error("can not find effective node in edge model");if(n[a])throw new Error("id: "+a+" \u5df2\u5b58\u5728\uff01id: "+a+" already exist!");o.isNull(a)&&(a=o.guid(),t.id=a);var c=i.addGroup(_,{id:a,type:"edge"}),h=new S({id:a,graph:e,source:s,target:u,model:t,group:c,mapper:e.get("edgeMapper"),useAnchor:e.get("useAnchor"),delegaRootGroup:e.get("delegaRootGroup"),controlPointRootGroup:e.get("controlPointRootGroup")});h.draw(),e._updateCache(a,h),r.push(h),e.get("items").push(h)}),r},invertPoint:function(t){var e=this.get("rootGroup").getMatrix();return o.invertPoint(t,e)},converPoint:function(t){var e=this.get("rootGroup").getMatrix();return o.converPoint(t,e)},forceFit:function(){var t=this.get("container"),e=o.getDOMWidth(t),n=this.get("height");e!==this.get("width")&&this.changeSize(e,n)},tooltip:function t(e){var n=this.get("tooltipAssist"),t={graph:this};return e?(o.isObject(n)&&n.destroy(),o.isObject(e)&&o.mix(t,e),n=new v(t),this.set("tooltipAssist",n)):(n&&n.destroy(),this.set("tooltipAssist",null)),this},getItem:function(t){if(!t)return null;var e=t.get("parent"),n=this.get("itemCache");return n[e.get("id")]},updateMatrix:function(t){var e=this.get("rootGroup"),n=this.get("frontCanvasRootGroup"),i=this.get("minZoom"),r=this.get("maxZoom");t.elements[0]r||(e.setMatrix(t),n.setMatrix(t.clone()),this._updateGrid())},getScale:function(){return this.getMatrix().elements[0]},getMatrix:function(){var t=this.get("rootGroup");return t.getMatrix()},toFront:function(t){var e=t.get("group"),n=e.get("parent"),i=n.get("children");return o.remove(i,e),i.push(e),self},toBack:function(t){var e=t.get("group"),n=e.get("parent"),i=n.get("children");return o.remove(i,e),i.unshift(e),self},source:function(t,e){this.set("nodes",t),this.set("edges",e)},guide:function(){var t=this.get("guideAssist");return t},node:function(){return this.get("nodeMapper")},edge:function(){return this.get("edgeMapper")},clear:function(){this._clearInner(),this._initMapper(),this._initData()},draw:function(t){var e=this,n=e.get("animateAssist"),i=e.get("drawFrameObj");i.callback=function(){e.destroyed||(n?t!==!1?n.run():(n.init(),e.refresh(!1)):e.refresh(!1))},o.frameDraw(i)},refreshFront:function(){this.get("frontCanvas").draw()},refresh:function(){this.get("canvas").draw(),this.get("frontCanvas").draw()},updateNodesPosition:function(){var t=this.get("itemCache"),e=this.get("edges"),n=this.get("nodes");o.each(n,function(e){t[e.id].updatePosition()}),o.each(e,function(e){t[e.id].update()}),this.draw()},add:function(){},render:function(){this._drawInner(),this._fitView(),this._renderPlugin(),this.draw()},changeLayout:function(t){var e=this.save();this._clearInner(),this._initData(),this.set("layout",t),this.read(e),this._drawInner(),this.draw()},changeData:function(){var t=o.toArray(arguments);this._clearInner(),this._initData(),this.source.apply(this,t),this._drawInner(),this.draw()},changeSize:function(t,e){if(Math.abs(t)>=1/0||Math.abs(e)>=1/0)return void console.warn("size parameter more than the maximum");var n=this,i=n.get("canvas"),r=n.get("frontCanvas"),a=n.get("htmlElementContaniner");i.changeSize(t,e),r.changeSize(t,e),n.set("width",t),n.set("height",e),a.css({width:t+"px",height:e+"px"}),n._updateGrid(),n.draw(!1)},destroy:function(){var t=this,e=t.get("canvas"),n=t.get("gridAssist"),i=t.get("guideAssist"),r=t.get("tooltipAssist"),a=t.get("eventAssist"),s=t.get("container"),u=t.get("graphContainer");s&&s.removeChild(u),a&&a.destroy(),n&&n.destroy(),r&&r.destroy(),i&&i.destroy(),e&&e.destroy(),A.superclass.destroy.call(this),window.removeEventListener("resize",o.getWrapBehavior(this,"_initForceFitEvent"))},find:function(t){var e=this,n=e.get("itemCache");return n[t]},snapshot:function(){var t=this.get("canvas"),e=t.get("el");return e.toDataURL("image/png")},downloadImage:function(t){var e=this.snapshot(),n=document.createElement("a"),i=t?t:"chart.png";return n.download=i,n.href=e.replace("image/png","image/octet-stream"),n.click(),this},showAnchor:function(t){return t.showAnchor(),this.refreshFront(),this},hideAnchor:function(t){return t.hideAnchor(),this.refreshFront(),this},updateAnchor:function(t,e,n){return t.updateAnchor(e,n),this.refreshFront(),this},setAnchorActived:function(t){var e=t.get("hoverStyle");return t.attr(e),this.refreshFront(),this},setAnchorUnActived:function(t){var e=t.get("attrs");return t.attr(e),this.refreshFront(),this},isInGraph:function(t){var e=this.get("itemCache"),n=!1;return o.each(e,function(e){e===t&&(n=!0)}),n}}),t.exports=A},function(t,e,n){"use strict";var i=n(4),r=n(26),a=n(5),o=function t(e){t.superclass.constructor.call(this,e),this._initEnds()};o.ATTRS={type:"edge",controlPoints:[null,null],source:null,target:null,sourceAnchor:null,targetAnchor:null},i.extend(o,r),i.augment(o,{_initEnds:function(){var t=this,e=t.get("source"),n=t.get("target");e&&e.addEdge(t),n&&n.addEdge(t)},_getEdgePoints:function(){var t,e=this,n=e.get("model"),r=e.get("source"),o=e.get("target"),s=e.get("useAnchor"),u=e.getControlPoints(),c=n.sourceAnchor,h=n.targetAnchor,l=r.getCenter(),d=o?o.getCenter():r.getCenter(),f=u.length,g=e.getShapeCfg(),p=e.get("shapeManger"),v=0,x=f-1;return s?(null===c&&delete n.sourceAnchor,null===h&&delete n.targetAnchor,i.isNumber(c)&&r&&(c=r.getAnchor(c)),i.isNumber(h)&&o&&(h=o.getAnchor(h)),f>2?(r&&!c&&(c=r.getAnchor(u[v+1])),o&&!h&&(h=o.getAnchor(u[x-1]))):(t=a.preciseAnchor&&p.getPath(g.shape,[l,d]),r&&!c&&(c=t?r.getAnchor(t):r.getAnchor(d)),o&&!h&&(h=t?o.getAnchor(t):o.getAnchor(l))),u[0]={x:c.x,y:c.y},u[x]={x:h.x,y:h.y},u):(u[0]={x:l.x,y:l.y},u[x]={x:d.x,y:d.y},u)},beforeDraw:function(){o.superclass.beforeDraw.call(this);var t=this.getShapeCfg(),e=this.get("group");t.points=this._getEdgePoints(),t.target=this.get("target"),t.source=this.get("source"),e.set("controlPoints",this.get("controlPoints"))},getControlPoints:function(){var t=this.get("model"),e=t.controlPoints?t.controlPoints:this.get("controlPoints");return e},addControlPoint:function(t){var e,n,r,a=this.getControlPoints(),o=1/0;return i.each(a,function(s,u){if(n=a[u+1]){if(r=i.segmentDistance(s,n,t),r<1)return e=u,!1;r1?a:a[0]}}),t.exports=r},function(t,e,n){"use strict";var i=n(4),r=function(){};i.augment(r,{isItemActived:function(t){return t.isActived()},setItemActived:function(t,e){this.setItemsActived([t],e)},setItemsActived:function(t,e){if(0!==t.length){var n=this;e!==!1?i.each(t,function(t){t.setActived(),n.fire("itemactived",{item:t})}):i.each(t,function(t){t.clearActived(),n.fire("itemunactived",{item:t})})}},getItems:function(){var t=this.get("itemCache");return i.getObjectValues(t)},getActived:function(){var t=this,e=t.getItems(),n=null;return i.each(e,function(e){if(t.isItemActived(e))return n=e,!1}),n},getAllActived:function(){var t=this,e=t.getItems(),n=[];return i.each(e,function(e){t.isItemActived(e)&&n.push(e)}),n},clearAllActived:function(){var t=this,e=t.getAllActived();return this.setItemsActived(e,!1),this}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=function(){};i.augment(r,{setActiveStatus:function(){},isActived:function(){return this.get("actived")},setActived:function(){this.setActiveStatus(!0),this.set("actived",!0)},clearActived:function(){this.setActiveStatus(!1),this.set("actived",!1)}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(3),a=n(5),o=r.Matrix3,s=function(){};s.ATTRS={fitView:null,fitViewPadding:a.fitViewPadding},i.augment(s,{_fitView:function(){var t=this.get("fitView"),e=this.get("items");i.isString(t)&&e.length>0&&this[t](!1),i.isObject(t)&&this.focusPoint(t,!1)},_zoom:function(t,e,n){var i,r,a=new o,s=this.get("width"),u=this.get("height"),c=this.get("itemGroup"),h=this.get("minZoom"),l=c.getBBox(),d=(l.maxX+l.minX)/2,f=(l.maxY+l.minY)/2,g=this.get("fitViewPadding"),p=d,v=f;i=l.maxX-l.minX+2*g,r=l.maxY-l.minY+2*g,n&&(p=n.x,v=n.y),e&&(s=i,u=r,this.changeSize(i,r)),t||(t=s/i,s/i>u/r&&(t=u/r)),(!t||tMath.abs(t.y-e.y)}function r(t,e,n,r,a){var o=[];if("horizontal"===n)o.push({x:1*(t.x+e.x)/2,y:t.y}),o.push({x:1*(t.x+e.x)/2,y:e.y});else if("vertical"===n)o.push({x:t.x,y:1*(t.y+e.y)/2}),o.push({x:e.x,y:1*(t.y+e.y)/2});else{var s=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y),c=t,h=e;r&&r.getCenter&&(c=r.getCenter()),a&&a.getCenter&&(h=a.getCenter()),i(t,c)||t===c&&u=s?(n=r+u/2-Math.abs(s-e[1]),i=[o,e[1]+n]):(n=r+u/2-Math.abs(s-e[1]),i=[o,e[1]-n])),s===e[1]&&(e[0]>=o?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,s]):(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,s])),i)return i;var d=Math.abs(o-e[0]),f=Math.abs(s-e[1]),g=Math.sqrt(Math.pow(d,2)+Math.pow(f,2)),p=180*Math.asin(f/g)/Math.PI;return e[0]>=o&&e[0]<=h?e[1]>=s&&e[1]<=l?p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]+n]):p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]-n]):e[1]>=s&&e[1]<=l?p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]+n]):p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]-n]),i}var u=n(1),c=n(3),h=n(30),l=n(17),d=n(131),f=c.Vector2,g={polyLineFlow:function(t,e,n){var i=s(e,t[0]),r=s(n,t[1]);n=n.get("boxStash"),e=e.get("boxStash");var a=new d({source:e,target:n,sourcePosition:[t[0].x,t[0].y],sourceHandlePosition:[i[0],i[1]],targetPosition:[t[1].x,t[1].y],targetHandlePosition:[r[0],r[1]]});return a=a.filter(function(t){return t}).map(function(t){return{x:t[0],y:t[1]}}),l.pointsToPolygon(a)},bezierHorizontal:function(t,e,n){return o(t,e,n,"horizontal")},bezierVertical:function(t,e,n){return o(t,e,n,"vertical")},bezierAuto:function(t,e,n){return o(t,e,n,"auto")},bezierQuadratic:function(t){var e=t[0],n=t[t.length-1],i=["M",e.x,e.y],r=a(e,n),o=["Q"],s=[i];return u.each(r,function(t){o.push(t.x,t.y)}),o.push(n.x,n.y),s.push(o),s},line:function(t){var e=l.pointsToPolygon(t);return e},HV:function(t){var e=t.length,n=l.pointsToPolygon([t[0],{x:t[e-1].x,y:t[0].y},t[e-1]]);return n},VH:function(t){var e=t.length,n=l.pointsToPolygon([t[0],{x:t[0].x,y:t[e-1].y},t[e-1]]);return n},HVH:function(t){var e=t.length,n=l.pointsToPolygon([t[0],{x:(t[0].x+t[e-1].x)/2,y:t[0].y},{x:(t[0].x+t[e-1].x)/2,y:t[e-1].y},t[e-1]]);return n},VHV:function(t){var e=t.length,n=l.pointsToPolygon([t[0],{x:t[0].x,y:(t[0].y+t[e-1].y)/2},{x:t[e-1].x,y:(t[0].y+t[e-1].y)/2},t[e-1]]);return n}};t.exports=g},function(t,e,n){"use strict";function i(t){var e=this,n=t.source,i=t.target,a=t.sourcePosition,o=t.targetPosition,s=t.sourceHandlePosition,u=t.targetHandlePosition,c=e.getMaxConflictArea(r.clone(s),r.clone(u),[n,i]),h=c.minCoor,l=c.maxCoor,d=e.getTurnPointGroup(r.clone(s),r.clone(u),[n,i],h,l);return d=[a,s].concat(d).concat([u,o])}var r=n(1),a=10;i.prototype={getTurnPointGroup:function(t,e,n,i,a){function o(t){return!s.isCrossNode(t[0],t[1],n)}for(var s=this,u=[],c=r.clone(t),h=r.clone(e),l=[{source:c,target:[c[0],i.y]},{source:c,target:[c[0],a.y]},{source:c,target:[i.x,c[1]]},{source:c,target:[a.x,c[1]]}],d=[{source:h,target:[h[0],i.y]},{source:h,target:[h[0],a.y]},{source:h,target:[i.x,h[1]]},{source:h,target:[a.x,h[1]]}],f=l,g=d,p=0;ph[0]?c[0]:h[0],N=c[1]h[1]?c[1]:h[1],R=[],D=1/0,G=F;G=r&&(r=t.x-a),t.x-a<=o&&t.x+t.width+a>=o&&(o=t.x+t.width+a),t.y-a<=s&&t.y+t.height+a>=s&&(s=t.y-a),t.y-a<=u&&t.y+t.height+a>=u&&(u=t.y+t.height+a),t}for(var r=Math.min(t[0],e[0]),o=Math.max(e[0],t[0]),s=Math.min(t[1],e[1]),u=Math.max(e[1],t[1]),c=0;c=t[0]&&(n.y>=t[1]&&n.y<=e[1]||n.y+n.height>=t[1]&&n.y+n.height<=e[1]||n.y<=t[1]&&n.y+n.height>=e[1]||n.y>=t[1]&&n.y+n.height<=e[1])}):i.isEqual(t,e,1)?n.some(function(n){return n.y<=t[1]&&n.y+n.height>=t[1]&&(n.x>=t[0]&&n.x<=e[0]||n.x+n.width>=t[0]&&n.x+n.width<=e[0]||n.x<=t[0]&&n.x+n.width>=e[0]||n.x>=t[0]&&n.x+n.width<=e[0])}):void 0}},t.exports=i},function(t,e,n){"use strict";function i(t,e){var n={};return n.arrow=e,t.color&&(n.stroke=t.color),t.size&&(n.lineWidth=t.size),a.mix({},l.edgeStyle,n,t.style)}function r(t,e,n){if(t.label){var i,r;try{i=n.getPoint(.5)}catch(t){}if(!i)return;r=a.isObject(t.label)?a.mix({},l.edgeLabelStyle,t.label,{x:i.x,y:i.y},t.labelStyle):a.mix({},l.edgeLabelStyle,{text:t.label,x:i.x,y:i.y},t.labelStyle);var o=u.drawLabel(e,r,l.zIndex.edgeLabel),s=o.getBBox(),c=s.maxX-s.minX,h=s.maxY-s.minY,d=c+2*f,g=h+2*f;e.addShape("rect",{attrs:a.mix({x:i.x-d/2,y:i.y-g/2,width:d,height:g},l.edgeLabelRectStyle),zIndex:l.zIndex.edgeLabelBackground})}}var a=n(1),o=n(3),s=n(17),u=n(29),c=n(62),h=n(130),l=n(5),d=o.Vector2,f=5,g={getEdgePath:function(t,e,n,i,r){return 2===e.length?h[t](e,i,r):"curve"===n?s.pointsToCurve(e):s.pointsToPolygon(e)},drawEdge:function(t,e,n,a,o){var s,u=i(e,a),c=g.getEdgePath(t,e.points,o,e.source,e.target);return u.path=c,s=n.addShape("path",{attrs:u,zIndex:l.zIndex.edge}),r(e,n,s),n.radixSort(),s},arrowTo:function(t,e,n,i,r,a,o){var s=new d(1,0),u=new d(a-i,o-r),c=u.angleTo(s,!0);return t.transform([["r",c],["t",e,n]]),t},snapPreciseAnchor:function(t,e){var n=e.getIntersectionByPath(t),i=c.getSnapAnchor(e,n);return i}};t.exports=g},function(t,e,n){"use strict";function i(t){return u.isObject(t.label)?u.mix({},c.nodeLabelStyle,t.label,{x:t.x,y:t.y}):u.mix({},c.nodeLabelStyle,{text:t.label,x:t.x,y:t.y})}function r(t,e){e.attr({y:e.attr("y")+t.attr("height")/2+f})}function a(t){var e=t.getBBox(),n=e.maxX-e.minX,i=e.maxY-e.minY,r=n+2*d[1],a=i+2*d[0];return[r,a]}function o(t,e,n){var r,o;return n=n?n:a,u.isNull(t.label)||(r=u.mix(i(t),t.labelStyle),o=l.drawLabel(e,r,c.zIndex.nodeLabel),t.size||(t.size=n(o))),t.size||(t.size=[g,g]),u.isNumber(t.size)&&(t.size=[t.size,t.size]),o}function s(t,e,n){var a,o,s={img:n};if(t.size||(t.size=g),s.width=u.isArray(t.size)?t.size[0]:t.size,s.height=u.isArray(t.size)?t.size[1]:t.size,s.x=t.x-s.width/2,s.y=t.y-s.height/2,o=e.addShape("image",{attrs:s,zIndex:c.zIndex.node}),t.label){var h=u.mix(i(t),t.labelStyle);h.textBaseline="top",a=l.drawLabel(e,h,c.zIndex.nodeLabel),r(o,a)}return o}var u=n(1),c=n(5),h=n(17),l=n(29),d=c.nodePadding,f=5,g=50,p={rect:function(t,e,n){o(t,e);var i,r,a=t.size[0],s=t.size[1],u=t.x-a/2,c=t.y-s/2;return r=n.radius?h.getRectPath(u,c,a,s,n.radius):h.getRectPath(u,c,a,s),i=e.addShape("path",{attrs:{path:r}})},circle:function(t,e){o(t,e,function(t){var e,n,i,r,a,o=t.getBBox(),s=o.maxX-o.minX+2*d[1],u=o.maxY-o.minY+2*d[0];return e=(s+u/2)/2,n=Math.acos(s/2/e),a=2*(Math.sin(n)*e),r=2*e,s0?(t.updateItem(e,n),t.updateRollback(),t.clearAllActived(),t.setItemActived(e),t.draw(!1),t.endAdd(e)):(t.removeItem(e),t.refreshFront(),t.endAdd())}r.dragEdgeExtremePoint(t,e,n,i)}},function(t,e,n){"use strict";var i=n(2),r=n(18);i.dragBlankX=function(t){r(t,!0,!0,!1)}},function(t,e,n){"use strict";var i=n(2),r=n(18);i.dragBlankY=function(t){r(t,!0,!1)}},function(t,e,n){"use strict";var i=n(2),r=n(4);i.dragEdgeEndHideAnchor=function(t){t._on("dragedgeend",function(t){r.isNode(t.item)&&t.item.hideAnchor()})}},function(t,e,n){"use strict";var i=n(2),r=n(9),a=n(4);i.dragEdge=function(t){function e(e){var n,i=e.shape;if(i&&i.hasClass("control-point")&&(n=i.get("item"),t.isEdge(n)))return n}function n(t,e){var n,i=t.shape;if(e&&(n=i.get("pointIndex"),e.isExtremePoint(n)))return n}function i(e,n){a.getObjectValues(n).length>0?(t.updateItem(e,n),t.updateRollback(),t.draw(!1)):t.refreshFront()}r.dragEdgeExtremePoint(t,e,n,i)}},function(t,e,n){"use strict";var i=n(2);i.dragHideEdges=function(t){var e=t.get("edgeGroup");t._on("dragstart",function(){e.hide(),t.draw(!1)}),t._on("dragend",function(){e.show(),t.draw(!1)}),t._on("dommouseleave",function(){e.show(),t.draw(!1)})}},function(t,e,n){"use strict";var i=n(2),r=n(9);i.dragHideTexts=function(t){t._on("dragstart",function(){r.hideTexts(t)}),t._on("dragend",function(){r.showTexts(t)}),t._on("dommouseleave",function(){r.showTexts(t)})}},function(t,e,n){"use strict";var i=n(2);i.dragNodeEndHideAnchor=function(t){t._on("dragnodeend",function(t){1===t.dragItems.length?t.node.showAnchor():t.node.hideAnchor()})}},function(t,e,n){"use strict";var i=n(2);i.dragNodeEndSetActive=function(t){t._on("dragnodeend",function(e){1===e.dragItems.length&&(t.clearAllActived(),t.setItemActived(e.dragItems[0]))})}},function(t,e,n){"use strict";var i=n(1),r=n(2),a=n(9);r.dragNode=function(t){var e,n,r,o,s,u,c,h=t.get("gridAssist"),l=h&&h.forceAlign,d=t.get("behaviourSignal"),f=[],g=null,p=!1;t._on("mousedown",function(a){r=a.shape,n=a.item,!t.isNode(n)||r&&r.hasClass("control-point")||r&&r.hasClass("anchor-point")||(g={x:a.x,y:a.y},n.isActived()?(e=t._getAllActived(),i.each(e,function(t){f.push(t)})):f.push(n))}),t._on("dragmove",function(e){i.isArray(f)&&0!==f.length&&(p=!0,d.draggingNode=!0,i.each(f,function(n){t.isNode(n)&&(c=n.getBBox(),u={x:(c.x+c.maxX)/2,y:(c.y+c.maxY)/2},n.showDelegation({x:u.x+e.x-g.x,y:u.y+e.y-g.y}))}),t.refreshFront())}),t._on("mouseup",function(r){i.isArray(f)&&0!==f.length&&(p&&(n=r.item,f=i.filter(f,function(e){return t.isInGraph(e)}),i.each(f,function(e){t.isNode(e)?(u=e.getPosition(),o={x:u.x+r.x-g.x,y:u.y+r.y-g.y},n!==e&&e&&!e.hasClass("preventToFront")&&t.toFront(e),l&&a.alignPoint(o,h.cell),e.hideDelegation()):(s=e.getControlPoints(),o={},s.length>2&&(i.each(s,function(t,e){0!==e&&e!==s.length-1&&(t.x=t.x+r.x-g.x,t.y=t.y+r.y-g.y,l&&a.alignPoint(t,h.cell))}),o={controlPoints:s})),t.updateItem(e,o),t.isNode(e)&&t.fire("dragnodeend",{dragItems:f,node:e})}),t.updateRollback(),t.draw(!1)),g=null,n=void 0,u=void 0,s=void 0,e=void 0,o=void 0,f=[],p=!1,d.draggingNode=void 0)})}},function(t,e,n){"use strict";var i=n(2);i.hoverAnchorSetActived=function(t){var e;t._on("mouseenter",function(n){e=n.shape,e&&e.hasClass("anchor-point")&&t.setAnchorActived(e)}),t._on("mouseleave",function(n){e=n.shape,e&&e.hasClass("anchor-point")&&t.setAnchorUnActived(e)})}},function(t,e,n){"use strict";var i=n(2);i.hoverNodeShowAnchor=function(t){var e,n=t.get("behaviourSignal");t._on("itemmouseenter",function(i){"node"!==i.itemType||n.draggingNode||(e=setTimeout(function(){!t.destroyed&&t.showAnchor(i.item)},200))}),t._on("itemmouseleave",function(n){"node"===n.itemType&&(clearTimeout(e),!t.destroyed&&t.hideAnchor(n.item))})}},function(t,e,n){"use strict";var i=n(2),r=n(9);i.mouseupAddNode=function(t){r.addNode(t,"mouseup")}},function(t,e,n){"use strict";var i=n(1),r=n(2),a=n(5),o=n(4);r.multiSelect=function(t){var e,n,r,s,u,c,h,l,d,f,g,p=t.get("frontCanvasRootGroup"),v=t.get("behaviourSignal"),x=!1,m=[];t._on("mousedown",function(t){s=t.item,u=t.shape,s||c||u||(h={x:t.x,y:t.y},c=p.addShape("rect",{attrs:a.frameRectStyle}),v.frameSelecting=!0)}),t._on("dragmove",function(e){c&&(l=Math.min(h.x,e.x),d=Math.min(h.y,e.y),f=Math.max(h.x,e.x),g=Math.max(h.y,e.y),c.attr({x:l,y:d,width:f-l,height:g-d}),t.refreshFront())}),t._on("mouseup",function(){c&&(e=t.get("itemCache"),i.each(e,function(e){n=e.getBBox(),r=[{x:n.x,y:n.y},{x:n.x,y:n.maxY},{x:n.maxX,y:n.y},{x:n.maxX,y:n.maxY}],i.each(r,function(n,i){if(x=o.isInRect(n,l,d,f,g),t.isNode(e)){if(x)return m.push(e),!1}else{if(!x)return!1;i===r.length-1&&m.push(e)}})}),t.clearAllActived(),t.setItemsActived(m),c.remove(!0),t.refreshFront(),v.frameSelecting=void 0,s=void 0,c=void 0,h=void 0,l=void 0,d=void 0,f=void 0,g=void 0,m=[])})}},function(t,e,n){"use strict";var i=n(2),r=n(9),a=n(4);i.resizeEdge=function(t){var e,n,i,o,s,u,c,h,l,d,f,g,p=t.get("gridAssist"),v=p&&p.forceAlign;t._on("click",function(i){e=i.item,n=t.getActived(),g=i.shape,!t.isEdge(e)||e!==n||g&&g.hasClass("control-point")||(e.addControlPoint({x:i.x,y:i.y}),s=e.getControlPoints(),t.updateItem(e,{controlPoints:s}),t.updateRollback(),t.refreshFront())}),t._on("mousedown",function(e){if(g=e.shape,g&&g.hasClass("control-point")){if(i=g.get("item"),!t.isEdge(i))return void(i=void 0);if(d=g.get("pointIndex"),i.isExtremePoint(d))return i=void 0,void(d=void 0);o=g.get("point"),s=i.getControlPoints(),u=s[d-1],c=s[d+1]}}),t._on("dragmove",function(n){t.isEdge(i)&&(e=n.item,f={x:n.x,y:n.y,controlPointIndex:d},a.isInSegment(u,c,f)?f.stroke="red":f.stroke="blue",i.showDelegation(f),t.refreshFront())}),t._on("mouseup",function(x){t.isEdge(i)&&(e=x.item,h={x:x.x,y:x.y},l={},i.hideDelegation(),a.isInSegment(u,c,h)?s.splice(d,1):0!==d&&d!==s.length-1&&(o.x=h.x,o.y=h.y,v&&r.alignPoint(o,p.cell),l.controlPoints=s),t.updateItem(i,l),t.updateRollback(),t.draw(!1),e=void 0,n=void 0,i=void 0,o=void 0,s=void 0,u=void 0,c=void 0,h=void 0,l=void 0,d=void 0,f=void 0,g=void 0)})}},function(t,e,n){"use strict";var i=n(2),r=n(9);i.resizeNode=function(t){var e,n,i,a,o,s,u,c=t.get("behaviourSignal"),h=!1;t._on("mousedown",function(t){e=t.shape,e&&e.hasClass("control-point")&&(o=e.get("item"),s=e.get("point"),u=e.get("pointIndex"))}),t._on("dragmove",function(e){t.isNode(o)&&(h=!0,c.resizingNode=!0,n={x:e.x,y:e.y},a=r.getControlInfo(n,u,s,o,"frontCanvas"),i=a.size,i[0]>5&&i[1]>5&&(o.showDelegation(a),t.refreshFront()))}),t._on("mouseup",function(l){t.isNode(o)&&(h&&(n={x:l.x,y:l.y},a=r.getControlInfo(n,u,s,o),i=a.size,i[0]>5&&i[1]>0&&(t.updateItem(o,a),t.updateRollback()),o.hideDelegation(),t.draw(!1)),c.resizingNode=void 0,e=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,h=!1,u=void 0)})}},function(t,e,n){"use strict";var i=n(2);i.shortcut=function(t){var e=!1;t._on("keydown",function(n){if(32===n.keyCode){if(e)return;e=!0,"drag"===t.get("mode")?t.changeMode("edit"):t.changeMode("drag"),e=!0}return n.metaKey&&67===n.keyCode?void t.copy():n.metaKey&&86===n.keyCode?void t.paste():n.metaKey&&n.altKey&&90===n.keyCode?void t.redo():n.metaKey&&90===n.keyCode?void t.updo():n.ctrlKey&&67===n.keyCode?void t.copy():n.ctrlKey&&86===n.keyCode?void t.paste():n.ctrlKey&&n.altKey&&90===n.keyCode?void t.redo():n.ctrlKey&&90===n.keyCode?void t.updo():8===n.keyCode?void t.del():void 0}),t._on("keyup",function(){e=!1})}},function(t,e,n){"use strict";var i=n(2);i.spreadout=function(t){t._on("click",function(e){var n=e.shape;n&&n.hasClass("spreadoutButton")&&(t.fire("spreadout",e),t.css({cursor:"default"}))}),t._on("spreadout",function(e){var n=t.get("dataMap"),i=e.item,r=i.get("id");n[r].isCollapsed=!1,t.clearAllActived(),t.refreshFront(),t.reRender()})}},function(t,e,n){"use strict";var i=n(2),r=n(9);i.wheelZoomHideEdges=function(t){var e=t.get("edgeGroup");r.wheelZoomHide(t,function(){e.hide(),t.draw(!1)},function(){e.show(),t.draw(!1)})}},function(t,e,n){"use strict";var i=n(2),r=n(9);i.wheelZoomHideTexts=function(t){r.wheelZoomHide(t,function(){r.hideTexts(t)},function(){r.showTexts(t)})}},function(t,e,n){"use strict";n(63),n(134),n(135),n(150),n(136),n(138),n(64),n(139),n(140),n(18),n(142),n(141),n(143),n(144),n(147),n(145),n(148),n(149),n(151),n(152),n(153),n(154),n(65),n(156),n(157),n(146)},function(t,e,n){"use strict";var i=n(1),r=n(13),a=r.Util,o={max:5,current:0,cache:[]},s={nodes:[],edges:[]},u=function(){};u.ATTRS={clipboard:!1,rollback:!1},i.augment(u,{_initEditor:function(){var t=this.get("rollback"),e=this.get("clipboard");t&&(i.isObject(t)?this.set("rollback",i.mix({},o,t)):this.set("rollback",i.clone(o))),e&&this.set("clipboard",i.clone(s))},_changeData:function(t,e){this._clearInner(),this._initData(),this.source(t,e),this.render(!1)},updateRollback:function(){var t=this.get("rollback");if(i.isObject(t)){var e=t.current,n=t.cache,r=t.max,a=n.length,o=this.save().source;n.splice(0,e,o),a>r&&n.splice(r,a-r+1),t.current=0}},copy:function(){var t,e,n,r=this,o=r.getAllActived(),s=r.get("clipboard"),u={};s.nodes=[],s.edges=[],i.each(o,function(c){t=i.mix(!0,{},c.get("model"),{id:a.guid()}),u[c.get("model").id]=t.id,r.isNode(c)?(t.x+=10,t.y-=10,s.nodes.push(t)):(e=c.get("model").target,n=c.get("model").source,e=r.find(e),n=r.find(n),o.indexOf(e)!==-1&&o.indexOf(n)!==-1&&(t.controlPoints&&i.each(t.controlPoints,function(e,n){t.controlPoints[n]={x:e.x+=10,y:e.y-=10}}),t.target=u[t.target],t.source=u[t.source],s.edges.push(t)))}),this.refresh()},paste:function(){var t=this,e=t.get("clipboard"),n=t.addNodes(e.nodes);n=n.concat(t.addEdges(e.edges)),t.clearAllActived(),t.setItemsActived(n),e.nodes=[],e.edges=[],t.updateRollback(),this.refresh()},del:function(){var t=this,e=t.getAllActived();i.each(e,function(e){t.removeItem(e)}),this.updateRollback(),this.refresh()},updo:function(){var t=this.get("rollback");if(i.isObject(t)){var e=t.cache,n=t.current,r=n+1,a=e[r];0!==e.length&&a&&(a=i.clone(a),this._changeData(a.nodes,a.edges),t.current=r,this.refresh())}},redo:function(){var t=this.get("rollback");if(i.isObject(t)){var e=t.cache,n=t.current,r=n-1,a=e[r];0!==e.length&&a&&(a=i.clone(a),this._changeData(a.nodes,a.edges),t.current=r,this.refresh())}},beginAdd:function(t,e){this.changeMode("add"),this.set("addingType",t),this.set("addingModel",e)},endAdd:function(t){this.changeMode("edit"),this.set("addingType",""),this.set("addingModel",null),t&&this.fire("afteradd",{item:t})}}),t.exports=u},function(t,e,n){"use strict";var i=n(161);n(158),i.Mode={default:["dragNode","dragEdge","dragBlank","clickBlankClearActive","resizeEdge","clickActive","resizeNode","wheelZoom","dragNodeEndSetActive"],edit:["dragNode","dragEdge","clickBlankClearActive","resizeEdge","clickActive","dragNodeEndSetActive","multiSelect","resizeNode","shortcut","wheelZoom","hoverNodeShowAnchor","hoverAnchorSetActived","dragEdgeEndHideAnchor","dragNodeEndHideAnchor"],drag:["shortcut","dragCanvas","wheelZoom"],add:["clickAddNode","dragAddEdge","hoverAnchorSetActived","hoverNodeShowAnchor"],complicated:["dragCanvas","wheelZoom","dragHideEdges","wheelZoomHideEdges"],analysis:["dragCanvas","wheelZoom","dragHideEdges","dragHideTexts","wheelZoomHideEdges","wheelZoomHideTexts"],none:[]},t.exports=i},function(t,e,n){"use strict";var i=n(1),r=n(159),a=n(13),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={defaultNodeShape:"rect"},i.extend(o,a),i.mixin(o,[r]),i.augment(o,{_doLayout:function(){var t=this.get("layout");t&&(t.nodes=this.get("nodes"),t.edges=this.get("edges"),t.execute())},_initCfg:function(){var t=this.get("mode");"analysis"===t&&(this.set("useAnchor",!1),this.set("useFreezeSizeGroup",!0),this.set("useEdgeSortGroup",!1),this.set("grid",null)),"edit"===t&&(this.set("wheelScaleLimit",[.5,4]),this.set("rollback",!0),this.set("clipboard",!0))},_readSource:function(t){this.source(t.nodes,t.edges)},_saveSource:function(){function t(t,e){i.each(t.get("children"),function(t){var n=t.get("id"),i=s[n];e.push(i.get("model"))})}var e=this,n=[],r=[],a=e.get("nodeGroup"),o=e.get("edgeGroup"),s=e.get("itemCache");return t(a,n),t(o,r),i.clone({nodes:n,edges:r})},render:function(t){void 0===t&&(t=this.get("rollback")),o.superclass.render.call(this),t!==!1&&this.updateRollback()},add:function(t,e){var n,i=this;return"node"===t?n=i.addNodes([e]):"edge"===t&&(n=i.addEdges([e])),this.draw(),n[0]},update:function(t,e){this.updateItem(t,e),this.draw()},remove:function(t){this.removeItem(t),this.draw()}}),t.exports=o},function(t,e,n){"use strict";n(64),n(137),n(155),n(63),n(65)},function(t,e,n){"use strict";var i=n(13),r=n(164);n(162),r.Mode={default:["dragBlank","collapse","spreadout","buttonPointer","wheelZoom"],none:[]},i.registNode("tree-node",{style:function(){return{fillOpacity:1}}},"rect"),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(32),a=n(23),o=n(165),s=n(5),u=n(13),c=a.Util,h=u.Util,l=function t(e){t.superclass.constructor.call(this,e)};l.ATTRS={layoutFn:r.CompactBoxTree,layoutCfg:{direction:"LR",getHGap:function(){return 40},getVGap:function(){return 10}},layout:null,grid:null,data:null,dataMap:null,showButton:!0,defaultNodeShape:"tree-node",animate:!0},i.extend(l,u),i.augment(l,{_readSource:function(t){this.source(t)},_saveSource:function(){var t=this.get("data"),e=o.clone(t,{parent:!0});return e},_createMap:function(t){var e={};return t.root=!0,t.id||(t.id=h.guid()),e[t.id]=t,o.traverseTree(t,function(t,n){t.id||(t.id=h.guid()),t.parent=n,e[t.id]=t}),e},_setWidthHeight:function(){var t,e,n=this.get("itemCache"),r=this.get("dataMap"),a=h.getObjectValues(r);this.set("nodes",a),this._drawItems(),i.each(a,function(i){t=i.id,e=n[t].getBBox(),r[t].width=e.width,r[t].height=e.height}),this._clearInner(),this._initData()},_doLayout:function(){var t=this.get("data"),e=this.get("layout");this._checkData(t)&&(this.set("dataMap",this._createMap(t)),this._setWidthHeight(),e.root=t,this.set("nodes",e.getNodes()),this.set("edges",e.getEdges()))},source:function(t){this.set("data",t)},reRender:function(){var t=this.get("data");this.clearAllActived(),this.refreshFront(),this._clearInner(),this._initData(),this.source(t),this._drawInner(),this.draw()},enterAnimate:function(t,e,n){var i,r=h.getBBox(t,t),a=r.centerX,s=r.centerY,u=t.get("shapeCfg"),l=u.origin;i="node"===t.get("type")?o.getButtonPoint(l,e,a,s):o.getButtonPoint(n[l.target].model,e,a,s),c.scaleIn(t,i.x,i.y,a,s)},leaveAnimate:function(t,e,n){var i,r=h.getBBox(t,t),a=r.centerX,s=r.centerY,u=t.get("shapeCfg"),l=u.origin;i="node"===t.get("type")?o.getButtonPoint(l,n,a,s):o.getButtonPoint(e[l.target].model,n,a,s),c.scaleOut(t,i.x,i.y)},beforeNodeDraw:function(t){var e=this,n=t.getShapeCfg(),i=e.get("layout");n.direction=i.options.direction,t.addChild=function(n){return e.add(t.get("id"),n)}},afterNodeDraw:function(t){var e,n,i=this.get("showButton"),r=t.get("group"),a=t.getShapeCfg(),u=t.getKeyShape(),c=t.get("shapeObj"),l=a.origin,d=u.getBBox(),f=l.inAnchor,g=l.outAnchor;if(c.getAnchorPoints=function(){return f?[f,g]:"center"},e=t.calculateAnchorPoints(d),!l.root&&e){switch(n=h.getpointInRectQuadrant(d,e[1])){case 0:a.buttonX=e[1].x,a.buttonY=e[1].y-s.treeButtonRadius;break;case 1:a.buttonX=e[1].x+s.treeButtonRadius,a.buttonY=e[1].y;break;case 2:a.buttonX=e[1].x,a.buttonY=e[1].y+s.treeButtonRadius;break;case 3:a.buttonX=e[1].x-s.treeButtonRadius,a.buttonY=e[1].y;break;default:a.buttonX=e[1].x,a.buttonY=e[1].y}if(l.isCollapsed?a.buttonType="plus":a.buttonType="minus",!i)return r.set("buttonX",(d.minX+d.maxX)/2),void r.set("buttonY",(d.minY+d.maxY)/2);l.children&&0!==l.children.length&&o.drawButton(a,r),r.set("buttonX",a.buttonX),r.set("buttonY",a.buttonY)}},add:function(t,e){var n=this.get("dataMap"),r=n[t],a=e.id;return a||(a=i.guid(),e.id=a),i.isArray(r.children)?r.children.push(e):r.children=[e],this.reRender(),this.find(a)},remove:function(t){var e,n,r=this.get("dataMap");return i.isString(t)&&(t=r[t]),n=t.parent,n?(e=n.children,n.children=i.filter(e,function(e){return t!==e})):this.source({}),this.reRender(),this},update:function(t,e){return l.superclass.updateItem.call(this,t,e),this.reRender(),t},_checkData:function(t){return t&&i.isObject(t)&&h.getObjectValues(t).length>0}}),t.exports=l},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=n(1),a=n(13),o=n(5),s=a.Util,u={traverseTree:function(t,e){var n=t.children;r.each(n,function(n){e(n,t),n.children&&u.traverseTree(n,e)})},getButtonPoint:function(t,e,n,i){for(var r,a=t.parent;t&&a&&!e[a.id];)a=a.parent;return a?(r=e[a.id].origin,s.applyPoint({x:r.get("buttonX"),y:r.get("buttonY")},r)):{x:n,y:i}},clone:function(t,e){var n;if(r.isArray(t)){n=[];for(var a=0,o=t.length;a