!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GGEditorCore=e():t.GGEditorCore=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=25)}([function(t,e,n){"use strict";function r(t,e,n){return t.addShape("path",{attrs:{...n,path:e}})}function i(t){return[{x:t.centerX,y:t.minY},{x:t.maxX,y:t.centerY},{x:t.centerX,y:t.maxY},{x:t.minX,y:t.centerY}]}function o(t,e){const n=i(e);let r,o,a=1/0;return n.forEach((e,n)=>{const i=(s=t,c=e,Math.sqrt(Math.pow(s.x-c.x,2)+Math.pow(s.y-c.y,2)));var s,c;ie&&(o=e,n=h,r=d,i=l)}}var a,s;return{verticalPoint:r,index:n,vertical:i}}function l(t,e,n){const r=function(t){if(!t)return{x:void 0,y:void 0};const e=t.getBBox();return{x:e.centerX,y:e.centerY}}(e);let a=t.getLinkPoints(r)[0];if(n){const r=i(t.getBBox())[n];s=t.getBBox(),c=r,u={x:e.getBBox().centerX,y:e.getBBox().centerY},((s.centerX-c.x)*(s.centerX-u.x)>0||(s.centerY-c.y)*(s.centerY-u.y)>0)&&(a=r)}var s,c,u;a=o(a,t.getBBox());let h=e.getLinkPoints(a.point)[0];return h=o(h,e.getBBox()),{sourcePoint:a,targetPoint:h}}function d(t,e,n){return c(e,n)?t.minX>e[n].x?1:t.maxXe[n].y?1:t.maxY{t.registerNode=(t,i,o)=>{r.registerNode(t,i,s(o,e+"-base",n))},t.registerEdge=(t,i,o)=>{r.registerEdge(t,i,s(o,e+"-base",n))},t.registerGroup=(t,i,o)=>{r.registerGroup(t,i,s(o,e+"-base",n))},t.registerGuide=(t,i,o)=>{r.registerGuide(t,i,s(o,e+"-base",n))},t.registerBehaviour=(t,e,n)=>{r.registerBehaviour(t,t=>{const n=t.get("page");n.set("_graph",t),e(n)},n)}},i.setRegister(i,"page"),n(44),t.exports=i},function(t,e,n){const r=n(7),i=n(22),o=n(63),a=n(64),s={...r.Util,...i,...o,...a};t.exports=s},function(t,e,n){const r=n(21),i=n(4),o=n(14),a=n(34),s=n(35),c=n(37),u=[a,n(38),n(39),s,c,n(40),n(42),n(43)];class h extends r{constructor(t){const e={defaultData:null,shortcut:{redo:!0,undo:!0,delete:!0,resetZoom:!0,autoZoom:!0,zoomIn:!0,zoomOut:!0},_controllers:{},_signals:{}};i.each(u,t=>{i.mix(e,t.CFG)}),i.mix(!0,e,t),super(e),this.isPage=!0,this.type="page",this._init()}getDelegation(t,e){if(!e){e=this.getGraph().getRootGroup()}let n;if(1!==t.length||t[0].isNode||t[0].isGroup){const r=i.getTotalBBox(t.map(t=>t.getBBox()));n=i.getRectByBox(r,e,o.nodeDelegationStyle),n.set("capture",!1)}else t[0].isEdge?n=e.addShape("path",{attrs:{path:"M0 0L 1 1",...o.edgeDelegationStyle},capture:!1}):(n=i.getRectByBox(t[0],e,o.nodeDelegationStyle),n.set("capture",!1));return n}focusGraphWrapper(){this.getGraph().getKeyboardEventWrapper().focus()}saveImage(t){const e=this.getGraph(),n=e.getBBox(),r=e.getFitViewPadding();let i,o;return e.saveImage({width:n.width+r[1]+r[3],height:n.height+r[0]+r[2],beforeTransform:()=>{i=this.getSelected().map(t=>t.id),o=this.getSelected().map(t=>t.id),this.clearSelected(),this.clearActived()},afterTransform:()=>{this.setSelected(i,!0),this.setActived(o,!0)},...t})}_init(){i.each(u,t=>{t.INIT&&this[t.INIT]()}),this.bindEvent(),this._cacheBBox()}executeCommand(t,e){const n=this.editor;n?n.executeCommand(t,e):t()}_cacheBBox(){const t=this.getGraph();this.set("bboxCache",t.getBBox())}bindEvent(){this.getGraph().on("afterchange",()=>{this._cacheBBox()})}translateLimt(t){const e=this.getGraph(),n=this.get("bboxCache"),r=e.getWidth(),o=e.getHeight(),a=[n.minX,n.minY,1],s=[n.maxX,n.maxY,1];return i.vec3.transformMat3(a,a,t),i.vec3.transformMat3(s,s,t),s[0]<100&&i.mat3.translate(t,t,[100-s[0],0]),s[1]<100&&i.mat3.translate(t,t,[0,100-s[1]]),a[1]>o-100&&i.mat3.translate(t,t,[0,o-100-a[1]]),a[0]>r-100&&i.mat3.translate(t,t,[r-100-a[0],0]),!0}setSignal(t,e){this.get("_signals")[t]=e}getSignal(t){return this.get("_signals")[t]}setController(t,e){this.get("_controllers")[t]=e}getController(t){return this.get("_controllers")[t]}destroy(){const t=this.get("_graph"),e=this.get("_controllers");i.each(e,t=>{t.destroy()}),t.destroy()}}i.each(u,t=>{i.mix(h.prototype,t.AUGMENT)}),t.exports=h},function(t,e,n){const r=n(6),i=n(14),o=r.createDOM("").getContext("2d");t.exports={...r,getPanCanvasBehaviour:t=>e=>{const n=e.getGraph();let o,a;n.behaviourOn("canvas:mouseenter",()=>{e.css({cursor:i.cursor.beforePanCanvas})}),n.behaviourOn("mouseleave",t=>{t.toShape||e.css({cursor:i.cursor.beforePanCanvas})}),n.behaviourOn("mousedown",r=>{(2!==r.button&&!t||!r.shape||r.item&&!1===r.item.dragable&&"mind-root"!==r.item.shapeObj.type&&!e.getSignal("dragEdge"))&&(o={x:r.domX,y:r.domY},e.css({cursor:i.cursor.panningCanvas}),a=n.getMatrix(),e.setCapture(!1))}),n.behaviourOn("drag",t=>{if(o){const i=t.domX-o.x,s=t.domY-o.y,c=[];r.mat3.translate(c,a,[i,s]),e.translateLimt(c)&&(n.updateMatrix(c),n.draw())}}),n.behaviourOn("mouseup",()=>{o&&(o=void 0,a=void 0,e.setCapture(!0),e.css({cursor:i.cursor.beforePanCanvas}))})},getLabelTextByTextLineWidth(t,e,n=320){o.font=e;let r=o.measureText(t).width;if(r>n){r=0;for(let e=1;e=n&&(t=t.substring(0,e)+"\n"+t.substring(e,t.length),e+=1,r=0)}return t}}},function(t,e){t.exports={orbitGap:10,nodeDefaultShape:"flow-node",edgeDefaultShape:"flow-smooth",groupDefaultShape:"flow-group",nodeActivedOutterStyle:{lineWidth:0},groupSelectedOutterStyle:{stroke:"#E0F0FF",lineWidth:2},nodeSelectedOutterStyle:{stroke:"#E0F0FF",lineWidth:2},edgeActivedStyle:{stroke:"#1890FF",strokeOpacity:.92},nodeActivedStyle:{fill:"#F3F9FF",stroke:"#1890FF"},groupActivedStyle:{stroke:"#1890FF"},edgeSelectedStyle:{lineWidth:2,strokeOpacity:.92,stroke:"#A3B1BF"},nodeSelectedStyle:{fill:"#F3F9FF",stroke:"#1890FF"},groupSelectedStyle:{stroke:"#1890FF",fillOpacity:.92},nodeStyle:{stroke:"#CED4D9",fill:"#FFFFFF",shadowOffsetX:0,shadowOffsetY:4,shadowBlur:10,shadowColor:"rgba(13, 26, 38, 0.08)",lineWidth:1,radius:4,fillOpacity:.92},edgeStyle:{stroke:"#A3B1BF",strokeOpacity:.92,lineWidth:1,lineAppendWidth:8,endArrow:!0},groupBackgroundPadding:[40,10,10,10],groupLabelOffsetX:10,groupLabelOffsetY:10,edgeLabelStyle:{fill:"#666",textAlign:"center",textBaseline:"middle"},edgeLabelRectPadding:4,edgeLabelRectStyle:{fill:"white"},nodeLabelStyle:{fill:"#666",textAlign:"center",textBaseline:"middle"},groupStyle:{stroke:"#CED4D9",radius:4},groupLabelStyle:{fill:"#666",textAlign:"left",textBaseline:"top"},multiSelectRectStyle:{fill:"#1890FF",fillOpacity:.08,stroke:"#1890FF",opacity:.1},dragNodeHoverToGroupStyle:{stroke:"#1890FF",lineWidth:2},dragNodeLeaveFromGroupStyle:{stroke:"#BAE7FF",lineWidth:2},anchorPointStyle:{radius:3.5,fill:"#fff",stroke:"#1890FF",lineAppendWidth:12},anchorHotsoptStyle:{radius:12,fill:"#1890FF",fillOpacity:.25},anchorHotsoptActivedStyle:{radius:14},anchorPointHoverStyle:{radius:4,fill:"#1890FF",fillOpacity:1,stroke:"#1890FF"},nodeControlPointStyle:{radius:4,fill:"#fff",shadowBlur:4,shadowColor:"#666"},edgeControlPointStyle:{radius:6,symbol:"square",lineAppendWidth:6,fillOpacity:0,strokeOpacity:0},nodeSelectedBoxStyle:{stroke:"#C2C2C2"},cursor:{panningCanvas:"-webkit-grabbing",beforePanCanvas:"-webkit-grab",hoverNode:"move",hoverEffectiveAnchor:"crosshair",hoverEdge:"default",hoverGroup:"move",hoverUnEffectiveAnchor:"default",hoverEdgeControllPoint:"crosshair",multiSelect:"crosshair"},zIndex:{anchorPoint:3,anchorHotsopt:2,selectedBox:1,controlPoint:4},polylineEdgeStyle:{offset:10,borderRadius:5},addToGroupDelayTime:400,outFromGroupDelayTime:400}},function(t,e,n){const r=n(7),i=n(28),o=n(29),a={whitespace:{9:"Tab",13:"Enter",32:"Space"},fn:{112:"f1 ",113:"f2 ",114:"f3 ",115:"f4 ",116:"f5 ",117:"f6 ",118:"f7 ",119:"f8 ",120:"f9 ",121:"f10",122:"f11",123:"f12"},letter:{65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z"},number:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9"},navigation:{37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},symbol:{110:"decimal point",186:"semi-colon",187:"=",188:"comma",189:"-",190:"period ",191:"/",192:"grave accent",219:"open bracket ",220:"back slash ",221:"close bracket ",222:"single quote "},smallNumberKey:{96:"numpad 0 ",97:"numpad 1 ",98:"numpad 2 ",99:"numpad 3 ",100:"numpad 4 ",101:"numpad 5 ",102:"numpad 6 ",103:"numpad 7 ",104:"numpad 8 ",105:"numpad 9 "},modifierKey:{16:"Shift",17:"Ctrl ",18:"Alt",20:"caps lock"},escKey:{8:"Backspace",46:"Delete",27:"Escape"},homeKey:{91:"Windows Key / Left command",92:"right window key ",93:"Windows Menu"},computeKey:{106:"multiply ",107:"add",109:"subtract ",111:"divide "}},s={...r.Util,...i,getNodeSize(t){if(t){if(r.Util.isNumber(t))return[t,t];if(r.Util.isString(t)){if(-1===t.indexOf("*")){const e=Number(t);return[e,e]}return t.split("*")}return t}return[96,48]},getTypeAndChar(t){let e,n;t=""+t;for(const r in a){e=r;for(const i in a[r])if(i===t)return n=a[r][i],{type:e,character:n}}return{}},getKeyboradKey:t=>t.key||s.getTypeAndChar(t.keyCode).character,getIndex:t=>t.getParent().get("children").indexOf(t),setId(t){t.id||(t.id=r.Util.guid())},pointLineDistance(t,e,n,i,o,a){const s=[n-t,i-e];if(r.Util.vec2.exactEquals(s,[0,0]))return NaN;const c=[-s[1],s[0]];r.Util.vec2.normalize(c,c);const u=[o-t,a-e];return Math.abs(r.Util.vec2.dot(u,c))},getRectByBox:(t,e,n)=>e.addShape("rect",{attrs:{...n,x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}}),objectToValues(t){const e=[];let n;for(n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e},getValue:t=>r.Util.isFunction(t)?t():t,getContrast(t,e){const n={};return r.Util.each(e,(e,r)=>{n[r]=t[r]}),n},arrowTo(t,e,n,i,o,a,s){const c=[a-i,s-o],u=r.Util.vec2.angleTo(c,[1,0],!0);return t.transform([["r",u],["t",e,n]]),t},setEndOfContenteditable(t){let e,n;document.createRange?(e=document.createRange(),e.selectNodeContents(t),e.collapse(!1),n=window.getSelection(),n.removeAllRanges(),n.addRange(e)):document.selection&&(e=document.body.createTextRange(),e.moveToElementText(t),e.collapse(!1),e.select())},matches:(t,e)=>(Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){const e=(this.document||this.ownerDocument).querySelectorAll(t);let n=e.length;for(;--n>=0&&e.item(n)!==this;);return n>-1}).call(t,e),delegateEvent:(t,e,n,r)=>s.addEventListener(t,e,(function(e){let i=e.target||e.srcElement;for(;i!==t;)s.matches(i,n)&&r.call(i,Array.prototype.slice.call(arguments)),i=i.parentNode})),Palettes:o};t.exports=s},function(t,e,n){window,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=820)}([,function(t,e,n){"use strict";var r=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function i(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function o(){}var a="\\s*([+-]?\\d+)\\s*",s="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",u=/^#([0-9a-f]{3})$/,h=/^#([0-9a-f]{6})$/,l=new RegExp("^rgb\\("+[a,a,a]+"\\)$"),d=new RegExp("^rgb\\("+[c,c,c]+"\\)$"),f=new RegExp("^rgba\\("+[a,a,a,s]+"\\)$"),g=new RegExp("^rgba\\("+[c,c,c,s]+"\\)$"),p=new RegExp("^hsl\\("+[s,c,c]+"\\)$"),m=new RegExp("^hsla\\("+[s,c,c,s]+"\\)$"),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function x(t){var e;return t=(t+"").trim().toLowerCase(),(e=u.exec(t))?new _((e=parseInt(e[1],16))>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):(e=h.exec(t))?y(parseInt(e[1],16)):(e=l.exec(t))?new _(e[1],e[2],e[3],1):(e=d.exec(t))?new _(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?b(e[1],e[2],e[3],e[4]):(e=g.exec(t))?b(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=p.exec(t))?A(e[1],e[2]/100,e[3]/100,1):(e=m.exec(t))?A(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?y(v[t]):"transparent"===t?new _(NaN,NaN,NaN,0):null}function y(t){return new _(t>>16&255,t>>8&255,255&t,1)}function b(t,e,n,r){return r<=0&&(t=e=n=NaN),new _(t,e,n,r)}function w(t){return t instanceof o||(t=x(t)),t?new _((t=t.rgb()).r,t.g,t.b,t.opacity):new _}function M(t,e,n,r){return 1===arguments.length?w(t):new _(t,e,n,null==r?1:r)}function _(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function S(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function A(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new P(t,e,n,r)}function E(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof P)return new P(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=x(t)),!t)return new P;if(t instanceof P)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),s=NaN,c=a-i,u=(a+i)/2;return c?(s=e===a?(n-r)/c+6*(n0&&u<1?0:s,new P(s,c,u,t.opacity)}(t):new P(t,e,n,null==r?1:r)}function P(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function C(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}r(o,x,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),r(_,M,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+S(this.r)+S(this.g)+S(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),r(P,E,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new P(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new P(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new _(C(t>=240?t-240:t+120,i,r),C(t,i,r),C(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var O=Math.PI/180,I=180/Math.PI,k=.96422,B=.82521,T=6/29,N=3*T*T;function L(t){if(t instanceof G)return new G(t.l,t.a,t.b,t.opacity);if(t instanceof U){if(isNaN(t.h))return new G(t.l,0,0,t.opacity);var e=t.h*O;return new G(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof _||(t=w(t));var n,r,i=R(t.r),o=R(t.g),a=R(t.b),s=D((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?n=r=s:(n=D((.4360747*i+.3850649*o+.1430804*a)/k),r=D((.0139322*i+.0971045*o+.7141733*a)/B)),new G(116*s-16,500*(n-s),200*(s-r),t.opacity)}function Y(t,e){return new G(t,0,0,null==e?1:e)}function X(t,e,n,r){return 1===arguments.length?L(t):new G(t,e,n,null==r?1:r)}function G(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function D(t){return t>.008856451679035631?Math.pow(t,1/3):t/N+4/29}function F(t){return t>T?t*t*t:N*(t-4/29)}function j(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function R(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function H(t){if(t instanceof U)return new U(t.h,t.c,t.l,t.opacity);if(t instanceof G||(t=L(t)),0===t.a&&0===t.b)return new U(NaN,0,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*I;return new U(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function q(t,e,n,r){return 1===arguments.length?H(t):new U(n,e,t,null==r?1:r)}function z(t,e,n,r){return 1===arguments.length?H(t):new U(t,e,n,null==r?1:r)}function U(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}r(G,X,i(o,{brighter:function(t){return new G(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new G(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new _(j(3.1338561*(e=k*F(e))-1.6168667*(t=1*F(t))-.4906146*(n=B*F(n))),j(-.9787684*e+1.9161415*t+.033454*n),j(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),r(U,z,i(o,{brighter:function(t){return new U(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new U(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return L(this).rgb()}}));var W=-.14861,V=1.78277,K=-.29227,Z=-.90649,Q=1.97294,$=Q*Z,J=Q*V,tt=V*K-Z*W;function et(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof nt)return new nt(t.h,t.s,t.l,t.opacity);t instanceof _||(t=w(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(tt*r+$*e-J*n)/(tt+$-J),o=r-i,a=(Q*(n-i)-K*o)/Z,s=Math.sqrt(a*a+o*o)/(Q*i*(1-i)),c=s?Math.atan2(a,o)*I-120:NaN;return new nt(c<0?c+360:c,s,i,t.opacity)}(t):new nt(t,e,n,null==r?1:r)}function nt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}r(nt,et,i(o,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*O,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new _(255*(e+n*(W*r+V*i)),255*(e+n*(K*r+Z*i)),255*(e+n*(Q*r)),this.opacity)}})),n.d(e,"a",(function(){return x})),n.d(e,"h",(function(){return M})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return X})),n.d(e,"d",(function(){return z})),n.d(e,"g",(function(){return q})),n.d(e,"c",(function(){return Y})),n.d(e,"b",(function(){return et}))},,,,,,,,,,,,,,,function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){"use strict";n.r(e);var r,i,o=0,a=0,s=0,c=0,u=0,h=0,l="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return u||(d(g),u=l.now()+h)}function g(){u=0}function p(){this._call=this._time=this._next=null}function m(t,e,n){var r=new p;return r.restart(t,e,n),r}function v(){f(),++o;for(var t,e=r;e;)(t=u-e._time)>=0&&e._call.call(null,t),e=e._next;--o}function x(){u=(c=l.now())+h,o=a=0;try{v()}finally{o=0,function(){for(var t,e,n=r,o=1/0;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,b(o)}(),u=0}}function y(){var t=l.now(),e=t-c;e>1e3&&(h-=e,c=t)}function b(t){o||(a&&(a=clearTimeout(a)),t-u>24?(t<1/0&&(a=setTimeout(x,t-l.now()-h)),s&&(s=clearInterval(s))):(s||(c=l.now(),s=setInterval(y,1e3)),o=1,d(x)))}p.prototype=m.prototype={constructor:p,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?f():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}};var w=function(t,e,n){var r=new p;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},M=function(t,e,n){var r=new p,i=e;return null==e?(r.restart(t,e,n),r):(e=+e,n=null==n?f():+n,r.restart((function o(a){a+=i,r.restart(o,i+=e,n),t(a)}),e,n),r)};n.d(e,"now",(function(){return f})),n.d(e,"timer",(function(){return m})),n.d(e,"timerFlush",(function(){return v})),n.d(e,"timeout",(function(){return w})),n.d(e,"interval",(function(){return M}))},,function(t,e,n){var r=n(644),i={};r.merge(i,r,{mixin:function(t,e){var n=t.CFG?"CFG":"ATTRS";if(t&&e){t._mixins=e,t[n]=t[n]||{};var r={};i.each(e,(function(e){i.augment(t,e);var o=e[n];o&&i.merge(r,o)})),t[n]=i.merge(r,t[n])}}}),t.exports=i},function(t,e,n){var r=n(117),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},,,function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},,,function(t,e,n){var r={},i=n(682),o=n(748),a=n(257),s=n(727),c=n(726),u=n(725);a.mix(r,a,c,u,s,o,i),t.exports=r},,,,,,,,function(t,e,n){var r=n(38),i=n(250),o=n(249),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},,,,function(t,e,n){var r=n(20).Symbol;t.exports=r},function(t,e,n){var r=n(34),i=n(23);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},,,,,function(t,e,n){"use strict";function r(t){return+t}function i(t){return t*t}function o(t){return t*(2-t)}function a(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function s(t){return t*t*t}function c(t){return--t*t*t+1}function u(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}n.r(e);var h=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),l=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),d=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),f=Math.PI,g=f/2;function p(t){return 1-Math.cos(t*g)}function m(t){return Math.sin(t*g)}function v(t){return(1-Math.cos(f*t))/2}function x(t){return Math.pow(2,10*t-10)}function y(t){return 1-Math.pow(2,-10*t)}function b(t){return((t*=2)<=1?Math.pow(2,10*t-10):2-Math.pow(2,10-10*t))/2}function w(t){return 1-Math.sqrt(1-t*t)}function M(t){return Math.sqrt(1- --t*t)}function _(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var S=4/11,A=7.5625;function E(t){return 1-P(1-t)}function P(t){return(t=+t)0){var o=e.strokeOpacity;r.isNil(o)||1===o||(t.globalAlpha=o),t.stroke()}this.afterPath(t)},afterPath:function(){},isHitBox:function(){return!0},isHit:function(t,e){var n=[t,e,1];if(this.invert(n),this.isHitBox()){var r=this.getBBox();if(r&&!a.box(r.minX,r.maxX,r.minY,r.maxY,n[0],n[1]))return!1}var i=this._attrs.clip;return i?(i.invert(n,this.get("canvas")),!!i.isPointInPath(n[0],n[1])&&this.isPointInPath(n[0],n[1])):this.isPointInPath(n[0],n[1])},calculateBox:function(){return null},getHitLineWidth:function(){var t=this._attrs,e=t.lineAppendWidth||0;return(t.lineWidth||0)+e},clearTotalMatrix:function(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function(){this._cfg.box=null,this._cfg.region=null},getBBox:function(){var t=this._cfg.box;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._cfg.box=t),t},clone:function(){var t=null,e=this._attrs,n={};return r.each(e,(function(t,i){c[i]&&r.isArray(e[i])?n[i]=function(t){for(var e=[],n=0;n=1?(n=1,e-1):Math.floor(n*e),o=t[r],a=t[r+1],s=r>0?t[r-1]:2*o-a,c=r180||n<-180?n-360*Math.round(n/360):n):s(isNaN(t)?e:t)}function h(t,e){var n=e-t;return n?c(t,n):s(isNaN(t)?e:t)}var l=function t(e){var n=function(t){return 1==(t=+t)?h:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):s(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=Object(r.h)(t)).r,(e=Object(r.h)(e)).r),o=n(t.g,e.g),a=n(t.b,e.b),s=h(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=o(e),t.b=a(e),t.opacity=s(e),t+""}}return i.gamma=t,i}(1);function d(t){return function(e){var n,i,o=e.length,a=new Array(o),s=new Array(o),c=new Array(o);for(n=0;no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:w(n,r)})),o=S.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:w(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,c),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:w(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,c),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:w(t,n)},{i:s-2,x:w(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,c),o=a=null,function(t){for(var e,n=-1,r=c.length;++n1?0:i<-1?Math.PI:Math.acos(i)},e.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},e.equals=function(t,e){var n=t[0],i=t[1],o=t[2],a=e[0],s=e[1],c=e[2];return Math.abs(n-a)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-s)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-c)<=r.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(59));function i(){var t=new r.ARRAY_TYPE(3);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function a(t,e,n){var i=new r.ARRAY_TYPE(3);return i[0]=t,i[1]=e,i[2]=n,i}function s(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function c(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function u(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function h(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)}function l(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function d(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function f(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function g(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.sub=s,e.mul=c,e.div=u,e.dist=h,e.sqrDist=l,e.len=o,e.sqrLen=d,e.forEach=function(){var t=i();return function(e,n,r,i,o,a){var s,c=void 0;for(n||(n=3),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,c=r;c0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},e.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},e.random=function(t,e){e=e||1;var n=2*r.RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},e.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},e.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},e.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},e.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},e.rotate=function(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t},e.angle=function(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=n*n+r*r;a>0&&(a=1/Math.sqrt(a));var s=i*i+o*o;s>0&&(s=1/Math.sqrt(s));var c=(n*i+r*o)*a*s;return c>1?0:c<-1?Math.PI:Math.acos(c)},e.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},e.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e.equals=function(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))};var r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(59));function i(){var t=new r.ARRAY_TYPE(2);return r.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function a(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function s(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function c(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}function u(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function h(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function l(t){var e=t[0],n=t[1];return e*e+n*n}e.len=h,e.sub=o,e.mul=a,e.div=s,e.dist=c,e.sqrDist=u,e.sqrLen=l,e.forEach=function(){var t=i();return function(e,n,r,i,o,a){var s,c=void 0;for(n||(n=2),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,c=r;c0?1:-1};var o=function(t){for(var e=1;e1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}r.each(e,(function(t,n){isNaN(t)||(e[n]=+t)})),t[n]=e})),t):void 0}}},function(t,e,n){var r=n(237);t.exports=function(t){return r(t)?"":t.toString()}},function(t,e,n){var r=n(115);t.exports=function(t){return r(t,"String")}},function(t,e,n){var r=n(619),i=n(115);t.exports=function(t){if(!r(t)||!i(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}},function(t,e,n){var r=function(t){function e(e){var n;return(n=t.call(this)||this).options=e,n}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e.prototype.execute=function(){var t=this,e=this.options;this.roots.forEach((function(n){t.layout(n,e).eachNode((function(t){t.data.x=t.x+t.data.width/2+t.hgap,t.data.y=t.y+t.data.height/2+t.vgap}))}))},e}(n(622));t.exports=r},function(t,e,n){"undefined"!=typeof self&&self,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){var r=n(7);t.exports={assign:r}},function(t,e,n){var r=n(3),i=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=r(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=i},function(t,e,n){var r=n(4),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var c=r(t,e),u=c.left,h=c.right;n(u,e),n(h,e),e.isHorizontal?u.right2left():u.bottom2top(),h.translate(u.x-h.x,u.y-h.y),t.x=u.x,t.y=h.y;var l=t.getBoundingBox();e.isHorizontal?l.top<0&&t.translate(0,-l.top):l.left<0&&t.translate(-l.left,0)}return t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},function(t,e,n){var r=n(0),i={getId:function(t){return t.id||t.name},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.name||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.width=e.getWidth(t),n.height=e.getHeight(t),n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.pop();)t(e),n=n.concat(e.children)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e}))},right2left:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.x=e.x-2*(e.x-t.left)-e.width})),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode((function(e){e.y=e.y-2*(e.y-t.top)-e.height})),this.translate(0,t.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),c=[s];if(!n&&!t.collapsed)for(;a=c.pop();)if(!a.data.collapsed){var u=e.getChildren(a.data),h=u?u.length:0;if(a.children=new Array(h),u&&h)for(var l=0;ln.low&&(n=n.nxt);var l=i+r.prelim+r.w-(h+o.prelim);l>0&&(h+=l,a(t,e,n.index,l));var d=u(r),f=u(o);d<=f&&null!==(r=c(r))&&(i+=r.mod),d>=f&&null!==(o=s(o))&&(h+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,h):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function a(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function s(t){return 0===t.cs?t.tl:t.c[0]}function c(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function u(t){return t.y+t.h}function h(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}!function t(e,n,r){void 0===r&&(r=0),n?(e.x=r,r+=e.width):(e.y=r,r+=e.height),e.children.forEach((function(e){t(e,n,r)}))}(t,r);var l=n.fromNode(t,r);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=h(u(e.c[0].el),0,null),r=1;ro&&(o=e.depth);var n=e.children,r=n.length,i=new function(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var n=this;n.x=n.y=0,n.leftChild=n.rightChild=null,n.height=0,n.children=e}(e.height,[]);return n.forEach((function(e,n){var o=t(e);i.children.push(o),0===n&&(i.leftChild=o),n===r-1&&(i.rightChild=o)})),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=o;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(a),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(a),function t(e,n,r){r?(n.x=e.x,n.y=e.y):(n.x=e.y,n.y=e.x),e.children.forEach((function(e,i){t(e,n.children[i],r)}))}(a,t,e.isHorizontal),t}},function(t,e,n){var r=n(1),i=n(12),o=n(4),a=n(0),s=["LR","RL","H"],c=s[0],u=function(t){function e(){return t.apply(this,arguments)||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=t.direction||c;if(r&&-1===s.indexOf(r))throw new TypeError("Invalid direction: "+r);if(r===s[0])i(e,n);else if(r===s[1])i(e,n),e.right2left();else if(r===s[2]){var a=o(e,t),u=a.left,h=a.right;i(u,n),u.right2left(),i(h,n);var l=u.getBoundingBox();h.translate(l.width,0),e.x=h.x-e.width/2}return e},e}(r),h={};t.exports=function(t,e){return e=a.assign({},h,e),new u(t,e).execute()}},function(t,e){t.exports=function(t,e){void 0===e&&(e=20);var n=null;t.eachNode((function(t){!function(t,e,n){t.x+=n*t.depth,t.y=e?e.y+e.height:0}(t,n,e),n=t}))}},function(t,e,n){var r=n(1),i=n(14),o=n(2),a=n(0),s=function(t){function e(){return t.apply(this,arguments)||this}return function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t),e.prototype.execute=function(){return o(this.rootNode,this.options,i)},e}(r),c={};t.exports=function(t,e){return e=a.assign({},c,e),new s(t,e).execute()}},function(t,e,n){var r=n(0),i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,function t(e,n){var r=0;return e.children.length?e.children.forEach((function(e){r+=t(e,n)})):r=e.height,e._subTreeSep=n.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,r)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;ie.height)e.y=i.y+a/2-e.height/2;else if(1!==n.length||e.height>s){var c=e.y+(e.height-a)/2-i.y;n.forEach((function(t){t.translate(0,c)}))}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}}])},function(t,e,n){var r=n(26),i=function(){var t=e.prototype;function e(t){var e=this.getDefaultCfg();r.mix(this,e,t),this._init()}return t.getDefaultCfg=function(){return{}},t._init=function(){},t.destroy=function(){},e}();t.exports=i},function(t,e,n){var r=n(19),i=n(613),o=n(612),a=n(640),s=n(639),c=r.vec3,u=r.mat3,h=["m","l","c","a","q","h","v","t","s","z"];function l(t,e,n){return{x:n.x+t,y:n.y+e}}function d(t,e){return{x:e.x+(e.x-t.x),y:e.y+(e.y-t.y)}}function f(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function g(t,e){return(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e))}function p(t,e){return(t[0]*e[1]=0,u=c?n.toUpperCase():n,f=t,m=e.endPoint,v=f[1],x=f[2];switch(u){default:break;case"M":s=c?l(v,x,m):{x:v,y:x},this.command="M",this.params=[m,s],this.subStart=s,this.endPoint=s;break;case"L":s=c?l(v,x,m):{x:v,y:x},this.command="L",this.params=[m,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-m.x,s.y-m.y]},this.startTangent=function(){return[m.x-s.x,m.y-s.y]};break;case"H":s=c?l(v,0,m):{x:v,y:m.y},this.command="L",this.params=[m,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-m.x,s.y-m.y]},this.startTangent=function(){return[m.x-s.x,m.y-s.y]};break;case"V":s=c?l(0,v,m):{x:m.x,y:v},this.command="L",this.params=[m,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return[s.x-m.x,s.y-m.y]},this.startTangent=function(){return[m.x-s.x,m.y-s.y]};break;case"Q":c?(i=l(v,x,m),o=l(f[3],f[4],m)):(i={x:v,y:x},o={x:f[3],y:f[4]}),this.command="Q",this.params=[m,i,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-i.x,o.y-i.y]},this.startTangent=function(){return[m.x-i.x,m.y-i.y]};break;case"T":o=c?l(v,x,m):{x:v,y:x},"Q"===e.command?(i=d(e.params[1],m),this.command="Q",this.params=[m,i,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-i.x,o.y-i.y]},this.startTangent=function(){return[m.x-i.x,m.y-i.y]}):(this.command="TL",this.params=[m,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return[o.x-m.x,o.y-m.y]},this.startTangent=function(){return[m.x-o.x,m.y-o.y]});break;case"C":c?(i=l(v,x,m),o=l(f[3],f[4],m),a=l(f[5],f[6],m)):(i={x:v,y:x},o={x:f[3],y:f[4]},a={x:f[5],y:f[6]}),this.command="C",this.params=[m,i,o,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-o.x,a.y-o.y]},this.startTangent=function(){return[m.x-i.x,m.y-i.y]};break;case"S":c?(o=l(v,x,m),a=l(f[3],f[4],m)):(o={x:v,y:x},a={x:f[3],y:f[4]}),"C"===e.command?(i=d(e.params[2],m),this.command="C",this.params=[m,i,o,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-o.x,a.y-o.y]},this.startTangent=function(){return[m.x-i.x,m.y-i.y]}):(this.command="SQ",this.params=[m,o,a],this.subStart=e.subStart,this.endPoint=a,this.endTangent=function(){return[a.x-o.x,a.y-o.y]},this.startTangent=function(){return[m.x-o.x,m.y-o.y]});break;case"A":var y=v,b=x,w=f[3],M=f[4],_=f[5];s=c?l(f[6],f[7],m):{x:f[6],y:f[7]},this.command="A";var S=function(t,e,n,i,o,a,s){var c=r.mod(r.toRadian(s),2*Math.PI),u=t.x,h=t.y,l=e.x,d=e.y,f=Math.cos(c)*(u-l)/2+Math.sin(c)*(h-d)/2,m=-1*Math.sin(c)*(u-l)/2+Math.cos(c)*(h-d)/2,v=f*f/(o*o)+m*m/(a*a);v>1&&(o*=Math.sqrt(v),a*=Math.sqrt(v));var x=o*o*(m*m)+a*a*(f*f),y=Math.sqrt((o*o*(a*a)-x)/x);n===i&&(y*=-1),isNaN(y)&&(y=0);var b=y*o*m/a,w=y*-a*f/o,M=(u+l)/2+Math.cos(c)*b-Math.sin(c)*w,_=(h+d)/2+Math.sin(c)*b+Math.cos(c)*w,S=p([1,0],[(f-b)/o,(m-w)/a]),A=[(f-b)/o,(m-w)/a],E=[(-1*f-b)/o,(-1*m-w)/a],P=p(A,E);return g(A,E)<=-1&&(P=Math.PI),g(A,E)>=1&&(P=0),0===i&&P>0&&(P-=2*Math.PI),1===i&&P<0&&(P+=2*Math.PI),[t,M,_,o,a,S,P,c,i]}(m,s,M,_,y,b,w);this.params=S;var A=e.subStart;this.subStart=A,this.endPoint=s;var E=S[5]%(2*Math.PI);r.isNumberEqual(E,2*Math.PI)&&(E=0);var P=S[6]%(2*Math.PI);r.isNumberEqual(P,2*Math.PI)&&(P=0);var C=.001;this.startTangent=function(){0===_&&(C*=-1);var t=S[3]*Math.cos(E-C)+S[1],e=S[4]*Math.sin(E-C)+S[2];return[t-A.x,e-A.y]},this.endTangent=function(){var t=S[6];t-2*Math.PI<1e-4&&(t=0);var e=S[3]*Math.cos(E+t+C)+S[1],n=S[4]*Math.sin(E+t-C)+S[2];return[m.x-e,m.y-n]};break;case"Z":this.command="Z",this.params=[m,e.subStart],this.subStart=e.subStart,this.endPoint=e.subStart}},isInside:function(t,e,n){var r=this.command,o=this.params,a=this.box;if(a&&!i.box(a.minX,a.maxX,a.minY,a.maxY,t,e))return!1;switch(r){default:break;case"M":return!1;case"TL":case"L":case"Z":return i.line(o[0].x,o[0].y,o[1].x,o[1].y,n,t,e);case"SQ":case"Q":return i.quadraticline(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,n,t,e);case"C":return i.cubicline(o[0].x,o[0].y,o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y,n,t,e);case"A":var s=o,h=s[1],l=s[2],d=s[3],f=s[4],g=s[5],p=s[6],m=s[7],v=s[8],x=d>f?d:f,y=d>f?1:d/f,b=d>f?f/d:1;s=[t,e,1];var w=[1,0,0,0,1,0,0,0,1];return u.translate(w,w,[-h,-l]),u.rotate(w,w,-m),u.scale(w,w,[1/y,1/b]),c.transformMat3(s,s,w),i.arcline(0,0,x,g,g+p,1-v,n,s[0],s[1])}return!1},draw:function(t){var e,n,r,i=this.command,o=this.params;switch(i){default:break;case"M":t.moveTo(o[1].x,o[1].y);break;case"TL":case"L":t.lineTo(o[1].x,o[1].y);break;case"SQ":case"Q":e=o[1],n=o[2],t.quadraticCurveTo(e.x,e.y,n.x,n.y);break;case"C":e=o[1],n=o[2],r=o[3],t.bezierCurveTo(e.x,e.y,n.x,n.y,r.x,r.y);break;case"A":var a=o,s=a[1],c=a[2],u=a[3],h=a[4],l=a[5],d=a[6],f=a[7],g=a[8],p=u>h?u:h,m=u>h?1:u/h,v=u>h?h/u:1;t.translate(s,c),t.rotate(f),t.scale(m,v),t.arc(0,0,p,l,l+d,1-g),t.scale(1/m,1/v),t.rotate(-f),t.translate(-s,-c);break;case"Z":t.closePath()}},getBBox:function(t){var e,n,r,i,c=t/2,u=this.params;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(u[0].x,u[1].x)-c,maxX:Math.max(u[0].x,u[1].x)+c,minY:Math.min(u[0].y,u[1].y)-c,maxY:Math.max(u[0].y,u[1].y)+c};break;case"SQ":case"Q":for(r=0,i=(n=a.extrema(u[0].x,u[1].x,u[2].x)).length;r_&&(_=E)}var P=s.yExtrema(v,f,g),C=1/0,O=-1/0,I=[y,b];for(r=2*-Math.PI;r<=2*Math.PI;r+=Math.PI){var k=P+r;1===x?yO&&(O=B)}this.box={minX:M-c,maxX:_+c,minY:C-c,maxY:O+c}}}}),t.exports=m},function(t,e,n){var r=n(593),i=n(600),o=Math.PI,a=Math.sin,s=Math.cos,c=Math.atan2,u=o/3;function h(t,e,n,r,i,h,l){var d,f,g,p,m,v,x;if(!e.fill){var y=e.arrowLength||10,b=e.arrowAngle?e.arrowAngle*o/180:u;x=c(r-h,n-i),m=Math.abs(e.lineWidth*s(x))/2,v=Math.abs(e.lineWidth*a(x))/2,l&&(m=-m,v=-v),d=i+y*s(x+b/2),f=h+y*a(x+b/2),g=i+y*s(x-b/2),p=h+y*a(x-b/2),t.beginPath(),t.moveTo(d-m,f-v),t.lineTo(i-m,h-v),t.lineTo(g-m,p-v),t.moveTo(i-m,h-v),t.lineTo(i+m,h+v),t.moveTo(i,h),t.stroke()}}function l(t,e,n,o,a,s,c){var u=c?e.startArrow:e.endArrow,h=u.d,l=0,d=a-n,f=s-o,g=Math.atan(d/f);0===f&&d<0?l=Math.PI:d>0&&f>0?l=Math.PI/2-g:d<0&&f<0?l=-Math.PI/2-g:d>=0&&f<0?l=-g-Math.PI/2:d<=0&&f>0&&(l=Math.PI/2-g);var p=function(t){var e,n=[],o=r.parsePath(t.path);if(!Array.isArray(o)||0===o.length||"M"!==o[0][0]&&"m"!==o[0][0])return!1;for(var a=o.length,s=0;sn&&(i=2*Math.PI-t+e,o=t-n):(i=t-e,o=n-t),i>o?n:e}function a(t,e,n,i){var a=0;return n-e>=2*Math.PI&&(a=2*Math.PI),e=r.mod(e,2*Math.PI),n=r.mod(n,2*Math.PI)+a,t=r.mod(t,2*Math.PI),i?e>=n?t>n&&tn?t:o(t,e,n):e<=n?ee||tt.x&&(g=t.x),pt.y&&(m=t.y),v-1}},function(t,e){function n(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}t.exports=function(t,e,r,i){return e&&n(t,e),r&&n(t,r),i&&n(t,i),t}},,function(t,e,n){var r=n(26),i=function(){function t(t){r.mix(this,{id:"",type:null,model:{},group:null,animate:!1,modelCache:{},isItem:!0,visible:!0},t),this._init()}var e=t.prototype;return e._init=function(){this._initGroup(),this.draw()},e._mapping=function(){var t=this.mapper,e=this.model;t.mapping(e)},e._initGroup=function(){var t=this.group,e=this.model,n=this.type;t.isItemContainer=!0,t.id=e.id,t.itemType=n,t.model=e,t.item=this},e._calculateBBox=function(){var t=this.keyShape,e=this.group,n=r.getBBox(t,e);return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},e.getLabel=function(){return this.group.findByClass("label")[0]},e.getGraph=function(){return this.graph},e._setShapeObj=function(){var t=this.graph,e=this.type,n=this.getModel();this.shapeObj=t.getShapeObj(e,n)},e._afterDraw=function(){var t=this.graph;this._setGId(),this._cacheModel(),t.emit("afteritemdraw",{item:this})},e._cacheModel=function(){this.modelCache=r.mix({},this.model)},e._setGId=function(){var t=this.group,e=this.id,n=this.type;t.gid=e,t.deepEach((function(t,r,i){var o=r.gid;if(t.id=e,t.eventPreFix=n,t.gid=o+"-"+i,t.isShape){var a=t.get("type");t.gid+="-"+a}}))},e._beforeDraw=function(){var t=this.graph,e=this.group;t.emit("beforeitemdraw",{item:this}),e.resetMatrix(),this.updateCollapsedParent()},e._shouldDraw=function(){return!0},e._getDiff=function(){var t=[],e=this.model,n=this.modelCache;return r.each(e,(function(e,i){r.isEqual(e,n[i])||t.push(i)})),0!==t.length&&t},e._drawInner=function(){var t=this.animate;this.group.clear(!t),this._mapping(),this._setShapeObj();var e=this.shapeObj,n=e.draw(this);n&&(n.isKeyShape=!0,this.keyShape=n),e.afterDraw&&e.afterDraw(this)},e.deepEach=function(t,e){r.traverseTree(this,t,e||function(t){return t.getChildren()})},e.getShapeObj=function(){return this.shapeObj},e.updateCollapsedParent=function(){var t=this.dataMap;this.collapsedParent=function t(e,n){var r=n[e.parent];if(!r)return!1;if(r){var i=t(r,n);if(i)return i}return r.collapsed?r:void 0}(this.model,t)},e.isVisible=function(){return this.visible},e.hide=function(){var t=this.group,e=this.graph;e.emit("beforeitemhide",{item:this}),t.hide(),this.visible=!1,e.emit("afteritemhide",{item:this})},e.show=function(){var t=this.group,e=this.graph;e.emit("beforeitemshow",{item:this}),t.show(),this.visible=!0,e.emit("afteritemshow",{item:this})},e.draw=function(){this._beforeDraw(),this._shouldDraw()&&this._drawInner(),this._afterDraw()},e.forceUpdate=function(){this._beforeDraw(),this._drawInner(),this._afterDraw()},e.getCenter=function(){var t=this.getBBox();return{x:t.centerX,y:t.centerY}},e.getBBox=function(){return this.bbox||this._calculateBBox()},e.layoutUpdate=function(){this.isVisible()&&this.draw()},e.update=function(){this.draw()},e.getModel=function(){return this.model},e.getKeyShape=function(){return this.keyShape},e.getGraphicGroup=function(){return this.group},e.getHierarchy=function(){return this.graph.getHierarchy(this)},e.getParent=function(){var t=this.model;return this.itemMap[t.parent]},e.getAllParents=function(){for(var t=this.model,e=this.itemMap,n=[],r=t.parent;r&&e[r];){var i=e[r],o=i.getModel();n.push(i),r=o.parent}return n},e.getAllChildren=function(){var t=[];return this.deepEach((function(e){t.push(e)})),t},e.getChildren=function(){var t=this.id;return this.graph.getItems().filter((function(e){return e.model.parent===t}))},e.toFront=function(){this.group.toFront()},e.toBack=function(){this.group.toBack()},e.destroy=function(){if(!this.destroyed){var t=this.animate,e=this.graph;e.emit("beforeitemdestroy",{item:this}),this.group.remove(!t),this.destroyed=!0,e.emit("afteritemdestroy",{item:this})}},t}();t.exports=i},function(t,e){t.exports="2.2.6"},function(t,e,n){var r=n(644),i="\t\n\v\f\r   ᠎              \u2028\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),s=function(t){if(!t)return null;if(typeof t==typeof[])return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(t,r,i){var o=[],s=r.toLowerCase();if(i.replace(a,(function(t,e){e&&o.push(+e)})),"m"===s&&o.length>2&&(n.push([r].concat(o.splice(0,2))),s="l",r="m"===r?"l":"L"),"o"===s&&1===o.length&&n.push([r,o[0]]),"r"===s)n.push([r].concat(o));else for(;o.length>=e[s]&&(n.push([r].concat(o.splice(0,e[s]))),e[s]););})),n},c=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},u=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),c=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,c,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},h=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,h=0,l=0;"M"===t[0][0]&&(a=i=+t[0][1],h=o=+t[0][2],l++,r[0]=["M",i,o]);for(var d,f,g=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=l,m=t.length;p1&&(r*=M=Math.sqrt(M),i*=M);var _=r*r,S=i*i,A=(a===s?-1:1)*Math.sqrt(Math.abs((_*S-_*w*w-S*b*b)/(_*w*w+S*b*b)));g=A*r*w/i+(e+c)/2,p=A*-i*b/r+(n+u)/2,d=Math.asin(((n-p)/i).toFixed(9)),f=Math.asin(((u-p)/i).toFixed(9)),d=ef&&(d-=2*Math.PI),!s&&f>d&&(f-=2*Math.PI)}var E=f-d;if(Math.abs(E)>m){var P=f,C=c,O=u;f=d+m*(s&&f>d?1:-1),x=t(c=g+r*Math.cos(f),u=p+i*Math.sin(f),r,i,o,0,s,C,O,[f,P,g,p])}E=f-d;var I=Math.cos(d),k=Math.sin(d),B=Math.cos(f),T=Math.sin(f),N=Math.tan(E/4),L=4/3*r*N,Y=4/3*i*N,X=[e,n],G=[e+L*k,n-Y*I],D=[c+L*T,u-Y*B],F=[c,u];if(G[0]=2*X[0]-G[0],G[1]=2*X[1]-G[1],h)return[G,D,F].concat(x);for(var j=[],R=0,H=(x=[G,D,F].concat(x).join().split(",")).length;R7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(c[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},m=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var v=0;v1?1:c<0?0:c)/2,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],l=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,f=0;f<12;f++){var g=u*h[f]+u,p=m(g,t,n,i,a),v=m(g,e,r,o,s),x=p*p+v*v;d+=l[f]*Math.sqrt(x)}return u*d},x=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)Math.max(i,a)||Math.max(e,r)Math.max(o,s))){var c=(t-n)*(o-s)-(e-r)*(i-a);if(c){var u=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/c,h=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/c,l=+u.toFixed(2),d=+h.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)))return{x:u,y:h}}}},y=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},b=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=p,o},w=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:b(t,e,n,r),vb:[t,e,n,r].join(" ")}},M=function(t,e,n,i,o,a,s,c){r.isArray(t)||(t=[t,e,n,i,o,a,s,c]);var u=function(t,e,n,r,i,o,a,s){for(var c,u,h,l,d=[],f=[[],[]],g=0;g<2;++g)if(0===g?(u=6*t-12*n+6*i,c=-3*t+9*n-9*i+3*a,h=3*n-3*t):(u=6*e-12*r+6*o,c=-3*e+9*r-9*o+3*s,h=3*r-3*e),Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;(l=-h/u)>0&&l<1&&d.push(l)}else{var p=u*u-4*h*c,m=Math.sqrt(p);if(!(p<0)){var v=(-u+m)/(2*c);v>0&&v<1&&d.push(v);var x=(-u-m)/(2*c);x>0&&x<1&&d.push(x)}}for(var y,b=d.length,w=b;b--;)y=1-(l=d[b]),f[0][b]=y*y*y*t+3*y*y*l*n+3*y*l*l*i+l*l*l*a,f[1][b]=y*y*y*e+3*y*y*l*r+3*y*l*l*o+l*l*l*s;return f[0][w]=t,f[1][w]=e,f[0][w+1]=a,f[1][w+1]=s,f[0].length=f[1].length=w+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}}.apply(null,t);return w(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},_=function(t,e,n,r,i,o,a,s,c){var u=1-c,h=Math.pow(u,3),l=Math.pow(u,2),d=c*c,f=d*c,g=t+2*c*(n-t)+d*(i-2*n+t),p=e+2*c*(r-e)+d*(o-2*r+e),m=n+2*c*(i-n)+d*(a-2*i+n),v=r+2*c*(o-r)+d*(s-2*o+r);return{x:h*t+3*l*c*n+3*u*c*c*i+f*a,y:h*e+3*l*c*r+3*u*c*c*o+f*s,m:{x:g,y:p},n:{x:m,y:v},start:{x:u*t+c*n,y:u*e+c*r},end:{x:u*i+c*a,y:u*o+c*s},alpha:90-180*Math.atan2(g-m,p-v)/Math.PI}},S=function(t,e,n){if(!function(t,e){return t=w(t),e=w(e),y(e,t.x,t.y)||y(e,t.x2,t.y)||y(e,t.x,t.y2)||y(e,t.x2,t.y2)||y(t,e.x,e.y)||y(t,e.x2,e.y)||y(t,e.x,e.y2)||y(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(M(t),M(e)))return n?0:[];for(var r=~~(v.apply(0,t)/8),i=~~(v.apply(0,e)/8),o=[],a=[],s={},c=n?0:[],u=0;u=0&&C<=1&&O>=0&&O<=1&&(n?c++:c.push({x:P.x,y:P.y,t1:C,t2:O}))}}return c};function A(t,e){var n=[],r=[];return t.length&&function t(e,i){if(1===e.length)n.push(e[0]),r.push(e[0]);else{for(var o=[],a=0;a=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r}(t[i],t[i+1],r))}),[]);return u.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||u.push("Z"),u},fillPathByDiff:function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],c=0;c<=i;c++)s[c]=[],s[c][0]={min:c};for(var u=0;u<=o;u++)s[0][u]={min:u};for(var h=1;h<=i;h++){n=t[h-1];for(var l=1;l<=o;l++){r=e[l-1],a=E(n,r)?0:1;var d=s[h-1][l].min+1,f=s[h][l-1].min+1,g=s[h-1][l-1].min+a;s[h][l]=P(d,f,g)}}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i]!==r){for(var c=1;c<=r;c++){var u=n[c][c].min;s=c;for(var h=a;h<=i;h++)n[c][h].min=0;l--)a=o[l].index,"add"===o[l].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var d=i-(r=t.length);if(r0)){t[r]=e[r];break}n=C(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=C(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=C(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t},intersection:function(t,e){return function(t,e,n){var r,i,o,a,s,c,u,h,l,d;t=f(t),e=f(e);for(var g=[],p=0,m=t.length;p=0&&m=0&&o<=1&&l.push(o);else{var d=u*u-4*c*h;r.isNumberEqual(d,0)?l.push(-u/(2*c)):d>0&&(a=(-u-(s=Math.sqrt(d)))/(2*c),(o=(-u+s)/(2*c))>=0&&o<=1&&l.push(o),a>=0&&a<=1&&l.push(a))}return l},len:function(t,e,n,i,o,a,c,u,h){r.isNil(h)&&(h=1);for(var l=(h=h>1?1:h<0?0:h)/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],g=0,p=0;p<12;p++){var m=l*d[p]+l,v=s(m,t,n,o,c),x=s(m,e,i,a,u),y=v*v+x*x;g+=f[p]*Math.sqrt(y)}return l*g}}},function(t,e,n){var r=n(603),i=n(640),o=n(612),a=n(602);t.exports={line:function(t,e,n,i,o,a,s){var c=r.box(t,e,n,i,o);if(!this.box(c.minX,c.maxX,c.minY,c.maxY,a,s))return!1;var u=r.pointDistance(t,e,n,i,a,s);return!isNaN(u)&&u<=o/2},polyline:function(t,e,n,r){var i=t.length-1;if(i<1)return!1;for(var o=0;on?n:t}},function(t,e){var n="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};t.exports=function(t){return"object"===(void 0===t?"undefined":n(t))&&null!==t}},function(t,e,n){var r=n(46),i=n(118);t.exports=function(t,e){if(!i(t))return t;var n=[];return r(t,(function(t,r){e(t,r)&&n.push(t)})),n}},function(t,e){var n="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};t.exports=function(t){var e=void 0===t?"undefined":n(t);return null!==t&&"object"===e||"function"===e}},function(t,e){var n=function(){function t(){}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=n},function(t,e,n){t.exports={CompactBoxTree:n(688),Dendrogram:n(687),IndentedTree:n(686),Mindmap:n(685),Base:n(622)}},function(t,e,n){var r=n(26),i=function(t){function e(e){var n={type:"node",isNode:!0,zIndex:3,edges:[],linkable:!0};return r.mix(n,e),t.call(this,n)||this}!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t);var n=e.prototype;return n.updatePosition=function(){var t=this.group,e=this.model;t.setMatrix([1,0,0,0,1,0,e.x?e.x:0,e.y?e.y:0,1]),this.bbox=this._calculateBBox()},n._shouldDraw=function(){var e=this._getDiff(),n=t.prototype._shouldDraw.call(this);return e&&!(2===e.length&&-1!==e.indexOf("x")&&-1!==e.indexOf("y"))&&!(1===e.length&&("x"===e[0]||"y"===e[0]))&&n},n._afterDraw=function(){this.updatePosition(),t.prototype._afterDraw.call(this)},n.layoutUpdate=function(){this._beforeDraw(),this._afterDraw()},n.getEdges=function(){var t=this;return this.graph.getEdges().filter((function(e){var n=e.getModel();return n.source===t.id||n.target===t.id}))},n.getInEdges=function(){var t=this;return this.getEdges().filter((function(e){return e.target===t}))},n.getOutEdges=function(){var t=this;return this.getEdges().filter((function(e){return e.source===t}))},n.getLinkPoints=function(t){var e=this.getAnchorPoints();if(r.isNumber(t)&&e[t])return[e[t]];var n=t.x,i=t.y,o=this.getBBox(),a=o.centerX,s=o.centerY,c=n-a,u=i-s,h=this.shapeObj,l=h.anchor||{},d=this.defaultIntersectBox,f=[];if(r.isEmpty(e)){switch(h.intersectBox||l.intersectBox||l.type||d){case"rect":f=[r.getIntersectPointRect(o,t)];break;case"path":if(this.keyShape&&"path"===this.keyShape.get("type")){var g=r.parsePathArray(["M",n,i,"L",a,s]);f=[r.intersection(g,this.keyShape.get("path"))]}break;default:f=[r.getIntersectPointCircle(n,i,o.centerX,o.centerY,Math.max(o.width,o.height)/2)]}r.isEmpty(f[0])&&(f=[{x:a,y:s}])}else f=e.map((function(t){var e=t.x-a,n=t.y-s,i=r.getArcOfVectors({x:c,y:u},{x:e,y:n});return r.mix({},t,{arc:i})})).sort((function(t,e){return t.arc-e.arc}));return f},n.getAnchorPoints=function(t){var e,n=this.shapeObj,i=this.getBBox(),o=[],a=n.anchor||{};return e=r.isArray(a)?a:r.isFunction(a)?a(this):r.isFunction(a.points)?a.points(this):a.points,r.each(e,(function(t,e){var n=r.mix({x:i.minX+t[0]*i.width,y:i.minY+t[1]*i.height},t[2],{index:e});o.push(n)})),this._anchorPoints=o,r.isNumber(t)?this._anchorPoints[t]:this._anchorPoints},e}(n(608));t.exports=i},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(715),n(714),n(713);var i=n(712),o=n(710),a=n(683),s=n(26),c=n(706),u=n(248),h=n(704),l=n(702),d=n(700),f=n(699),g=n(697),p=n(696),m=n(695),v=n(692),x=n(691),y=[p,l,d,h,m,v,n(690),x,f,g],b=function(t){!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(n,t);var e=n.prototype;function n(e){var n,r={};return y.forEach((function(t){s.mix(r,s.clone(t.CFG),e)})),(n=t.call(this,r)||this)._pluginInit(),n.emit("beforeinit"),n._init(),n.emit("afterinit"),n}return e.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,plugins:[],fontFamily:'"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", SimSun, "sans-serif"',nodeDefaultShape:void 0,edgeDefaultShape:void 0,groupDefaultShape:void 0,defaultIntersectBox:"circle",renderer:"canvas",_type:"graph",_controllers:{},_timers:{},_dataMap:{},_itemMap:{},_freezMap:{},_data:{},_delayRunObj:{}}},e._init=function(){var t=this;this._initData(),this._initContainer(),this._initCanvas(),y.forEach((function(e){e.INIT&&t[e.INIT]()})),this.initEvent()},e.initEvent=function(){},e._executeLayout=function(t,e,n,r){s.isFunction(t)?t(e,n,this):s.isObject(t)&&(t.nodes=e,t.edges=n,t.groups=r,t.graph=this,t.execute())},e._pluginInit=function(){var t=this;this.get("plugins").forEach((function(e){t._initPlugin(e)}))},e._initPlugin=function(t){t.graph=this,t.init&&t.init()},e._getTimer=function(t){return this.get("_timers")[t]},e._setTimer=function(t,e){this.get("_timers")[t]=e},e._getController=function(t){return this.get("_controllers")[t]},e._initContainer=function(){var t=this.get("container");t||(t=this.get("id")),t=s.initDOMContainer(t,"graph");var e=s.createDOM('
',{position:"relative"});t.appendChild(e),this.set("_containerDOM",t),this.set("_graphContainer",e)},e._initCanvas=function(){var t=this.get("_graphContainer"),e=this.get("width"),n=this.get("height"),r=this.get("fontFamily"),i=this.get("renderer"),o={width:e,height:n,fontFamily:r,renderer:i,eventEnable:!1,containerDOM:t};"svg"===i&&(o.pixelRatio=1);var a=new(0,u.Canvas)(o),s=a.get("el");s.style.top=0,s.style.left=0,s.style.overflow="hidden",this.set("_canvas",a);var c=this.getMouseEventWrapper();c.style.outline="none",c.style["user-select"]="none",c.setAttribute("tabindex",20);var h=a.addGroup(),l=h.addGroup();this.set("_itemGroup",l),this.set("_rootGroup",h)},e._initData=function(){this.set("_dataMap",{}),this.set("_itemMap",{_nodes:[],_edges:[],_groups:[],_guides:[]}),this.set("_data",{})},e._refresh=function(){},e.getKeyboardEventWrapper=function(){return this.get("keyboardEventWrapper")||this.getMouseEventWrapper()},e.getMouseEventWrapper=function(){return this.get("_canvas").get("el")},e.addPlugin=function(t){var e=this.get("plugins");this._initPlugin(t),e.push(t)},e.getGraphContainer=function(){return this.get("_graphContainer")},e._sortGroup=function(t){var e=this.get("_dataMap"),n={};t.forEach((function(t){var r=t.id,i=t.parent;for(n[r]=1;i&&e[i];)n[r]++,i=e[i].parent})),t.sort((function(t,e){return n[e.id]-n[t.id]}))},e._addItems=function(t,e){var n=this;this._addDatas(t,e),"group"===t&&this._sortGroup(e);var r=s.upperFirst(t),i=o[r],a=this.get("_itemMap"),c=this.get("_itemGroup"),u=this.get("_dataMap"),h=this.get("animate"),l=this.get("defaultIntersectBox");if(!i)throw new Error("please set valid item type!");e.forEach((function(e){var r=new i({id:e.id,type:t,model:e,group:c.addGroup(),graph:n,mapper:n._getController(t+"Mapper"),itemMap:a,animate:h,dataMap:u,defaultIntersectBox:l});a[e.id]=r,a["_"+t+"s"].push(r)}))},e._removeItems=function(t){var e=this.get("_dataMap"),n=this.get("_itemMap");t.forEach((function(t){delete e[t.id],delete n[t.id],s.Array.remove(n["_"+t.type+"s"],t),t.destroy()}))},e._updateItems=function(t,e){t.forEach((function(t,n){var r=e[n];r&&s.mix(t.getModel(),r),t.update()}))},e._getShowEdge=function(t){var e=t.getSource(),n=t.getTarget();return(e.linkable&&e.isVisible()||!e.linkable)&&(n.linkable&&n.isVisible()||!n.linkable)&&t},e._addDatas=function(t,e){var n=this.get("_dataMap");e.forEach((function(t){if(s.isNil(t.id)&&(t.id=s.guid()),n[t.id])throw new Error("id:"+t.id+" has already been set, please set new one");n[t.id]=t}))},e._drawInner=function(){var t=this.get("_data"),e=this.get("_itemGroup"),n=this.get("_dataMap"),r=this.get("_itemMap");t.nodes&&this._addItems("node",t.nodes),t.groups&&this._addItems("group",t.groups),t.edges&&this._addItems("edge",t.edges),t.guides&&this._addItems("guide",t.guides),e.sortBy((function(t){var e=t.id,i=r[e],o=n[e];return o&&!s.isNil(o.index)?o.index:!i||i.destroyed||s.isNil(i.zIndex)?void 0:i.zIndex}))},e._clearInner=function(){this.getItems().forEach((function(t){t&&t.destroy()}))},e.preventAnimate=function(t){return this.set("_forcePreventAnimate",!0),t(),this.set("_forcePreventAnimate",!1),this},e.getShapeObj=function(t,e){if(!s.isObject(t)){var n=s.upperFirst(t),r=a[n],i=this.get(t+"DefaultShape");return r.getShape(e.shape,i)}return t.getShapeObj()},e.getSource=function(){return this.get("_sourceData")},e.parseSource=function(t){return t},e.getCanvas=function(){return this.get("_canvas")},e.getRootGroup=function(){return this.get("_rootGroup")},e.getItemGroup=function(){return this.get("_itemGroup")},e.source=function(t){return this.emit("beforesource"),this.set("_data",t),this.set("_sourceData",t),this.emit("aftersource"),this},e.render=function(){return this.emit("beforerender"),this.emit("beforedrawinner"),this._drawInner(),this.emit("afterdrawinner"),this.emit("afterrender"),this},e.reRender=function(){var t=this.get("_sourceData");return this.read(t),this},e.setCapture=function(t){this.get("_rootGroup").set("capture",t)},e.destroy=function(){this.emit("beforedestroy");var e=this.get("_canvas"),n=this.get("_graphContainer"),r=this.get("_controllers"),i=this.get("_timers"),o=this.get("_windowForceResizeEvent"),a=this.get("plugins");return s.each(i,(function(t){clearTimeout(t)})),s.each(r,(function(t){t.destroy()})),a.forEach((function(t){t.destroy&&t.destroy()})),e&&e.destroy(),n.destroy(),window.removeEventListener("resize",o),this.emit("afterdestroy"),t.prototype.destroy.call(this),this},e.save=function(){var t={nodes:[],edges:[],groups:[],guides:[]};return this.get("_itemGroup").get("children").forEach((function(e,n){var r=e.model;if(r){var i=e.itemType,o=s.clone(r);o.index=n,t[i+"s"].push(o)}})),0===t.nodes.length&&delete t.nodes,0===t.edges.length&&delete t.edges,0===t.groups.length&&delete t.groups,0===t.guides.length&&delete t.guides,t},e.add=function(t,e){var n=[],r={action:"add",model:e,affectedItemIds:n};this.emit("beforechange",r);var i=this.get("_itemMap");this._addItems(t,[e]);var o=i[e.id];return o.getAllParents().forEach((function(t){t.update()})),r.item=o,n.push(e.id),this.emit("afterchange",r),o},e.remove=function(t){if((t=this.getItem(t))&&!t.destroyed){var e=[],n=[],r={action:"remove",item:t,affectedItemIds:n};if(t.isNode){var i=t.getEdges();e=e.concat(i)}if(t.isGroup){var o=t.getEdges(),a=t.getAllChildren(),c=t.getCrossEdges(),u=t.getInnerEdges();e=e.concat(o,a,c,u),e=s.uniq(e)}e.push(t);var h=t.getAllParents();return h.forEach((function(t){n.push(t.id)})),e.forEach((function(t){n.push(t.id)})),this.emit("beforechange",r),this._removeItems(e),h.forEach((function(t){t.update()})),this.emit("afterchange",r),this}},e.simpleUpdate=function(t,e){return this._updateItems([t],[e]),this.draw(),this},e.update=function(t,e){var n=this.get("_itemMap");if((t=this.getItem(t))&&!t.destroyed&&e){var r=this.get("animate"),i=[],o=[],a=[],c=t.getModel(),u=s.mix({},c),h={action:"update",item:t,originModel:u,updateModel:e,affectedItemIds:a},l=n[u.parent];if(i.push(t),o.push(e),a.push(t.id),l&&l!==parent&&s.isGroup(l)&&t.getAllParents().forEach((function(t){i.push(t),o.push(null),a.push(t.id)})),e.parent){var d=n[e.parent];if(!d)throw new Error("there is no "+e.parent+" exist, please add a new one!");i.push(d),o.push(null),a.push(d.id),d.getAllParents().forEach((function(t){i.push(t),o.push(null),a.push(t.id)}))}return(t.isNode||t.isGroup)&&t.getEdges().forEach((function(t){i.push(t),o.push(null),a.push(t.id)})),t.isGroup&&!s.isNil(e.collapsed)&&(r&&t.deepEach((function(t){a.push(t.id)})),t.getCrossEdges().forEach((function(t){i.push(t),o.push(null),a.push(t.id)}))),this.emit("beforechange",h),this._updateItems(i,o),this.emit("afterchange",h),this}},e.read=function(t){var e=this;if(!t)throw new Error("please read valid data!");var n={action:"changeData",data:t};return this.emit("beforechange",n),this.preventAnimate((function(){e.clear(),e.source(t),e.render()})),this.emit("afterchange",n),this},e.clear=function(){return this.emit("beforeclear"),this._clearInner(),this._initData(),this.emit("afterclear"),this},e.hide=function(t){var e=[],n=[],r={item:t=this.getItem(t),affectedItemIds:n};return e.push(t),t.isNode&&t.getEdges().forEach((function(t){e.push(t)})),t.isGroup&&(t.getEdges().forEach((function(t){e.push(t)})),t.deepEach((function(t){e.push(t)}))),(e=s.uniq(e)).forEach((function(t){n.push(t.id)})),this.emit("beforehide",r),e.forEach((function(t){t.hide()})),this.emit("afterhide",r),this},e.show=function(t){var e=this,n=[],r=[],i={item:t=this.getItem(t),affectedItemIds:r};if(t.visible=!0,t.isEdge){var o=this._getShowEdge(t);o&&n.push(o)}else n.push(t);return t.isNode&&t.getEdges().forEach((function(t){(t=e._getShowEdge(t))&&n.push(t)})),t.isGroup&&(t.getEdges().forEach((function(t){(t=e._getShowEdge(t))&&n.push(t)})),t.deepEach((function(t){n.push(t)}))),(n=s.uniq(n)).forEach((function(t){r.push(t.id)})),this.emit("beforeshow",i),n.forEach((function(t){t.show()})),this.emit("aftershow",i),this},e.getWidth=function(){return this.get("width")},e.getHeight=function(){return this.get("height")},e.changeSize=function(t,e){if(!(Math.abs(t)>=1/0||Math.abs(e)>=1/0)){var n=this.get("_canvas");return t===this.get("width")&&e===this.get("height")||(this.emit("beforechangesize"),n.changeSize(t,e),this.set("width",t),this.set("height",e),this.emit("afterchangesize"),this.draw()),this}console.warn("size parameter more than the maximum")},e.toFront=function(t){t=this.getItem(t);var e=this.get("_itemGroup"),n=t.getGraphicGroup();s.toFront(n,e),this.draw()},e.toBack=function(t){t=this.getItem(t);var e=this.get("_itemGroup"),n=t.getGraphicGroup();s.toBack(n,e),this.draw()},e.css=function(t){var e=this.getGraphContainer();s.modifyCSS(e,t)},e.saveImage=function(t){var e=this.getBBox(),n=this.getFitViewPadding();return new c(function(t){for(var e=1;e1?n*e+this._getSpaceingY()*(e-1):n},isHitBox:function(){return!1},calculateBox:function(){var t=this._attrs,e=this._cfg;e.attrs&&!e.hasUpdate||(this._assembleFont(),this._setAttrText()),t.textArr||this._setAttrText();var n=t.x,r=t.y,i=this.measureText();if(!i)return{minX:n,minY:r,maxX:n,maxY:r};var o=this._getTextHeight(),a=t.textAlign,s=t.textBaseline,c=this.getHitLineWidth(),u={x:n,y:r-o};a&&("end"===a||"right"===a?u.x-=i:"center"===a&&(u.x-=i/2)),s&&("top"===s?u.y+=o:"middle"===s&&(u.y+=o/2)),this.set("startPoint",u);var h=c/2;return{minX:u.x-h,minY:u.y-h,maxX:u.x+i+h,maxY:u.y+o+h}},_getSpaceingY:function(){var t=this._attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},drawInner:function(t){var e=this._attrs,n=this._cfg;n.attrs&&!n.hasUpdate||(this._assembleFont(),this._setAttrText()),t.font=e.font;var i=e.text;if(i){var o=e.textArr,a=e.x,s=e.y;if(t.beginPath(),this.hasStroke()){var c=e.strokeOpacity;r.isNil(c)||1===c||(t.globalAlpha=c),o?this._drawTextArr(t,!1):t.strokeText(i,a,s),t.globalAlpha=1}if(this.hasFill()){var u=e.fillOpacity;r.isNil(u)||1===u||(t.globalAlpha=u),o?this._drawTextArr(t,!0):t.fillText(i,a,s)}n.hasUpdate=!1}},_drawTextArr:function(t,e){var n,i=this._attrs.textArr,o=this._attrs.textBaseline,a=1*this._attrs.fontSize,s=this._getSpaceingY(),c=this._attrs.x,u=this._attrs.y,h=this.getBBox(),l=h.maxY-h.minY;r.each(i,(function(r,i){n=u+i*(s+a)-l+a,"middle"===o&&(n+=l-a-(l-a)/2),"top"===o&&(n+=l-a),e?t.fillText(r,c,n):t.strokeText(r,c,n)}))},measureText:function(){var t,e=this._attrs,n=e.text,i=e.font,o=e.textArr,a=0;if(!r.isNil(n)){var s=document.createElement("canvas").getContext("2d");return s.save(),s.font=i,o?r.each(o,(function(e){t=s.measureText(e).width,aa&&(a=e),ns&&(s=n)}));var c=e/2;return{minX:i-c,minY:o-c,maxX:a+c,maxY:s+c}},_setTcache:function(){var t,e,n=this._attrs.points,i=0,o=0,s=[];n&&0!==n.length&&(r.each(n,(function(t,e){n[e+1]&&(i+=a.len(t[0],t[1],n[e+1][0],n[e+1][1]))})),i<=0||(r.each(n,(function(r,c){n[c+1]&&((t=[])[0]=o/i,e=a.len(r[0],r[1],n[c+1][0],n[c+1][1]),o+=e,t[1]=o/i,s.push(t))})),this.tCache=s))},createPath:function(t){var e,n,r=this._attrs.points;if(!(r.length<2)){for((t=t||this.get("context")).beginPath(),t.moveTo(r[0][0],r[0][1]),n=1,e=r.length-1;n=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),{x:a.at(i[n][0],i[n+1][0],e),y:a.at(i[n][1],i[n+1][1],e)}}}),t.exports=s},function(t,e,n){var r=n(19),i=n(58),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={points:null,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"polygon",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this._attrs.points,e=this.getHitLineWidth();if(!t||0===t.length)return null;var n=1/0,i=1/0,o=-1/0,a=-1/0;r.each(t,(function(t){var e=t[0],r=t[1];eo&&(o=e),ra&&(a=r)}));var s=e/2;return{minX:n-s,minY:i-s,maxX:o+s,maxY:a+s}},createPath:function(t){var e=this._attrs.points;e.length<2||((t=t||this.get("context")).beginPath(),r.each(e,(function(e,n){0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])})),t.closePath())}}),t.exports=o},function(t,e,n){var r=n(19),i=n(58),o=n(600),a=n(593),s=n(601),c=n(610),u=n(612),h=function t(e){t.superclass.constructor.call(this,e)};h.ATTRS={path:null,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(h,i),r.augment(h,{canFill:!0,canStroke:!0,type:"path",getDefaultAttrs:function(){return{lineWidth:1,startArrow:!1,endArrow:!1}},_afterSetAttrPath:function(t){if(r.isNil(t))return this.setSilent("segments",null),void this.setSilent("box",void 0);var e,n=a.parsePath(t),i=[];if(r.isArray(n)&&0!==n.length&&("M"===n[0][0]||"m"===n[0][0])){for(var s=n.length,c=0;ci&&(i=r.maxX),r.minYa&&(a=r.maxY))})),n===1/0||o===1/0?{minX:0,minY:0,maxX:0,maxY:0}:{minX:n,minY:o,maxX:i,maxY:a}},_setTcache:function(){var t,e,n,i,o=0,a=0,s=[],c=this._cfg.curve;c&&(r.each(c,(function(t,e){n=c[e+1],i=t.length,n&&(o+=u.len(t[i-2],t[i-1],n[1],n[2],n[3],n[4],n[5],n[6]))})),r.each(c,(function(r,h){n=c[h+1],i=r.length,n&&((t=[])[0]=a/o,e=u.len(r[i-2],r[i-1],n[1],n[2],n[3],n[4],n[5],n[6]),a+=e,t[1]=a/o,s.push(t))})),this._cfg.tCache=s)},_calculateCurve:function(){var t=this._attrs.path;this._cfg.curve=c.pathTocurve(t)},getStartTangent:function(){var t,e,n,i,o=this.get("segments");if(o.length>1)if(t=o[0].endPoint,e=o[1].endPoint,n=o[1].startTangent,i=[],r.isFunction(n)){var a=n();i.push([t.x-a[0],t.y-a[1]]),i.push([t.x,t.y])}else i.push([e.x,e.y]),i.push([t.x,t.y]);return i},getEndTangent:function(){var t,e,n,i,o=this.get("segments"),a=o.length;if(a>1)if(t=o[a-2].endPoint,e=o[a-1].endPoint,n=o[a-1].endTangent,i=[],r.isFunction(n)){var s=n();i.push([e.x-s[0],e.y-s[1]]),i.push([e.x,e.y])}else i.push([t.x,t.y]),i.push([e.x,e.y]);return i},getPoint:function(t){var e,n,i=this._cfg.tCache;i||(this._calculateCurve(),this._setTcache(),i=this._cfg.tCache);var o=this._cfg.curve;if(!i)return o?{x:o[0][1],y:o[0][2]}:null;r.each(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var a=o[n];if(r.isNil(a)||r.isNil(n))return null;var s=a.length,c=o[n+1];return{x:u.at(a[s-2],c[1],c[3],c[5],1-e),y:u.at(a[s-1],c[2],c[4],c[6],1-e)}},createPath:function(t){var e=this.get("segments");if(r.isArray(e)){(t=t||this.get("context")).beginPath();for(var n=e.length,i=0;ia?o:a,c=o>a?1:o/a,u=o>a?a/o:1,h=[1,0,0,0,1,0,0,0,1];r.mat3.scale(h,h,[c,u]),r.mat3.translate(h,h,[n,i]),t.beginPath(),t.save(),t.transform(h[0],h[1],h[3],h[4],h[6],h[7]),t.arc(0,0,s,0,2*Math.PI),t.restore(),t.closePath()}}),t.exports=o},function(t,e,n){var r=n(19),i=n(58),o=function t(e){t.superclass.constructor.call(this,e)};r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"dom",calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.width,i=t.height,o=this.getHitLineWidth()/2;return{minX:e-o,minY:n-o,maxX:e+r+o,maxY:n+i+o}}}),t.exports=o},function(t,e,n){var r=n(19),i=n(58),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={x:0,y:0,r:0,lineWidth:1},r.extend(o,i),r.augment(o,{canFill:!0,canStroke:!0,type:"circle",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.r,i=this.getHitLineWidth()/2+r;return{minX:e-i,minY:n-i,maxX:e+i,maxY:n+i}},createPath:function(t){var e=this._attrs,n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()}}),t.exports=o},function(t,e,n){var r=n(19),i=n(58),o=n(602),a=n(601);function s(t,e,n){return t+e*Math.cos(n)}function c(t,e,n){return t+e*Math.sin(n)}var u=function t(e){t.superclass.constructor.call(this,e)};u.ATTRS={x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1},r.extend(u,i),r.augment(u,{canStroke:!0,type:"arc",getDefaultAttrs:function(){return{x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,startArrow:!1,endArrow:!1}},calculateBox:function(){var t=this._attrs,e=t.x,n=t.y,r=t.r,i=t.startAngle,a=t.endAngle,s=t.clockwise,c=this.getHitLineWidth()/2,u=o.box(e,n,r,i,a,s);return u.minX-=c,u.minY-=c,u.maxX+=c,u.maxY+=c,u},getStartTangent:function(){var t=this._attrs,e=t.x,n=t.y,r=t.startAngle,i=t.r,o=t.clockwise,a=Math.PI/180;o&&(a*=-1);var u=[],h=s(e,i,r+a),l=c(n,i,r+a),d=s(e,i,r),f=c(n,i,r);return u.push([h,l]),u.push([d,f]),u},getEndTangent:function(){var t=this._attrs,e=t.x,n=t.y,r=t.endAngle,i=t.r,o=t.clockwise,a=Math.PI/180,u=[];o&&(a*=-1);var h=s(e,i,r+a),l=c(n,i,r+a),d=s(e,i,r),f=c(n,i,r);return u.push([d,f]),u.push([h,l]),u},createPath:function(t){var e=this._attrs,n=e.x,r=e.y,i=e.r,o=e.startAngle,a=e.endAngle,s=e.clockwise;(t=t||self.get("context")).beginPath(),t.arc(n,r,i,o,a,s)},afterPath:function(t){var e=this._attrs;if(t=t||this.get("context"),e.startArrow){var n=this.getStartTangent();a.addStartArrow(t,e,n[0][0],n[0][1],n[1][0],n[1][1])}if(e.endArrow){var r=this.getEndTangent();a.addEndArrow(t,e,r[0][0],r[0][1],r[1][0],r[1][1])}}}),t.exports=u},function(t,e){t.exports={xAt:function(t,e,n,r,i){return e*Math.cos(t)*Math.cos(i)-n*Math.sin(t)*Math.sin(i)+r},yAt:function(t,e,n,r,i){return e*Math.sin(t)*Math.cos(i)+n*Math.cos(t)*Math.sin(i)+r},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){var r=n(19),i=r.vec2;function o(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function a(t,e,n,r,a,s,c,u,h){var l,d,f,g,p,m,v,x=.005,y=1/0,b=[c,u];for(p=0;p<1;p+=.05)f=[o(t,n,a,p),o(e,r,s,p)],(d=i.squaredDistance(b,f))=0&&d=0?[o]:[]}}},function(t,e,n){var r=n(19),i=n(746),o=n(745),a=n(744),s=n(116),c=function(t){this._cfg={zIndex:0,capture:!0,visible:!0,destroyed:!1},r.assign(this._cfg,this.getDefaultCfg(),t),this.initAttrs(this._cfg.attrs),this._cfg.attrs={},this.initTransform(),this.init()};c.CFG={id:null,zIndex:0,canvas:null,parent:null,capture:!0,context:null,visible:!0,destroyed:!1},r.augment(c,i,o,s,a,{init:function(){this.setSilent("animable",!0),this.setSilent("animating",!1)},getParent:function(){return this._cfg.parent},getDefaultCfg:function(){return{}},set:function(t,e){return"zIndex"===t&&this._beforeSetZIndex&&this._beforeSetZIndex(e),"loading"===t&&this._beforeSetLoading&&this._beforeSetLoading(e),this._cfg[t]=e,this},setSilent:function(t,e){this._cfg[t]=e},get:function(t){return this._cfg[t]},show:function(){return this._cfg.visible=!0,this},hide:function(){return this._cfg.visible=!1,this},remove:function(t,e){var n=this._cfg,i=n.parent,o=n.el;return i&&r.remove(i.get("children"),this),o&&(e?i&&i._cfg.tobeRemoved.push(o):o.parentNode.removeChild(o)),(t||void 0===t)&&this.destroy(),this},destroy:function(){this.get("destroyed")||(this._attrs=null,this.removeEvent(),this._cfg={destroyed:!0})},toFront:function(){var t=this._cfg,e=t.parent;if(e){var n=e._cfg.children,r=t.el,i=n.indexOf(this);n.splice(i,1),n.push(this),r&&(r.parentNode.removeChild(r),t.el=null)}},toBack:function(){var t=this._cfg,e=t.parent;if(e){var n=e._cfg.children,r=t.el,i=n.indexOf(this);if(n.splice(i,1),n.unshift(this),r){var o=r.parentNode;o.removeChild(r),o.insertBefore(r,o.firstChild)}}},_beforeSetZIndex:function(t){var e=this._cfg.parent;this._cfg.zIndex=t,r.isNil(e)||e.sort();var n=this._cfg.el;if(n){var i=e._cfg.children,o=i.indexOf(this),a=n.parentNode;a.removeChild(n),o===i.length-1?a.appendChild(n):a.insertBefore(n,a.childNodes[o])}return t},_setAttrs:function(t){return this.attr(t),t},setZIndex:function(t){return this._cfg.zIndex=t,this._beforeSetZIndex(t)},clone:function(){return r.clone(this)},getBBox:function(){}}),t.exports=c},function(t,e,n){var r=n(19),i=n(641),o=n(743),a={},s="_INDEX";function c(t,e,n){for(var r,i=t.length-1;i>=0;i--){var o=t[i];if(o._cfg.visible&&o._cfg.capture&&(o.isGroup?r=o.getShape(e,n):o.isHit(e,n)&&(r=o)),r)break}return r}var u=function t(e){t.superclass.constructor.call(this,e),this.set("children",[]),this.set("tobeRemoved",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};r.extend(u,i),r.augment(u,{isGroup:!0,type:"group",canFill:!0,canStroke:!0,getDefaultCfg:function(){return function t(e){if(!e._cfg&&e!==u){var n=e.superclass.constructor;n&&!n._cfg&&t(n),e._cfg={},r.merge(e._cfg,n._cfg),r.merge(e._cfg,e.CFG)}}(this.constructor),r.merge({},this.constructor._cfg)},_beforeRenderUI:function(){},_renderUI:function(){},_bindUI:function(){},addShape:function(t,e){var n=this.get("canvas");e=e||{};var i=a[t];if(i||(i=r.upperFirst(t),a[t]=i),e.attrs&&n){var s=e.attrs;if("text"===t){var c=n.get("fontFamily");c&&(s.fontFamily=s.fontFamily?s.fontFamily:c)}}e.canvas=n,e.type=t;var u=new o[i](e);return this.add(u),u},addGroup:function(t,e){var n,i=this.get("canvas");if(e=r.merge({},e),r.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(r.isObject(t))t.canvas=i,n=new u(t),this.add(n);else{if(void 0!==t)return!1;n=new u,this.add(n)}return n},renderBack:function(t,e){var n=this.get("backShape"),i=this.getBBox();return r.merge(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=this.addShape("rect",{zIndex:-1,attrs:e}),this.set("backShape",n),this.sort(),n},removeChild:function(t,e){if(arguments.length>=2)this.contain(t)&&t.remove(e);else{if(1===arguments.length){if(!r.isBoolean(t))return this.contain(t)&&t.remove(!0),this;e=t}0===arguments.length&&(e=!0),u.superclass.remove.call(this,e)}return this},add:function(t){var e=this,n=e.get("children");if(r.isArray(t))r.each(t,(function(t){var n=t.get("parent");n&&n.removeChild(t,!1),e._setCfgProperty(t)})),e._cfg.children=n.concat(t);else{var i=t,o=i.get("parent");o&&o.removeChild(i,!1),e._setCfgProperty(i),n.push(i)}return e},_setCfgProperty:function(t){var e=this._cfg;t.set("parent",this),t.set("canvas",e.canvas),e.timeline&&t.set("timeline",e.timeline)},contain:function(t){return this.get("children").indexOf(t)>-1},getChildByIndex:function(t){return this.get("children")[t]},getFirst:function(){return this.getChildByIndex(0)},getLast:function(){var t=this.get("children").length-1;return this.getChildByIndex(t)},getBBox:function(){var t=1/0,e=-1/0,n=1/0,i=-1/0,o=this.get("children");o.length>0?r.each(o,(function(r){if(r.get("visible")){if(r.isGroup&&0===r.get("children").length)return;var o=r.getBBox();if(!o)return!0;var a=[o.minX,o.minY,1],s=[o.minX,o.maxY,1],c=[o.maxX,o.minY,1],u=[o.maxX,o.maxY,1];r.apply(a),r.apply(s),r.apply(c),r.apply(u);var h=Math.min(a[0],s[0],c[0],u[0]),l=Math.max(a[0],s[0],c[0],u[0]),d=Math.min(a[1],s[1],c[1],u[1]),f=Math.max(a[1],s[1],c[1],u[1]);he&&(e=l),di&&(i=f)}})):(t=0,e=0,n=0,i=0);var a={minX:t,minY:n,maxX:e,maxY:i};return a.x=a.minX,a.y=a.minY,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},getCount:function(){return this.get("children").length},sort:function(){var t=this.get("children");return r.each(t,(function(t,e){return t[s]=e,t})),t.sort((function(t,e){var n=function(t,e){return t.get("zIndex")-e.get("zIndex")}(t,e);return 0===n?t[s]-e[s]:n})),this},findById:function(t){return this.find((function(e){return e.get("id")===t}))},find:function(t){if(r.isString(t))return this.findById(t);var e=this.get("children"),n=null;return r.each(e,(function(e){if(t(e)?n=e:e.find&&(n=e.find(t)),n)return!1})),n},findAll:function(t){var e=this.get("children"),n=[],i=[];return r.each(e,(function(e){t(e)&&n.push(e),e.findAllBy&&(i=e.findAllBy(t),n=n.concat(i))})),n},findBy:function(t){var e=this.get("children"),n=null;return r.each(e,(function(e){if(t(e)?n=e:e.findBy&&(n=e.findBy(t)),n)return!1})),n},findAllBy:function(t){var e=this.get("children"),n=[],i=[];return r.each(e,(function(e){t(e)&&n.push(e),e.findAllBy&&(i=e.findAllBy(t),n=n.concat(i))})),n},getShape:function(t,e){var n,r=this._attrs.clip,i=this._cfg.children;if(r){var o=[t,e,1];r.invert(o,this.get("canvas")),r.isPointInPath(o[0],o[1])&&(n=c(i,t,e))}else n=c(i,t,e);return n},clearTotalMatrix:function(){if(this.get("totalMatrix")){this.setSilent("totalMatrix",null);for(var t=this._cfg.children,e=0;e=0;n--)e[n].remove(!0,t);return this._cfg.children=[],this},destroy:function(){this.get("destroyed")||(this.clear(),u.superclass.destroy.call(this))},clone:function(){var t=this._cfg.children,e=new u;return r.each(t,(function(t){e.add(t.clone())})),e}}),t.exports=u},function(t,e,n){var r=n(19),i=function(t,e,n,r){this.type=t,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=r,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=e};r.augment(i,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return r.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),t.exports=i},function(t,e,n){t.exports={isFunction:n(84),isObject:n(621),isBoolean:n(653),isNil:n(237),isString:n(595),isArray:n(45),isNumber:n(236),isEmpty:n(647),uniqueId:n(646),clone:n(616),deepMix:n(615),assign:n(606),merge:n(615),upperFirst:n(655),each:n(46),isEqual:n(614),toArray:n(604),extend:n(650),augment:n(651),remove:n(676),isNumberEqual:n(673),toRadian:n(669),toDegree:n(671),mod:n(672),clamp:n(618),createDom:n(681),modifyCSS:n(680),requestAnimationFrame:n(679),getRatio:function(){return window.devicePixelRatio?window.devicePixelRatio:2},mat3:n(617),vec2:n(668),vec3:n(667),transform:n(666)}},function(t,e,n){var r=n(16),i=n(253),o=n(251),a=Math.max,s=Math.min;t.exports=function(t,e,n){var c,u,h,l,d,f,g=0,p=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function x(e){var n=c,r=u;return c=u=void 0,g=e,l=t.apply(r,n)}function y(t){var n=t-f;return void 0===f||n>=e||n<0||m&&t-g>=h}function b(){var t=i();if(y(t))return w(t);d=setTimeout(b,function(t){var n=e-(t-f);return m?s(n,h-(t-g)):n}(t))}function w(t){return d=void 0,v&&c?x(t):(c=u=void 0,l)}function M(){var t=i(),n=y(t);if(c=arguments,u=this,f=t,n){if(void 0===d)return function(t){return g=t,d=setTimeout(b,e),p?x(t):l}(f);if(m)return d=setTimeout(b,e),x(f)}return void 0===d&&(d=setTimeout(b,e)),l}return e=o(e)||0,r(n)&&(p=!!n.leading,h=(m="maxWait"in n)?a(o(n.maxWait)||0,e):h,v="trailing"in n?!!n.trailing:v),M.cancel=function(){void 0!==d&&clearTimeout(d),g=0,c=f=u=d=void 0},M.flush=function(){return void 0===d?l:w(i())},M}},function(t,e){var n=function(){var t={};return function(e){return t[e=e||"g"]?t[e]+=1:t[e]=1,e+t[e]}}();t.exports=n},function(t,e,n){var r=n(237),i=n(118),o=n(654),a=n(652),s=Object.prototype.hasOwnProperty;t.exports=function(t){if(r(t))return!0;if(i(t))return!t.length;var e=o(t);if("Map"===e||"Set"===e)return!t.size;if(a(t))return!Object.keys(t).length;for(var n in t)if(s.call(t,n))return!1;return!0}},function(t,e,n){var r=n(46),i=n(45),o=Object.prototype.hasOwnProperty;t.exports=function(t,e){if(!e||!i(t))return t;var n={},a=null;return r(t,(function(t){a=e(t),o.call(n,a)?n[a].push(t):n[a]=[t]})),n}},function(t,e,n){var r=n(84),i=n(45),o=n(648);t.exports=function(t,e){if(!e)return{0:t};if(!r(e)){var n=i(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;rr;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}},function(t,e){var n="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="\t\n\v\f\r   ᠎              \u2028\u2029",i=new RegExp("([a-z])["+r+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+r+"]*,?["+r+"]*)+)","ig"),o=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+r+"]*,?["+r+"]*","ig");t.exports=function(t){if(!t)return null;if((void 0===t?"undefined":n(t))===n([]))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},r=[];return String(t).replace(i,(function(t,n,i){var a=[],s=n.toLowerCase();if(i.replace(o,(function(t,e){e&&a.push(+e)})),"m"===s&&a.length>2&&(r.push([n].concat(a.splice(0,2))),s="l",n="m"===n?"l":"L"),"o"===s&&1===a.length&&r.push([n,a[0]]),"r"===s)r.push([n].concat(a));else for(;a.length>=e[s]&&(r.push([n].concat(a.splice(0,e[s]))),e[s]););})),r}},function(t,e,n){var r=n(659),i=n(658);function o(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),c=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,c,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o}t.exports=function(t){if(!(t=r(t))||!t.length)return[["M",0,0]];var e=[],n=0,a=0,s=0,c=0,u=0,h=void 0,l=void 0;"M"===t[0][0]&&(s=n=+t[0][1],c=a=+t[0][2],u++,e[0]=["M",n,a]);for(var d,f,g=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=u,m=t.length;p1&&(r*=M=Math.sqrt(M),i*=M);var _=r*r,S=i*i,A=(a===s?-1:1)*Math.sqrt(Math.abs((_*S-_*w*w-S*b*b)/(_*w*w+S*b*b)));v=A*r*w/i+(e+c)/2,x=A*-i*b/r+(n+u)/2,p=Math.asin(((n-x)/i).toFixed(9)),m=Math.asin(((u-x)/i).toFixed(9)),p=em&&(p-=2*Math.PI),!s&&m>p&&(m-=2*Math.PI)}var E=m-p;if(Math.abs(E)>l){var P=m,C=c,O=u;m=p+l*(s&&m>p?1:-1),f=t(c=v+r*Math.cos(m),u=x+i*Math.sin(m),r,i,o,0,s,C,O,[m,P,v,x])}E=m-p;var I=Math.cos(p),k=Math.sin(p),B=Math.cos(m),T=Math.sin(m),N=Math.tan(E/4),L=4/3*r*N,Y=4/3*i*N,X=[e,n],G=[e+L*k,n-Y*I],D=[c+L*T,u-Y*B],F=[c,u];if(G[0]=2*X[0]-G[0],G[1]=2*X[1]-G[1],h)return[G,D,F].concat(f);for(var j=[],R=0,H=(f=[G,D,F].concat(f).join().split(",")).length;R7){t[e].shift();for(var r=t[e];r.length;)u[e]="A",a&&(h[e]="A"),t.splice(e++,0,["C"].concat(r.splice(0,6)));t.splice(e,1),f=Math.max(n.length,a&&a.length||0)}},m=function(t,e,r,i,o){t&&e&&"M"===t[o][0]&&"M"!==e[o][0]&&(e.splice(o,0,["M",i.x,i.y]),r.bx=0,r.by=0,r.x=t[o][1],r.y=t[o][2],f=Math.max(n.length,a&&a.length||0))};f=Math.max(n.length,a&&a.length||0);for(var v=0;v=0;return n?o?2*Math.PI-i:i:o?i:2*Math.PI-i},r.vertical=function(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t},t.exports=r},function(t,e){var n=Math.PI/180;t.exports=function(t){return n*t}},function(t,e){t.exports=parseInt},function(t,e){var n=180/Math.PI;t.exports=function(t){return n*t}},function(t,e){t.exports=function(t,e){return(t%e+e)%e}},function(t,e){t.exports=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(t-e)-1;)r.call(t,s,1);return t}},function(t,e,n){var r=n(46),i=n(84),o=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return r(t,(function(n,r){i(t)&&"prototype"===r||e.push(r)})),e};t.exports=o},function(t,e,n){var r=n(677),i=n(237);t.exports=function(t,e){var n=r(e),o=n.length;if(i(t))return!o;for(var a=0;a]*>/,o={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:r,th:r,"*":document.createElement("div")};t.exports=function(t){var e=i.test(t)&&RegExp.$1;e in o||(e="*");var n=o[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var r=n.childNodes[0];return n.removeChild(r),r}},function(t,e,n){var r=n(257),i={isBetween:function(t,e,n){return t>=e&&t<=n},getLineIntersect:function(t,e,n,r){var o=n.x-t.x,a=n.y-t.y,s=e.x-t.x,c=e.y-t.y,u=r.x-n.x,h=r.y-n.y,l=s*h-c*u,d=null;if(l*l>.001*(s*s+c*c)*(u*u+h*h)){var f=(o*h-a*u)/l,g=(o*c-a*s)/l;i.isBetween(f,0,1)&&i.isBetween(g,0,1)&&(d={x:t.x+f*s,y:t.y+f*c})}return d},getIntersectPointRect:function(t,e){var n=t.minX,r=t.minY,o=t.maxX-t.minX,a=t.maxY-t.minY,s=[],c={x:n+o/2,y:r+a/2};s.push({x:n,y:r}),s.push({x:n+o,y:r}),s.push({x:n+o,y:r+a}),s.push({x:n,y:r+a}),s.push({x:n,y:r});for(var u=null,h=1;hd&&(d=r);for(i=0;i0?(n=n.filter((function(t){var n=e[t.id];return!!n&&!1!==n.getShapeObj().bboxCalculation})),r.getChildrenBBox(n)):{minX:0,minY:0,maxX:this.get("width"),maxY:this.get("height")}},getFitViewPadding:function(){return r.toAllPadding(this.get("fitViewPadding"))},setFitView:function(t){if(!t)return this;if("autoZoom"===t)return this.autoZoom(),this;var e=this.getFitViewPadding(),n=this.get("width"),i=this.get("height"),o=this.getBBox(),a=o.maxX-o.minX,s=o.maxY-o.minY,c={x:0,y:0,width:n,height:i},u=r.getNineBoxPosition(t,c,a,s,e),h=[1,0,0,0,1,0,0,0,1];r.mat3.translate(h,h,[-o.minX+u.x,-o.minY+u.y]),this.updateMatrix(h)},_getZoomRatio:function(t){var e=this.get("maxZoom"),n=this.get("minZoom");return te&&(t=e),t},autoZoom:function(t){var e=this;t||(t=this.getFitViewPadding());var n=this.get("width"),i=this.get("height"),o=this.getBBox(),a=r.getAutoZoomMatrix({minX:0,minY:0,maxX:n,maxY:i},o,t,(function(t){return e._getZoomRatio(t)}));this.updateMatrix(a)},getZoom:function(){return this.getMatrix()[0]},updateMatrix:function(t){var e=this.getMatrix(),n={updateMatrix:t,originMatrix:e},r=e[0]!==t[0];return this.emit("beforeviewportchange",n),r&&this.emit("beforezoom",n),this.setMatrix(t),r&&this.emit("afterzoom",n),this.emit("afterviewportchange",n),this.draw(),this},zoom:function(t,e){if(!r.isNumber(t)){e=this._getZoomRatio(e);var n=this.get("_rootGroup"),i=r.clone(n.getMatrix()),o=i[6]+i[0]*t.x-e*t.x,a=i[7]+i[0]*t.y-e*t.y;return i[6]=0,i[7]=0,i[0]=e,i[4]=e,r.mat3.translate(i,i,[o,a]),this.updateMatrix(i),this}var s=this.get("width"),c=this.get("height");this.zoomByDom({x:s/2,y:c/2},t)},zoomByDom:function(t,e){var n=this.getPoint(t);return this.zoom(n,e),this},translate:function(t,e){var n=this.get("_rootGroup").getMatrix();return r.mat3.translate(n,n,[t,e]),this.updateMatrix(n),this},translateByDom:function(t,e){var n=this.get("_rootGroup").getMatrix()[0];return this.translate(t/n,e/n),this},getMatrix:function(){return this.get("_rootGroup").getMatrix()},setMatrix:function(t){this.get("_rootGroup").setMatrix(t)},getPoint:function(t){return this.getPointByDom(t)},getPointByDom:function(t){var e=this.get("_rootGroup").getMatrix();return r.invertMatrix(t,e)},getPointByCanvas:function(t){var e=this.get("_canvas").get("pixelRatio");return this.getPoint({x:t.x/e,y:t.y/e})},getPointByClient:function(t){var e=this.get("_canvas").getPointByClient(t.x,t.y);return this.getPointByCanvas(e)},getDomPoint:function(t){var e=this.get("_rootGroup").getMatrix();return r.applyMatrix(t,e)},getCanvasPoint:function(t){var e=this.get("_canvas").get("pixelRatio"),n=this.getDomPoint(t);return{x:n.x*e,y:n.y*e}},getClientPoint:function(t){var e=this.getCanvasPoint(t),n=this.get("_canvas").getClientByPoint(e.x,e.y);return{x:n.clientX,y:n.clientY}},focus:function(t){if(r.isString(t)&&(t=this.find(t)),t){var e=t.getCenter();this.focusPoint(e)}return this},focusPoint:function(t){var e=this.get("_rootGroup").getMatrix(),n=this.get("width"),r=this.get("height"),i=-e[6]+n/2-e[0]*t.x,o=-e[7]+r/2-e[0]*t.y;return this.translate(i,o),this},focusPointByDom:function(t){var e=this.getPoint(t);return this.focusPoint(e),this}},t.exports=i},function(t,e){t.exports={INIT:"_initDraw",AUGMENT:{_initDraw:function(){var t=this,e=this.get("_controllers").animate;["clear","show","hide","change","updatenodeposition"].forEach((function(n){e&&t.on("before"+n,(function(n){var r=t.get("_forcePreventAnimate"),i=n?n.affectedItemIds:void 0;!0!==r&&e&&e.cacheGraph("startCache",i)})),t.on("after"+n,(function(n){var r=n?n.affectedItemIds:void 0,i=t.get("_forcePreventAnimate");if(n&&"changeData"===n.action){var o=t.get("fitView");o&&t.setFitView(o)}!0!==i&&e?(e.cacheGraph("endCache",r),e.run()):t.draw()}))}))},draw:function(){this.get("_canvas").draw()},animateDraw:function(){this.get("_controllers").animate.run()}}}},function(t,e,n){var r=n(247);function i(t,e){var n=t.getGraphicGroup(),i=t.getBBox(),o=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2,s=n.getMatrix()[0];n.transform([["t",-o,-a],["s",.01/s,.01/s],["t",o,a]]),n.animate({transform:[["t",-o,-a],["s",100*s,100*s],["t",o,a]]},r.enterDuration,r.enterEasing,e)}function o(t,e){var n=t.getGraphicGroup(),i=t.getBBox(),o=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2,s=n.getMatrix()[0];n.animate({transform:[["t",-o,-a],["s",.01/s,.01/s],["t",o,a]]},r.leaveDuration,r.leaveEasing,e)}function a(t,e){t.deepEach((function(t){if(t.isShape){var n=t.attr("fillOpacity"),i=t.attr("strokeOpacity");t.attr({fillOpacity:0,strokeOpacity:0}),t.animate({fillOpacity:n,strokeOpacity:i},r.enterDuration,r.enterEasing,e)}}))}function s(t,e){t.deepEach((function(t){var n=t.attr("fillOpacity"),i=t.attr("strokeOpacity");t.isShape&&t.animate({fillOpacity:0,strokeOpacity:0},r.leaveDuration,r.leaveEasing,(function(){t.attr({fillOpacity:n,strokeOpacity:i}),e()}))}))}t.exports={enterScaleIn:function(t){var e=t.item;t.element.isItemContainer&&e.getKeyShape()&&i(e)},showScaleIn:function(t){var e=t.item;t.element.isItemContainer&&e.getKeyShape()&&i(e)},leaveScaleOut:function(t){var e=t.item,n=t.element,r=t.done;n.isItemContainer&&o(e,(function(){r()}))},hideScaleOut:function(t){var e=t.item,n=t.element,r=t.done;n.isItemContainer&&o(e,(function(){r()}))},enterFadeIn:function(t){var e=t.element,n=t.item;e.isItemContainer&&n.getKeyShape()&&a(e)},showFadeIn:function(t){var e=t.element,n=t.item;e.isItemContainer&&n.getKeyShape()&&a(e)},leaveFadeOut:function(t){var e=t.element,n=t.item,r=t.done;e.isItemContainer&&n.getKeyShape()&&s(e,r)},hideFadeOut:function(t){var e=t.element,n=t.item,r=t.done;e.isItemContainer&&n.getKeyShape()&&s(e,r)}}},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(599),o=n(693),a=n(26),s=n(247),c=["matrix","fillStyle","strokeStyle","endArrow","startArrow"],u=function(t){function e(){return t.apply(this,arguments)||this}!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{show:"scaleIn",hide:"scaleOut",enter:"scaleIn",leave:"scaleOut",update:function(t){var e=t.element,n=t.endKeyFrame.props;e.animate(function(t){for(var e=1;e0&&"changeData"===r&&!t.destroyed&&t.filter()}))},addFilter:function(t){return this.get("filters").push(t),t},removeFilter:function(t){var e=this.get("filters");this.set("filters",r.filter(e,t))},filter:function(){this.emit("beforefilter");var t=this.get("filters"),e=this.getItems(),n=this._getFilterItems();t.forEach((function(t){n=n.filter(t)})),e.forEach((function(t){-1===n.indexOf(t)?t.hide():t.show()})),this.draw(),this.emit("afterfilter")},_getFilterItems:function(){return this.getItems().filter((function(t){return!1!==t.getShapeObj().filter}))}},t.exports=i},function(t,e,n){var r=n(26),i=n(626),o={CFG:{modes:{default:[]},mode:"default",_eventCache:{}},INIT:"_initModes"};o.AUGMENT={_initModes:function(){var t=this.get("mode");this.changeMode(t)},changeMode:function(t){var e=this.get("modes");r.isEmpty(e)||r.isEmpty(e[t])||(i.resetMode(e[t],this),this.set("mode",t))},addBehaviour:function(t,e){var n=this.get("modes");e=e||this.get("mode"),r.isEmpty(n[e])&&(n[e]=[]);var o=n[e],a=[].concat(t);return r.each(a,(function(t){-1===o.indexOf(t)&&o.push(t)})),i.resetMode(n[e],this),this},removeBehaviour:function(t){var e=this.get("modes"),n=this.get("mode"),o=e[n];if(!r.isEmpty(o)){var a=[].concat(t);return o=o.filter((function(t){return-1===a.indexOf(t)})),e[n]=o,i.resetMode(o,this),this}},behaviourOn:function(t,e){var n=this._eventCache;n[t]||(n[t]=[]),n[t].push(e),this.on(t,e)},_off:function(){var t=this,e=this._eventCache;r.each(e,(function(e,n){r.each(e,(function(e){t.off(n,e)}))})),this._eventCache={}}},t.exports=o},function(t,e,n){var r=n(599),i=n(26),o={MOUSEMOVE:"mousemove",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",MOUSEENTER:"mouseenter",MOUSELEAVE:"mouseleave",CLICK:"click",DBLCLICK:"dblclick",DRAGSTART:"dragstart",DRAG:"drag",DRAGENTER:"dragenter",DRAGLEAVE:"dragleave",DRAGEND:"dragend",DROP:"drop",CONTEXTMENU:"contextmenu",WHEEL:"wheel",KEYDOWN:"keydown",KEYUP:"keyup",KEYPRESS:"keypress",MOUSEWHEEL:"mousewheel"},a=[o.DBLCLICK,o.MOUSEDOWN,o.MOUSEUP,o.MOUSEENTER,o.MOUSELEAVE,o.MOUSEMOVE,o.CONTEXTMENU,o.WHEEL,o.MOUSEWHEEL],s=[o.KEYDOWN,o.KEYUP,o.KEYPRESS],c=function(t){function e(e){var n;return(n=t.call(this,e)||this)._domEvents=[],n._initEventStates(),n._registerEvents(),n}!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t);var n=e.prototype;return n._initEventStates=function(){this._pressing=!1,this._dragging=!1,this._currentEventObj={},this._dragEventObj={}},n._registerEvents=function(){this._registerMouseEvents(),this._registerKeyboardEvents()},n._registerKeyboardEvents=function(){var t=this.graph,e=t.getKeyboardEventWrapper(),n=this._domEvents,r=t.get("keyboardEnable");i.each(s,(function(o){n.push(i.addEventListener(e,o,(function(e){var n=!0;i.isFunction(r)&&(n=r()),n&&t.emit(o,{domEvent:e})})))}))},n._registerMouseEvents=function(){var t=this,e=this,n=this.graph.getMouseEventWrapper(),r=this._domEvents;i.each(a,(function(a){r.push(i.addEventListener(n,a,(function(n){if(n.type!==o.MOUSEENTER||!n.fromElement||n.fromElement.parentNode&&!function(t,e){for(var n=t.parentNode;n;){if("foreignObject"===n.tagName)return!0;n=n.parentNode}return!1}(n.fromElement)){var r=t._currentEventObj;t._oldEventObj=r,t._processEventObj(n);var a=t._currentEventObj;e._simulateEvents(n,r,a),-1!==[o.MOUSELEAVE,o.MOUSEENTER].indexOf(n.type)&&e._triggerEvent("canvas:"+n.type),e._triggerEvent(n.type),n.type===o.MOUSELEAVE&&(t._dragging&&e._triggerEvent(o.DRAGLEAVE,i.mix({},a,{item:null,shape:null,currentItem:t._dragEventObj.item,currentShape:t._dragEventObj.shape})),e._initEventStates())}})))}))},n.destroy=function(){var t=this._domEvents;i.each(t,(function(t){t&&t.remove()})),this._domEvents=null},n._triggerEvent=function(t,e){if(e||(e="mouseleave"===t?this._oldEventObj:this._currentEventObj),"mousedown"===t&&(e.button=this._button),e._type=t,this.emitGraphEvent(t,e),-1===["canvas:"+o.MOUSELEAVE,"canvas:"+o.MOUSEENTER].indexOf(t)){var n=e.shape&&e.shape.eventPreFix;if(-1!==[o.DRAGSTART,o.DRAG,o.DRAGEND].indexOf(t)&&(n=e.currentShape&&e.currentShape.eventPreFix),n){var r=n+":"+t;e._type=r,i.isBoolean(e._isItemChange)?e._isItemChange&&this.emitGraphEvent(r,e):this.emitGraphEvent(r,e)}}},n.emitGraphEvent=function(t,e){this.graph.emit(t,e)},n._getDistanceToPress=function(t){return Math.pow(t.clientX-this._pressX,2)+Math.pow(t.clientY-this._pressY,2)},n._simulateEvents=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=this._dragEventObj.item,a=this._dragEventObj.shape;switch(t.type){case o.MOUSEDOWN:this._pressing=!0,this._button=t.button,this._pressX=t.clientX,this._pressY=t.clientY;break;case o.MOUSEMOVE:if(this._dragging){if(this._triggerEvent(o.DRAG,i.mix({},n,{button:this._button,currentItem:r,currentShape:a})),e.shape!==n.shape){var s=this._isItemChange(e,n);e.shape&&this._triggerEvent(o.DRAGLEAVE,i.mix({},n,{button:this._button,item:e.item,shape:e.shape,toItem:n.item,toShape:n.shape,currentItem:r,currentShape:a,_isItemChange:s})),n.shape&&this._triggerEvent(o.DRAGENTER,i.mix({},n,{button:this._button,currentItem:r,currentShape:a,fromItem:e.item,fromShape:e.shape,_isItemChange:s}))}}else this._pressing&&this._getDistanceToPress(t)>9&&(this._dragging=!0,this._dragEventObj=e,r=this._dragEventObj.item,a=this._dragEventObj.shape,this._triggerEvent(o.DRAGSTART,i.mix({},e,{button:this._button,currentItem:r,currentShape:a})));if(e.shape!==n.shape){var c=this._isItemChange(e,n);e.shape&&this._triggerEvent(o.MOUSELEAVE,i.mix({},n,{item:e.item,shape:e.shape,toItem:n.item,toShape:n.shape,_isItemChange:c})),n.shape&&this._triggerEvent(o.MOUSEENTER,i.mix({},n,{fromtItem:e.item,fromShape:e.shape,_isItemChange:c}))}break;case o.MOUSEUP:!this._dragging&&this._pressing?this._triggerEvent(o.CLICK,i.mix({},n,{button:this._button})):(this._triggerEvent(o.DROP,i.mix({},n,{button:this._button,currentItem:r,currentShape:a})),this._triggerEvent(o.DRAGEND,i.mix({},n,{button:this._button,currentItem:r,currentShape:a}))),this._pressing=!1,this._dragging=!1,this._dragEventObj={};break;default:return}},n._isItemChange=function(t,e){var n=t.shape,r=e.shape,o=n&&r&&(n.get("isItemChange")||r.get("isItemChange"));return o?o(r,n):i.isObject(t.item)&&i.isObject(e.item)?t.item.id!==e.item.id:t.item!==e.item},n._processEventObj=function(t){var e=this.graph.get("_canvas"),n=this._getEventObj(t,e);this._currentEventObj=n},n._parsePoint=function(t,e){return this.graph.getPointByCanvas({x:t,y:e})},n._getEventObj=function(t,e){var n=this.graph,r=t.clientX,i=t.clientY,o=e.getPointByClient(r,i),a=this._parsePoint(o.x,o.y),s=e.getShape(o.x,o.y,t),c=n.getItemByShape(s),u=e.get("pixelRatio");return{item:c,shape:s,x:a.x,y:a.y,domX:o.x/u,domY:o.y/u,domEvent:t}},e}(r);t.exports=c},function(t,e,n){var r={},i=n(698);r.INIT="_initEvents",r.CFG={keyboardEnable:!0},r.AUGMENT={_initEvents:function(){this.get("_controllers").events=new i({graph:this})}},t.exports=r},function(t,e,n){var r=n(26),i={};i.AUGMENT={find:function(t){return this.get("_itemMap")[t]},getNodes:function(){return this.get("_itemMap")._nodes},getEdges:function(){return this.get("_itemMap")._edges},getGroups:function(){return this.get("_itemMap")._groups},getGuides:function(){return this.get("_itemMap")._guides},getItems:function(){var t=this.get("_itemMap"),e=[];return r.each(t,(function(t){t.type&&e.push(t)})),e},getItemByShape:function(t){return t?this.getItem(t.id):null},getItem:function(t){var e=this.get("_itemMap");return r.isObject(t)?t.destroyed&&(t=e[t.id]):t=e[t],t}},t.exports=i},function(t,e,n){var r=n(599),i=n(26),o=["color","shape","size","label","style"],a=function(t){function e(){return t.apply(this,arguments)||this}!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t);var n=e.prototype;return n._init=function(){var t=this,e={};i.each(o,(function(n){e[n]={},t[n]=function(r){return e[n].input=r,t}})),this.channels=e},n.addChannels=function(t){var e=this.channels;i.each(t,(function(t,n){e[n]={input:t}}))},n.mapping=function(t){var e=this.channels;i.each(e,(function(e,n){i.isFunction(e.input)?t[n]=e.input(t):e.input&&(t[n]=e.input)}))},e}(r);t.exports=a},function(t,e,n){var r=n(701),i={INIT:"_initMapper"};i.AUGMENT={_initMapper:function(){var t=this.get("_controllers");t.nodeMapper=new r({graph:this}),t.edgeMapper=new r({graph:this}),t.groupMapper=new r({graph:this}),t.guideMapper=new r({graph:this})},node:function(t){var e=this._getController("nodeMapper");return t&&e.addChannels(t),e},edge:function(t){var e=this._getController("edgeMapper");return t&&e.addChannels(t),e},group:function(t){var e=this._getController("groupMapper");return t&&e.addChannels(t),this._getController("groupMapper")},guide:function(t){var e=this._getController("guideMapper");return t&&e.addChannels(t),this._getController("guideMapper")}},t.exports=i},function(t,e,n){var r=function(t){function e(){return t.apply(this,arguments)||this}!function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}(e,t);var n=e.prototype;return n.getDefaultCfg=function(){return{graph:null,auto:!0,processor:null}},n._init=function(){var t=this,e=this.graph;e.on("afteritemdraw",(function(t){var e=t.item,n=e.getKeyShape(),r=e.getModel();if(e.isEdge)r.lineWidth=n.attr("lineWidth");else if(e.isNode||e.isGroup){var i=e.getBBox();r.width=i.width,r.height=i.height}})),e.on("afterchange",(function(n){var r=n.action;"once"===t.auto?"changeData"===r&&(e.destroyed||e.preventAnimate((function(){t.layout()}))):t.auto&&!e.destroyed&&e.preventAnimate((function(){t.layout()}))}))},n.changeLayout=function(t){this.processor=t,this.layout()},n.layout=function(){var t=this.graph,e=this.getLayoutProcessor();t.emit("beforelayout");var n=t.getNodes().filter((function(t){return t.isVisible()})).map((function(t){return t.getModel()})),r=t.getEdges().filter((function(t){return t.isVisible()})).map((function(t){return t.getModel()})),i=t.getGroups().filter((function(t){return t.isVisible()})).map((function(t){return t.getModel()}));t._executeLayout(e,n,r,i),t.updateNodePosition(),t.emit("afterlayout")},n.getLayoutProcessor=function(){return this.processor?this.processor:this.processer},e}(n(599));t.exports=r},function(t,e,n){var r=n(26),i=n(703),o={CFG:{layout:void 0},INIT:"_initLayout"};o.AUGMENT={_initLayout:function(){var t=this.get("_controllers"),e=this._getLayoutCfg();e&&(t.layout=new i(r.mix({graph:this},e)))},_getLayoutCfg:function(){var t=this.get("layout");return r.isPlainObject(t)?t:r.isFunction(t)||r.isObject(t)?{processor:t}:null},layout:function(){return this._getController("layout").layout(),this},updateNodePosition:function(t){var e=this.getGuides(),n=[],i=[];return this.emit("beforeupdatenodeposition"),t?(t.forEach((function(t){t.getEdges().forEach((function(t){i.push(t)}));var e=t.getParent();e&&n.push(e)})),i=r.uniq(i),n=r.uniq(n)):(t=this.getNodes(),n=this.getGroups(),i=this.getEdges()),t.forEach((function(t){t.layoutUpdate()})),n.forEach((function(t){t.layoutUpdate()})),i.forEach((function(t){t.layoutUpdate()})),e.forEach((function(t){t.layoutUpdate()})),this.emit("afterupdatenodeposition"),this},changeLayout:function(t){return this._getController("layout").changeLayout(t),this},getLayout:function(){return this._getController("layout").getLayoutProcessor()}},t.exports=o},function(t,e,n){!function(e){"use strict";var n=function(){return{escape:function(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},parseExtension:t,mimeType:function(e){var n=t(e).toLowerCase();return function(){var t="application/font-woff";return{woff:t,woff2:t,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}()[n]||""},dataAsUrl:function(t,e){return"data:"+e+";base64,"+t},isDataUrl:function(t){return-1!==t.search(/^(data:)/)},canvasToBlob:function(t){return t.toBlob?new Promise((function(e){t.toBlob(e)})):function(t){return new Promise((function(e){for(var n=window.atob(t.toDataURL().split(",")[1]),r=n.length,i=new Uint8Array(r),o=0;o'+t+""})).then((function(t){return''+t+""})).then((function(t){return"data:image/svg+xml;charset=utf-8,"+t}))}(r,e.width||n.width(t),e.height||n.height(t))}))}function h(t,e){return u(t,e).then(n.makeImage).then(n.delay(100)).then((function(r){var i=function(t){var r=document.createElement("canvas");if(r.width=e.width||n.width(t),r.height=e.height||n.height(t),e.bgcolor){var i=r.getContext("2d");i.fillStyle=e.bgcolor,i.fillRect(0,0,r.width,r.height)}return r}(t);return i.getContext("2d").drawImage(r,0,0),i}))}function l(t,e,r){return r||!e||e(t)?Promise.resolve(t).then((function(t){return t instanceof HTMLCanvasElement?n.makeImage(t.toDataURL()):t.cloneNode(!1)})).then((function(n){return i(t,n,e)})).then((function(e){return function(t,e){return e instanceof Element?Promise.resolve().then((function(){!function(t,e){t.cssText?e.cssText=t.cssText:function(t,e){n.asArray(t).forEach((function(n){e.setProperty(n,t.getPropertyValue(n),t.getPropertyPriority(n))}))}(t,e)}(window.getComputedStyle(t),e.style)})).then((function(){[":before",":after"].forEach((function(r){!function(r){var i=window.getComputedStyle(t,r),o=i.getPropertyValue("content");if(""!==o&&"none"!==o){var a=n.uid();e.className=e.className+" "+a;var s=document.createElement("style");s.appendChild(function(t,e,r){var i="."+t+":"+e,o=r.cssText?function(t){var e=t.getPropertyValue("content");return t.cssText+" content: "+e+";"}(r):function(t){return n.asArray(t).map((function(e){return e+": "+t.getPropertyValue(e)+(t.getPropertyPriority(e)?" !important":"")})).join("; ")+";"}(r);return document.createTextNode(i+"{"+o+"}")}(a,r,i)),e.appendChild(s)}}(r)}))})).then((function(){t instanceof HTMLTextAreaElement&&(e.innerHTML=t.value),t instanceof HTMLInputElement&&e.setAttribute("value",t.value)})).then((function(){e instanceof SVGElement&&(e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e instanceof SVGRectElement&&["width","height"].forEach((function(t){var n=e.getAttribute(t);n&&e.style.setProperty(t,n)})))})).then((function(){return e})):e}(t,e)})):Promise.resolve();function i(t,e,r){var i=t.childNodes;return 0===i.length?Promise.resolve(e):function(t,e,n){var r=Promise.resolve();return e.forEach((function(e){r=r.then((function(){return l(e,n)})).then((function(e){e&&t.appendChild(e)}))})),r}(e,n.asArray(i),r).then((function(){return e}))}}function d(t){return i.resolveAll().then((function(e){var n=document.createElement("style");return t.appendChild(n),n.appendChild(document.createTextNode(e)),t}))}function f(t){return o.inlineAll(t).then((function(){return t}))}t.exports=c}()},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(26),o=n(248),a=n(705),s=function(){function t(t){this.options=function(t){for(var e=1;e
");r=new o.Canvas({containerDOM:a,width:e,height:n})}return r.drawCount||(r.drawCount=0),r},e.drawInner=function(t,e){var n=this.options.graph,r=n.getCanvas(),i=n.get("renderer"),o=t.drawCount;if("svg"===i){var s=[];r.deepEach((function(t){"dom"===t.get("type")&&s.push(t)})),s.length>0?s.forEach((function(n){var r=n.get("el");if(r){n.domImageOnload=!1;var i=n.attr("width"),c=n.attr("height");a.toPng(r,{width:i,height:c}).then((function(r){var i=new Image;i.src=r,i.onload=function(){if(o===t.drawCount-1){n.domImage=i,n.domImageOnload=!0;for(var r=0;r0&&v>0?b=Math.PI/2-w:m<0&&v<0?b=-Math.PI/2-w:m>=0&&v<0?b=-w-Math.PI/2:m<=0&&v>0&&(b=Math.PI/2-w),p.rotate(b),p.translate(g.x,g.y),"end"===e?(d[d.length-1]=y[1]+g.y,d[d.length-2]=y[0]+g.x):(f[f.length-1]=y[1]+g.y,f[f.length-2]=y[0]+g.x),h.attr("path",l),this[e+"Arrow"]=p}},n._getControlPoints=function(){var t=this.model.controlPoints;return i.isArray(t)?t:[]},n._shouldDraw=function(){return t.prototype._shouldDraw.call(this)&&this.linkedItemVisible()},n._getPoint=function(t){if(t.isItem){var e=t.getBBox();return{x:e.centerX,y:e.centerY}}return{x:t.x,y:t.y}},n.linkedItemVisible=function(){var t=this.source,e=this.target;return i.isPlainObject(t)||i.isPlainObject(e)||t.isVisible()||e.isVisible()||t.collapsedParent!==e.collapsedParent},n.getSource=function(){var t=this.source,e=t.collapsedParent,n=this.itemMap;return e?n[e.id]:t},n.getTarget=function(){var t=this.target,e=t.collapsedParent,n=this.itemMap;return e?n[e.id]:t},n.getPoints=function(){var t=this.getSource(),e=this.getTarget(),n=this.model,r=this._getControlPoints(),o=this._getPoint(t),a=this._getPoint(e),s=[o].concat(r).concat([a]),c=s.length;if(t.isItem){var u=i.isNumber(this.model.sourceAnchor)&&t.id===n.source?this.model.sourceAnchor:s[1],h=t.getLinkPoints(u);s[0]=h[0]}if(e.isItem){var l=i.isNumber(this.model.targetAnchor)&&e.id===n.target?this.model.targetAnchor:s[c-2],d=e.getLinkPoints(l);s[c-1]=d[0]}return s},n.destroy=function(){var e=this.itemMap,n=this.model,r=e[n.source],o=e[n.target];r&&r.isItem&&i.Array.remove(r.edges,this),o&&o.isItem&&i.Array.remove(o.edges,this),t.prototype.destroy.call(this)},e}(n(608));t.exports=o},function(t,e,n){t.exports={Node:n(624),Edge:n(709),Group:n(708),Guide:n(707)}},function(t,e,n){var r; /*! * EventEmitter v5.2.5 - git.io/ee * Unlicense - http://unlicense.org/ * Oliver Caldwell - http://oli.me.uk/ * @preserve */!function(e){"use strict";function i(){}var o=i.prototype,a=e.EventEmitter;function s(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function c(t){return function(){return this[t].apply(this,arguments)}}o.getListeners=function(t){var e,n,r=this._getEvents();if(t instanceof RegExp)for(n in e={},r)r.hasOwnProperty(n)&&t.test(n)&&(e[n]=r[n]);else e=r[t]||(r[t]=[]);return e},o.flattenListeners=function(t){var e,n=[];for(e=0;e=0;n--)e[n].remove(t);return this._cfg.children=[],this}}),i.mixin(r.Group,[o]),t.exports=o},function(t,e,n){n(258).registerGuide("common",{draw:function(){console.warn("do not have this guide, please register one")}})},function(t,e,n){t.exports={common:n(716)}},function(t,e,n){function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var i=n(258),o=n(26),a=n(247);i.registerGroup("common",{draw:function(t){return t.getModel().collapsed?this.drawCollapsed(t):this.drawExpanded(t)},defaultWidth:184,defaultHeight:40,getLabel:function(t){return t.getModel().label},drawLabel:function(t,e,n){var r=this.getLabel(t);if(r){var i=t.getGraphicGroup(),s=[8,8];e+=s[0],n+=s[1];var c=t.getModel(),u=c.labelOffsetX,h=c.labelOffsetY,l=c.labelRotate;e=u?u+e:e,n=h?h+n:n;var d=o.mix(!0,{},a.labelStyle,{x:e,y:n,textAlign:"left",textBaseline:"top"});o.isObject(r)?o.mix(d,r):d.text=r;var f=i.addShape("text",{class:"label",attrs:d});if(l){var g=f.getBBox(),p=(g.maxX+g.minX)/2,m=(g.maxY+g.minY)/2;f.transform([["t",-p,-m],["r",l,l],["t",p,m]])}}},drawKeyShape:function(t,e){var n=e.x,r=e.y,i=e.width,s=e.height,c=t.getModel(),u=t.getGraphicGroup(),h=o.mix({},a.groupStyle,c.style),l=o.getRectPath(n,r,i,s,h.radius);return t.lastChildrenBox=e,u.addShape("path",{attrs:o.mix({},h,{path:l})})},getChildrenBBox:function(t){var e=function(t){for(var e=1;e0){var i=t.getChildrenBBox();e.x=i.minX-a.groupBackgroundPadding[3],e.y=i.minY-a.groupBackgroundPadding[0],e.width=i.maxX-i.minX+a.groupBackgroundPadding[3]+a.groupBackgroundPadding[1],e.height=i.maxY-i.minY+a.groupBackgroundPadding[0]+a.groupBackgroundPadding[2]}else e.width=this.defaultWidth,e.height=this.defaultHeight;return o.isNil(e.x)&&!o.isNil(n.x)&&(e.x=n.x),o.isNil(e.y)&&!o.isNil(n.y)&&(e.y=n.y),e},drawExpanded:function(t){var e=this.getChildrenBBox(t),n=this.drawKeyShape(t,e);return this.drawLabel(t,e.x,e.y),n},drawCollapsed:function(t){var e=this.getChildrenBBox(t);e.width=this.defaultWidth,e.height=this.defaultHeight;var n=this.drawKeyShape(t,e);return this.drawLabel(t,e.x,e.y),n},anchor:{intersectBox:"rect"}})},function(t,e,n){t.exports={common:n(718)}},function(t,e,n){function r(t){for(var e=1;e3?e:3)/3,r=4*e/3,i=4*e;return[["M",-n,r],["L",0,0],["L",-n,-r],["A",i,i,0,0,1,-n,r],["Z"]]},shorten:function(t){var e=t.getKeyShape().attr("lineWidth");return 3.1*(e>3?e:3)},style:function(t){var e=t.getKeyShape().attr();return{fillOpacity:e.strokeOpacity,fill:e.stroke}}};o.registerEdge("common",{draw:function(t){var e=this.drawKeyShape(t);return this.drawLabel(t,e),e},drawKeyShape:function(t){var e=t.getGraphicGroup(),n=this.getStyle(t),r=this.getPath(t);return e.addShape("path",{attrs:a.mix({},n,{path:r})})},getStyle:function(t){var e=t.getModel();return a.mix(!0,{},{stroke:e.color||"#A3B1BF",strokeOpacity:.92,lineAppendWidth:4,lineWidth:e.size||1},e.style)},getPath:function(t){var e=t.getPoints();return a.pointsToPolygon(e)},getLabel:function(t){return t.getModel().label},getDefaultLabelRectStyle:function(){return{fill:"white"}},getDefaultLabelRectPadding:function(){return a.toAllPadding([4,8])},drawLabel:function(t,e){var n=this.getLabel(t),r=t.getGraphicGroup(),i=t.getModel(),o=i.labelOffsetX,c=i.labelOffsetY,u=i.labelRotate;if(n){var h=e.getPoint(.5);if(!h)return;h.x=o?h.x+o:h.x,h.y=c?h.y+c:h.y;var l=a.mix(!0,{},s.labelStyle,h);a.isObject(n)?a.mix(l,n):l.text=n,n=r.addShape("text",{class:"label",attrs:l});var d=this.getDefaultLabelRectPadding(t),f=this.getDefaultLabelRectStyle(t),g=n.getBBox(),p=i.labelRectStyle?a.mix({},f,i.labelRectStyle):f,m=r.addShape("rect",{attrs:a.mix({},p,{x:g.minX-d[3],y:g.minY-d[0],width:g.maxX-g.minX+d[1]+d[3],height:g.maxY-g.minY+d[0]+d[2]})});if(u){var v=(g.maxX+g.minX)/2,x=(g.maxY+g.minY)/2;n.transform([["t",-v,-x],["r",u,u],["t",v,x]]),m.transform([["t",-v,-x],["r",u,u],["t",v,x]])}a.toFront(n)}},startArrow:r({},c,{tangent:function(t){return t.getKeyShape().getStartTangent()},ratio:function(){return 0}}),endArrow:r({},c,{tangent:function(t){return t.getKeyShape().getEndTangent()},ratio:function(){return 1}})})},function(t,e,n){t.exports={common:n(720)}},function(t,e,n){var r=n(258),i=n(26);r.registerNode("html",{getHtml:function(t){return t.getModel().html},cssSize:!0,draw:function(t){var e=i.createDOM('
'),n=t.getGraphicGroup(),r=t.getGraph();if("svg"!==r.get("renderer"))throw new Error("please use svg renderer draw html element !");var o=r.getGraphContainer(),a=this.getSize(t),s=this.getStyle(t),c=this.cssSize,u=this.getHtml(t);u=i.createDOM(u),e.css({position:"absolute",padding:"0px",margin:"0px"}),e.appendChild(u),o.appendChild(e),c&&(a[0]=e.width(),a[1]=e.height());var h=-a[0]/2,l=-a[1]/2,d=a[0],f=a[1],g=n.addShape("rect",{attrs:i.mix({},s,{x:h,y:l,width:d,height:f})});return n.addShape("dom",{attrs:i.mix({x:h,y:l,width:d,height:f,html:e})}),g}})},function(t,e,n){var r=n(258),i=n(26),o=n(247);r.registerNode("common",{draw:function(t){var e=t.getGraphicGroup(),n=this.drawLabel(t),r=this.drawKeyShape(t);return n&&i.toFront(n,e),r},getSize:function(t){var e=t.getModel().size;return i.isArray(e)?e:i.isNumber(e)?[e,e]:[o.defaultNodeSize,o.defaultNodeSize]},getStyle:function(t){var e=t.getModel();return i.mix(!0,{lineWidth:1,fill:e.color||"#40a9ff",stroke:e.color||"#096dd9",fillOpacity:.92},e.style)},getLabel:function(t){return t.getModel().label},drawKeyShape:function(t){var e=t.getGraphicGroup(),n=this.getStyle(t),r=this.getPath(t);return e.addShape("path",{attrs:i.mix({},n,{path:r})})},drawLabel:function(t){var e=t.getGraphicGroup(),n=this.getLabel(t),r=t.getModel(),a=r.labelOffsetX,s=r.labelOffsetY,c=r.labelRotate;if(!i.isNil(n)){var u=i.mix(!0,{},o.labelStyle,{x:a||0,y:s||0});i.isObject(n)?i.mix(u,n):u.text=n;var h=e.addShape("text",{class:"label",attrs:u});return c&&h.rotate(c),h}},getPath:function(t){var e=this.getSize(t);return i.getEllipsePath(0,0,e[0]/2,e[1]/2)}})},function(t,e,n){t.exports={common:n(723),html:n(722)}},function(t,e,n){var r=n(682),i=n(257),o={getAutoZoomMatrix:function(t,e,n,i){var o=[1,0,0,0,1,0,0,0,1],a=t.maxX-t.minX,s=t.maxY-t.minY,c=(e.maxX+e.minX)/2,u=(e.maxY+e.minY)/2,h=a-n[1]-n[3],l=s-n[0]-n[2],d=e.maxX-e.minX,f=e.maxY-e.minY,g=Math.min(l/f,h/d);return i&&(g=i(g)),r.mat3.translate(o,o,[-c,-u]),r.mat3.scale(o,o,[g,g]),r.mat3.translate(o,o,[a/2,s/2]),o},getNineBoxPosition:function(t,e,n,r,i){var o={};switch(t){case"tl":o.y=e.x+i[0],o.x=e.y+i[3];break;case"lc":o.y=(e.height-r)/2,o.x=i[3];break;case"bl":o.y=e.height-r-i[2],o.x=i[3];break;case"cc":o.y=(e.height-r)/2,o.x=(e.width-n)/2;break;case"tc":o.y=i[0],o.x=(e.width-n)/2;break;case"tr":o.y=i[0],o.x=e.width-n-i[1];break;case"rc":o.y=(e.height-r)/2,o.x=e.width-n-i[1];break;case"br":o.y=e.height-r-i[2],o.x=e.width-n-i[1];break;case"bc":o.y=e.height-r-i[2],o.x=(e.width-n)/2;break;default:o.y=e.x+i[0],o.x=e.y+i[3]}return o.x+=e.x,o.y+=e.y,o},getTotalBBox:function(t){var e=1/0,n=-1/0,r=1/0,i=-1/0;return t.forEach((function(t){t.minXn&&(n=t.maxX),t.minYi&&(i=t.maxY)})),{minX:e,minY:r,maxX:n,maxY:i,width:n-e,height:i-r}},getChildrenBBox:function(t){var e=1/0,n=-1/0,r=1/0,a=-1/0;i.each(t,(function(t){var i=t.isGroup?o.getChildrenBBox(t.get("children")):t.getBBox();if(!i)return!0;var s=[i.minX,i.minY,1],c=[i.minX,i.maxY,1],u=[i.maxX,i.minY,1],h=[i.maxX,i.maxY,1];t.apply(s),t.apply(c),t.apply(u),t.apply(h);var l=Math.min(s[0],c[0],u[0],h[0]),d=Math.max(s[0],c[0],u[0],h[0]),f=Math.min(s[1],c[1],u[1],h[1]),g=Math.max(s[1],c[1],u[1],h[1]);ln&&(n=d),fa&&(a=g)}));var s={minX:e,minY:r,maxX:n,maxY:a};return s.x=s.minX,s.y=s.minY,s.width=s.maxX-s.minX,s.height=s.maxY-s.minY,s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2,s},getBBox:function(t,e){var n,i=t.getBBox(),o={x:i.minX,y:i.minY},a={x:i.maxX,y:i.maxY};if(e.isGroup){for(n=t;n!==e;){var s=n.getMatrix();o=r.applyMatrix(o,s),a=r.applyMatrix(a,s),n=n.getParent()}var c=n.getMatrix();o=r.applyMatrix(o,c),a=r.applyMatrix(a,c)}else o=r.applyMatrix(o,e),a=r.applyMatrix(a,e);return{minX:o.x,minY:o.y,maxX:a.x,maxY:a.y}},toBack:function(t){t.toBack()},toFront:function(t){t.toFront()}};t.exports=o},function(t,e,n){var r=n(257);t.exports={isNode:function(t){return t&&r.isObject(t)&&"node"===t.type},isEdge:function(t){return t&&r.isObject(t)&&"edge"===t.type},isGroup:function(t){return t&&r.isObject(t)&&"group"===t.type}}},function(t,e,n){var r=n(257),i={};r.mix(i,{addEventListener:function(t,e,n){return t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):void 0},createDOM:function(t,e){var n;return(n=r.isString(t)?r.createDom(t):t).bbox=n.getBoundingClientRect(),n.hide=function(){return n.style.visibility="hidden",n},n.show=function(){return n.style.visibility="visible",n},n.css=function(t){return r.modifyCSS(n,t),n},n.width=function(){return r.getWidth(n)},n.height=function(){return r.getHeight(n)},n.destroy=function(){n.parentNode&&n.parentNode.removeChild(n)},n.on=function(t,e){n.addEventListener(t,e)},n.off=function(t,e){n.removeEventListener(t,e)},n.css(e),n},initDOMContainer:function(t,e){if(!t)throw new Error("please set the container for the "+e+" !");return r.isString(t)&&(t=document.getElementById(t)),t}}),t.exports=i},function(t,e){var n={svg:"svg",circle:"circle",rect:"rect",text:"text",path:"path",foreignObject:"foreignObject",polygon:"polygon",ellipse:"ellipse",image:"image"};t.exports=function(t,e,r){var i=r.target||r.srcElement;if(!n[i.tagName]){for(var o=i.parentNode;o&&!n[o.tagName];)o=o.parentNode;i=o}return this._cfg.el===i?this:this.find((function(t){return t._cfg&&t._cfg.el===i}))}},function(t,e,n){var r=n(19),i=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,o=function(){function t(t){var e=document.createElementNS("http://www.w3.org/2000/svg","pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=document.createElementNS("http://www.w3.org/2000/svg","image");e.appendChild(n);var o=r.uniqueId("pattern_");e.id=o,this.el=e,this.id=o,this.cfg=t;var a=i.exec(t)[2];n.setAttribute("href",a);var s=new Image;function c(){console.log(s.width,s.height),e.setAttribute("width",s.width),e.setAttribute("height",s.height)}return a.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=a,s.complete?c():(s.onload=c,s.src=s.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}();t.exports=o},function(t,e,n){var r=n(19),i=function(){function t(t){this.type="clip";var e=document.createElementNS("http://www.w3.org/2000/svg","clipPath");this.el=e,this.id=r.uniqueId("clip_"),e.id=this.id;var n=t._cfg.el;return e.appendChild(n.cloneNode(!0)),this.cfg=t,this}var e=t.prototype;return e.match=function(){return!1},e.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}();t.exports=i},function(t,e,n){var r=n(19),i=function(){function t(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg","marker"),i=r.uniqueId("marker_");n.setAttribute("id",i);var o=document.createElementNS("http://www.w3.org/2000/svg","path");return o.setAttribute("stroke","none"),o.setAttribute("fill",t.stroke||"#000"),n.appendChild(o),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=o,this.id=i,this.cfg=t["marker-start"===e?"startArrow":"endArrow"],this.stroke=t.stroke||"#000",!0===this.cfg?this._setDefaultPath(e,o):this._setMarker(t.lineWidth,o),this}var e=t.prototype;return e.match=function(){return!1},e._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L6,3 L0,6 L3,3Z"),n.setAttribute("refX",3),n.setAttribute("refY",3)},e._setMarker=function(t,e){var n=this.el,i=this.cfg.path,o=this.cfg.d;r.isArray(i)&&(i=i.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",i),n.appendChild(e),o&&n.setAttribute("refX",o/t)},e.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}();t.exports=i},function(t,e,n){var r=n(19),i={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},o={x:"-40%",y:"-40%",width:"200%",height:"200%"},a=function(){function t(t){this.type="filter";var e=document.createElementNS("http://www.w3.org/2000/svg","filter");return r.each(o,(function(t,n){e.setAttribute(n,t)})),this.el=e,this.id=r.uniqueId("filter_"),this.el.id=this.id,this.cfg=t,this._parseShadow(t,e),this}var e=t.prototype;return e.match=function(t,e){if(this.type!==t)return!1;var n=!0,i=this.cfg;return r.each(Object.keys(i),(function(t){if(i[t]!==e[t])return n=!1,!1})),n},e.update=function(t,e){var n=this.cfg;return n[i[t]]=e,this._parseShadow(n,this.el),this},e._parseShadow=function(t,e){var n='';e.innerHTML=n},t}();t.exports=a},function(t,e,n){var r=n(19),i=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,o=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,a=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function s(t){var e=t.match(a);if(!e)return"";var n="";return e.sort((function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])})),r.each(e,(function(t){t=t.split(":"),n+=''})),n}var c=function(){function t(t){var e=null,n=r.uniqueId("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,o,a=i.exec(t),c=r.mod(r.toRadian(parseFloat(a[1])),2*Math.PI),u=a[2];c>=0&&c<.5*Math.PI?(n={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=c&&c');return t.appendChild(n),this.type="svg",this.canvas=n,this.context=new a(n),this.toDraw=!1,this}var e=t.prototype;return e.draw=function(t){var e=this;e.animateHandler?e.toDraw=!0:function n(){e.animateHandler=r.requestAnimationFrame((function(){e.animateHandler=void 0,e.toDraw&&n()}));try{e._drawChildren(t)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e.toDraw=!1}e.toDraw=!1}()},e.drawSync=function(t){this._drawChildren(t)},e._drawGroup=function(t,e){var n=t._cfg;n.removed||n.destroyed||(n.tobeRemoved&&(r.each(n.tobeRemoved,(function(t){t.parentNode&&t.parentNode.removeChild(t)})),n.tobeRemoved=[]),this._drawShape(t,e),n.children&&n.children.length>0&&this._drawChildren(t))},e._drawChildren=function(t){var e,n=t._cfg.children;if(n)for(var r=0;rs?1:0,d=Math.abs(c-s)>Math.PI?1:0,f=n.rs,g=n.re,p=e(s,n.rs,o),m=e(c,n.rs,o);n.rs>0?(a.push("M "+h.x+","+h.y),a.push("L "+m.x+","+m.y),a.push("A "+f+","+f+",0,"+d+","+(1===l?0:1)+","+p.x+","+p.y),a.push("L "+u.x+" "+u.y)):(a.push("M "+o.x+","+o.y),a.push("L "+u.x+","+u.y)),a.push("A "+g+","+g+",0,"+d+","+l+","+h.x+","+h.y),n.rs>0?a.push("L "+m.x+","+m.y):a.push("Z"),i.el.setAttribute("d",a.join(" "))},e._updateText=function(t){var e=t._attrs,n=t._cfg.attrs,r=t._cfg.el;for(var i in this._setFont(t),e)if(e[i]!==n[i]){if("text"===i){this._setText(t,""+e[i]);continue}if("fillStyle"===i||"strokeStyle"===i){this._setColor(t,i,e[i]);continue}if("matrix"===i){this._setTransform(t);continue}c[i]&&r.setAttribute(c[i],e[i])}t._cfg.attrs=Object.assign({},t._attrs),t._cfg.hasUpdate=!1},e._setFont=function(t){var e=t.get("el"),n=t._attrs,r=n.fontSize;e.setAttribute("alignment-baseline",u[n.textBaseline]||"baseline"),e.setAttribute("text-anchor",h[n.textAlign]||"left"),r&&+r<12&&(n.matrix=[1,0,0,0,1,0,0,0,1],t.transform([["t",-n.x,-n.y],["s",+r/12,+r/12],["t",n.x,n.y]]))},e._setText=function(t,e){var n=t._cfg.el,i=t._attrs.textBaseline||"bottom";if(e)if(~e.indexOf("\n")){var o=t._attrs.x,a=e.split("\n"),s=a.length-1,c="";r.each(a,(function(t,e){0===e?"alphabetic"===i?c+=''+t+"":"top"===i?c+=''+t+"":"middle"===i?c+=''+t+"":"bottom"===i?c+=''+t+"":"hanging"===i&&(c+=''+t+""):c+=''+t+""})),n.innerHTML=c}else n.innerHTML=e;else n.innerHTML=""},e._setClip=function(t,e){var n=t._cfg.el;if(e)if(n.hasAttribute("clip-path"))e._cfg.hasUpdate&&this._updateShape(e);else{this._createDom(e),this._updateShape(e);var r=this.context.addClip(e);n.setAttribute("clip-path","url(#"+r+")")}else n.removeAttribute("clip-path")},e._setColor=function(t,e,n){var r=t._cfg.el,i=this.context;if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var o=i.find("gradient",n);o||(o=i.addGradient(n)),r.setAttribute(c[e],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var a=i.find("pattern",n);a||(a=i.addPattern(n)),r.setAttribute(c[e],"url(#"+a+")")}else r.setAttribute(c[e],n);else r.setAttribute(c[e],"none")},e._setShadow=function(t){var e=t._cfg.el,n=t._attrs,r={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(r.dx||r.dy||r.blur||r.color){var i=this.context.find("filter",r);i||(i=this.context.addShadow(r,this)),e.setAttribute("filter","url(#"+i+")")}else e.removeAttribute("filter")},t}();t.exports=l},function(t,e,n){t.exports={painter:n(735),getShape:n(728)}},function(t,e,n){var r=n(19),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi,a=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,s=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,c=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,u=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function h(t,e){var n=t.match(u);r.each(n,(function(t){t=t.split(":"),e.addColorStop(t[0],t[1])}))}t.exports={parsePath:function(t){return t=t||[],r.isArray(t)?t:r.isString(t)?(t=t.match(i),r.each(t,(function(e,n){if((e=e.match(o))[0].length>1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}r.each(e,(function(t,n){isNaN(t)||(e[n]=+t)})),t[n]=e})),t):void 0},parseStyle:function(t,e,n){if(r.isString(t)){if("("===t[1]||"("===t[2]){if("l"===t[0])return function(t,e,n){var i,o,s=a.exec(t),c=r.mod(r.toRadian(parseFloat(s[1])),2*Math.PI),u=s[2],l=e.getBBox();c>=0&&c<.5*Math.PI?(i={x:l.minX,y:l.minY},o={x:l.maxX,y:l.maxY}):.5*Math.PI<=c&&c');return t.appendChild(n),this.type="canvas",this.canvas=n,this.context=n.getContext("2d"),this.toDraw=!1,this}var e=t.prototype;return e.beforeDraw=function(){var t=this.canvas;this.context&&this.context.clearRect(0,0,t.width,t.height)},e.draw=function(t){var e=this;e.animateHandler?e.toDraw=!0:function n(){e.animateHandler=r.requestAnimationFrame((function(){e.animateHandler=void 0,e.toDraw&&n()})),e.beforeDraw();try{e._drawGroup(t)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e.toDraw=!1}e.toDraw=!1}()},e.drawSync=function(t){this.beforeDraw(),this._drawGroup(t)},e._drawGroup=function(t){if(!t._cfg.removed&&!t._cfg.destroyed&&t._cfg.visible){var e=t._cfg.children,n=null;this.setContext(t);for(var r=0;r-1){var s=n[a];"fillStyle"===a&&(s=i.parseStyle(s,t,e)),"strokeStyle"===a&&(s=i.parseStyle(s,t,e)),"lineDash"===a&&e.setLineDash?r.isArray(s)?e.setLineDash(s):r.isString(s)&&e.setLineDash(s.split(" ")):e[a]=s}},t}();t.exports=a},function(t,e,n){t.exports={painter:n(738)}},function(t,e,n){t.exports={canvas:n(739),svg:n(736)}},function(t,e,n){var r=n(19),i=n(610),o=n(17),a=n(44),s=n(238),c=s.interpolate,u=s.interpolateArray,h=function(t){this._animators=[],this._current=0,this._timer=null,this.canvas=t};function l(t,e,n){var o,s=e.startTime;if(ng.length?(f=i.parsePathString(a[d]),g=i.parsePathString(s[d]),g=i.fillPathByDiff(g,f),g=i.formatPath(g,f),e.fromAttrs.path=g,e.toAttrs.path=f):e.pathFormatted||(f=i.parsePathString(a[d]),g=i.parsePathString(s[d]),g=i.formatPath(g,f),e.fromAttrs.path=g,e.toAttrs.path=f,e.pathFormatted=!0),o[d]=[];for(var p=0;p0){for(var a=r._animators.length-1;a>=0;a--)if((t=r._animators[a]).get("destroyed"))i.removeAnimator(a);else{if(!t.get("pause").isPaused)for(var s=(e=t.get("animators")).length-1;s>=0;s--)n=e[s],l(t,n,o)&&(e.splice(s,1),n.callback&&n.callback());0===e.length&&i.removeAnimator(a)}r.canvas.draw()}}))},addAnimator:function(t){this._animators.push(t)},removeAnimator:function(t){this._animators.splice(t,1)},isAnimating:function(){return!!this._animators.length},stop:function(){this._timer&&this._timer.stop()},stopAllAnimations:function(){this._animators.forEach((function(t){t.stopAnimate()})),this._animators=[],this.canvas.draw()},getTime:function(){return this._current}}),t.exports=h},function(t,e,n){var r=n(19),i=n(613),o={arc:n(602),ellipse:n(639),line:n(603)},a=r.createDom('').getContext("2d");function s(t,e,n){return n.createPath(a),a.isPointInPath(t,e)}var c={arc:function(t,e){var n=this._attrs,r=n.x,o=n.y,a=n.r,s=n.startAngle,c=n.endAngle,u=n.clockwise,h=this.getHitLineWidth();return!!this.hasStroke()&&i.arcline(r,o,a,s,c,u,h,t,e)},circle:function(t,e){var n=this._attrs,r=n.x,o=n.y,a=n.r,s=this.getHitLineWidth(),c=this.hasFill(),u=this.hasStroke();return c&&u?i.circle(r,o,a,t,e)||i.arcline(r,o,a,0,2*Math.PI,!1,s,t,e):c?i.circle(r,o,a,t,e):!!u&&i.arcline(r,o,a,0,2*Math.PI,!1,s,t,e)},dom:function(t,e){if(!this._cfg.el)return!1;var n=this._cfg.el.getBBox();return i.box(n.x,n.x+n.width,n.y,n.y+n.height,t,e)},ellipse:function(t,e){var n=this._attrs,o=this.hasFill(),a=this.hasStroke(),s=n.x,c=n.y,u=n.rx,h=n.ry,l=this.getHitLineWidth(),d=u>h?u:h,f=u>h?1:u/h,g=u>h?h/u:1,p=[t,e,1],m=[1,0,0,0,1,0,0,0,1];r.mat3.scale(m,m,[f,g]),r.mat3.translate(m,m,[s,c]);var v=r.mat3.invert([],m);return r.vec3.transformMat3(p,p,v),o&&a?i.circle(0,0,d,p[0],p[1])||i.arcline(0,0,d,0,2*Math.PI,!1,l,p[0],p[1]):o?i.circle(0,0,d,p[0],p[1]):!!a&&i.arcline(0,0,d,0,2*Math.PI,!1,l,p[0],p[1])},fan:function(t,e){var n=this,a=n.hasFill(),s=n.hasStroke(),c=n._attrs,u=c.x,h=c.y,l=c.rs,d=c.re,f=c.startAngle,g=c.endAngle,p=c.clockwise,m=[t-u,e-h],v=r.vec2.angleTo([1,0],m);function x(){var t=o.arc.nearAngle(v,f,g,p);if(r.isNumberEqual(v,t)){var e=r.vec2.squaredLength(m);if(l*l<=e&&e<=d*d)return!0}return!1}function y(){var r=n.getHitLineWidth(),o={x:Math.cos(f)*l+u,y:Math.sin(f)*l+h},a={x:Math.cos(f)*d+u,y:Math.sin(f)*d+h},s={x:Math.cos(g)*l+u,y:Math.sin(g)*l+h},c={x:Math.cos(g)*d+u,y:Math.sin(g)*d+h};return!!(i.line(o.x,o.y,a.x,a.y,r,t,e)||i.line(s.x,s.y,c.x,c.y,r,t,e)||i.arcline(u,h,l,f,g,p,r,t,e)||i.arcline(u,h,d,f,g,p,r,t,e))}return a&&s?x()||y():a?x():!!s&&y()},image:function(t,e){var n=this._attrs;if(this.get("toDraw")||!n.img)return!1;this._cfg.attrs&&this._cfg.attrs.img===n.img||this._setAttrImg();var r=n.x,o=n.y,a=n.width,s=n.height;return i.rect(r,o,a,s,t,e)},line:function(t,e){var n=this._attrs,r=n.x1,o=n.y1,a=n.x2,s=n.y2,c=this.getHitLineWidth();return!!this.hasStroke()&&i.line(r,o,a,s,c,t,e)},path:function(t,e){var n=this,i=n.get("segments"),o=n.hasFill(),a=n.hasStroke();function c(){if(!r.isEmpty(i)){for(var o=n.getHitLineWidth(),a=0,s=i.length;a=3&&a.push(r[0]),i.polyline(a,o,t,e)}return r&&o?s(t,e,n)||a():r?s(t,e,n):!!o&&a()},polyline:function(t,e){var n=this._attrs;if(this.hasStroke()){var r=n.points;if(r.length<2)return!1;var o=n.lineWidth;return i.polyline(r,o,t,e)}return!1},rect:function(t,e){var n=this,r=n.hasFill(),o=n.hasStroke();function a(){var r=n._attrs,o=r.x,a=r.y,s=r.width,c=r.height,u=r.radius,h=n.getHitLineWidth();if(0===u){var l=h/2;return i.line(o-l,a,o+s+l,a,h,t,e)||i.line(o+s,a-l,o+s,a+c+l,h,t,e)||i.line(o+s+l,a+c,o-l,a+c,h,t,e)||i.line(o,a+c+l,o,a-l,h,t,e)}return i.line(o+u,a,o+s-u,a,h,t,e)||i.line(o+s,a+u,o+s,a+c-u,h,t,e)||i.line(o+s-u,a+c,o+u,a+c,h,t,e)||i.line(o,a+c-u,o,a+u,h,t,e)||i.arcline(o+s-u,a+u,u,1.5*Math.PI,2*Math.PI,!1,h,t,e)||i.arcline(o+s-u,a+c-u,u,0,.5*Math.PI,!1,h,t,e)||i.arcline(o+u,a+c-u,u,.5*Math.PI,Math.PI,!1,h,t,e)||i.arcline(o+u,a+u,u,Math.PI,1.5*Math.PI,!1,h,t,e)}return r&&o?s(t,e,n)||a():r?s(t,e,n):!!o&&a()},text:function(t,e){var n=this.getBBox();if(this.hasFill()||this.hasStroke())return i.box(n.minX,n.maxX,n.minY,n.maxY,t,e)}};t.exports={isPointInPath:function(t,e){var n=c[this.type];return!!n&&n.call(this,t,e)}}},function(t,e,n){var r=n(58);r.Arc=n(638),r.Circle=n(637),r.Dom=n(636),r.Ellipse=n(635),r.Fan=n(634),r.Image=n(633),r.Line=n(632),r.Marker=n(611),r.Path=n(631),r.Polygon=n(630),r.Polyline=n(629),r.Rect=n(628),r.Text=n(627),t.exports=r},function(t,e,n){var r=n(19),i={delay:"delay",rotate:"rotate"},o={fill:"fill",stroke:"stroke",fillStyle:"fillStyle",strokeStyle:"strokeStyle"};t.exports={animate:function(t,e,n,a,s){void 0===s&&(s=0),this.set("animating",!0);var c=this.get("timeline");c||(c=this.get("canvas").get("timeline"),this.setSilent("timeline",c));var u=this.get("animators")||[];c._timer||c.initTimer(),r.isNumber(a)&&(s=a,a=null),r.isFunction(n)?(a=n,n="easeLinear"):n=n||"easeLinear";var h=function(t,e){var n={matrix:null,attrs:{}},a=e._attrs;for(var s in t)if("transform"===s)n.matrix=r.transform(e.getMatrix(),t[s]);else if("rotate"===s)n.matrix=r.transform(e.getMatrix(),[["r",t[s]]]);else if("matrix"===s)n.matrix=t[s];else{if(o[s]&&/^[r,R,L,l]{1}[\s]*\(/.test(t[s]))continue;i[s]||a[s]===t[s]||(n.attrs[s]=t[s])}return n}(t,this),l={fromAttrs:function(t,e){var n={},r=e._attrs;for(var i in t.attrs)n[i]=r[i];return n}(h,this),toAttrs:h.attrs,fromMatrix:r.clone(this.getMatrix()),toMatrix:h.matrix,duration:e,easing:n,callback:a,delay:s,startTime:c.getTime(),id:r.uniqueId()};u.length>0?u=function(t,e){var n=e.delay,i=Object.prototype.hasOwnProperty;return r.each(e.toAttrs,(function(e,o){r.each(t,(function(t){n2*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,r=this.get("y")||0;return this.translate(t-n,e-r),this.set("x",t),this.set("y",e),this},transform:function(t){var e=this,n=this._attrs.matrix;return r.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.attr("matrix",r.mat3.multiply([],n,t[1])),e.clearTotalMatrix()}})),e},setTransform:function(t){return this.attr("matrix",[1,0,0,0,1,0,0,0,1]),this.transform(t)},getMatrix:function(){return this.attr("matrix")},setMatrix:function(t){return this.attr("matrix",t),this.clearTotalMatrix(),this},apply:function(t,e){var n;return n=e?this._getMatrixByRoot(e):this.attr("matrix"),r.vec3.transformMat3(t,t,n),this},_getMatrixByRoot:function(t){t=t||this;for(var e=this,n=[];e!==t;)n.unshift(e),e=e.get("parent");n.unshift(e);var i=[1,0,0,0,1,0,0,0,1];return r.each(n,(function(t){r.mat3.multiply(i,t.attr("matrix"),i)})),i},getTotalMatrix:function(){var t=this._cfg.totalMatrix;if(!t){t=[1,0,0,0,1,0,0,0,1];var e=this._cfg.parent;e&&a(t,e.getTotalMatrix()),a(t,this.attr("matrix")),this._cfg.totalMatrix=t}return t},clearTotalMatrix:function(){},invert:function(t){var e=this.getTotalMatrix();if(o(e))t[0]/=e[0],t[1]/=e[4];else{var n=r.mat3.invert([],e);n&&r.vec3.transformMat3(t,t,n)}return this},resetTransform:function(t){var e=this.attr("matrix");i(e)||t.transform(e[0],e[1],e[3],e[4],e[6],e[7])}}},function(t,e,n){var r=n(19);t.exports={canFill:!1,canStroke:!1,initAttrs:function(t){return this._attrs={opacity:1,fillOpacity:1,strokeOpacity:1,matrix:[1,0,0,0,1,0,0,0,1]},this.attr(r.assign(this.getDefaultAttrs(),t)),this},getDefaultAttrs:function(){return{}},attr:function(t,e){if(0===arguments.length)return this._attrs;if(r.isObject(t)){for(var n in t)this._setAttr(n,t[n]);return this.clearBBox(),this._cfg.hasUpdate=!0,this}return 2===arguments.length?(this._setAttr(t,e),this.clearBBox(),this._cfg.hasUpdate=!0,this):this._attrs[t]},_setAttr:function(t,e){var n=this._attrs;n[t]=e,"fill"!==t&&"stroke"!==t?"opacity"!==t?"clip"===t&&e?this._setClip(e):"path"===t&&this._afterSetAttrPath?this._afterSetAttrPath(e):"transform"!==t?"rotate"===t&&this.rotateAtStart(e):this.transform(e):n.globalAlpha=e:n[t+"Style"]=e},clearBBox:function(){this.setSilent("box",null)},hasFill:function(){return this.canFill&&this._attrs.fillStyle},hasStroke:function(){return this.canStroke&&this._attrs.strokeStyle},_setClip:function(t){t._cfg.renderer=this._cfg.renderer,t._cfg.canvas=this._cfg.canvas,t._cfg.parent=this._cfg.parent,t.hasFill=function(){return!0}}}},function(t,e,n){var r=n(19),i=n(643),o=n(642),a=n(741),s=n(740),c=function t(e){t.superclass.constructor.call(this,e)};c.CFG={eventEnable:!0,width:null,height:null,widthCanvas:null,heightCanvas:null,widthStyle:null,heightStyle:null,containerDOM:null,canvasDOM:null,pixelRatio:null,renderer:"canvas"},r.extend(c,o),r.augment(c,{init:function(){c.superclass.init.call(this),this._setGlobalParam(),this._setContainer(),this._initPainter(),this._scale(),this.get("eventEnable")&&this._registEvents()},getEmitter:function(t,e){if(t){if(!r.isEmpty(t._getEvents()))return t;var n=t.get("parent");if(n&&!e.propagationStopped)return this.getEmitter(n,e)}},_getEventObj:function(t,e,n,r){var o=new i(t,e,!0,!0);return o.x=n.x,o.y=n.y,o.clientX=e.clientX,o.clientY=e.clientY,o.currentTarget=r,o.target=r,o},_triggerEvent:function(t,e){var n,r=this.getPointByClient(e.clientX,e.clientY),i=this.getShape(r.x,r.y,e),o=this.get("el");if("mousemove"===t){var a=this.get("preShape");if(a&&a!==i){var s=this._getEventObj("mouseleave",e,r,a);(n=this.getEmitter(a,e))&&n.emit("mouseleave",s),o.style.cursor="default"}if(i){var c=this._getEventObj("mousemove",e,r,i);if((n=this.getEmitter(i,e))&&n.emit("mousemove",c),a!==i){var u=this._getEventObj("mouseenter",e,r,i);n&&n.emit("mouseenter",u,e)}}else{var h=this._getEventObj("mousemove",e,r,this);this.emit("mousemove",h)}this.set("preShape",i)}else{var l=this._getEventObj(t,e,r,i||this);(n=this.getEmitter(i,e))&&n!==this&&n.emit(t,l),this.emit(t,l)}i&&!i.get("destroyed")&&(o.style.cursor=i.attr("cursor")||"default")},_registEvents:function(){var t=this,e=t.get("el");r.each(["mouseout","mouseover","mousemove","mousedown","mouseleave","mouseup","click","dblclick"],(function(n){e.addEventListener(n,(function(e){t._triggerEvent(n,e)}),!1)})),e.addEventListener("touchstart",(function(e){r.isEmpty(e.touches)||t._triggerEvent("touchstart",e.touches[0])}),!1),e.addEventListener("touchmove",(function(e){r.isEmpty(e.touches)||t._triggerEvent("touchmove",e.touches[0])}),!1),e.addEventListener("touchend",(function(e){r.isEmpty(e.changedTouches)||t._triggerEvent("touchend",e.changedTouches[0])}),!1)},_scale:function(){if("svg"!==this._cfg.renderType){var t=this.get("pixelRatio");this.scale(t,t)}},_setGlobalParam:function(){var t=this.get("renderer")||"canvas";"svg"===t?this.set("pixelRatio",1):this.get("pixelRatio")||this.set("pixelRatio",r.getRatio()),this._cfg.renderType=t;var e=s[t];this._cfg.renderer=e,this._cfg.canvas=this;var n=new a(this);this._cfg.timeline=n},_setContainer:function(){var t=this.get("containerId"),e=this.get("containerDOM");e||(e=document.getElementById(t),this.set("containerDOM",e)),r.modifyCSS(e,{position:"relative"})},_initPainter:function(){var t=this.get("containerDOM"),e=new this._cfg.renderer.painter(t);this._cfg.painter=e,this._cfg.canvasDOM=this._cfg.el=e.canvas,this.changeSize(this.get("width"),this.get("height"))},_resize:function(){var t=this.get("canvasDOM"),e=this.get("widthCanvas"),n=this.get("heightCanvas"),r=this.get("widthStyle"),i=this.get("heightStyle");t.style.width=r,t.style.height=i,t.setAttribute("width",e),t.setAttribute("height",n)},getWidth:function(){var t=this.get("pixelRatio");return this.get("width")*t},getHeight:function(){var t=this.get("pixelRatio");return this.get("height")*t},changeSize:function(t,e){var n=this.get("pixelRatio"),r=t*n,i=e*n;this.set("widthCanvas",r),this.set("heightCanvas",i),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"),r=this.get("pixelRatio")||1,i=n.getBoundingClientRect();return{x:(t-i.left)*r,y:(e-i.top)*r}},getClientByPoint:function(t,e){var n=this.get("el").getBoundingClientRect(),r=this.get("pixelRatio")||1;return{clientX:t/r+n.left,clientY:e/r+n.top}},draw:function(){this._cfg.painter.draw(this)},getShape:function(t,e,n){return 3===arguments.length&&this._cfg.renderer.getShape?this._cfg.renderer.getShape.call(this,t,e,n):c.superclass.getShape.call(this,t,e)},getRenderer:function(){return this._cfg.renderType},_drawSync:function(){this._cfg.painter.drawSync(this)},destroy:function(){var t=this._cfg,e=t.containerDOM,n=t.canvasDOM;n&&e&&e.removeChild(n),t.timeline.stop(),c.superclass.destroy.call(this)}}),t.exports=c},function(t,e,n){var r=n(248),i={};n(257).mix(i,r.PathUtil,{getRectPath:r.PathUtil.rectPath,pointsToPolygon:function(t){for(var e=[["M",t[0].x,t[0].y]],n=1;ne?(r&&(clearTimeout(r),r=null),s=u,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,h)),a};return u.cancel=function(){clearTimeout(r),s=0,r=i=o=null},u}},function(t,e,n){var r=n(46),i=n(596),o=Object.prototype.hasOwnProperty;t.exports=function(t,e){if(null===t||!i(t))return{};var n={};return r(e,(function(e){o.call(t,e)&&(n[e]=t[e])})),n}},function(t,e,n){var r=n(46),i=n(118);t.exports=function(t,e){if(!i(t))return t;var n=[];return r(t,(function(t,r){n.push(e(t,r))})),n}},function(t,e,n){var r=n(84),i=n(614);t.exports=function(t,e,n){return r(n)?!!n(t,e):i(t,e)}},function(t,e,n){var r=n(118);t.exports=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o0)){t[o]=e[o];break}i=r(i,t[o-1],1)}t[o]=["Q"].concat(i.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[o]=["T"].concat(i[0]);break;case"C":if(i.length<3){if(!(o>0)){t[o]=e[o];break}i=r(i,t[o-1],2)}t[o]=["C"].concat(i.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(i.length<2){if(!(o>0)){t[o]=e[o];break}i=r(i,t[o-1],1)}t[o]=["S"].concat(i.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[o]=e[o]}return t}},function(t,e,n){var r=n(46);t.exports=function(t,e){if(t.length!==e.length)return!1;var n=!0;return r(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n}},function(t,e,n){var r=n(770);function i(t,e,n){var r=null,i=n;return e=0;f--)c=s[f].index,"add"===s[f].type?t.splice(c,0,[].concat(t[c])):t.splice(c,1)}if((o=t.length)=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e.concat(t[t.length-1])}))}(t,e,r));else{var o=[].concat(t);"M"===o[0]&&(o[0]="L");for(var a=0;a<=r-1;a++)i.push(o)}return i}t.exports=function(t,e){if(1===t.length)return t;var n=t.length-1,i=e.length-1,o=n/i,a=[];if(1===t.length&&"M"===t[0][0]){for(var s=0;s1?1:u<0?0:u)/2,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;g<12;g++){var p=h*l[g]+h,m=a(p,t,n,i,s),v=a(p,e,r,o,c),x=m*m+v*v;f+=d[g]*Math.sqrt(x)}return h*f},c=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)Math.max(i,a)||Math.max(e,r)Math.max(o,s))){var c=(t-n)*(o-s)-(e-r)*(i-a);if(c){var u=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/c,h=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/c,l=+u.toFixed(2),d=+h.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||d<+Math.min(e,r).toFixed(2)||d>+Math.max(e,r).toFixed(2)||d<+Math.min(o,s).toFixed(2)||d>+Math.max(o,s).toFixed(2)))return{x:u,y:h}}}},u=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},h=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:i(t,e,n,r),vb:[t,e,n,r].join(" ")}},l=function(t,e,n,i,o,a,s,c){r(t)||(t=[t,e,n,i,o,a,s,c]);var u=function(t,e,n,r,i,o,a,s){for(var c=[],u=[[],[]],h=void 0,l=void 0,d=void 0,f=void 0,g=0;g<2;++g)if(0===g?(l=6*t-12*n+6*i,h=-3*t+9*n-9*i+3*a,d=3*n-3*t):(l=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*s,d=3*r-3*e),Math.abs(h)<1e-12){if(Math.abs(l)<1e-12)continue;(f=-d/l)>0&&f<1&&c.push(f)}else{var p=l*l-4*d*h,m=Math.sqrt(p);if(!(p<0)){var v=(-l+m)/(2*h);v>0&&v<1&&c.push(v);var x=(-l-m)/(2*h);x>0&&x<1&&c.push(x)}}for(var y=c.length,b=y,w=void 0;y--;)w=1-(f=c[y]),u[0][y]=w*w*w*t+3*w*w*f*n+3*w*f*f*i+f*f*f*a,u[1][y]=w*w*w*e+3*w*w*f*r+3*w*f*f*o+f*f*f*s;return u[0][b]=t,u[1][b]=e,u[0][b+1]=a,u[1][b+1]=s,u[0].length=u[1].length=b+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}}.apply(null,t);return h(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},d=function(t,e,n,r,i,o,a,s,c){var u=1-c,h=Math.pow(u,3),l=Math.pow(u,2),d=c*c,f=d*c,g=t+2*c*(n-t)+d*(i-2*n+t),p=e+2*c*(r-e)+d*(o-2*r+e),m=n+2*c*(i-n)+d*(a-2*i+n),v=r+2*c*(o-r)+d*(s-2*o+r);return{x:h*t+3*l*c*n+3*u*c*c*i+f*a,y:h*e+3*l*c*r+3*u*c*c*o+f*s,m:{x:g,y:p},n:{x:m,y:v},start:{x:u*t+c*n,y:u*e+c*r},end:{x:u*i+c*a,y:u*o+c*s},alpha:90-180*Math.atan2(g-m,p-v)/Math.PI}},f=function(t,e,n){if(!function(t,e){return t=h(t),e=h(e),u(e,t.x,t.y)||u(e,t.x2,t.y)||u(e,t.x,t.y2)||u(e,t.x2,t.y2)||u(t,e.x,e.y)||u(t,e.x2,e.y)||u(t,e.x,e.y2)||u(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(l(t),l(e)))return n?0:[];for(var r=~~(s.apply(0,t)/8),i=~~(s.apply(0,e)/8),o=[],a=[],f={},g=n?0:[],p=0;p=0&&C<=1&&O>=0&&O<=1&&(n?g++:g.push({x:P.x,y:P.y,t1:C,t2:O}))}}return g};t.exports=function(t,e){return function(t,e,n){t=o(t),e=o(e);for(var r=void 0,i=void 0,a=void 0,s=void 0,c=void 0,u=void 0,h=void 0,l=void 0,d=void 0,g=void 0,p=[],m=0,v=t.length;ma&&(n=t,a=s)})),n}}},function(t,e,n){var r=n(236);t.exports=function(t){return r(t)&&t>0}},function(t,e,n){var r=n(236);t.exports=function(t){return r(t)&&t%2!=0}},function(t,e,n){var r=n(236);t.exports=function(t){return r(t)&&t<0}},function(t,e,n){var r=n(236),i=Number.isInteger?Number.isInteger:function(t){return r(t)&&t%1==0};t.exports=i},function(t,e,n){var r=n(236);t.exports=function(t){return r(t)&&t%2==0}},function(t,e,n){var r=n(236);t.exports=function(t){return r(t)&&t%1!=0}},function(t,e){t.exports=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))}},function(t,e,n){var r=n(673);t.exports={clamp:n(618),fixedBase:n(788),isDecimal:n(787),isEven:n(786),isInteger:n(785),isNegative:n(784),isNumberEqual:r,isOdd:n(783),isPositive:n(782),maxBy:n(781),minBy:n(780),mod:n(672),snapEqual:r,toDegree:n(671),toInt:n(670),toInteger:n(670),toRadian:n(669)}},function(t,e,n){var r=n(45);t.exports=function(t){var e=0,n=0,i=0,o=0;return r(t)?1===t.length?e=n=i=o=t[0]:2===t.length?(e=i=t[0],n=o=t[1]):3===t.length?(e=t[0],n=o=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],o=t[3]):e=n=i=o=t,{r1:e,r2:n,r3:i,r4:o}}},function(t,e,n){var r=n(45),i=n(595),o=n(46),a=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,s=/[^\s\,]+/gi;t.exports=function(t){return r(t=t||[])?t:i(t)?(t=t.match(a),o(t,(function(e,n){if((e=e.match(s))[0].length>1){var r=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=r}o(e,(function(t,n){isNaN(t)||(e[n]=+t)})),t[n]=e})),t):void 0}},function(t,e){var n={};t.exports=function(t){var e=n[t];if(!e){for(var r=t.toString(16),i=r.length;i<6;i++)r="0"+r;e="#"+r,n[t]=e}return e}},function(t,e,n){var r=n(792);t.exports={number2color:r,numberToColor:r,parsePath:n(791),parseRadius:n(790)}},function(t,e){t.exports=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n}},function(t,e){t.exports=function(t,e){return t["_wrap_"+e]}},function(t,e,n){t.exports={getWrapBehavior:n(795),wrapBehavior:n(794)}},function(t,e,n){var r=n(237),i=n(45),o=n(46);t.exports=function(t,e){for(var n=[],a={},s=0;se[r])return 1;if(t[r]1&&void 0!==arguments[1]?arguments[1]:[];if(r(e))for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:[];return r(t,(function(t){return!i(e,t)}))}},function(t,e,n){t.exports={contains:n(605),difference:n(808),find:n(807),firstValue:n(806),flatten:n(805),flattenDeep:n(804),getRange:n(803),merge:n(802),pull:n(676),pullAt:n(675),reduce:n(801),remove:n(800),sortBy:n(799),union:n(798),uniq:n(674),valuesOfKey:n(797)}},function(t,e){t.exports=function(t,e){var n=this.getStyle(t,"width",e);return"auto"===n&&(n=t.offsetWidth),parseFloat(n)}},function(t,e,n){var r=n(237);t.exports=function(t,e,n){try{return window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.currentStyle[e]}catch(t){return r(n)?null:n}}},function(t,e){t.exports=function(){return window.devicePixelRatio?window.devicePixelRatio:2}},function(t,e){t.exports=function(t,e){var n=this.getWidth(t,e),r=parseFloat(this.getStyle(t,"borderLeftWidth"))||0,i=parseFloat(this.getStyle(t,"paddingLeft"))||0,o=parseFloat(this.getStyle(t,"paddingRight"))||0;return n+r+(parseFloat(this.getStyle(t,"borderRightWidth"))||0)+i+o}},function(t,e){t.exports=function(t,e){var n=this.getHeight(t,e),r=parseFloat(this.getStyle(t,"borderTopWidth"))||0,i=parseFloat(this.getStyle(t,"paddingTop"))||0,o=parseFloat(this.getStyle(t,"paddingBottom"))||0;return n+r+(parseFloat(this.getStyle(t,"borderBottomWidth"))||0)+i+o}},function(t,e){t.exports=function(t,e){var n=this.getStyle(t,"height",e);return"auto"===n&&(n=t.offsetHeight),parseFloat(n)}},function(t,e){t.exports=function(t,e){if(t&&t.getBoundingClientRect){var n=t.getBoundingClientRect(),r=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:n.top-r,bottom:n.bottom-r,left:n.left-i,right:n.right-i}}return e||null}},function(t,e){t.exports=function(t,e,n){if(t){if(t.addEventListener)return t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}};if(t.attachEvent)return t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}}}},function(t,e,n){t.exports={addEventListener:n(817),createDom:n(681),getBoundingClientRect:n(816),getHeight:n(815),getOuterHeight:n(814),getOuterWidth:n(813),getRatio:n(812),getStyle:n(811),getWidth:n(810),modifyCSS:n(680),requestAnimationFrame:n(679)}},function(t,e,n){var r=n(46),i=n(606),o=n(818),a=n(809),s=n(796),c=n(793),u=n(789),h=n(779),l=n(778),d=n(774),f=n(768),g=n(763),p={DOMUtil:o,DomUtil:o,MatrixUtil:h,PathUtil:d,arrayUtil:a,domUtil:o,eventUtil:s,formatUtil:c,mathUtil:u,matrixUtil:h,objectUtil:l,stringUtil:f,pathUtil:d,typeUtil:g,augment:n(651),clone:n(616),debounce:n(756),deepMix:n(615),each:r,extend:n(650),filter:n(620),group:n(755),groupBy:n(648),groupToMap:n(649),indexOf:n(754),isEmpty:n(647),isEqual:n(614),isEqualWith:n(753),map:n(752),mix:i,pick:n(751),throttle:n(750),toArray:n(604),toString:n(594),uniqueId:n(646)};r([o,a,s,c,u,h,l,d,f,g],(function(t){i(p,t)})),t.exports=p},function(t,e,n){var r=n(683),i=n(626),o=n(247),a=n(609),s=n(248),c={Graph:n(625),Tree:n(689),Util:n(26),Layouts:n(623),G:s,Plugins:{},Components:{},Global:o,Shape:r,registerNode:r.registerNode,registerEdge:r.registerEdge,registerGroup:r.registerGroup,registerGuide:r.registerGuide,registerBehaviour:i.registerBehaviour,version:a,track:function(t){o.track=t}};n(684),t.exports=c}])},function(t,e,n){const r=n(7),i=n(1),o=n(10),a=[];class s extends i{constructor(t){const e={showHotArea:!1,defaultData:{roots:[{label:"思维导图",children:[{label:"新建节点"},{label:"新建节点"},{label:"新建节点"}]}]},shortcut:{append:!0,appendChild:!0,collapseExpand:!0,selectAll:!0},labelEditable:!0,graph:{modes:{default:["clickNodeSelected","keydownMoveSelection","clickCanvasSelected","keydownEditLabel","panBlank","wheelChangeViewport","panMindNode","clickCollapsedButton","clickExpandedButton","hoverButton","hoverNodeActived","dblclickItemEditLabel"],readOnly:["clickNodeSelected","wheelChangeViewport","keydownMoveSelection","hoverNodeActived","panCanvas","clickExpandedButton","hoverButton","clickCanvasSelected"]},layout:new r.Layouts.Mindmap({direction:"H",getSubTreeSep:t=>t.children&&t.children.length>0?t.hierarchy<=2?8:2:0,getHGap:t=>1===t.hierarchy?8:2===t.hierarchy?24:18,getVGap:t=>1===t.hierarchy||2===t.hierarchy?24:2,getSide:t=>t.data.side?t.data.side:"right"}),mode:"default",defaultIntersectBox:"rect",nodeDefaultShape:"mind-base",edgeDefaultShape:"mind-edge",minZoom:.2,maxZoom:2},align:{item:!1},rootShape:"mind-root",firstSubShape:"mind-first-sub",secondSubShape:"mind-second-sub",subShape:"mind-base",nodeDefaultShape:"mind-base",graphConstructor:r.Tree,defaultSide:"right"},n={};o.each(a,t=>{o.mix(n,t.CFG)}),o.mix(!0,e,n,t),super(e),this.isMind=!0}_init(){super._init(),o.each(a,t=>{t.INIT&&this[t.INIT]()});const t=this.getGraph(),e=this.get("defaultData"),n=t.get("mode"),r=t.getRootGroup().addGroup();if(this.set("hotAreaGroup",r),t.edge().shape(e=>{if(t.find(e.target).getModel().isPlaceholder)return"mind-placeholder-edge"}),e&&this.read(e),"default"===n){if(e){const e=this.getRoot(),n=t.find(e.id);this.setSelected(n,!0)}}else if("readOnly"===n){const t=this.get("shortcut");t.append=!1,t.appendChild=!1,t.selectAll=!1,t.delete=!1}if(e){const t=this.getRoot();this.focus(t.id)}}bindEvent(){super.bindEvent();const t=this.get("_graph");t.on("keydown",t=>{t.domEvent.preventDefault()}),t.on("beforechange",t=>{"add"===t.action?this._beforeAdd(t):"changeData"===t.action&&this._beforeChangeData(t)}),t.on("aftersource",()=>{this._setHierarchy()}),t.on("afterchange",()=>{this._setHotArea()}),t.on("afteritemdraw",t=>{const e=t.item,n=e.getModel();if(e.isEdge){const t=e.getGraphicGroup();o.toBack(t,t.getParent()),t.setSilent("capture",!1)}n.parent||(e.isRoot=!0,e.deleteable=!1,e.collapseExpand=!1,e.appendable=!1,e.dragable=!1)}),this.on("beforedelete",t=>{const e=t.items[0],n=this._getBrothers(e),r=this._getNth(e);n[r-1]?this.setSelected(n[r-1].id,!0):n[r+1]?this.setSelected(n[r+1].id,!0):this.setSelected(e.getParent(),!0)}),this.on("afteritemselected",t=>{this._tryAdjustViewport(t.item)})}getRoot(){return this.getGraph().getSource().roots[0]}_setHierarchy(t){const e=this.getGraph(),n=this.get("firstSubShape"),r=this.get("secondSubShape"),i=this.get("defaultSide");if(t){const o=e.find(t.parent);if(o){const e=o.getModel();t.hierarchy=e.hierarchy+1,"mind-placeholder"!==t.shape&&(2===t.hierarchy&&(t.shape=n,t.side||(t.side=i)),3===t.hierarchy&&(t.shape=r))}}else(t=this.getRoot()).hierarchy=1;o.traverseTree(t,(t,e)=>{t.hierarchy=e.hierarchy+1,t.side||(t.side=i),e.side&&(t.side=e.side),2===t.hierarchy?t.shape=n:3===t.hierarchy&&(t.shape=r)},t=>t.children)}getFirstChildrenBySide(t){const e=this.getRoot(),n=[];return e.children.forEach(e=>{e.side===t&&n.push(e)}),n}_getNth(t){return this.getGraph().getNth(t)}_getBrothers(t){return t.getParent().getModel().children}_getMoveChildModel(t){if(t&&t.length>0){const e=t.length;return t[parseInt(e/2)]}}_getVerticalMoveItem(t,e,n){const r=this.getGraph().getNodes(),i=t.getBBox(),o=[i.minX,i.maxX],a=[];let s;for(let t=0;t0&&(a.sort((t,e)=>t.long-e.long),s=a[0].node),s}_arrowTopItem(t){const e=this._getBrothers(t),n=this._getNth(t);return e[n-1]?e[n-1]:this._getVerticalMoveItem(t,(t,e,n)=>t.centerY=t.minX,(t,e)=>e.centerY-t.centerY)}_arrowBottomItem(t){const e=this._getBrothers(t),n=this._getNth(t);return e[n+1]?e[n+1]:this._getVerticalMoveItem(t,(t,e,n)=>t.centerY>e.centerY&&n<=t.maxX&&n>=t.minX,(t,e)=>t.centerY-e.centerY)}_arrowLeftItem(t){const e=o.getMindNodeSide(t);if(t.isRoot){const t=this.getFirstChildrenBySide("left");return this._getMoveChildModel(t)}if("left"===e){const e=t.getModel().children;return this._getMoveChildModel(e)}return t.getParent()}_arrowRightItem(t){const e=o.getMindNodeSide(t);if(t.isRoot){const t=this.getFirstChildrenBySide("right");return this._getMoveChildModel(t)}if("right"===e){const e=t.getModel().children;return this._getMoveChildModel(e)}return t.getParent()}_moveItemSelection(t){const e=this.getGraph(),n=this.getSelected()[0];if(!n)return;const{domEvent:r}=t,i=o.getKeyboradKey(r);let a;"ArrowUp"!==i||n.isRoot?"ArrowDown"!==i||n.isRoot?"ArrowLeft"===i?a=this._arrowLeftItem(n):"ArrowRight"===i&&(a=this._arrowRightItem(n)):a=this._arrowBottomItem(n):a=this._arrowTopItem(n),a&&(a=e.find(a.id),a.isVisible()&&(this.clearSelected(),this.setSelected(a,!0)))}showLabelEditor(t){const{domEvent:e}=t,n=this.getSelected()[0],r=o.getKeyboradKey(e);if(n&&1===r.length&&!e.metaKey&&!e.ctrlKey){const t=this.get("labelTextArea");n&&(this.beginEditLabel(n),t.innerHTML=r,o.setEndOfContenteditable(t))}}_tryAdjustViewport(t){const e=this.get("_graph"),n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY},o=e.getDomPoint(r),a=e.getDomPoint(i),s=e.getWidth(),c=e.getHeight();o.x<0&&e.translate(16-o.x,0),o.y<0&&e.translate(0,16-o.y),a.x>s&&e.translate(s-a.x-16,0),a.y>c&&e.translate(0,c-a.y-16)}_beforeChangeData(t){const e=t.data.roots[0],n=this.get("rootShape");e.shape=n,this._setHierarchy(e)}_beforeAdd(t){const e=this.get("_graph"),{model:n}=t,r=e.find(n.parent);r.getModel().collapsed&&e.update(r,{collapsed:!1}),this._setHierarchy(n)}_drawHotAreaShape(){const t=this.get("_graph"),e=this.get("hotAreaGroup"),n=this.get("hotAreas");e.clear(),n.forEach(t=>{e.addShape("rect",{attrs:{x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY,fill:t.color,fillOpacity:.4},capture:!1})}),t.draw()}_setHotArea(){const t=[],e=this.get("_graph"),n=this.getRoot(),r="placeholder",i=this.get("showHotArea"),a=e.find(n.id).getBBox();t.push({minX:a.minX-90,minY:a.minY-60,maxX:(a.minX+a.maxX)/2,maxY:a.maxY+60,parent:n,current:n,id:n.id+"left"+r,nth:n.children.length,side:"left",color:"orange"}),t.push({minX:(a.minX+a.maxX)/2,minY:a.minY-60,maxX:a.maxX+90,maxY:a.maxY+60,parent:n,current:n,id:n.id+"right"+r,nth:n.children.length,side:"right",color:"pink"}),o.traverseTree(n,(n,i,o)=>{const a=e.find(n.id);if(n.isPlaceholder||!a||!a.isVisible())return;const s=function(t,e,n){const r=n.children;let i=t;if(!n.parent)for(;r[i]&&r[i].side!==e.side;)i++;for(;r[i]&&r[i].isPlaceholder;)i++;if(r[i]&&r[i].side===e.side)return r[i]}(o+1,n,i),c=function(t,e,n){const r=n.children;let i=t;if(!n.parent)for(;r[i]&&r[i].side!==e.side;)i--;for(;r[i]&&r[i].isPlaceholder;)i--;if(r[i]&&r[i].side===e.side)return r[i]}(o-1,n,i),u=e.find(n.id).getBBox(),h=i.children,l=2===n.hierarchy&&"right"===n.side,d=2===n.hierarchy&&"left"===n.side;if(c||t.push({minX:l?u.minX-90:u.minX,minY:(()=>{let t=c?u.minY:u.minY-16;if(h[o-1]&&h[o-1].isPlaceholder&&h[o-1].side===n.side){t=e.find(h[o-1].id).getBBox().minY}return t})(),maxX:d?u.maxX+90:u.maxX,maxY:(u.minY+u.maxY)/2,parent:i,id:(c?c.id:void 0)+n.id+i.id+r,side:n.side,color:"yellow",nth:o}),s){const a=e.find(s.id).getBBox();t.push({minX:"left"===n.side?Math.max(u.minX,a.minX):l?u.minX-90:u.minX,minY:(u.minY+u.maxY)/2,maxX:"right"===n.side?Math.min(u.maxX,a.maxX):d?u.maxX+90:u.maxX,maxY:(a.minY+a.maxY)/2,parent:i,id:n.id+(s?s.id:void 0)+i.id+r,side:n.side,color:"blue",nth:o+1})}else t.push({minX:l?u.minX-90:u.minX,minY:(u.minY+u.maxY)/2,maxX:d?u.maxX+90:u.maxX,maxY:(()=>{let t=u.maxY+16;if(h[o+1]&&h[o+1].isPlaceholder&&h[o+1].side===n.side){t=e.find(h[o+1].id).getBBox().maxY}return t})(),parent:i,id:n.id+void 0+i.id+r,color:"red",nth:o+1,addOrder:"push",side:n.side});if(!n.children||0===n.children.length||1===n.children.length&&n.children[0].isPlaceholder){const e=100,o=0;let a;a=n.x>i.x?{minX:u.maxX,minY:u.minY-o,maxX:u.maxX+e,maxY:u.maxY+o}:{minX:u.minX-e,minY:u.minY-o,maxX:u.minX,maxY:u.maxY+o},t.push({...a,parent:n,id:NaN+n.id+r,nth:0,color:"green",side:n.side,addOrder:"push"})}},t=>t.children),this.set("hotAreas",t),i&&this._drawHotAreaShape()}hideHotArea(){const t=this.get("_graph");this.get("hotAreaGroup").clear(),t.draw(),this.set("showHotArea",!1)}showHotArea(){this._drawHotAreaShape(),this.set("showHotArea",!0)}getHotArea(t){let e;return this.get("hotAreas").forEach(n=>{if(t.x>n.minX&&t.xn.minY&&t.y{const t=e.getNodes();i=t.filter(t=>t.getModel().collapsed).map(t=>t.getModel().id),i.forEach(t=>{e.update(t,{collapsed:!1})}),e.layout(),o=this.getSelected().map(t=>t.id),a=this.getSelected().map(t=>t.id),this.clearSelected(),this.clearActived()},afterTransform:()=>{i.forEach(t=>{e.update(t,{collapsed:!0})}),this.setSelected(o,!0),this.setActived(a,!0)},...t})}save(){const t=this.get("_graph").save();return t.roots.forEach(t=>{o.traverseTree(t,t=>{delete t.x,delete t.y,delete t.width,delete t.height,delete t.parent,delete t.nth,delete t.hierarchy,delete t.index,delete t.shape},t=>t.children,!0)}),t}}o.each(a,t=>{o.mix(s.prototype,t.AUGMENT)}),i.setRegister(s,"mind","page"),t.exports=s},function(t,e,n){const r=n(7).Util;t.exports=class{getDefaultCfg(){return{}}constructor(t){const e=this.getDefaultCfg();r.mix(!0,this,e,t),this.init()}init(){}destroy(){}}},function(t,e,n){const r={...n(4),getMindNodeSide(t){const e=t.getModel();if(e.side)return e.side;const n=t.getParent();return n?n.getModel().side?n.getModel().side:r.getMindNodeSide(n):void 0}};t.exports=r},function(t,e,n){const r=n(1),i=n(16),o=n(19);class a extends i{constructor(t){const e={graph:{modes:{default:["panBlank","hoverGroupActived","keydownCmdWheelZoom","clickEdgeSelected","clickNodeSelected","clickCanvasSelected","clickGroupSelected","hoverNodeActived","hoverEdgeActived","hoverButton","clickCollapsedButton","clickExpandedButton","wheelChangeViewport","keydownShiftMultiSelected","dragNodeAddToGroup","dragOutFromGroup","panItem","hoverEdgeControlPoint","dragEdgeControlPoint"],add:["dragPanelItemAddNode"],readOnly:["panCanvas"],move:["panCanvas"],multiSelect:["dragMultiSelect"]},mode:"default",defaultIntersectBox:"rect",nodeDefaultShape:"flow-base",edgeDefaultShape:"flow-smooth",groupDefaultShape:"flow-base"},linkNode:!1};o.mix(!0,e,{},t),super(e),this.isFlow=!0}}r.setRegister(a,"flow","diagram"),t.exports=a},function(t,e,n){const r=n(16),i=n(1),o=n(6);class a extends r{constructor(t){const e={graph:{modes:{default:["panBlank","keydownCmdWheelZoom","clickEdgeSelected","clickNodeSelected","clickCanvasSelected","hoverNodeActived","hoverEdgeActived","hoverButton","wheelChangeViewport","keydownShiftMultiSelected","panItem","hoverNodeShowArrowController","hoverEdgeControlPoint","dragEdgeControlPoint","bpmnMoveEdgeController"],add:["dragPanelItemAddNode","processAddEdge"],readOnly:["panCanvas"],move:["panCanvas"],multiSelect:["dragMultiSelect"]},mode:"default",defaultIntersectBox:"rect",nodeDefaultShape:"bpmn-base",edgeDefaultShape:"bpmn-base"},arrowController:{thickness:32,long:32,controllers:[]}};o.mix(!0,e,{},t),super(e),this.isBPMN=!0}_init(){super._init(),this._initArrowController()}_createArrowController(t,e){const n=this.get("arrowController").controllers,r=o.createDOM('
',{visibility:"hidden",width:t+"px",height:e+"px",position:"absolute"});return r.setAttribute("draggable","true"),o.addEventListener(r,"dragstart",()=>{const t=r.hoverNode,e={shape:"bpmn-base",source:t.id,anchorIndex:r.getAttribute("anchorIndex")},n=t.getBBox(),i=this.getDelegation([{isEdge:!0}]);this.setSignal("dragEdge",!0),this.beginAdd("edge",e),this.set("addEdgeConfig",{addModel:e,delegation:i,startPoint:{x:n.centerX,y:n.centerY},sourceItem:t}),this.hideArrowController()}),n.push(r),r}showArrowController(t){this.get("arrowController").controllers.forEach(e=>{e.show(),e.hoverNode=t})}hideArrowController(){this.get("arrowController").controllers.forEach(t=>{t.hide()})}_initArrowController(){const t=this.getGraph().getGraphContainer(),e=this.get("arrowController"),{thickness:n,long:r}=e,i=this._createArrowController(n,r),o=this._createArrowController(n,r),a=this._createArrowController(r,n),s=this._createArrowController(r,n);t.appendChild(i),t.appendChild(o),t.appendChild(a),t.appendChild(s),e.topArrow=i,e.bottomArrow=o,e.leftArrow=a,e.rightArrow=s}bindEvent(){super.bindEvent();const t=this.getGraph();t.on("beforepanitem",()=>{this.hideArrowController()}),t.on("afterviewportchange",()=>{this.hideArrowController()})}}i.setRegister(a,"bpmn","diagram"),t.exports=a},function(t,e,n){const r=n(7),i=n(1),o=n(2),a=n(65),s=n(66),c=n(68),u=n(72),h=[a,n(73),u,s,c,n(74)];class l extends i{constructor(t){const e={shortcut:{copy:!0,paste:!0,selectAll:!0,addGroup:!0,unGroup:!0},graph:{minZoom:.2,maxZoom:2},graphConstructor:r.Graph,noEndEdge:!0},n={};o.each(h,t=>{o.mix(n,t.CFG)}),o.mix(!0,e,n,t),super(e),this.isFlow=!0}_init(){super._init(),o.each(h,t=>{t.INIT&&this[t.INIT]()})}bindEvent(){super.bindEvent(),this.on("beforeitemactived",t=>{const e=t.item,n=this.get("_graph").getShapeObj(e).getActivedOutterStyle(e);e.isNode&&this.addOutterShape(e,n)}),this.on("beforeitemunactived",t=>{const e=t.item;(e.isNode||e.isGroup)&&this.clearOutterShape(e)}),this.on("beforeitemselected",t=>{const e=t.item,n=this.get("_graph").getShapeObj(e).getSelectedOutterStyle(e);(e.isNode||e.isGroup)&&this.addOutterShape(e,n)}),this.on("beforeitemunselected",t=>{const e=t.item;(e.isNode||e.isGroup)&&this.clearOutterShape(e)})}}o.each(h,t=>{o.mix(l.prototype,t.AUGMENT)}),i.setRegister(l,"diagram","page"),t.exports=l},function(t,e){t.exports={gridStyle:{stroke:"#A3B1BF",lineWidth:.5},cursor:{panningCanvas:"-webkit-grabbing",beforePanCanvas:"-webkit-grab"},wheelPanRatio:.3,alignLineStyle:{stroke:"#FA8C16",lineWidth:1},nodeDelegationStyle:{stroke:"#1890FF",fill:"#1890FF",fillOpacity:.08,lineDash:[4,4],radius:4,lineWidth:1},edgeDelegationStyle:{stroke:"#1890FF",lineDash:[4,4],lineWidth:1}}},function(t,e,n){const r=n(18);n(32),n(33),t.exports=r},function(t,e,n){const r=n(13);n(75),n(80),t.exports=r},function(t,e,n){const r=n(1),i=n(16),o=n(24);class a extends i{constructor(t){const e={graph:{modes:{default:["panBlank","hoverGroupActived","keydownCmdWheelZoom","clickEdgeSelected","clickNodeSelected","clickCanvasSelected","clickGroupSelected","hoverNodeActived","hoverEdgeActived","hoverButton","clickCollapsedButton","clickExpandedButton","wheelChangeViewport","keydownShiftMultiSelected","dragNodeAddToGroup","dragOutFromGroup","panItem","hoverEdgeControlPoint","dragEdgeControlPoint"],add:["dragPanelItemAddNode","processAddEdge"],readOnly:["panCanvas"],move:["panCanvas"],multiSelect:["dragMultiSelect"]},mode:"default",defaultIntersectBox:"circle",nodeDefaultShape:"koni-base",edgeDefaultShape:"koni-base",groupDefaultShape:"koni-base",minZoom:.5,maxZoom:2},orbit:{satellite:["forkAndLink"]},anchorLink:!1,noEndEdge:!1};o.mix(!0,e,{},t),super(e),this.isKoni=!0}bindEvent(){super.bindEvent();const t=this.getGraph();t.on("afterchange",({item:e,action:n,originModel:r,updateModel:i})=>{if(e&&e.isEdge)if("add"===n||"remove"===n){const t=e.getSource(),n=e.getTarget();o.getParallelEdges(t,n,!0).forEach(t=>{t.update()})}else if("update"===n){const e=t.find(r.source),n=t.find(r.target);let a=[];if(o.getParallelEdges(e,n,!0).forEach(t=>{t.update()}),o.isNil(i.target)&&!o.isNil(i.source)){const e=t.find(i.source);a=o.getParallelEdges(e,n,!0)}else if(!o.isNil(i.target)&&o.isNil(i.source)){const n=t.find(i.target);a=o.getParallelEdges(e,n,!0)}else if(!o.isNil(i.target)&&!o.isNil(i.source)){const e=t.find(i.source),n=t.find(i.target);a=o.getParallelEdges(e,n,!0)}a.forEach(t=>{t.update()})}"changeData"===n&&t.getEdges().forEach(t=>{t.update()}),t.draw()})}}r.setRegister(a,"koni","diagram"),t.exports=a},function(t,e,n){const r=n(6),i={};function o(t){return t.getCurrentPage().getSelected().length>0}function a(t){const e=t.getCurrentPage();this.snapShot=e.save(),this.selectedItems=e.getSelected().map(t=>t.id),this.method&&(r.isString(this.method)?e[this.method]():this.method(t))}function s(t){const e=t.getCurrentPage();e.read(this.snapShot),e.setSelected(this.selectedItems,!0)}function c(t){return t.getCurrentPage().getMode()!==this.toMode}function u(t){const e=t.getCurrentPage();this.fromMode=e.getMode(),e.changeMode(this.toMode)}function h(t){t.getCurrentPage().changeMode(this.fromMode)}function l(t){const e={},n=[];return t.forEach(t=>{const i=t.model,o=r.mix(!0,{},{...i,id:r.guid()});e[i.id]=o.id,n.push({...t,model:o})}),n.forEach(t=>{const n=t.model;if(n.parent){const t=e[n.parent];t?n.parent=t:delete n.parent}}),n.sort((t,e)=>t.index-e.index),n}i.list=[],i.registerCommand=(t,e,n)=>{if(i[t])r.mix(i[t],e);else{let o={enable:()=>!0,init(){},execute:a,back:s,shortcutCodes:void 0,executeTimes:1,name:t,queue:!0,...e};n&&i[n]&&(o=r.mix({},i[n],e)),i[t]=o,i.list.push(o)}},i.execute=(t,e,n)=>{const o=r.mix(!0,{},i[t],n),a=e.get("_command");return o.enable(e)&&(o.init(),o.queue&&(a.queue.splice(a.current,a.queue.length-a.current,o),a.current+=1),e.emit("beforecommandexecute",{command:o}),o.execute(e),e.emit("aftercommandexecute",{command:o}),e.setCommandDOMenable()),o},i.enable=(t,e)=>i[t].enable(e),i.registerCommand("common",{back:s}),i.registerCommand("copyAdjacent",{enable(){return this.copyNode&&this.copyNode.isNode&&this.x&&this.y},execute(t){const{copyNode:e}=this,n=t.getCurrentPage(),i=n.getGraph(),o=e.getModel(),a=r.clone(o);a.id=r.guid(),a.x=this.x,a.y=this.y;const s=i.add("node",a),c=i.add("edge",{source:o.id,target:a.id});1===this.executeTimes&&(this.addIds=[s.id,c.id],this.page=n)},back(){const t=this.page.getGraph();this.addIds.forEach(e=>{t.remove(e)})}}),i.registerCommand("add",{enable(){return this.type&&this.addModel},execute(t){const e=t.getCurrentPage(),n=e.getGraph().add(this.type,this.addModel);1===this.executeTimes&&(this.addId=n.id,this.page=e)},back(){this.page.getGraph().remove(this.addId)}}),i.registerCommand("update",{enable(){return this.itemId&&this.updateModel},execute(t){const e=t.getCurrentPage(),n=e.getGraph(),i=n.find(this.itemId);1===this.executeTimes&&(this.originModel=r.getContrast(i.getModel(),this.updateModel),this.page=e),n.update(i,this.updateModel)},back(){const t=this.page.getGraph(),e=t.find(this.itemId);t.update(e,this.originModel)}}),i.registerCommand("redo",{queue:!1,enable(t){const e=t.get("_command"),n=e.queue;return e.currentt.get("_command").current>0,execute(t){const e=t.get("_command"),n=e.queue[e.current-1];n.executeTimes++,n.back(t),e.current-=1},shortcutCodes:[["metaKey","z"],["ctrlKey","z"]]}),i.registerCommand("copy",{queue:!1,enable:o,method(t){const e=t.getCurrentPage().getSelected(),n=t.get("_command"),i=e.map(t=>t.getGraphicGroup()),o=r.getChildrenBBox(i);n.clipboard=[],e.forEach(t=>{r.traverseTree(t,t=>{const e=t.getModel(),i=t.getGraphicGroup();n.clipboard.push({type:t.type,index:r.getIndex(i),model:e})},t=>t.getChildren&&t.getChildren(),!0)}),t.set("copyCenterBox",{...o})}}),i.registerCommand("pasteHere",{enable:t=>t.get("_command").clipboard.length>0,method(t){const e=t.getCurrentPage(),n=t.get("_command"),i=this.pasteData?this.pasteData:l(n.clipboard),o=this.copyCenterBox?this.copyCenterBox:t.get("copyCenterBox"),a=this.contextmenuPoint?this.contextmenuPoint:t.get("contextmenuPoint");e.clearSelected(),this.copyCenterBox=r.clone(o),this.pasteData=r.clone(i),this.contextmenuPoint=r.clone(a),i.forEach(t=>{const n=t.model;n.x&&(n.x+=a.x-o.minX),n.y&&(n.y+=a.y-o.minY),e.add(t.type,n)})},back:s}),i.registerCommand("paste",{enable:t=>t.get("_command").clipboard.length>0,method(t){const e=t.getCurrentPage(),n=t.get("_command"),i=this.pasteData?this.pasteData:l(n.clipboard);e.clearSelected(),this.pasteData=r.clone(i),i.forEach(t=>{const n=t.model;n.x&&(n.x+=10),n.y&&(n.y+=10),e.add(t.type,n)})},back:s}),i.registerCommand("addGroup",{init(){this.addGroupId=r.guid()},enable:t=>t.getCurrentPage().getSelected().length>1,method(t){t.getCurrentPage().addGroup({id:this.addGroupId})},back:s}),i.registerCommand("unGroup",{enable(t){const e=t.getCurrentPage().getSelected();return 1===e.length&&e[0].isGroup},method:"unGroup",back:s}),i.registerCommand("delete",{getDeleteItems(t){const e=t.getCurrentPage(),n=e.getGraph();let r=this.itemIds?this.itemIds.map(t=>n.find(t)):e.getSelected();return r=r.filter(t=>!1!==t.deleteable),r},enable(t){return this.getDeleteItems(t).length>0},method(t){const e=t.getCurrentPage(),n=this.getDeleteItems(t),i=e.getGraph();e.emit("beforedelete",{items:n}),r.each(n,t=>{i.remove(t)}),e.emit("afterdelete",{items:n}),this.itemIds=n.map(t=>t.getModel().id)},back:s,shortcutCodes:["Delete","Backspace"]}),i.registerCommand("selectAll",{method(t){const e=t.getCurrentPage();e.getGraph().getItems().forEach(t=>{e.setSelected(t,!0)})},back:s,shortcutCodes:[["metaKey","a"]]}),i.registerCommand("toBack",{enable:o,method:"toBack",back:s}),i.registerCommand("toFront",{enable:o,method:"toFront",back:s}),i.registerCommand("clear",{enable:t=>t.getCurrentPage().getItems().length>0,method:"clear",back:s}),i.registerCommand("multiSelect",{enable:c,toMode:"multiSelect",execute:u,back:h}),i.registerCommand("move",{enable:c,toMode:"move",execute:u,back:h}),t.exports=i},function(t,e,n){t.exports=n(2)},function(t,e,n){"use strict";n.r(e),n.d(e,"mouseEnterEdge",(function(){return i})),n.d(e,"mouseLeaveEdge",(function(){return o})),n.d(e,"startMove",(function(){return a})),n.d(e,"endMove",(function(){return s})),n.d(e,"mouseMoveEdge",(function(){return c})),n.d(e,"mergeLine",(function(){return u}));var r=n(0);function i({graph:t,bpmn:e,ev:n,backUpCursor:i}){const o=n.item,a=o.model.controlPoints,{index:s,vertical:c}=Object(r.e)({x:n.x,y:n.y},a);null!=s&&(i&&(o._cursor=e.getGraph().getMouseEventWrapper().style.cursor),t.update(o,{hold:{index:s,vertical:c}}),c?e.css({cursor:"col-resize"}):e.css({cursor:"row-resize"}))}function o({graph:t,bpmn:e,item:n}){n._cursor&&e.css({cursor:n._cursor}),delete n._cursor,t.update(n,{hold:void 0})}function a(t,e){const n=e.item;t.update(n,{lastMouse:{x:e.x,y:e.y}})}function s({graph:t,item:e}){t.update(e,{lastMouse:void 0,moveDelta:void 0})}function c(t,e,n){let r;r=e.model&&e.model.hold&&e.model.hold.vertical?{x:n.x-e.model.lastMouse.x,y:0}:{x:0,y:n.y-e.model.lastMouse.y},t.update(e,{edgeMoved:r,modifiedByMouse:!0})}function u(t,e,n){const r=t.model,i=e||r.hold.index,o=r.controlPoints;let a;null===n&&(n=r.hold.vertical);const s=[];return i>=2&&(n?Math.abs(o[i-2].x-o[i].x)<=3&&(a=[{x:o[i-2].x,y:o[i-2].y},{x:o[i-2].x,y:o[i+1].y}],s.push(i-1,i),r.hold.index=i-2,r.controlPoints[i+1].x=o[i-2].x):Math.abs(o[i-2].y-o[i].y)<=3&&(a=[{x:o[i-2].x,y:o[i-2].y},{x:o[i+1].x,y:o[i-2].y}],s.push(i-1,i),r.hold.index=i-2,r.controlPoints[i+1].y=o[i-2].y)),i<=o.length-4&&(n?Math.abs(o[i].x-o[i+2].x)<=3&&(a?(a[1]={x:o[i-2].x,y:o[i+3].y},r.controlPoints[i+3].x=o[i-2].x):(a=[{x:o[i+3].x,y:o[i].y},{x:o[i+3].x,y:o[i+3].y}],r.controlPoints[i].x=o[i+3].x),s.push(i+1,i+2)):Math.abs(o[i].y-o[i+2].y)<=3&&(a?(a[1]={x:o[i+3].x,y:o[i-2].y},r.controlPoints[i+3].y=o[i-2].y):(a=[{x:o[i].x,y:o[i+3].y},{x:o[i+3].x,y:o[i+3].y}],r.controlPoints[i].y=o[i+3].y),s.push(i+1,i+2))),s&&s.length&&o.splice(s[0],s.length),a}},function(t,e,n){const r=n(27),i=n(6);t.exports=class extends r{getDefaultCfg(){return{}}constructor(t){super();const e=this.getDefaultCfg();this._cfg=i.mix(!0,{},this._cfg,e,t)}get(t){return this._cfg[t]}set(t,e){this._cfg[t]=e}destroy(){this._cfg={},this.destroyed=!0}}},function(t,e,n){const r=n(4);t.exports={...r,getParallelEdges:(t,e,n=!1)=>t.getEdges().filter(t=>{const r=t.getModel();return r.target===e.id||n&&r.source===e.id}),object2array(t){const e=[];return r.each(t,t=>{e.push(t)}),e}}},function(t,e,n){const r=n(9),i=n(2);t.exports=class extends r{getDefaultCfg(){return{name:"",render:()=>"",bindEvent:()=>[]}}_renderDOM(){const t=i.createDOM(this.render(this.diagram));return this.dom=t,t.isSatellite=!0,t}getDOM(){return this.dom||this._renderDOM()}init(){const t=this.getDOM(),e=this.diagram.getGraph().getGraphContainer();t&&(t.css({position:"absolute",visibility:"hidden"}),e.appendChild(t),t&&this.bindEvent(t,this.diagram))}enable(){return!0}show(){this.getDOM().show()}hide(){this.getDOM().hide()}isVisible(){return"hidden"!==this.getDOM().style.visibility}destroy(){const{events:t}=this;t&&t.forEach(t=>{t.remove()})}}},function(t,e,n){t.exports=n(2)},function(t,e,n){const r=n(26),i=n(6),o=n(15);n(7);r.Editor=r,r.Util=i,r.Diagram=n(16),r.Page=n(1),r.Flow=n(95),r.Koni=n(102),r.Mind=n(107),r.Toolbar=n(121),r.Contextmenu=n(122),r.Command=n(15),r.BPMN=n(123),r.registerBehaviour=r.Page.registerBehaviour,r.registerNode=r.Page.registerNode,r.registerEdge=r.Page.registerEdge,r.registerGroup=r.Page.registerGroup,r.registerGuide=r.Page.registerGuide,r.registerCommand=o.registerCommand,t.exports=r},function(t,e,n){const r=n(21),i=n(6),o=n(15);t.exports=class extends r{getDefaultCfg(){return{_components:[],_command:{zoomDelta:.1,queue:[],current:0,clipboard:[]}}}_getComponentsBy(t){return this.get("_components").filter(t)}_bindCommands(t){i.each(t,t=>{const e=t.dataset,n=e.command;o[n]?i.addEventListener(t,"click",()=>{this.getCurrentPage().focusGraphWrapper(),this.executeCommand(n,e)}):console.warn("请设置有效的命令!")})}getCommands(){return this.get("_command").queue}getCurrentCommand(){const t=this.get("_command"),{queue:e,current:n}=t;return e[n-1]}executeCommand(t,e){i.isString(t)?o.execute(t,this,e):o.execute("common",this,{method:t},e)}commandEnable(t){return o.enable(t,this)}setCommandDOMenable(){const t=this.getComponentsByType("toolbar"),e=this.getComponentsByType("contextmenu"),n=[];t.forEach(t=>{i.each(t.getCommandDoms(),t=>{n.push(t)})}),e.forEach(t=>{i.each(t.getCommandDoms(),t=>{n.push(t)})}),i.each(n,t=>{const e=t.dataset.command;o.enable(e,this)?t.classList.remove("disable"):t.classList.add("disable")})}_onPageStatusChange(){this.setCommandDOMenable()}_afterAddContextmenu(){this.getCurrentPage()&&this.setCommandDOMenable()}_afterAddPage(t){this.setCommandDOMenable(),t.on("statuschange",t=>{this._onPageStatusChange(t)}),t.on("mousedown",()=>{this.getComponentsByType("contextmenu").forEach(t=>{t.hide()})}),t.on("contextmenu",e=>{const n=this.getComponentsByType("contextmenu"),r=t.getGraph().getCanvas().get("el"),o=i.getBoundingClientRect(r),a={x:e.x,y:e.y},{item:s}=e;s&&!s.isSelected&&(t.clearSelected(),t.setSelected(e.item,!0)),this.set("contextmenuPoint",a),e.domEvent.preventDefault(),n.forEach(t=>{t.show(),t.contextmenuPoint=a,t.move(o.left+e.domX,o.top+e.domY)})}),t.on("statuschange",t=>{this.getComponentsByType("contextmenu").forEach(e=>{e.switch(t.status)})}),this._bindShortcut(t)}_beforeAddToolbar(t){const e=t.getCommandDoms();this._bindCommands(e)}_beforeAddContextmenu(t){const e=t.getCommandDoms();t.bindEvent(),this._bindCommands(e)}getComponentsByType(t){return this._getComponentsBy(e=>e.type===t)}getCurrentPage(){const t=this.getComponentsByType("page");let e;return t.every(t=>!t.isActived||(e=t,!1)),e||(e=t[0]),e}getComponents(){return this.get("_components")}_shortcutEnable(t,e){const n=t.shortcutCodes,r=i.getKeyboradKey(e);let o=!1;for(let t=0;t{const n=this.getComponentsByType("contextmenu"),{domEvent:r}=t;n.forEach(t=>{t.hide()}),r.preventDefault();const i=o.list.filter(t=>t.shortcutCodes&&e[t.name]);for(let t=0;t{t.destroy()})}}},function(t,e,n){var r; /*! * EventEmitter v5.2.9 - git.io/ee * Unlicense - http://unlicense.org/ * Oliver Caldwell - https://oli.me.uk/ * @preserve */!function(e){"use strict";function i(){}var o=i.prototype,a=e.EventEmitter;function s(t,e){for(var n=t.length;n--;)if(t[n].listener===e)return n;return-1}function c(t){return function(){return this[t].apply(this,arguments)}}o.getListeners=function(t){var e,n,r=this._getEvents();if(t instanceof RegExp)for(n in e={},r)r.hasOwnProperty(n)&&t.test(n)&&(e[n]=r[n]);else e=r[t]||(r[t]=[]);return e},o.flattenListeners=function(t){var e,n=[];for(e=0;e"M9.75,9.60000014 L3.75,9.60000014 C3.33578644,9.60000014 3,9.2865995 3,8.90000022 C3,8.51340093 3.33578644,8.20000029 3.75,8.20000029 L9.75,8.20000029 C10.1642136,8.20000029 10.5,8.51340093 10.5,8.90000022 C10.5,9.2865995 10.1642136,9.60000014 9.75,9.60000014 M3,11.6999999 C3,11.3134006 3.33578644,11 3.75,11 L6.75,11 C7.16421356,11 7.5,11.3134006 7.5,11.6999999 C7.5,12.0865992 7.16421356,12.3999999 6.75,12.3999999 L3.75,12.3999999 C3.33578644,12.3999999 3,12.0865992 3,11.6999999 M3.75,13.7999997 L6.75,13.7999997 C7.16421356,13.7999997 7.5,14.1134004 7.5,14.4999996 C7.5,14.8865989 7.16421356,15.1999996 6.75,15.1999996 L3.75,15.1999996 C3.33578644,15.1999996 3,14.8865989 3,14.4999996 C3,14.1134004 3.33578644,13.7999997 3.75,13.7999997 M16.4985,4.00000072 L1.5015,4.00000072 C0.674533504,3.99922416 0.00289396564,4.6232696 0,5.39510058 L0,16.6048994 C0.00289396564,17.3767304 0.674533504,18.0007758 1.5015,17.9999993 L16.4985,17.9999993 C17.3254665,18.0007758 17.997106,17.3767304 18,16.6048994 L18,5.39510058 C17.997106,4.6232696 17.3254665,3.99922416 16.4985,4.00000072M19,13.9999993 L19,3 L5,3 L5,1.39510058 C5.00289397,0.623269599 5.6745335,-0.00077583787 6.5015,7.23978642e-07 L21.4985,7.23978642e-07 C22.3254665,-0.00077583787 22.997106,0.623269599 23,1.39510058 L23,12.6048994 C22.997106,13.3767304 22.3254665,14.0007758 21.4985,13.9999993 L19,13.9999993 Z",getCollapsedButtonPath:()=>r.getRectPath(0,0,14,14,2)+"M3,7L11,7",getExpandedButtonPath:()=>r.getRectPath(0,0,14,14,2)+"M3,7L11,7M7,3L7,11"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.presetPrimaryColors=e.presetPalettes=e.generate=void 0;var r,i=n(30),o=(r=i)&&r.__esModule?r:{default:r};var a={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},s={};Object.keys(a).forEach((function(t){s[t]=(0,o.default)(a[t])})),e.generate=o.default,e.presetPalettes=s,e.presetPrimaryColors=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=[],n=(0,o.default)(t),r=5;r>0;r-=1){var i=n.toHsv(),u=(0,o.default)({h:a(i,r,!0),s:s(i,r,!0),v:c(i,r,!0)}).toHexString();e.push(u)}e.push(n.toHexString());for(var h=1;h<=4;h+=1){var l=n.toHsv(),d=(0,o.default)({h:a(l,h),s:s(l,h),v:c(l,h)}).toHexString();e.push(d)}return e};var r,i=n(31),o=(r=i)&&r.__esModule?r:{default:r};function a(t,e,n){var r=void 0;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function s(t,e,n){if(0===t.h&&0===t.s)return t.s;var r=void 0;return(r=n?Math.round(100*t.s)-16*e:4===e?Math.round(100*t.s)+16:Math.round(100*t.s)+5*e)>100&&(r=100),n&&5===e&&r>10&&(r=10),r<6&&(r=6),r}function c(t,e,n){return n?Math.round(100*t.v)+5*e:Math.round(100*t.v)-15*e}},function(t,e,n){var r;!function(i){var o=/^\s+/,a=/\s+$/,s=0,c=i.round,u=i.min,h=i.max,l=i.random;function d(t,e){if(e=e||{},(t=t||"")instanceof d)return t;if(!(this instanceof d))return new d(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,s=null,c=null,l=!1,d=!1;"string"==typeof t&&(t=function(t){t=t.replace(o,"").replace(a,"").toLowerCase();var e,n=!1;if(I[t])t=I[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=H.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=H.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=H.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=H.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=H.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=H.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=H.hex8.exec(t))return{r:L(e[1]),g:L(e[2]),b:L(e[3]),a:D(e[4]),format:n?"name":"hex8"};if(e=H.hex6.exec(t))return{r:L(e[1]),g:L(e[2]),b:L(e[3]),format:n?"name":"hex"};if(e=H.hex4.exec(t))return{r:L(e[1]+""+e[1]),g:L(e[2]+""+e[2]),b:L(e[3]+""+e[3]),a:D(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=H.hex3.exec(t))return{r:L(e[1]+""+e[1]),g:L(e[2]+""+e[2]),b:L(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==typeof t&&(q(t.r)&&q(t.g)&&q(t.b)?(f=t.r,g=t.g,p=t.b,e={r:255*T(f,255),g:255*T(g,255),b:255*T(p,255)},l=!0,d="%"===String(t.r).substr(-1)?"prgb":"rgb"):q(t.h)&&q(t.s)&&q(t.v)?(r=X(t.s),s=X(t.v),e=function(t,e,n){t=6*T(t,360),e=T(e,100),n=T(n,100);var r=i.floor(t),o=t-r,a=n*(1-e),s=n*(1-o*e),c=n*(1-(1-o)*e),u=r%6;return{r:255*[n,s,a,a,c,n][u],g:255*[c,n,n,s,a,a][u],b:255*[a,a,c,n,n,s][u]}}(t.h,r,s),l=!0,d="hsv"):q(t.h)&&q(t.s)&&q(t.l)&&(r=X(t.s),c=X(t.l),e=function(t,e,n){var r,i,o;function a(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=T(t,360),e=T(e,100),n=T(n,100),0===e)r=i=o=n;else{var s=n<.5?n*(1+e):n+e-n*e,c=2*n-s;r=a(c,s,t+1/3),i=a(c,s,t),o=a(c,s,t-1/3)}return{r:255*r,g:255*i,b:255*o}}(t.h,r,c),l=!0,d="hsl"),t.hasOwnProperty("a")&&(n=t.a));var f,g,p;return n=B(n),{ok:l,format:t.format||d,r:u(255,h(e.r,0)),g:u(255,h(e.g,0)),b:u(255,h(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=c(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=n.ok,this._tc_id=s++}function f(t,e,n){t=T(t,255),e=T(e,255),n=T(n,255);var r,i,o=h(t,e,n),a=u(t,e,n),s=(o+a)/2;if(o==a)r=i=0;else{var c=o-a;switch(i=s>.5?c/(2-o-a):c/(o+a),o){case t:r=(e-n)/c+(e>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(d(r));return o}function O(t,e){e=e||6;for(var n=d(t).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(d({h:r,s:i,v:o})),o=(o+s)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:i.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:i.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:i.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=B(t),this._roundA=c(100*this._a)/100,this},toHsv:function(){var t=g(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=g(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=f(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=f(this._r,this._g,this._b),e=c(360*t.h),n=c(100*t.s),r=c(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return p(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var o=[Y(c(t).toString(16)),Y(c(e).toString(16)),Y(c(n).toString(16)),Y(G(r))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(100*T(this._r,255))+"%",g:c(100*T(this._g,255))+"%",b:c(100*T(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+c(100*T(this._r,255))+"%, "+c(100*T(this._g,255))+"%, "+c(100*T(this._b,255))+"%)":"rgba("+c(100*T(this._r,255))+"%, "+c(100*T(this._g,255))+"%, "+c(100*T(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(k[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+m(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=d(t);n="#"+m(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(M,arguments)},desaturate:function(){return this._applyModification(v,arguments)},saturate:function(){return this._applyModification(x,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(_,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(O,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(A,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},d.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:X(t[r]));t=n}return d(t,e)},d.equals=function(t,e){return!(!t||!e)&&d(t).toRgbString()==d(e).toRgbString()},d.random=function(){return d.fromRatio({r:l(),g:l(),b:l()})},d.mix=function(t,e,n){n=0===n?0:n||50;var r=d(t).toRgb(),i=d(e).toRgb(),o=n/100;return d({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},d.readability=function(t,e){var n=d(t),r=d(e);return(i.max(n.getLuminance(),r.getLuminance())+.05)/(i.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(t,e,n){var r,i,o=d.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},d.mostReadable=function(t,e,n){var r,i,o,a,s=null,c=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var u=0;uc&&(c=r,s=d(e[u]));return d.isReadable(t,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,d.mostReadable(t,["#fff","#000"],n))};var I=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},k=d.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(I);function B(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function T(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=u(e,h(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),i.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function N(t){return u(1,h(0,t))}function L(t){return parseInt(t,16)}function Y(t){return 1==t.length?"0"+t:""+t}function X(t){return t<=1&&(t=100*t+"%"),t}function G(t){return i.round(255*parseFloat(t)).toString(16)}function D(t){return L(t)/255}var F,j,R,H=(j="[\\s|\\(]+("+(F="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",R="[\\s|\\(]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")[,|\\s]+("+F+")\\s*\\)?",{CSS_UNIT:new RegExp(F),rgb:new RegExp("rgb"+j),rgba:new RegExp("rgba"+R),hsl:new RegExp("hsl"+j),hsla:new RegExp("hsla"+R),hsv:new RegExp("hsv"+j),hsva:new RegExp("hsva"+R),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function q(t){return!!H.CSS_UNIT.exec(t)}t.exports?t.exports=d:void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}(Math)},function(t,e,n){const r=n(18);function i(t){const e=t.getCurrentPage();this.matrixCache=e.getMatrix().slice(0),this._zoom(t),e.updateStatus()}function o(t){t.getCurrentPage().updateMatrix(this.matrixCache)}r.registerCommand("zoomTo",{_zoom(t){t.getCurrentPage().zoom(Number(this.zoom))},queue:!1,execute:i,back:o}),r.registerCommand("zoomIn",{enable(t){const e=t.getCurrentPage(),n=e.getMaxZoom(),r=e.getMinZoom(),i=e.getZoom();return i=i&&(o=i),e.zoom(o)},queue:!1,execute:i,back:o,shortcutCodes:[["metaKey","="],["ctrlKey","="]]}),r.registerCommand("zoomOut",{enable(t){const e=t.getCurrentPage(),n=e.getMaxZoom(),r=e.getMinZoom(),i=e.getZoom();return i>r||i===n},_zoom(t){const e=t.getCurrentPage(),n=e.getZoom(),r=e.getMinZoom();let i=n-t.get("_command").zoomDelta;i<=r&&(i=r),e.zoom(i)},queue:!1,execute:i,back:o,shortcutCodes:[["metaKey","-"],["ctrlKey","-"]]}),r.registerCommand("autoZoom",{enable:()=>!0,_zoom(t){t.getCurrentPage().autoZoom()},queue:!1,execute:i,back:o}),r.registerCommand("resetZoom",{enable:()=>!0,_zoom(t){t.getCurrentPage().resetZoom()},queue:!1,execute:i,back:o,shortcutCodes:[["metaKey","0"],["ctrlKey","0"]]})},function(t,e,n){const r=n(18);r.registerCommand("collapseExpand",{getItem(t){const e=t.getCurrentPage(),n=e.getGraph();return this.itemId?n.find(this.itemId):e.getSelected()[0]},enable(t){const e=this.getItem(t);return e&&!1!==e.collapseExpand&&e.getChildren().length>0},execute(t){const e=t.getCurrentPage(),n=e.getGraph(),r=this.getItem(t);r.getModel().collapsed?(n.update(r,{collapsed:!1}),r.getInnerEdges&&r.getInnerEdges().forEach(t=>{t.update()}),this.toCollapsed=!1):(n.update(r,{collapsed:!0}),this.toCollapsed=!0),e.clearSelected(),e.setSelected(r,!0),1===this.executeTimes&&(this.itemId=r.id)},back(t){const e=t.getCurrentPage(),n=e.getGraph(),r=this.getItem(t);this.toCollapsed?n.update(r,{collapsed:!1}):n.update(r,{collapsed:!0}),e.clearSelected(),e.setSelected(r,!0)},shortcutCodes:[["metaKey","/"],["ctrlKey","/"]]}),r.registerCommand("collapse",{enable(t){const e=this.getItem(t);return e&&!1!==e.collapseExpand&&e.getChildren().length>0&&!e.getModel().collapsed}},"collapseExpand"),r.registerCommand("expand",{enable(t){const e=this.getItem(t);return e&&!1!==e.collapseExpand&&e.getChildren().length>0&&e.getModel().collapsed}},"collapseExpand")},function(t,e,n){const r=n(4),i={INIT:"_initGraph"};i.AUGMENT={_initGraph(){const t=this.get("graph"),e=new(this.get("graphConstructor"))({page:this,...t});e.draw(),this.set("_graph",e)},changeMode(t){this.get("_graph").changeMode(t)},updateMatrix(t){this.get("_graph").updateMatrix(t)},getMode(){return this.get("_graph").get("mode")},getMatrix(){return this.get("_graph").getMatrix()},getZoom(){return this.get("_graph").getMatrix()[0]},getMaxZoom(){return this.get("_graph").get("maxZoom")},getMinZoom(){return this.get("_graph").get("minZoom")},getGraph(){return this.get("_graph")},getItems(){return this.get("_graph").getItems()},getNodes(){return this.get("_graph").getNodes()},translate(t,e){return this.get("_graph").translate(t,e)},getEdges(){return this.get("_graph").getEdges()},getGroups(){return this.get("_graph").getGroups()},render(){return this.get("_graph").render(),this},add(t,e){return this.get("_graph").add(t,e),this},focusPointByDom(t){return this.get("_graph").focusPointByDom(t),this},focusPoint(t){return this.get("_graph").focusPoint(t),this},find(t){return this.get("_graph").find(t)},focus(t){const e=this.get("_graph"),n=e.find(t);if(n){const t=n.getCenter();e.focusPoint(t)}return this},save(){return this.get("_graph").save()},read(t){this.get("_graph").read(t)},clear(){this.get("_graph").clear()},remove(t){return this.get("_graph").remove(t),this},update(t,e){return this.get("_graph").update(t,e),this},zoom(t,e){return this.get("_graph").zoom(t,e),this},getDomPoint(t){return this.get("_graph").getDomPoint(t)},getPoint(t){return this.get("_graph").getPoint(t)},zoomByDom(t,e){const n=this.get("_graph"),r=n.getPoint(t);return n.zoom(r,e),this},autoZoom(){return this.get("_graph").autoZoom(),this},resetZoom(){const t=this.get("_graph"),e=t.getWidth(),n=t.getHeight();return t.zoomByDom({x:e/2,y:n/2},1),this},css(t){const e=this.get("_graph").getMouseEventWrapper();r.modifyCSS(e,t)},setCapture(t){this.get("_graph").getRootGroup().set("capture",t)},destroy(){this.get("_graph").destroy()},delete(){const t=this.getSelected(),e=this.get("_graph");r.each(t,t=>{e.remove(t)})}},t.exports=i},function(t,e,n){const r=n(36),i=n(4),o={CFG:{grid:void 0},INIT:"_initGrid"};o.AUGMENT={_initGrid(){const t=this.get("grid"),e=this.get("_graph");if(t){const n=new r({page:this,graph:e,...t});this.setController("grid",n)}},showGrid(t){const e=this.get("_graph");let n=this.getController("grid");n||(t?i.isObject(t)&&this.set("grid",t):this.set("grid",!0),this._initGrid()),n=this.getController("grid"),n.show(),e.draw()},hideGrid(){const t=this.get("_graph"),e=this.getController("grid");e&&e.hide(),t.draw()},getGridCell(){return this.getController("grid").getCell()}},t.exports=o},function(t,e,n){const r=n(9),i=n(14),o=n(4);t.exports=class extends r{getDefaultCfg(){return{cell:16,line:i.gridStyle,type:"point",visible:!0}}init(){this._draw(),this._onViewPortChange(),!this.visible&&this.hide()}_onViewPortChange(){const t=this.graph;t.on("afterviewportchange",()=>{this.update()}),t.on("beforechangesize",()=>{this.update()})}_draw(){const t=this.graph,e=this._getPath(),n=t.getRootGroup(),r=o.mix({},this.line),i=t.getMatrix(),a=this.type,s="line"===a?1/i[0]:2/i[0];"point"===a&&(r.lineDash=null),r.lineWidth=s,r.path=e;const c=n.addShape("path",{attrs:r,capture:!1,zIndex:0});o.toBack(c,n),this.gridEl=c}show(){this.gridEl.show(),this.visible=!0}hide(){this.gridEl.hide(),this.visible=!1}_getLinePath(){const t=this.graph,e=t.get("width"),n=t.get("height"),r=t.getPoint({x:0,y:0}),i=t.getPoint({x:e,y:n}),o=this.cell,a=Math.ceil(r.x/o)*o,s=Math.ceil(r.y/o)*o,c=[];for(let t=0;t<=i.x-r.x;t+=o){const e=a+t;c.push(["M",e,r.y]),c.push(["L",e,i.y])}for(let t=0;t<=i.y-r.y;t+=o){const e=s+t;c.push(["M",r.x,e]),c.push(["L",i.x,e])}return c}_getPointPath(){const t=this.graph,e=t.get("width"),n=t.get("height"),r=t.getPoint({x:0,y:0}),i=2/t.getMatrix()[0],o=t.getPoint({x:e,y:n}),a=this.getCell(),s=Math.ceil(r.x/a)*a,c=Math.ceil(r.y/a)*a,u=[];for(let t=0;t<=o.x-r.x;t+=a){const e=s+t;for(let t=0;t<=o.y-r.y;t+=a){const n=c+t;u.push(["M",e,n]),u.push(["L",e+i,n])}}return u}getCell(){const t=this.cell,e=this.graph.getMatrix()[0];return t*e<9.6?9.6/e:t}_getPath(){const t=this.type;return this["_get"+o.upperFirst(t)+"Path"]()}update(t){o.mix(this,t);const e=this._getPath(),n=this.gridEl,r=this.graph.getMatrix(),i="line"===this.type?1/r[0]:2/r[0];n.attr("lineWidth",i),n.attr("path",e)}destroy(){const t=this.gridEl;t&&t.remove()}}},function(t,e){const n={};function r(t,e,n){t.on(n,t=>{e.emit(n,t)}),t.on("node:"+n,t=>{e.emit("node:"+n,t)}),t.on("edge:"+n,t=>{e.emit("edge:"+n,t)}),t.on("group:"+n,t=>{e.emit("group:"+n,t)}),t.on("anchor:"+n,t=>{e.emit("anchor:"+n,t)})}n.INIT="_initEvent",n.AUGMENT={_initEvent(){const t=this.get("_graph");r(t,this,"click"),r(t,this,"dblclick"),r(t,this,"mouseenter"),r(t,this,"mouseleave"),r(t,this,"mousedown"),r(t,this,"mouseup"),r(t,this,"contextmenu"),t.on("keydown",t=>{this.emit("keydown",t)}),t.on("keyup",t=>{this.emit("keyup",t)}),t.on("beforechange",t=>{this.emit("beforechange",t)}),t.on("afterchange",t=>{this.emit("afterchange",t)}),t.on("afterviewportchange",t=>{this.emit("afterviewportchange",t),t.updateMatrix[0]!==t.originMatrix[0]&&this.emit("afterzoom",t)}),t.on("beforeviewportchange",t=>{this.emit("beforeviewportchange",t),t.updateMatrix[0]!==t.originMatrix[0]&&this.emit("beforezoom",t)})}},t.exports=n},function(t,e,n){const r=n(4),i={CFG:{selectable:!0,multiSelectable:!0,_selectedCache:{}},INIT:"_initSelected"};i.AUGMENT={_initSelected(){const t=this.get("_graph");t.on("afteritemdraw",({item:t})=>{t.isSelected&&this.setItemSelected(t)}),t.on("beforeitemdestroy",t=>{this.clearItemSelected(t.item)})},setItemSelected(t){const e=this.get("_graph").getShapeObj(t).getSelectedStyle(t),n=t.getKeyShape();this.get("_selectedCache")[t.id]=t,e&&n.attr(e),t.isEdge&&(t.startArrow&&t.startArrow.attr({fill:e.stroke}),t.endArrow&&t.endArrow.attr({fill:e.stroke}))},clearItemSelected(t){const e=this.get("_graph"),n=t.getKeyShape(),i=e.getShapeObj(t),o=i.getStyle(t),a=i.getSelectedStyle(t),s=this.get("_selectedCache"),c=r.getContrast(o,a);if(n.attr(c),t.isEdge)try{t.startArrow&&t.startArrow.attr({fill:c.stroke}),t.endArrow&&t.endArrow.attr({fill:c.stroke})}catch(t){}delete s[t.id]},setSelected(t,e){const n=this.get("selectable"),i=this.get("_graph");if(!n)return;let o;o=r.isArray(t)?t:[t],r.each(o,t=>{r.isString(t)&&(t=i.find(t)),t&&!t.destroyed&&(e?(this.emit("beforeitemselected",{item:t}),this.setItemSelected(t),this.emit("afteritemselected",{item:t})):(this.emit("beforeitemunselected",{item:t}),this.clearItemSelected(t),this.emit("afteritemunselected",{item:t})),t.isSelected=e,this.updateStatus(),i.draw())})},getSelected(){const t=this.get("_selectedCache");return r.objectToValues(t)},clearSelected(){const t=this.get("_graph"),e=this.get("_selectedCache");r.each(e,t=>{t.isSelected&&this.setSelected(t,!1)}),t.draw()}},t.exports=i},function(t,e,n){const r=n(4),i={CFG:{activeable:!0,_activedCache:{}},INIT:"_initActived"};i.AUGMENT={_initActived(){const t=this.get("_graph");t.on("afteritemdraw",({item:t})=>{t.isActived&&this.setItemActived(t)}),t.on("beforeitemdestroy",t=>{this.clearItemActived(t.item)})},setItemActived(t){const e=this.get("_graph").getShapeObj(t),n=this.get("_activedCache"),r=e.getActivedStyle(t),i=t.getKeyShape();n[t.id]=t,r&&i.attr(r),t.isEdge&&(t.startArrow&&t.startArrow.attr({fill:r.stroke}),t.endArrow&&t.endArrow.attr({fill:r.stroke}))},clearItemActived(t){const e=this.get("_graph"),n=t.getKeyShape(),i=e.getShapeObj(t),o=i.getStyle(t),a=this.get("_activedCache"),s=i.getActivedStyle(t),c=r.getContrast(o,s);n.attr(c);try{t.isEdge&&(t.startArrow&&t.startArrow.attr({fill:c.stroke}),t.endArrow&&t.endArrow.attr({fill:c.stroke}))}catch(t){}delete a[t.id]},setActived(t,e){const n=this.get("activeable"),i=this.get("_graph");if(!n)return;let o;o=r.isArray(t)?t:[t],r.each(o,t=>{r.isString(t)&&(t=i.find(t)),t&&!t.destroyed&&(e?(this.emit("beforeitemactived",{item:t}),this.setItemActived(t),this.emit("afteritemactived",{item:t})):(this.emit("beforeitemunactived",{item:t}),this.clearItemActived(t),this.emit("afteritemunactived",{item:t})),t.isActived=e)}),i.draw()},getActived(){const t=this.get("_activedCache");return r.objectToValues(t)},clearActived(){const t=this.get("_graph"),e=this.get("_activedCache");r.each(e,t=>{t.isActived&&this.setActived(t,!1)}),t.draw()}},t.exports=i},function(t,e,n){const r=n(41),i={CFG:{align:{}},INIT:"_initAlign"};i.AUGMENT={_initAlign(){const t=this.get("align"),e=this.get("_graph"),n=new r({flow:this,graph:e,...t});this.setController("align",n)},align(t,e,n){return this.getController("align").align(t,e,n)},clearAlignLine(){return this.getController("align").clearAlignLine()}},t.exports=i},function(t,e,n){const r=n(9),i=n(14),o=n(4);function a(t,e){return{line:t,point:e,dis:o.pointLineDistance(t[0],t[1],t[2],t[3],e.x,e.y)}}t.exports=class extends r{getDefaultCfg(){return{line:i.alignLineStyle,item:!0,grid:!1,tolerance:5,_horizontalLines:{},_verticalLines:{},_alignLines:[]}}init(){this.item&&this._cacheBoxLine()}_cacheBoxLine(){const t=this.graph,e=this._horizontalLines,n=this._verticalLines,r=this.item;t.on("afteritemdraw",t=>{const i=t.item;if(!o.isEdge(i)){const t=i.getBBox();!0===r||"horizontal"===r?(e[i.id+"tltr"]=[t.minX,t.minY,t.maxX,t.minY,i],e[i.id+"lcrc"]=[t.minX,t.centerY,t.maxX,t.centerY,i],e[i.id+"blbr"]=[t.minX,t.maxY,t.maxX,t.maxY,i]):"center"===r&&(e[i.id+"lcrc"]=[t.minX,t.centerY,t.maxX,t.centerY,i]),!0===r||"vertical"===r?(n[i.id+"tlbl"]=[t.minX,t.minY,t.minX,t.maxY,i],n[i.id+"tcbc"]=[t.centerX,t.minY,t.centerX,t.maxY,i],n[i.id+"trbr"]=[t.maxX,t.minY,t.maxX,t.maxY,i]):"center"===r&&(n[i.id+"tcbc"]=[t.centerX,t.minY,t.centerX,t.maxY,i])}}),t.on("beforeitemdestroy",t=>{const r=t.item;delete e[r.id+"tltr"],delete e[r.id+"lcrc"],delete e[r.id+"blbr"],delete n[r.id+"tlbl"],delete n[r.id+"tcbc"],delete n[r.id+"trbr"]})}align(t,e){const n=o.mix({},t),r=this.flow.getController("grid");return this.grid&&r&&r.visible&&this._gridAlign(t,e),this.item&&this._itemAlign(t,e,n),t}_gridAlign(t,e){const n=this.flow,r=this.grid,i=n.getGridCell();if("cc"===r){const n=Math.round((t.x+e.width/2)/i)*i,r=Math.round((t.y+e.height/2)/i)*i;t.x=n-e.width/2,t.y=r-e.height/2}else t.x=Math.round(t.x/i)*i,t.y=Math.round(t.y/i)*i}_itemAlign(t,e,n){const r=this._horizontalLines,i=this._verticalLines,s=this.tolerance,c={x:n.x+e.width/2,y:n.y},u={x:n.x+e.width/2,y:n.y+e.height/2},h={x:n.x+e.width/2,y:n.y+e.height},l={x:n.x,y:n.y+e.height/2},d={x:n.x+e.width,y:n.y+e.height/2},f=[],g=[];let p=null;if(this.clearAlignLine(),o.each(r,t=>{t[4].isVisible()&&(f.push(a(t,c)),f.push(a(t,u)),f.push(a(t,h)))}),o.each(i,t=>{t[4].isVisible()&&(g.push(a(t,l)),g.push(a(t,u)),g.push(a(t,d)))}),f.sort((t,e)=>t.dis-e.dis),g.sort((t,e)=>t.dis-e.dis),0!==f.length&&f[0].dis{t.remove()}),this._alignLines=[]}_addAlignLine(t){const e=t.bbox,n=this.graph.getRootGroup(),r=this.line,i=this._alignLines;"item"===t.type&&(t.horizontals&&o.each(t.horizontals,t=>{const a=t.line,s=t.point,c=(a[0]+a[2])/2;let u,h;s.x{const a=t.line,s=t.point,c=(a[1]+a[3])/2;let u,h;s.y',{position:"absolute",visibility:"hidden","z-index":"2",padding:"0px 2px 0px 0px",resize:"none",width:"auto",height:"auto",outline:"none",border:"1px solid #1890FF","transform-origin":"left top","max-width":"320px",background:"white","box-sizing":"content-box"});t.getGraphContainer().appendChild(e),e.on("blur",e=>{e.stopPropagation(),!t.destroyed&&this.endEditLabel()}),e.on("keydown",t=>{t.stopPropagation();const e=r.getKeyboradKey(t);(t.metaKey&&"s"===e||t.ctrlKey&&"s"===e)&&t.preventDefault(),"Enter"!==e&&"Escape"!==e||this.endEditLabel()}),this.set("labelTextArea",e),t.on("beforeviewportchange",()=>{e.focusItem&&this.setLabelEditorBeginPosition(e.focusItem)})}},_getLabelTextAreaBox(t,e,n=[0,0]){e&&t.attr("text",e);const i=this.getGraph().getRootGroup(),o=r.getBBox(t,i);return{minX:o.minX-n[1],minY:o.minY-n[0],maxX:o.maxX+n[1],maxY:o.maxY+n[0]}},setLabelEditorBeginPosition(t){const e=this.get("labelTextArea"),n=t.getLabel();if(n){const t=this._getLabelTextAreaBox(n),r=n.attr("lineHeight"),i=n.attr("fontSize"),o={x:t.minX,y:t.minY-r/4+i/4-1,width:t.maxX-t.minX,height:t.maxY-t.minY};e.css({top:o.y+"px",left:o.x+"px"}),e.labelPoint=o}else{const n=this.getGraph().getRootGroup(),i=t.getKeyShape(),o=r.getBBox(i,n),a={x:o.minY+(o.maxY-o.minY-e.height())/2,y:(o.minX+o.maxX)/2};e.css({top:a.x+"px",left:a.y+"px"}),e.labelPoint=a}},beginEditLabel(t){const e=this.get("labelTextArea"),n=this.getGraph();if(r.isString(t)&&(t=n.find(t)),t&&!t.destroyed&&e){this.setSignal("preventWheelPan",!0);const r=t.getModel(),i=t.getLabel(),o=n.getZoom();if(e.focusItem=t,i){const t=i.attr("lineHeight"),n=this._getLabelTextAreaBox(i),a=(n.maxX-n.minX)/o,s=(n.maxY-n.minY+t/4)/o;e.innerHTML=r.label,e.innerHTML=r.label,e.css({"min-width":a+"px","min-height":s+"px",visibility:"visible","font-family":i.attr("fontFamily"),"line-height":t+"px","font-size":i.attr("fontSize")+"px",transform:"scale("+o+")"})}else e.innerHTML="",e.css({"min-width":"auto","min-height":"auto"});this.setLabelEditorBeginPosition(t),e.css({visibility:"visible"}),e.focus(),document.execCommand("selectAll",!1,null)}},endEditLabel(){const t=this.get("labelTextArea");if(this.setSignal("preventWheelPan",!1),t){const e=t.focusItem;if(e){const n=e.getModel(),r=this.editor;n.label!==t.textContent&&r.executeCommand("update",{action:"updateLabel",itemId:e.id,updateModel:{label:t.textContent}}),t.hide(),t.focusItem=void 0,this.focusGraphWrapper()}}}},t.exports=i},function(t,e){const n={};n.AUGMENT={updateStatus(){const t=this.getSelected();let e;0===t.length?e="canvas-selected":1===t.length?t[0].isNode?e="node-selected":t[0].isEdge?e="edge-selected":t[0].isGroup&&(e="group-selected"):e="multi-selected",this.emit("statuschange",{status:e})}},t.exports=n},function(t,e,n){n(45),n(46),n(47),n(48),n(49),n(50),n(51),n(52),n(53),n(54),n(55),n(56),n(57),n(58),n(59),n(60),n(61),n(62)},function(t,e,n){const r=n(3),i=n(4);r.registerBehaviour("panBlank",i.getPanCanvasBehaviour(!0))},function(t,e,n){n(3).registerBehaviour("hoverButton",t=>{t.getGraph().behaviourOn("mouseenter",e=>{t.getSignal("panningItem")||e.shape&&e.shape.isButton&&t.css({cursor:"pointer"})})})},function(t,e,n){const r=n(3),i=n(4);r.registerBehaviour("panCanvas",i.getPanCanvasBehaviour())},function(t,e,n){const r=n(3),i=n(14),o=n(4);r.registerBehaviour("wheelChangeViewport",t=>{const e=t.getGraph();let n;e.behaviourOn("wheel",t=>{const{domEvent:e}=t;e.preventDefault()}),e.behaviourOn("wheel",o.throttle((function(r){if(t.getSignal("preventWheelPan"))return;const{domEvent:a}=r,s=t.getSignal("wheelZoom");n||t.setCapture(!1);if(s){const t=a.wheelDelta,n=1.05;if(Math.abs(t)>10){const i=e.getMatrix()[0];t>0?e.zoom({x:r.x,y:r.y},i*n):e.zoom({x:r.x,y:r.y},i*(1/n))}}else{const n=[],r=e.getMatrix();o.mat3.translate(n,r,[a.wheelDeltaX*i.wheelPanRatio,a.wheelDeltaY*i.wheelPanRatio]),t.translateLimt(n)&&e.updateMatrix(n)}n&&clearTimeout(n),n=setTimeout(()=>{t.setCapture(!0),n=void 0},50)}),16))})},function(t,e,n){n(3).registerBehaviour("processPanItem",t=>{const e=t.getGraph();e.behaviourOn("mousemove",n=>{const r=t.get("panItemDelegation");if(r){const i=t.get("panItemStartPoint"),o=t.get("panItemStartBox"),a=n.x-i.x,s=n.y-i.y,c=t.align({x:o.minX+a,y:o.minY+s},{width:o.width,height:o.height});r.attr({x:c.x,y:c.y}),e.emit("itempanning",n),e.draw()}})})},function(t,e,n){n(3).registerBehaviour("startPanItem",t=>{const e=t.getGraph(),n=e.getRootGroup();e.behaviourOn("dragstart",r=>{if(2===r.button||!r.item||!r.item.isNode&&!r.item.isGroup)return;const i=r.item;let o;if(o=i.isSelected?t.getSelected():[i],o=o.filter(t=>t.isNode||t.isGroup),o[0]&&!1!==o[0].dragable){e.emit("beforepanitem",{items:o}),e.emit("beforeshowdelegation",{items:o});const i=t.getDelegation(o,n),a=i.getBBox();t.setSignal("panningItem",!0),t.set("panItems",o),t.set("panItemDelegation",i),t.set("panItemStartBox",a),t.set("panItemStartPoint",{x:r.x,y:r.y}),e.draw()}})})},function(t,e,n){n(3).registerBehaviour("endPanItem",t=>{const e=t.getGraph();e.behaviourOn("panitemend",()=>{const n=t.get("panItemDelegation");n&&(n.remove(),e.draw()),t.setSignal("panningItem",!1),t.set("panItemDelegation",void 0),t.set("panItemStartPoint",void 0),t.set("panItemStartBox",void 0),t.set("panItems",void 0)}),e.behaviourOn("canvas:mouseleave",()=>{t.get("panItems")&&(t.clearAlignLine(),e.emit("panitemend"))})})},function(t,e,n){n(3).registerBehaviour("dblclickItemEditLabel",t=>{t.getGraph().behaviourOn("node:dblclick",e=>{e.shape&&!e.shape.isButton&&t.beginEditLabel(e.item)})})},function(t,e,n){n(3).registerBehaviour("clickCanvasSelected",t=>{const e=t.getGraph();e.behaviourOn("click",e=>{e.shape||(t.clearSelected(),t.clearActived(),t.updateStatus())}),e.behaviourOn("contextmenu",e=>{e.shape||(t.clearSelected(),t.clearActived(),t.updateStatus())})})},function(t,e,n){n(3).registerBehaviour("clickCollapsedButton",t=>{const e=t.getGraph();e.behaviourOn("click",n=>{const r=n.item,i=n.shape;if(r&&i&&i.isCollapsedButton){const n=t.editor;n?n.executeCommand("collapseExpand",{itemId:r.id}):e.update(r,{collapsed:!0})}})})},function(t,e,n){n(3).registerBehaviour("clickEdgeSelected",t=>{t.getGraph().behaviourOn("edge:click",e=>{t.get("multiSelectable")&&!0===t.getSignal("shiftKeyDown")||(t.clearActived(),t.clearSelected()),t.setSelected(e.item.id,!0)})})},function(t,e,n){n(3).registerBehaviour("clickExpandedButton",t=>{const e=t.getGraph();e.behaviourOn("click",n=>{const r=n.item,i=n.shape;if(r&&i&&i.isExpandedButton){const n=t.editor;n?n.executeCommand("collapseExpand",{itemId:r.id}):e.update(r,{collapsed:!1})}})})},function(t,e,n){n(3).registerBehaviour("clickGroupSelected",t=>{t.getGraph().behaviourOn("group:click",e=>{t.get("multiSelectable")&&!0===t.getSignal("shiftKeyDown")||(t.clearActived(),t.clearSelected()),t.setSelected(e.item.id,!0)})})},function(t,e,n){n(3).registerBehaviour("clickNodeSelected",t=>{t.getGraph().behaviourOn("node:click",e=>{t.get("multiSelectable")&&!0===t.getSignal("shiftKeyDown")||(t.clearActived(),t.clearSelected()),t.setSelected(e.item.id,!0)})})},function(t,e,n){n(3).registerBehaviour("hoverNodeActived",t=>{const e=t.getGraph();let n;e.behaviourOn("node:mouseenter",e=>{const{item:r}=e;!1!==r.getShapeObj().panAble&&t.css({cursor:"move"}),t.getSignal("panningItem")||t.getSignal("dragEdge")||e.item&&e.item.isSelected||(n=e.item,t.setActived(n,!0))}),e.behaviourOn("node:mouseleave",e=>{const r=e.toShape;n&&(r&&r.isAnchor&&r.getItem()===n||t.getSignal("dragEdge")||(n.isSelected||t.setActived(n,!1),n=void 0))})})},function(t,e,n){n(3).registerBehaviour("hoverGroupActived",t=>{const e=t.getGraph();e.behaviourOn("mouseenter",e=>{t.getSignal("panningItem")||e.item&&e.item.isSelected||t.getSignal("dragEdge")||e.shape&&e.shape.isGroupKeyShape&&(t.css({cursor:"move"}),t.setActived(e.item,!0))}),e.behaviourOn("group:mouseleave",e=>{e.item.isActived&&!e.item.isSelected&&t.setActived(e.item,!1)})})},function(t,e,n){n(3).registerBehaviour("hoverEdgeActived",t=>{const e=t.getGraph();e.behaviourOn("edge:mouseenter",e=>{t.getSignal("panningItem")||e.item&&e.item.isSelected||t.getSignal("dragEdge")||t.setActived(e.item,!0)}),e.behaviourOn("edge:mouseleave",e=>{t.setActived(e.item,!1)})})},function(t,e,n){n(3).registerBehaviour("keydownCmdWheelZoom",t=>{const e=t.getGraph();e.behaviourOn("keydown",e=>{91===e.domEvent.keyCode&&t.setSignal("wheelZoom",!0)}),e.behaviourOn("keyup",e=>{91===e.domEvent.keyCode&&t.setSignal("wheelZoom",!1)})})},function(t,e,n){const r=n(22);t.exports={dragingEdgeEndPoint({endPointType:t,edgeModel:e,graph:n,delegation:r,startPoint:i,ev:o,source:a,target:s}){const{item:c}=o,u="source"===t?[o,i]:[i,o];c&&("source"===t?s=c:a=c);const h=n.getShapeObj("edge",e).getPathByPoints({points:u,source:a,target:s});r.attr("path",h),n.draw()},panGroup(t,e,n,i){const o=t.getModel();r.traverseTree(t,r=>{if("node"===r.type){const t=r.getModel();i.update(r,{x:t.x+e,y:t.y+n})}t.getCrossEdges&&t.getCrossEdges().forEach(t=>{t.update()})},t=>"group"===t.type?t.getChildren():[]),i.update(t,{x:o.x+e,y:o.y+n})},dropUpdateEdge({ev:t,endPointType:e,model:n,diagram:r}){const i=r.get("noEndEdge"),o=r.get("linkAnchor"),a=r.get("linkNode"),{item:s,shape:c,x:u,y:h}=t;if(r.getGraph().emit("beforedropedge"),c){if(o&&c.isAnchor&&c.hasHotspot){const t=c,r=t.getItem();return"target"===e?(n.target=r.id,n.targetAnchor=t.getIndex(),!0):(n.source=r.id,n.sourceAnchor=t.getIndex(),!0)}if(a&&s&&s.isNode)return"target"===e?(n.target=s.id,!0):(n.source=s.id,!0)}else if(i)return"target"===e?(n.target={x:u,y:h},!0):(n.source={x:u,y:h},!0);return!1}}},function(t,e){t.exports={rectRectCrossAlgorithm(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return n>i||r>o},euclideanDistance:{pointPoint(t,e){const n=Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2);return Math.sqrt(n)}}}},function(t,e,n){const r={},i=n(2);r.AUGMENT={changeAddEdgeModel(t){this.set("addEdgeModel",t)},cancelAdd(){this.set("addType",void 0),this.set("addModel",void 0),this.changeMode("default")},beginAdd(t,e){this.set("addType",t),this.set("addModel",e),this.changeMode("add")},endAdd(){this.set("addType",void 0),this.set("addModel",void 0),this.changeMode("default")},delete(){const t=this.getSelected(),e=this.get("_graph");i.each(t,t=>{e.remove(t)})},toBack(){const t=this.getSelected(),e=this.get("_graph");t.sort((t,e)=>{const n=t.getGraphicGroup(),r=e.getGraphicGroup();return i.getIndex(r)-i.getIndex(n)}),t.forEach(t=>{e.toBack(t)})},toFront(){const t=this.getSelected(),e=this.get("_graph");t.sort((t,e)=>{const n=t.getGraphicGroup(),r=e.getGraphicGroup();return i.getIndex(n)-i.getIndex(r)}),t.forEach(t=>{e.toFront(t)})},addGroup(t){const e=this.get("_graph"),n=this.getSelected();let r,o=!0;if(0===n.length)return;t||(t={label:"新建分组"}),i.setId(t),e.add("group",t),e.toFront(t.id);const a=e.find(t.id);if(n.forEach(t=>{const e=t.getParent();e&&(r?r!==e&&(o=!1):r=e)}),!o)return void console.warn("add group elements must have the same parent");r&&(t.parent=r.getModel().id),n.forEach(n=>{e.update(n,{parent:t.id})});const s=a.getInnerEdges();a.deepEach(t=>{e.toFront(t)}),s.forEach(t=>{e.toFront(t)})},unGroup(){const t=this.get("_graph"),e=this.getSelected(),n=e[0];1===e.length&&i.isGroup(n)&&(n.getChildren().forEach(e=>{t.update(e,{parent:void 0}),e.collapsedParent||e.show(),e.isGroup&&e.deepEach(t=>{t.collapsedParent||t.show()})}),t.remove(n))},newGroup(t){this.addGroup(t)}},t.exports=r},function(t,e,n){const r=n(67),i=n(2),o={CFG:{anchor:{}},INIT:"_initAnchor"};o.AUGMENT={_initAnchor(){const t=this.get("anchor"),e=this.get("_graph");if(t){const n=new r({diagram:this,graph:e,...t});this.setController("anchor",n)}},showAnchor(t,e,n){this.getController("anchor").showAnchor(t,e,n)},clearAnchor(t){this.getController("anchor").clearAnchor(t)},setHotspotActived(t,e){this.getController("anchor").setHotspotActived(t,e)},hoverShowAnchor(t){const e=t.getAnchorPoints(),n=[];e.forEach((e,r)=>{const i={anchor:e,item:t};this.emit("hovernode:beforeshowanchor",i),i.cancel||n.push(r)}),this.showAnchor(t,n)},anchorHasBeenLinked(t,e){const n=t.getEdges(),r=[];return n.forEach(e=>{const n=e.getModel();n.source!==t.id||i.isNil(n.sourceAnchor)||r.push(n.sourceAnchor),n.target!==t.id||i.isNil(n.targetAnchor)||r.push(n.targetAnchor)}),i.isObject(e)?-1!==r.indexOf(e.index):-1!==r.indexOf(e)},dragEdgeBeforeShowAnchor(t,e,n){this.getGraph().getNodes().forEach(r=>{const i=[],o=r.getAnchorPoints();let a;if(t.isNode){const s=t.getAnchorPoints();o.forEach((o,c)=>{a="target"===n?{source:t,sourceAnchor:s[e],target:r,targetAnchor:o,dragEndPointType:n}:{target:t,targetAnchor:s[e],source:r,sourceAnchor:o,dragEndPointType:n},this.emit("dragedge:beforeshowanchor",a),a.cancel||i.push(c)})}else o.forEach((t,e)=>{i.push(e)});r===t&&r.isAnchorShow?i.forEach(t=>{const n=r.getAnchor(t);e!==t&&n&&n.showHotspot()}):this.showAnchor(r,i,!0)})}},t.exports=o},function(t,e,n){const r=n(9),i=n(5),o=n(2);t.exports=class extends r{getDefaultCfg(){return{_anchorItemCache:{}}}init(){const t=this.graph;t.on("afteritemdraw",t=>{t.item.isAnchorShow&&this.showAnchor(t.item)}),t.on("beforeitemdestroy",t=>{this._clearAnchor(t.item)}),t.on("afteritemhide",t=>{t.item.isNode&&this._clearAnchor(t.item)})}_updateAnchor(t){const e=this.graph;t.anchorShapes.forEach(t=>{t.updatePosition()}),e.draw()}_drawAnchor(t,e,n,r){const a=t.getAnchorPoints();this._clearAnchor(t),o.each(a,(o,a)=>{if(n&&-1===n.indexOf(a))return;let s;const c=e.addShape("marker",{attrs:{symbol:"circle",...i.anchorPointStyle,x:o.x,y:o.y},freezePoint:o,item:t,index:a,eventPreFix:"anchor",isItemChange(){},zIndex:i.zIndex.anchorPoint});c.toFront(),c.eventPreFix="anchor",c.showHotspot=()=>{s=e.addShape("marker",{attrs:{symbol:"circle",...i.anchorHotsoptStyle,x:o.x,y:o.y},freezePoint:o,capture:!1,zIndex:i.zIndex.anchorHotsopt}),t.anchorShapes.push(s),c.hasHotspot=!0,s.toFront(),c.toFront()},c.getIndex=()=>a,c.getItem=()=>t,c.getPoint=()=>o,c.updatePosition=()=>{const e=t.getAnchorPoints()[a];c.attr(e)},c.setActived=()=>{c.attr(i.anchorPointHoverStyle)},c.clearActived=()=>{c.attr(i.anchorPointStyle)},c.isAnchor=!0,c.setHotspotActived=t=>{s&&(t?s.attr(i.anchorHotsoptActivedStyle):s.attr(i.anchorHotsoptStyle))},r&&c.showHotspot(),t.anchorShapes.push(c),t.getAllAnchors=()=>t.anchorShapes.filter(t=>t.isAnchor),t.getAnchor=e=>t.anchorShapes.find(t=>t.get("index")===e)})}_clearAnchor(t){t.anchorShapes&&t.anchorShapes.forEach(t=>{t.remove()}),t.anchorShapes=[]}setHotspotActived(t,e){const n=this.diagram.getGraph();t.setHotspotActived(e),n.draw()}showAnchor(t,e,n){if(!t.isVisible())return;const r=this.graph,i=this._anchorItemCache,o=r.getRootGroup();this._drawAnchor(t,o,e,n),t.isAnchorShow=!0,i[t.id]=t}clearAnchor(t){const e=this.graph,n=e.get("itemCache"),r=this._anchorItemCache;let i=t;i=o.isObject(t)?[t]:o.isString(t)?[n[t]]:r,o.each(i,t=>{this._clearAnchor(t),t.isAnchorShow=!1,delete r[t.id]}),e.draw()}}},function(t,e,n){const r=n(69),i={CFG:{orbit:null},INIT:"_initOrbit"};i.AUGMENT={_initOrbit(){const t=this.get("orbit");if(t){const e=new r({diagram:this,...t});this.setController("orbit",e)}},showOrbit(t){this.getController("orbit").show(t)},hideOrbit(){this.getController("orbit").hide()},layoutOrbit(t,e){this.getController("orbit").layout(t,e)}},t.exports=i},function(t,e,n){const r=n(9),i=n(5),o=n(70),{vec2:a,isString:s}=n(2);t.exports=class extends r{getDefaultCfg(){return{satellite:[],satelliteCache:[]}}init(){const t=this.satellite,e=this.diagram,n={diagram:e};e.getGraph().addBehaviour("orbit"),t.forEach(t=>{s(t)?this.satelliteCache.push(new o[t](n)):this.satelliteCache.push(new o({...n,...t}))})}layout(t,e){const n=this.diagram,r=n.getGraph(),{satelliteCache:o}=this,s=t.getBBox(),{centerX:c,centerY:u}=s,h=n.getZoom(),l=i.orbitGap/h,d=o.filter(t=>t.isVisible()),f=[e.x-c,e.y-u],g=a.length(f),p=s.width/2+l,m=a.scale([],f,p/g);d.forEach(t=>{const e=t.getDOM(),n=e.width()/2,i=r.getDomPoint({x:m[0]+c,y:m[1]+u});e.css({top:i.y-n+"px",left:i.x-n+"px"})})}show(t){const{satelliteCache:e}=this;e.forEach(e=>{e.enable()&&(e.item=t,e.show())})}hide(){const{satelliteCache:t}=this;t.forEach(t=>{t.hide()})}}},function(t,e,n){const r=n(23);r.forkAndLink=n(71),t.exports=r},function(t,e,n){const r=n(23),i=n(2);t.exports=class extends r{getDefaultCfg(){return{name:"forkAndLink",render:()=>'\n
\n ',bindEvent(t,e){const n=e.getGraph(),r=n.getRootGroup();t.setAttribute("draggable","true");return[i.addEventListener(t,"dragstart",()=>{const n=this.item,i={...e.get("addEdgeModel"),source:n.id},o=n.getBBox(),a=e.getDelegation([{isEdge:!0}],r);e.setSignal("dragEdge",!0),e.beginAdd("edge",i),e.set("addEdgeConfig",{addModel:i,delegation:a,startPoint:{x:o.centerX,y:o.centerY},sourceItem:n}),t.hide()}),i.addEventListener(t,"click",({clientX:t,clientY:r})=>{const o=e.editor,a=this.item,s=n.getPointByClient({x:t,y:r}),c=a.getBBox(),u=a.getModel(),h=[s.x-c.centerX,s.y-c.centerY],l=i.vec2.length(h);if(i.vec2.scale(h,h,160/l),o)o.executeCommand("copyAdjacent",{copyNode:a,x:s.x+h[0],y:s.y+h[1]});else{const t=i.clone(u);t.x=s.x+h[0],t.y=s.y+h[1],n.add(a.type,t)}})]}}}}},function(t,e,n){const r=n(2),i=n(5),o={};function a(t){t.controlPointShapes&&r.each(t.controlPointShapes,t=>{t.remove()}),t.controlPointShapes=[],t.isControlPointShow=!1}o.INIT="_initResize",o.CFG={nodeResizeable:!1,edgeResizeable:!0},o.AUGMENT={_initResize(){const t=this.get("_graph"),e=this.get("nodeResizeable"),n=this.get("edgeResizeable");e&&t.on("afteritemdraw",t=>{"node"===t.item.type&&t.item.isVisible()&&this.drawControlPoints(t.item)}),n&&t.on("afteritemdraw",t=>{"edge"===t.item.type&&t.item.isVisible()&&this.drawControlPoints(t.item)}),t.on("afteritemhide",t=>{var e;t.item.isControlPointShow&&((e=t.item).controlPointShapes&&r.each(e.controlPointShapes,t=>{t.hide()}),e.isControlPointShow=!1)}),t.on("afteritemshow",t=>{var e;!t.item.isControlPointShow&&((e=t.item).controlPointShapes&&r.each(e.controlPointShapes,t=>{t.show()}),e.isControlPointShow=!0)}),t.on("beforeitemdestroy",t=>{t.item.isControlPointShow&&a(t.item)})},drawControlPoints(t){const e=this.get("_graph").getRootGroup(),n=this.get("nodeResizeable"),o=this.get("edgeResizeable");"node"===t.type?n&&function(t,e){const n=t.getBBox(),o=[{x:n.minX,y:n.minY},{x:n.maxX,y:n.minY},{x:n.minX,y:n.maxY},{x:n.maxX,y:n.maxY}];a(t);const s=e.addShape("rect",{attrs:r.mix({},i.nodeSelectedBoxStyle,{symbol:"square",x:n.minX,y:n.minY,width:n.maxX-n.minX,height:n.maxY-n.minY})});t.controlPointShapes.push(s),r.each(o,n=>{const o=e.addShape("marker",{attrs:r.mix({},i.nodeControlPointStyle,{symbol:"square",x:n.x,y:n.y}),freezePoint:{x:n.x,y:n.y},item:t});t.controlPointShapes.push(o)})}(t,e):"edge"===t.type&&o&&function(t,e){const n=t.getKeyShape().attr("path"),o=n[0],s=o.length,c=n[n.length-1],u=c.length,h=[{x:o[s-2],y:o[s-1]},{x:c[u-2],y:c[u-1]}],l=t.getModel();a(t),r.each(h,(n,o)=>{const a=e.addShape("marker",{attrs:r.mix({},i.edgeControlPointStyle,{x:n.x,y:n.y}),freezePoint:{x:n.x,y:n.y},item:t});a.eventPreFix="edgeControlPoint",a.getSourcePoint=()=>h[0],a.getTargetPoint=()=>h[h.length-1],a.getItem=()=>t,a.isSourceEndPoint=()=>l.source&&0===o,a.isTargetEndPoint=()=>l.target&&o===h.length-1,t.controlPointShapes.push(a)})}(t,e),t.isControlPointShow=!0}},t.exports=o},function(t,e,n){const r=n(2),i={};i.AUGMENT={addOutterShape(t,e){this.clearOutterShape(t);const{lineWidth:n}=e,i=t.getKeyShape(),o=t.getGraphicGroup(),a=i.attr(),s=i.get("type"),c=i.attr("lineWidth"),u=r.clone(a);delete u.fillStyle,delete u.strokeStyle,delete u.matrix;const h=o.addShape(s,{attrs:{...u,fill:null,...e}});r.toBack(h,o);const l=h.getBBox(),d=l.maxX-l.minX,f=l.maxY-l.minY,g=(l.minX+l.maxX)/2,p=(l.minY+l.maxY)/2;h.transform([["t",-g,-p],["s",(n+d+c)/d,(n+f+c)/f],["t",g,p]]),h.isOutter=!0,t.outterShape=h},clearOutterShape(t){t.outterShape&&t.outterShape.remove()}},t.exports=i},function(t,e){const n={CFG:{linkNode:!0,linkAnchor:!0},INIT:"_initLink"};n.AUGMENT={_initLink(){const t=this.getGraph(),e=this.get("linkAnchor"),n=this.get("linkNode"),r=t.get("mode");e&&(this.on("beforeitemactived",t=>{const e=t.item;e.isNode&&this.hoverShowAnchor(e)}),this.on("beforeitemunactived",t=>{const e=t.item;(e.isNode||e.isGroup)&&this.clearAnchor(e)}),this.on("beforeitemselected",t=>{const e=t.item;(e.isNode||e.isGroup)&&this.hoverShowAnchor(e)}),this.on("beforeitemunselected",t=>{const e=t.item;(e.isNode||e.isGroup)&&this.clearAnchor(e)}),t.addBehaviour("dragAnchorAddEdge","add"),t.addBehaviour("hoverAnchorActived","default"),t.changeMode(r)),n&&(t.addBehaviour("hoverNodeAddOutter","add"),t.addBehaviour("hoverNodeAddOutter","default"),t.changeMode(r))}},t.exports=n},function(t,e,n){n(76),n(77),n(78),n(79)},function(t,e,n){const r=n(13),i=n(2),o=n(5);r.registerNode("diagram-base",{getSize(t){const e=t.getModel();return i.getNodeSize(e.size)},defaultFillPalette:0,defaultStrokePalette:3,activedFillPalette:0,activedStrokePalette:5,selectedFillPalette:2,selectedStrokePalette:5,getDefaulStyle:()=>o.nodeStyle,getDefaulActivedStyle:()=>o.nodeActivedStyle,getDefaulSelectedtyle:()=>o.nodeSelectedStyle,getStyle(t){const e=t.getModel(),n=e.color;let r,o;if(n){const t=i.Palettes.generate(n);r=t[this.defaultFillPalette],o=t[this.defaultStrokePalette]}return i.mix(!0,{},this.getDefaulStyle(),{fill:r,stroke:o},e.style)},getPath(t){const e=this.getSize(t),n=this.getStyle(t);return i.getRectPath(-e[0]/2,-e[1]/2,e[0],e[1],n.radius)},getActivedOutterStyle:()=>o.nodeActivedOutterStyle,getActivedStyle(t){const e=t.getModel(),n=this.getDefaulActivedStyle(t),{color:r}=e;if(r){const t=i.Palettes.generate(r);return{...n,fill:t[this.activedFillPalette],stroke:t[this.activedStrokePalette]}}return n},getSelectedStyle(t){const e=t.getModel(),n=this.getDefaulSelectedtyle(t),{color:r}=e;if(r){const t=i.Palettes.generate(r);return{...n,fill:t[this.selectedFillPalette],stroke:t[this.selectedStrokePalette]}}return n},getSelectedOutterStyle(t){const e=t.getModel(),{color:n}=e;if(n){const t=i.Palettes.generate(n);return{...o.nodeSelectedOutterStyle,stroke:t[1],fill:t[1]}}return o.nodeSelectedOutterStyle},anchor:[[.5,0],[1,.5],[.5,1],[0,.5]]}),r.registerNode("capsule",{getPath(t){const e=this.getSize(t);return i.getRectPath(-e[0]/2,-e[1]/2,e[0],e[1],e[1]/2)}}),r.registerNode("circle",{getPath(t){const e=this.getSize(t),n=e[0],r=e[1];return i.getEllipsePath(0,0,n/2,r/2)}}),r.registerNode("rhombus",{getPath(t){const e=this.getSize(t),n=e[0],r=e[1],o=[{x:0,y:0-r/2},{x:0+n/2,y:0},{x:0,y:0+r/2},{x:0-n/2,y:0},{x:0,y:0-r/2}];return i.pointsToPolygon(o)}})},function(t,e,n){const r=n(13),i=n(2),o=n(5);r.registerEdge("diagram-base",{getPath(t){const e=t.getPoints(),n=t.getSource(),r=t.getTarget();return this.getPathByPoints({points:e,source:n,target:r,item:t})},getPathByPoints:({points:t})=>i.pointsToPolygon(t),getStyle(t){const e=t.getModel();return i.mix(!0,{},o.edgeStyle,{stroke:e.color},e.style)},getActivedStyle:()=>o.edgeActivedStyle,getSelectedStyle:()=>o.edgeSelectedStyle,getActivedOutterStyle(){},getSelectedOutterStyle(){}})},function(t,e,n){const r=n(13),i=n(5),o=n(2),a=o.getGroupIconPath(),s=o.getCollapsedButtonPath(),c=o.getExpandedButtonPath(),u={fill:"#CED4D9"},h={stroke:"#697B8C",fill:"#fff",fillOpacity:0},l={stroke:"#697B8C",fill:"#fff",fillOpacity:0},d={fill:"#000000",textBaseline:"top",textAlign:"left"},f={stroke:"#CED4D9",fill:"#F2F4F5",radius:4},g=i.groupBackgroundPadding,p=184-g[1]-g[3],m=40-g[0]-g[2];r.registerGroup("diagram-base",{draw(t){const e=t.getModel(),n=t.getGraphicGroup(),r=t.getChildrenBBox(),i=this.getStyle(t),f=e.collapsed,v=e.padding?e.padding:g;if(r.minX===1/0&&(r.minX=e.x,r.maxX=e.x+p,r.minY=e.y,r.maxY=e.y+m),f&&(r.minX=r.maxX-p,r.maxY=r.minY+m),r.maxX-r.minXi.groupActivedStyle,getSelectedStyle:()=>i.groupSelectedStyle,getSelectedOutterStyle:()=>i.groupSelectedOutterStyle,getActivedOutterStyle(){},intersectBox:"rect"})},function(t,e,n){n(13).registerGuide("diagram-base")},function(t,e,n){n(81),n(82),n(83),n(84),n(85),n(86),n(87),n(88),n(89),n(90),n(91),n(92),n(93),n(94)},function(t,e,n){const r=n(1),i=n(2);r.registerBehaviour("panItem",t=>{const e=t.getGraph();e.behaviourOn("drop",()=>{const n=t.get("panItems");if(!n)return;const r=n[0],o=n.map(t=>t.id),a=t.get("panItemDelegation"),s=t.get("panItemStartBox"),c=r.id,u=a.attr("x")-s.minX,h=a.attr("y")-s.minY;function l(){o.forEach(t=>{const n=e.find(t),r=n.getModel();n.isGroup?i.panGroup(n,u,h,e):(e.update(n,{x:r.x+u,y:r.y+h}),e.toFront(n))}),1===o.length&&(t.clearSelected(),t.setSelected(c,!0))}e.emit("afterpanitemdrop",{panItems:n}),t.clearAlignLine();const d=t.editor;e.emit("panitemend"),!d||t.getSignal("dragaddnodetogroup")?l():d.executeCommand(l)})},["startPanItem","processPanItem","endPanItem"])},function(t,e,n){const r=n(1),i=n(5);r.registerBehaviour("hoverAnchorActived",t=>{const e=t.getGraph();e.behaviourOn("anchor:mouseenter",n=>{if(t.getSignal("panningItem")||t.getSignal("dragEdge"))return;const r=n.shape,o=r.getItem(),a=o.getModel(),s={...t.get("addEdgeModel"),source:a.id},c={anchor:r.getPoint(),item:o};t.emit("hoveranchor:beforeaddedge",c),c.cancel?t.css({cursor:i.cursor.hoverUnEffectiveAnchor}):(t.css({cursor:i.cursor.hoverEffectiveAnchor}),!r.get("destroyed")&&r.setActived(),t.beginAdd("edge",s),e.draw())}),e.behaviourOn("anchor:mouseleave",n=>{if(!t.getSignal("dragEdge")&&!t.getSignal("panningItem")){const r=n.shape,o=r.getItem();t.css({cursor:i.cursor.beforePanCanvas}),o.isSelected||(t.clearAnchor(o),t.setActived(o,!1)),!r.get("destroyed")&&r.clearActived(),t.cancelAdd(),e.draw()}})})},function(t,e,n){const r=n(1),i=n(5);r.registerBehaviour("hoverEdgeControlPoint",t=>{t.getGraph().behaviourOn("edgeControlPoint:mouseenter",e=>{if(t.getSignal("dragEdge")||t.getSignal("panningItem"))return;const n=e.shape;(n.isTargetEndPoint()||n.isSourceEndPoint())&&t.css({cursor:i.cursor.hoverEdgeControllPoint})})})},function(t,e,n){const r=n(1),i=n(5),o=n(2);r.registerBehaviour("dragEdgeControlPoint",t=>{const e=t.getGraph(),n=e.getRootGroup();let r,a,s,c,u,h,l,d,f,g;function p(n){if(!s)return;const p={};e.getNodes().forEach(e=>{t.clearAnchor(e)}),t.css({cursor:i.cursor.beforePanCanvas}),s.remove();const m=o.dropUpdateEdge({ev:n,endPointType:r?"target":"source",model:p,diagram:t});e.show(f);const v=f.id;if(m){const n=t.editor;n?n.executeCommand("update",{itemId:v,updateModel:p}):e.update(v,p)}t.setSignal("dragEdge",!1),r=void 0,a=void 0,s=void 0,c=void 0,u=void 0,h=void 0,l=void 0,d=void 0,f=void 0,g=void 0}e.behaviourOn("edgeControlPoint:mousedown",i=>{if(2===i.button)return;const o=i.shape;o.isTargetEndPoint()?(f=o.getItem(),g=f.getModel(),r=o,c=o.getSourcePoint(),u=f.getSource(),l=g.sourceAnchor):o.isSourceEndPoint()&&(f=o.getItem(),g=f.getModel(),a=o,c=o.getTargetPoint(),h=f.getTarget(),d=g.targetAnchor),f&&(s=t.getDelegation([f],n),u?t.dragEdgeBeforeShowAnchor(u,l,"target"):h&&t.dragEdgeBeforeShowAnchor(h,d,"source"),e.hide(f),t.setSignal("dragEdge",!0))}),e.behaviourOn("mousemove",t=>{s&&o.dragingEdgeEndPoint({endPointType:u?"target":"source",edgeModel:g,graph:e,delegation:s,startPoint:c,ev:t,originSource:u,originTarget:h})}),e.behaviourOn("edgeControlPoint:mouseleave",e=>{r||a||e.toShape||t.css({cursor:i.cursor.beforePanCanvas})}),e.behaviourOn("mouseup",p),e.behaviourOn("canvas:mouseleave",p)},["dragHoverAnchorHotspot"])},function(t,e,n){const r=n(1),i=n(2);r.registerBehaviour("dragPanelItemAddNode",t=>{const e=t.getGraph(),n=e.getRootGroup();let r,o,a,s,c;function u(){t.setSignal("panningItem",!1),t.set("panItemDelegation",void 0),t.set("panItemStartBox",void 0),t.set("panItemStartPoint",void 0),o=void 0,a=void 0,s=void 0,c=void 0}e.behaviourOn("canvas:mouseenter",e=>{if(!o&&(s=t.get("addType"),c=t.get("addModel"),c=i.clone(c),"node"===s)){a=i.getNodeSize(c.size);const s=a[0]/2,u=a[1]/2;r={minX:e.x-s,minY:e.y-u,maxX:e.x+s,maxY:e.y+u,width:a[0],height:a[1]},o=t.getDelegation([r],n),t.setSignal("panningItem",!0),t.set("panItemDelegation",o),t.set("panItemStartBox",r),t.set("panItemStartPoint",{x:e.x,y:e.y})}}),e.behaviourOn("mouseup",n=>{if(!o)return;c.x=n.x,c.y=n.y;const r=s;i.setId(c);const a=t.editor;o.remove(),t.endAdd(),t.clearAlignLine(),t.clearSelected(),t.focusGraphWrapper(),a?a.executeCommand("add",{type:"node",addModel:c}):e.add(r,c),t.setSelected(e.find(c.id),!0),u()}),e.behaviourOn("canvas:mouseleave",()=>{o&&(t.clearAlignLine(),o.remove(),e.draw(),t.cancelAdd(),u())})},["processPanItem"])},function(t,e,n){n(1).registerBehaviour("dragHoverAnchorHotspot",t=>{const e=t.getGraph();e.behaviourOn("anchor:dragenter",e=>{if(t.getSignal("dragEdge")){const n=e.shape;t.setHotspotActived(n,!0)}}),e.behaviourOn("anchor:dragleave",e=>{if(t.getSignal("dragEdge")){const n=e.shape;t.setHotspotActived(n,!1)}})})},function(t,e,n){const r=n(1),i=n(2);r.registerBehaviour("dragAnchorAddEdge",t=>{const e=t.getGraph(),n=e.getRootGroup();e.behaviourOn("anchor:dragstart",e=>{if(2===e.button)return;const r=e.shape,o=r.get("freezePoint"),a=r.getItem(),s=i.clone(t.get("addModel")),c=r.getIndex();s.source=a.id,s.sourceAnchor=c;const u={x:o.x,y:o.y},h=t.getDelegation([{isEdge:!0}],n);t.setSignal("dragEdge",!0),t.dragEdgeBeforeShowAnchor(a,c,"target"),t.set("addEdgeConfig",{addModel:s,delegation:h,startPoint:u,sourceItem:a})})},["processAddEdge","dragHoverAnchorHotspot","hoverAnchorActived"])},function(t,e,n){const r=n(1),i=n(5);r.registerBehaviour("dragMultiSelect",t=>{const e=t.getGraph(),n=e.getRootGroup();let r,o;function a(){t.css({cursor:i.cursor.beforePanCanvas}),r=void 0,o=void 0}t.css({cursor:i.cursor.multiSelect}),e.behaviourOn("dragstart",t=>{2!==t.button&&(r={x:t.x,y:t.y},o=n.addShape("rect",{attrs:i.multiSelectRectStyle}))}),e.behaviourOn("drag",t=>{o&&(o.attr({x:Math.min(r.x,t.x),y:Math.min(r.y,t.y),width:Math.abs(t.x-r.x),height:Math.abs(t.y-r.y)}),e.draw())}),e.behaviourOn("dragend",()=>{if(!o)return;const n=e.getNodes().map(t=>t.id),r=o.getBBox();function i(){t.clearSelected(),n.forEach(n=>{const i=e.find(n),o=i.getBBox();o.minX>r.minX&&o.minY>r.minY&&o.maxX{o&&(o.remove(),e.draw(),a())})})},function(t,e,n){n(1).registerBehaviour("keydownShiftMultiSelected",t=>{const e=t.getGraph();e.behaviourOn("keydown",e=>{e.domEvent.shiftKey&&t.setSignal("shiftKeyDown",!0)}),e.behaviourOn("keyup",e=>{e.domEvent.shiftKey||t.setSignal("shiftKeyDown",!1)})})},function(t,e,n){const r=n(1),i=n(5);r.registerBehaviour("dragNodeAddToGroup",t=>{const e=t.getGraph();let n,r;function o(){t.setSignal("dragaddnodetogroup",!1),n=void 0,r=void 0}e.behaviourOn("dragenter",o=>{if(!t.getSignal("panningItem"))return;const a=t.get("panItems");a[0]&&a[0].isNode&&1===a.length&&o.item&&o.item.isGroup&&a[0].getParent()!==o.item&&(n=a[0],r=o.item,e.update(r,{padding:i.groupBackgroundPadding.map(t=>t+4),style:i.dragNodeHoverToGroupStyle}))}),e.behaviourOn("dragleave",()=>{r&&n&&e.update(r,{padding:void 0,style:void 0})}),e.behaviourOn("drop",i=>{if(!r||!n||r!==i.item)return;t.setSignal("dragaddnodetogroup",!0);const o=n.id,a=r.id;function s(){e.update(o,{parent:a})}e.update(a,{padding:void 0,style:void 0,collapsed:!1});const c=t.editor;c?c.executeCommand(s):s()}),e.behaviourOn("dragend",()=>{o()}),e.behaviourOn("canvas:mouseleave",()=>{r&&(e.update(r,{padding:void 0,style:void 0}),o())})})},function(t,e,n){const r=n(1),i=n(5),o=n(2);r.registerBehaviour("dragOutFromGroup",t=>{const e=t.getGraph();let n,r,a,s=!1;function c(){clearTimeout(a),r&&e.update(r,{padding:void 0,style:void 0}),s=!1,n=void 0,r=void 0}e.behaviourOn("drag",c=>{t.getSignal("panningItem")&&!s&&(clearTimeout(a),a=setTimeout(()=>{const a=t.get("panItems");if(a){if(n=a[0],r=a[0].getParent(),n&&1===a.length&&r&&!c.shape){const n=t.get("panItemDelegation").getBBox(),a=r.getBBox();o.rectRectCrossAlgorithm(n,a)&&(e.update(r,{padding:i.groupBackgroundPadding.map(t=>t-8),style:i.dragNodeLeaveFromGroupStyle}),s=!0)}s||(n=void 0,r=void 0)}},i.outFromGroupDelayTime))}),e.behaviourOn("dragenter",t=>{n&&r&&(r===t.item&&e.update(r,{padding:i.groupBackgroundPadding.map(t=>t+4),style:i.dragNodeHoverToGroupStyle}),s=!1)}),e.on("drop",t=>{r&&n&&!t.shape&&(e.update(n,{parent:void 0}),e.update(r,{style:void 0}),c())}),e.on("dragend",()=>{c()}),e.behaviourOn("canvas:mouseleave",()=>{c()})})},function(t,e,n){const r=n(1),i=n(2),o=n(5);r.registerBehaviour("processAddEdge",t=>{const e=t.getGraph();function n(){t.setSignal("dragEdge",!1),t.set("addEdgeConfig",{addModel:void 0,delegation:void 0,startPoint:void 0,sourceItem:void 0})}e.behaviourOn("mousemove",n=>{const r=t.get("addEdgeConfig");if(!r)return;const{addModel:o,delegation:a,startPoint:s,sourceItem:c}=r;a&&i.dragingEdgeEndPoint({endPointType:"target",edgeModel:o,graph:e,delegation:a,startPoint:s,ev:n,sourceItem:c})}),e.behaviourOn("mouseup",r=>{const a=t.get("addEdgeConfig");if(!a)return;const{addModel:s,delegation:c,sourceItem:u}=a,h=t.editor;if(!c)return void n();e.getNodes().forEach(e=>{t.clearAnchor(e)}),t.clearAnchor(u),t.setActived(u,!1),t.setSelected(u,!1),t.css({cursor:o.cursor.beforePanCanvas}),c.remove();i.dropUpdateEdge({ev:r,endPointType:"target",model:s,diagram:t})&&(h?h.executeCommand("add",{type:"edge",addModel:s}):e.add("edge",s)),e.draw(),t.endAdd(),n()}),e.behaviourOn("canvas:mouseleave",()=>{const r=t.get("addEdgeConfig");if(!r)return;const{delegation:i,sourceItem:o}=r;if(!i)return void n();e.getNodes().forEach(e=>{t.clearAnchor(e)}),t.setActived(o,!1),t.clearAnchor(o),i.remove(),t.cancelAdd(),e.draw(),n()})})},function(t,e,n){n(1).registerBehaviour("hoverNodeAddOutter",t=>{const e=t.getGraph();let n;e.behaviourOn("node:mouseenter",({item:e})=>{t.getSignal("dragEdge")&&(n=e,t.addOutterShape(e,{stroke:"#52C41A",strokeOpacity:.45,lineWidth:4}))}),e.behaviourOn("node:mouseleave",()=>{n&&t.clearOutterShape(n)}),e.behaviourOn("beforedropedge",()=>{n&&t.clearOutterShape(n)})})},function(t,e,n){const r=n(1),i=n(5),o=n(2);r.registerBehaviour("orbit",t=>{const e=t.getGraph();let n;e.behaviourOn("beforepanitem",()=>{t.hideOrbit()}),e.behaviourOn("node:mouseenter",({item:e})=>{t.getSignal("panningItem")||t.getSignal("dragEdge")||(n=e,t.showOrbit(e))}),e.on("beforeviewportchange",()=>{t.hideOrbit()}),e.behaviourOn("mousemove",({item:r,x:a,y:s})=>{if(!n)return;const c=n.getBBox(),u=o.euclideanDistance.pointPoint({x:c.centerX,y:c.centerY},{x:a,y:s}),h=e.getMatrix()[0];r!==n&&u>c.width/2+i.orbitGap/h&&(t.hideOrbit(),n=void 0),n&&t.layoutOrbit(n,{x:a,y:s})})})},function(t,e,n){const r=n(11);n(96),t.exports=r},function(t,e,n){n(97),n(98),n(99),n(100),n(101)},function(t,e,n){const r=n(11);r.registerNode("flow-base",{}),r.registerNode("flow-html",{},["html"]),r.registerNode("flow-rect",{},"flow-base"),r.registerNode("flow-capsule",{},"capsule"),r.registerNode("flow-circle",{},"circle"),r.registerNode("flow-rhombus",{},"rhombus")},function(t,e,n){n(11).registerEdge("flow-base",{})},function(t,e,n){const r=n(19),i=n(11);function o(t,e,n,r){const i=r?r/2:30,o=r;if(t<=e&&e<=n||t>=e&&e>=n){const r=(n-e)/2,a=Math.abs(r);if(0===r)return t===e?0:(e-t)/Math.abs(e-t)*i;if(a>o){const t=r/a*o;return Math.abs(t)o&&(a=o),at?a:-a}function a(t,e,n,r){const i=t.bbox,a=function(t,e){const n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height}(e,i);let s,c;s=c=0;let u=Math.min(i.height,i.width);return r&&r.bbox&&(u=Math.min(u,r.bbox.height,r.bbox.width)),a?s=o(i.centerX,e.x,n.x,u):c=o(i.centerY,e.y,n.y,u),{x:e.x+s,y:e.y+c}}function s(t,e){const n=t.x,r=t.y;return{x:n+.1*(e.x-n),y:r+.1*(e.y-r)}}function c(t,e,n){const i=t[0],o=t[t.length-1],c=["M",i.x,i.y],u=function(t,e,n,r){return[n&&n.bbox?a(n,t,e,r):s(t,e),r&&r.bbox?a(r,e,t,n):s(e,t)]}(i,o,e,n),h=["C"],l=[c];return r.each(u,(function(t){h.push(t.x,t.y)})),h.push(o.x,o.y),l.push(h),l}i.registerEdge("flow-smooth",{getPathByPoints:({points:t,source:e,target:n})=>c(t,e,n)},"flow-edge")},function(t,e,n){const r=n(19),i=n(11),o={offset:16,borderRadius:5};function a(t,e){const n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}}function s(t,e){return 2*Math.abs(t.centerX-e.centerX)r/e.height}(e,t)?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}}function l(t){const{minX:e,minY:n,maxX:r,maxY:i}=t;return[{x:e,y:n},{x:r,y:n},{x:r,y:i},{x:e,y:i}]}function d(t,e){const{x:n,y:r}=t;return ne.maxX||re.maxY}function f(t,e,n,r){const i=e.x-t.x,o=e.y-t.y,a=r.x-n.x,s=r.y-n.y,c=(-o*(t.x-n.x)+i*(t.y-n.y))/(-a*o+i*s),u=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*o+i*s);return c>=0&&c<=1&&u>=0&&u<=1}function g(t,e,n){if(n.width===n.height===0)return!1;const[r,i,o,a]=l(n);return f(t,e,r,i)||f(t,e,r,a)||f(t,e,i,o)||f(t,e,o,a)}function p(t){return t=v(t)}function m(t,e){return[t,{x:t.x,y:e.y},e]}function v(t){const e=[],n={};return t.forEach(t=>{const e=t.id=`${t.x}-${t.y}`;n[e]=t}),r.each(n,t=>{e.push(t)}),e}function x(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function y(t,e,n,r,i){return x(t,e)+x(t,n)+function(t,e){let n=0;return e.forEach(e=>{e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))}),n}(t,[e,n,r,i])}function b(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function w(t,e,n,r){const i=[];return t.forEach(t=>{t!==e&&(t.x!==e.x&&t.y!==e.y||g(t,e,n)||g(t,e,r)||i.push(t))}),v(i)}function M(t,e,n,r,i=0){t.unshift(e[r]),n[r]&&n[r]!==r&&i<=100&&M(t,e,n,n[r],i+1)}function _(t,e,n,r,i){const o=n&&n.bbox?n.bbox:c(t),f=r&&r.bbox?r.bbox:c(e);if(s(o,f))return p(m(t,e));const g=u(o,i),_=u(f,i);if(s(g,_))return p(m(t,e));const S=h(g,t),A=h(_,e),E=function(t=[]){const e=[],n=[];t.forEach(t=>{e.push(t.x),n.push(t.y)});const r=Math.min.apply(Math,e),i=Math.max.apply(Math,e),o=Math.min.apply(Math,n),a=Math.max.apply(Math,n);return{centerX:(r+i)/2,centerY:(o+a)/2,maxX:i,maxY:a,minX:r,minY:o,height:a-o,width:i-r}}([S,A]),P=(a(g,_),a(g,E)),C=a(_,E);let O=[];O=O.concat(l(P)),O=O.concat(l(C));const I={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[E,P,C].forEach(t=>{O=O.concat(function(t,e){return function(t,e){return et.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,I).filter(t=>d(t,g)&&d(t,_)))}),[{x:S.x,y:A.y},{x:A.x,y:S.y}].forEach(t=>{d(t,g)&&d(t,_)&&O.push(t)}),O.unshift(S),O.push(A),O=v(O);const k=function(t,e,n,r,i,o,a){const s=[],c=[e],u={},h={},l={};h[e.id]=0,l[e.id]=y(e,n,e);const d={};for(t.forEach(t=>{d[t.id]=t});c.length;){let f,g=1/0;if(c.forEach(t=>{l[t.id]{if(-1!==s.indexOf(t))return;-1===c.indexOf(t)&&c.push(t);const r=l[f.id]+x(f,t);h[t.id]&&r>=h[t.id]||(u[t.id]=f.id,h[t.id]=r,l[t.id]=h[t.id]+y(t,n,e,o,a))})}return console.error("cannot find path: ",t,e,n),[e,n]}(O,S,A,o,f,t,e);return k.unshift(t),k.push(e),p(k)}function S(t,e){const n=[],r=t[0];return n.push(`M${r.x} ${r.y}`),t.forEach((r,i)=>{const o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x===n.x||t.y===e.y===n.y)}(r,o,a)){const[t,i]=function(t,e,n,r){const i=x(t,e),o=x(n,e);return ii.toAllPadding([0,2]),getPathByPoints({points:t,source:e,target:n,item:r}){if(e&&n){const t=i.getParallelEdges(n,e);let a=i.getParallelEdges(e,n),s=a.indexOf(r);return e===n?(a=a.filter(t=>{const r=t.getModel();return r.source===e.id&&r.target===n.id}),s=a.indexOf(r),function(t,e){const n=t.getBBox(),r=[n.centerX,n.centerY],i=n.width/2,a=50*(e+1)+50,s=[r[0]-i/2,r[1]-Math.sqrt(3)/2*i],c=[s[0]-r[0],s[1]-r[1]],u=o.scale([],c,(i+a)/i),h=[r[0]+u[0],r[1]+u[1]],l=[r[0]+i/2,r[1]-Math.sqrt(3)/2*i],d=[l[0]-r[0],l[1]-r[1]],f=o.scale([],d,(i+a)/i),g=[r[0]+f[0],r[1]+f[1]];return[["M",s[0],s[1]],["C",h[0],h[1],g[0],g[1],l[0],l[1]]]}(e,s)):(0===t.length&&s--,function(t,e,n){const r=t.getBBox(),i=e.getBBox(),a=r.centerX,s=r.centerY,c=20*(n+1),u=[.5*(i.centerX+a)-a,.5*(i.centerY+s)-s],h=[-u[1],u[0]],l=o.length(h);o.scale(h,h,c/l);const d={x:u[0]+h[0]+a,y:u[1]+h[1]+s},f=t.getLinkPoints(d)[0],g=e.getLinkPoints(d)[0];return[["M",f.x,f.y],["Q",d.x,d.y,g.x,g.y]]}(e,n,s))}return i.pointsToPolygon(t)}})},function(t,e,n){n(17).registerGroup("koni-base",{})},function(t,e,n){const r=n(8);r.Util=n(10),n(108),n(112),n(120),t.exports=r},function(t,e,n){n(109),n(110),n(111)},function(t,e,n){const r=n(1),i=n(10);r.registerBehaviour("panMindNode",t=>{const e=t.getGraph();let n,r,o;function a(){n.nth=r;const i=e.add("node",n);t.setSelected(i,!0),o&&e.remove(o.id)}function s(){e.emit("panitemend"),n=void 0,o=void 0,r=void 0}e.behaviourOn("beforeshowdelegation",()=>{t.clearSelected(),t.clearActived()}),e.behaviourOn("node:dragstart",t=>{if(2===t.button)return;const i=t.item;n=i.getModel(),!n.parent||t.shape.isCollapsedButton||t.shape.isExpandedButton?s():(r=e.getNth(i),e.remove(i))}),e.behaviourOn("itempanning",n=>{if(n.shape&&n.shape.isPlaceholder)return;const r=t.getHotArea(n),i=t.getRoot();if(o&&(r?o.id!==r.id&&e.remove(e.find(o.id)):e.remove(e.find(o.id))),o=r,r){const t=r.parent;if(!e.find(r.id)){const n={id:r.id,parent:t.id,isPlaceholder:!0,parentModel:t,baseline:o.parent.id===i.id?"center":void 0,shape:"mind-placeholder",nth:r.nth};r.side&&(n.side=r.side),e.add("node",n)}}}),e.behaviourOn("drop",()=>{if(n)if(o){const a=i.clone(n);e.remove(o.id),t.executeCommand("moveMindNode",{model:a,newParentId:o.parent.id,newNth:o.nth,newSide:o.side,originParentId:n.parent,originNth:r,originSide:n.side})}else a();s()}),e.behaviourOn("canvas:mouseleave",()=>{n&&(a(),s())})},["startPanItem","processPanItem","endPanItem"])},function(t,e,n){n(1).registerBehaviour("keydownMoveSelection",t=>{t.getGraph().on("keydown",e=>{t._moveItemSelection(e)})})},function(t,e,n){n(1).registerBehaviour("keydownEditLabel",t=>{t.getGraph().behaviourOn("keydown",e=>{t.showLabelEditor(e)})})},function(t,e,n){n(113),n(114),n(115),n(116),n(117),n(118),n(119)},function(t,e,n){const r=n(8),i=n(10),o={fill:"#000",textAlign:"left",textBaseline:"top"},a={stroke:"#959EA6",strokeOpacity:0,fill:"#959EA6",cursor:"pointer"},s={stroke:"#434B54",fill:"#fff",cursor:"pointer"};r.registerNode("mind-base",{dy:4,afterDraw(t){const e=t.getModel();e.children&&e.children.length>0&&e.collapsed&&this.drawExpandedButton(t)},debugDrawLayoutPoint(t){const e=t.getModel();t.getGraphicGroup().addShape("circle",{attrs:{x:e.x,y:e.y,r:5,fill:"red"}})},drawExpandedButton(t){const e=t.getKeyShape().getBBox(),n=t.getGraphicGroup().addGroup(),r=n.addShape("path",{attrs:{path:i.getRectPath(0,0,16,7,3),...a}}),o=r.getBBox(),s=i.getMindNodeSide(t),c=this.getButtonPositon(e,o,s),u={fill:"white",r:1};n.addShape("circle",{attrs:{...u,x:4,y:3.5},capture:!1}),n.addShape("circle",{attrs:{...u,x:8,y:3.5},capture:!1}),n.addShape("circle",{attrs:{...u,x:12,y:3.5},capture:!1}),r.attr("lineAppendWidth",20),n.translate(c.x,c.y),r.isExpandedButton=!0,r.isButton=!0},drawCollapsedButton(t){const e=t.getKeyShape().getBBox(),n=t.getGraphicGroup().addShape("path",{attrs:{path:i.getCollapsedButtonPath(),...s}}),r=n.getBBox(),o=i.getMindNodeSide(t),a=this.getButtonPositon(e,r,o);n.translate(a.x,a.y),n.isCollapsedButton=!0,n.isButton=!0},getButtonPositon:(t,e,n)=>"right"===n?{x:t.maxX+2,y:t.maxY-(e.maxY-e.minY)/2}:{x:t.minX-(e.maxX-e.minX)-2,y:t.maxY-(e.maxY-e.minY)/2},getLabel:t=>t.getModel().label,getPadding:()=>[4,8,4,8],getSize(t){const e=t.getModel(),n=t.getGraphicGroup(),r=e.size;if(e.size){if(i.isArray(r))return r;if(i.isNumber(r))return[r,r]}const o=n.findByClass("label")[0],a=this.getPadding(t),s=o.getBBox();return[s.width+a[1]+a[3],s.height+a[0]+a[2]]},getPath(t){const e=this.getSize(t),n=this.getStyle(t);return i.getRectPath(-e[0]/2,-e[1]/2+this.dy,e[0],e[1],n.radius)},drawLabel(t){const e=t.getGraphicGroup();let n=this.getLabel(t);const r=this.getLabelStyle(t);n||(n=" ");const a=i.mix(!0,{},o,r,{x:0,y:0});i.isObject(n)?i.mix(a,n):a.text=n;const s=e.addShape("text",{class:"label",attrs:a});return this.adjustLabelText(s),this.adjustLabelPosition(t,s),s},adjustLabelText(t){let e=t.attr("text");const n=t.getBBox();if(n.maxX-n.minX>400){const n=t.attr("font");e=i.getLabelTextByTextLineWidth(e,n),t.attr("text",e)}},adjustLabelPosition(t,e){const n=this.getSize(t),r=this.getPadding(),i=n[0],o=e.getBBox();e.attr({x:-i/2+r[3],y:-o.height/2+this.dy})},getLabelStyle:()=>({fill:"rgba(38,38,38,0.85)",lineHeight:18,fontSize:12}),getStyle:()=>({fill:"#ccc",fillOpacity:0,radius:4,lineWidth:2}),getActivedStyle:()=>({stroke:"#44C0FF",lineWidth:2}),getSelectedStyle:()=>({stroke:"#1AA7EE",lineWidth:2}),anchor:[[0,1],[1,1]]})},function(t,e,n){n(8).registerNode("mind-first-sub",{dy:0,getPadding:()=>[6,12,8,12],getLabelStyle:()=>({fill:"rgba(38,38,38,0.85)",fontWeight:500,fontSize:14,lineHeight:20})})},function(t,e,n){n(8).registerNode("mind-second-sub",{dy:0,getPadding:()=>[8,4,8,4],getLabelStyle:()=>({fill:"rgba(38,38,38,0.85)",fontSize:12,lineHeight:20})})},function(t,e,n){const r=n(8),i=n(10);r.registerNode("mind-root",{adjustLabelPosition(t,e){const n=e.getBBox();e.attr({x:-n.width/2,y:-n.height/2-1})},getPath(t){const e=this.getSize(t),n=this.getStyle(t);return i.getRectPath(-e[0]/2,-e[1]/2,e[0],e[1],n.radius)},getButtonPositon:(t,e,n)=>"right"===n?{x:t.maxX+2,y:(t.maxY+t.minY)/2-(e.maxY-e.minY)/2}:{x:t.minX-(e.maxX-e.minX)-2,y:(t.maxY+t.minY)/2-(e.maxY-e.minY)/2},getPadding:()=>i.toAllPadding([12,24]),getStyle:()=>({fill:"#587EF7",stroke:"#587EF7",fillOpacity:1,radius:4}),getLabelStyle:()=>({fontSize:20,fill:"white",lineHeight:28}),drawExpandedButton(){},drawCollapsedButton(){},panAble:!1,anchor:[[.45,.5],[.55,.5]]},"mind-first-sub")},function(t,e,n){const r=n(8),i=n(10);r.registerNode("mind-placeholder",{afterDraw(t){t.getKeyShape().isPlaceholder=!0},getPath(t){const e=t.getModel(),{parentModel:n}=e,r=this.getStyle(t);let o,a=0;return n.hierarchy<=2?o=28:(o=20,a=4),i.getRectPath(-27.5,-o/2+a,55,o,r.radius)},getStyle:()=>({fill:"#91D5FF",radius:4,lineWidth:3}),drawExpandedButton(){},drawCollapsedButton(){},anchor:()=>[[0,1],[1,1]]})},function(t,e,n){n(8).registerEdge("mind-edge",{getEdetal:t=>t.children&&t.children.length>0&&!t.collapsed?2===t.hierarchy?24:18:0,getPath(t){const e=t.getPoints(),n=t.getSource(),r=t.getTarget(),i=n.getBBox(),o=r.getBBox(),a=r.getModel();let s=14,c=4;if(2===a.hierarchy&&(s=66,c=30),e[0].y===e[1].y){const t=3===a.hierarchy?24:18,n=this.getEdetal(a);return i.centerX=3){const t=3===a.hierarchy?24:18,n=this.getEdetal(a);if(i.centerXt.getGraph().getShapeObj("edge",{shape:"mind-edge"}),getPath(t){return this.getOriginShapeObject(t).getPath(t)},getStyle(t){return{...this.getOriginShapeObject(t).getStyle(t),stroke:"#91D5FF"}}})},function(t,e,n){const r=n(15),i=n(10);function o(t,e,n){const r=t.getGraph(),i=e.getModel(),o=t.getFirstChildrenBySide("left"),a=o[0]&&r.find(o[0].id);return r.add("node",{id:n,parent:e.id,label:"新建节点",side:i.children.length>2?"left":"right",nth:a?r.getNth(a):void 0})}r.registerCommand("append",{enable(t){const e=t.getCurrentPage(),n=e.getSelected();return e.isMind&&1===n.length},getItem(t){const e=t.getCurrentPage(),n=e.getGraph();return this.selectedItemId?n.find(this.selectedItemId):e.getSelected()[0]},execute(t){const e=t.getCurrentPage(),n=e.getGraph(),r=e.getRoot(),i=this.getItem(t),a=i.getModel(),s=a.hierarchy,c=i.getParent();let u;if(i.isRoot)u=o(e,i,this.addItemId);else{const t=n.getNth(i);u=n.add("node",{id:this.addItemId,parent:c.id,side:2===s&&3===r.children.length?"left":a.side,label:"新建节点",nth:"left"===a.side&&2===s?t:t+1})}e.clearSelected(),e.clearActived(),e.setSelected(u,!0),1===this.executeTimes&&(this.selectedItemId=i.id,this.addItemId=u.id,e.beginEditLabel(u))},back(t){const e=t.getCurrentPage();e.getGraph().remove(this.addItemId),e.clearSelected(),e.clearActived(),e.setSelected(this.selectedItemId,!0)},shortcutCodes:["Enter"]}),r.registerCommand("appendChild",{enable:function(t){const e=t.getCurrentPage(),n=e.getSelected();return e.isMind&&n.length>0},getItem(t){const e=t.getCurrentPage(),n=e.getGraph();return this.selectedItemId?n.find(this.selectedItemId):e.getSelected()[0]},execute(t){const e=t.getCurrentPage(),n=e.getGraph(),r=this.getItem(t);let i;i=r.isRoot?o(e,r,this.addItemId):n.add("node",{id:this.addItemId,parent:r.id,label:"新建节点"}),e.clearSelected(),e.clearActived(),e.setSelected(i,!0),1===this.executeTimes&&(this.selectedItemId=r.id,this.addItemId=i.id,e.beginEditLabel(i))},back(t){const e=t.getCurrentPage();e.getGraph().remove(this.addItemId),e.clearSelected(),e.clearActived(),e.setSelected(this.selectedItemId,!0)},shortcutCodes:["Tab"]}),r.registerCommand("moveMindNode",{enable(t){const e=t.getCurrentPage(),n=e.get("panItems");return e.isMind&&n&&n.length>0},execute(t){const e=t.getCurrentPage(),n=e.getGraph(),r=this.newParentId,o=this.newNth,a=this.newSide,s=i.clone(this.model);delete s.shape,delete s.side,n.remove(s.id),i.mix(s,{parent:r,nth:o,side:a});const c=n.add("node",s);e.clearSelected(),e.setSelected(c,!0)},back(t){const e=t.getCurrentPage(),n=e.getGraph(),r=this.originParentId,o=this.originNth,a=this.originSide,s=i.clone(this.model);delete s.shape,delete s.side,n.remove(s.id),i.mix(s,{parent:r,nth:o,side:a});const c=n.add("node",s);e.clearSelected(),e.setSelected(c,!0)}})},function(t,e,n){const r=n(6),i=n(9);t.exports=class extends i{getDefaultCfg(){return{type:"toolbar",container:null}}init(){this._initContainer()}_initContainer(){let t=this.container;if(!t)throw new Error("please set the container for the toolbar !");r.isString(t)&&(t=document.getElementById(t));const e=t.getElementsByClassName("command");this.commands=e}getCommandDoms(){return this.commands}}},function(t,e,n){const r=n(6),i=n(9);t.exports=class extends i{getDefaultCfg(){return{type:"contextmenu",container:null}}init(){this._initContainer()}_initContainer(){let t=this.container;if(!t)throw new Error("please set the container for the tontextmenu !");r.isString(t)&&(t=document.getElementById(t));const e=t.getElementsByClassName("command");t.style.position="absolute",t.style["z-index"]=2,t.style.top="0px",t.style.left="0px",this.commands=e,this.containerDom=t}bindEvent(){const t=this.commands;r.each(t,t=>{r.addEventListener(t,"click",()=>{-1===t.className.indexOf("disable")&&this.hide()})})}switch(t){const e=this.containerDom.getElementsByClassName("menu");r.each(e,e=>{e.dataset.status===t?e.style.display="block":e.style.display="none"})}getCommandDoms(){return this.commands}show(){const t=this.containerDom;this.editor.getCurrentPage().setSignal("preventWheelPan",!0),t.style.display="block"}hide(){const t=this.containerDom;this.editor.getCurrentPage().setSignal("preventWheelPan",!1),t.style.display="none"}move(t,e){const n=this.containerDom,i=r.getBoundingClientRect(n),o=parseFloat(r.getStyle(n,"top")),a=parseFloat(r.getStyle(n,"left"));n.style.left=a+(t-i.left)+"px",n.style.top=o+(e-i.top)+"px"}}},function(t,e,n){const r=n(12);n(124),n(127),t.exports=r},function(t,e,n){n(125),n(126)},function(t,e,n){const{mouseEnterEdge:r,startMove:i,mouseLeaveEdge:o,mouseMoveEdge:a,endMove:s}=n(20);let c,u;n(12).registerBehaviour("bpmnMoveEdgeController",t=>{const e=t.getGraph(),n=e.getRootGroup();let h;function l(){t.set("panItemDelegation",void 0),t.set("panItemStartBox",void 0),t.set("panItemStartPoint",void 0),h=void 0}e.behaviourOn("edge:mouseenter",n=>{!c&&n.item&&(u=n.item,r({graph:e,bpmn:t,ev:n,backUpCursor:!0}))}),e.behaviourOn("edge:mousedown",t=>{const n=t.item;i(e,t),c=n}),e.behaviourOn("mouseup",()=>{c&&(s({graph:e,item:c}),c=void 0)}),e.behaviourOn("mousemove",n=>{c?a(e,c,n):u&&r({graph:e,bpmn:t,ev:{...n,item:u},backUpCursor:!1})}),e.behaviourOn("edge:mouseleave",()=>{c||u&&(o({graph:e,bpmn:t,item:u}),u=void 0)}),e.behaviourOn("node:dragstart",e=>{const r=e.item.getBBox();h=t.getDelegation([r],n),t.set("bpmnNodePanDelegation",h),t.set("bpmnNodePanStartBox",r),t.set("bpmnNodePanStartPoint",{x:e.x,y:e.y}),t.set("bpmnNodePanStartItem",e.item)}),e.behaviourOn("node:dragend",n=>{const r=t.get("bpmnNodePanDelegation"),i=t.get("bpmnNodePanStartPoint"),o=t.get("bpmnNodePanStartItem");o&&o.getEdges().forEach(t=>{e.update(t,{nodeMoved:{item:o.id,start:i,delta:{x:n.x-i.x,y:n.y-i.y}}})}),r.remove(),l()})},["startPanItem","processPanItem","endPanItem"])},function(t,e,n){n(12).registerBehaviour("hoverNodeShowArrowController",t=>{const e=t.getGraph(),n=t.get("arrowController"),{long:r,thickness:i}=n;let o;e.on("node:mouseenter",a=>{if(t.getSignal("panningItem")||t.getSignal("dragEdge"))return;const{topArrow:s,bottomArrow:c,leftArrow:u,rightArrow:h}=n;o=a.item;const l=o.getBBox(),d=e.getDomPoint({x:l.centerX,y:l.minY}),f=e.getDomPoint({x:l.minX,y:l.centerY}),g=e.getDomPoint({x:l.centerX,y:l.maxY}),p=e.getDomPoint({x:l.maxX,y:l.centerY});s.css({top:d.y-(r+10)+"px",left:d.x-i/2+"px",transform:"rotate(-90deg)"}),c.css({top:g.y+10+"px",left:g.x-i/2+"px",transform:"rotate(90deg)"}),u.css({top:f.y-i/2+"px",left:f.x-(r+10)+"px",transform:"rotate(180deg)"}),h.css({top:p.y-i/2+"px",left:p.x+10+"px"}),s.setAttribute("anchorIndex",0),c.setAttribute("anchorIndex",2),u.setAttribute("anchorIndex",3),h.setAttribute("anchorIndex",1),t.showArrowController(o)}),e.behaviourOn("mousemove",({x:e,y:n})=>{if(!o)return;const i=o.getBBox(),a=r+10,s=i.minX-a,c=i.minY-a,u=i.maxX+a,h=i.maxY+a;(eu||n>h)&&(t.hideArrowController(),o=void 0)})})},function(t,e,n){n(128);n(12).registerNode("bpmn-base",{anchor:null})},function(t,e,n){"use strict";n.r(e);var r=n(12),i=n.n(r),o=n(0);function a({bbox:t,shape:e="ROUNDED_RECT",point:n,vertical:r}){r=!!r;const i={true:"x",false:"y"},o={true:"minX",false:"minY"},a={true:"maxX",false:"maxY"};switch(e){case"ROUNDED_RECT":if(n[i[r]]>=t[o[r]]+4&&n[i[r]]<=t[a[r]]-4)return{added:void 0,joint:{x:r?n.x:n.x>t.centerX?t.maxX:t.minX,y:r?n.y>t.centerY?t.maxY:t.minY:n.y}};if(n[i[r]]>=t[o[r]]&&n[i[r]]t.centerX?t.maxX-4+Math.sqrt(16-Math.pow(t.minY+4-n.y,2)):t.minX+4-Math.sqrt(16-Math.pow(t.minY+4-n.y,2)),y:r?n.y>t.centerY?t.maxY-4+Math.sqrt(16-Math.pow(t.minX+4-n.x,2)):t.minY+4-Math.sqrt(16-Math.pow(t.minX+4-n.x,2)):n.y}};if(n[i[r]]>=t[a[r]]-4&&n[i[r]]<=t[a[r]])return{added:void 0,joint:{x:r?n.x:n.x>t.centerX?t.maxX-4+Math.sqrt(16-Math.pow(n.y-t.maxY+4,2)):t.minX+4-Math.sqrt(16-Math.pow(n.y-t.maxY+4,2)),y:r?n.y>t.centerY?t.maxY-4+Math.sqrt(16-Math.pow(n.x-t.maxX+4,2)):t.minY+4-Math.sqrt(16-Math.pow(n.x-t.maxX+4,2)):n.y}};break;case"CIRCLE":if(n[i[r]]>=t[o[r]]&&n[i[r]]<=t[a[r]])return{added:void 0,joint:{x:r?n.x:n.x>t.centerX?t.centerX+Math.sqrt(16-Math.pow(t.centerY-n.y)):t.centerX-Math.sqrt(16-Math.pow(t.centerY-n.y)),y:r?n.y>t.centerY?t.centerY+Math.sqrt(16-Math.pow(t.centerX-n.x)):t.centerY-Math.sqrt(16-Math.pow(t.centerX-n.x)):n.y}};break;case"RHOMEBUS":if(n[i[r]]>=t[o[r]]&&n[i[r]]<=t[a[r]])return{added:void 0,joint:{x:r?n.x:n.x>t.centerX?n.yt.centerY?n.x=t[o[r]]&&n[i[r]]<=t[a[r]])return{added:void 0,joint:{x:r?n.x:n.x>t.centerX?t.maxX:t.minX,y:r?n.y>t.centerY?t.maxY:t.minY:n.y}}}return r?n.x=150&&(n.helpLine=void 0,n.helpLineTime=void 0),n.helpLine&&e.addShape("path",{attrs:{path:[["M",n.helpLine[0].x,n.helpLine[0].y],["L",n.helpLine[1].x,n.helpLine[1].y]],lineAppendWidth:8,lineWidth:1,strokeOpacity:.92,stroke:"rgba(255,139,48)"}}),s}})}])}));