37 lines
148 KiB
JavaScript
37 lines
148 KiB
JavaScript
import{c as He}from"./chunk-4KE642ED-DwBAzfS-.js";import{p as ze}from"./treemap-KMMF4GRG-7ORZ52ND-CoiuN2Kf.js";import{m as A,aN as Ve,b7 as Be,p as we,H as We,U as je,j as $e,e as qe,$ as Je,G as Ze,N as Ke,L as Qe,O as ti,r as ei,a as ue,bj as fe,bo as ge,o as ii,i as ri,J as ni,q as oi,aM as pe,bp as ai,bq as si}from"./mermaid.esm.min-RL45CjrO.js";import{r as xe}from"./chunk-7SRKK4IT-8I_gr733.js";import"./chunk-OMTJKCYW-DMe1YJoF.js";import"./app-BwvsBlHw.js";var _e=pe((w,O)=>{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b():typeof define=="function"&&define.amd?define([],b):typeof w=="object"?w.layoutBase=b():L.layoutBase=b()}),"webpackUniversalModuleDefinition")(w,function(){return(function(L){var b={};function T(c){if(b[c])return b[c].exports;var h=b[c]={i:c,l:!1,exports:{}};return L[c].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return A(T,"__webpack_require__"),T.m=L,T.c=b,T.i=function(c){return c},T.d=function(c,h,o){T.o(c,h)||Object.defineProperty(c,h,{configurable:!1,enumerable:!0,get:o})},T.n=function(c){var h=c&&c.__esModule?A(function(){return c.default},"getDefault"):A(function(){return c},"getModuleExports");return T.d(h,"a",h),h},T.o=function(c,h){return Object.prototype.hasOwnProperty.call(c,h)},T.p="",T(T.s=28)})([(function(L,b,T){function c(){}A(c,"LayoutConstants"),c.QUALITY=1,c.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,c.DEFAULT_INCREMENTAL=!1,c.DEFAULT_ANIMATION_ON_LAYOUT=!0,c.DEFAULT_ANIMATION_DURING_LAYOUT=!1,c.DEFAULT_ANIMATION_PERIOD=50,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,c.DEFAULT_GRAPH_MARGIN=15,c.NODE_DIMENSIONS_INCLUDE_LABELS=!1,c.SIMPLE_NODE_SIZE=40,c.SIMPLE_NODE_HALF_SIZE=c.SIMPLE_NODE_SIZE/2,c.EMPTY_COMPOUND_NODE_SIZE=40,c.MIN_EDGE_LENGTH=1,c.WORLD_BOUNDARY=1e6,c.INITIAL_WORLD_BOUNDARY=c.WORLD_BOUNDARY/1e3,c.WORLD_CENTER_X=1200,c.WORLD_CENTER_Y=900,L.exports=c}),(function(L,b,T){var c=T(2),h=T(8),o=T(9);function i(a,r,f){c.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=r}A(i,"LEdge"),i.prototype=Object.create(c.prototype);for(var e in c)i[e]=c[e];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,r){for(var f=this.getOtherEnd(a),n=r.getGraphManager().getRoot();;){if(f.getOwner()==r)return f;if(f.getOwner()==n)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=i}),(function(L,b,T){function c(h){this.vGraphObject=h}A(c,"LGraphObject"),L.exports=c}),(function(L,b,T){var c=T(2),h=T(10),o=T(13),i=T(0),e=T(16),a=T(5);function r(n,t,l,u){l==null&&u==null&&(u=t),c.call(this,u),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=n,l!=null&&t!=null?this.rect=new o(t.x,t.y,l.width,l.height):this.rect=new o}A(r,"LNode"),r.prototype=Object.create(c.prototype);for(var f in c)r[f]=c[f];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(n){this.rect.width=n},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(n){this.rect.height=n},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(n,t){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=t.width,this.rect.height=t.height},r.prototype.setCenter=function(n,t){this.rect.x=n-this.rect.width/2,this.rect.y=t-this.rect.height/2},r.prototype.setLocation=function(n,t){this.rect.x=n,this.rect.y=t},r.prototype.moveBy=function(n,t){this.rect.x+=n,this.rect.y+=t},r.prototype.getEdgeListToNode=function(n){var t=[],l=this;return l.edges.forEach(function(u){if(u.target==n){if(u.source!=l)throw"Incorrect edge source!";t.push(u)}}),t},r.prototype.getEdgesBetween=function(n){var t=[],l=this;return l.edges.forEach(function(u){if(!(u.source==l||u.target==l))throw"Incorrect edge source and/or target";(u.target==n||u.source==n)&&t.push(u)}),t},r.prototype.getNeighborsList=function(){var n=new Set,t=this;return t.edges.forEach(function(l){if(l.source==t)n.add(l.target);else{if(l.target!=t)throw"Incorrect incidency!";n.add(l.source)}}),n},r.prototype.withChildren=function(){var n=new Set,t,l;if(n.add(this),this.child!=null)for(var u=this.child.getNodes(),d=0;d<u.length;d++)t=u[d],l=t.withChildren(),l.forEach(function(N){n.add(N)});return n},r.prototype.getNoOfChildren=function(){var n=0,t;if(this.child==null)n=1;else for(var l=this.child.getNodes(),u=0;u<l.length;u++)t=l[u],n+=t.getNoOfChildren();return n==0&&(n=1),n},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},r.prototype.scatter=function(){var n,t,l=-i.INITIAL_WORLD_BOUNDARY,u=i.INITIAL_WORLD_BOUNDARY;n=i.WORLD_CENTER_X+e.nextDouble()*(u-l)+l;var d=-i.INITIAL_WORLD_BOUNDARY,N=i.INITIAL_WORLD_BOUNDARY;t=i.WORLD_CENTER_Y+e.nextDouble()*(N-d)+d,this.rect.x=n,this.rect.y=t},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var t=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(t+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>t?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(t+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(l+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(l+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(n){var t=this.rect.x;t>i.WORLD_BOUNDARY?t=i.WORLD_BOUNDARY:t<-i.WORLD_BOUNDARY&&(t=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var u=new a(t,l),d=n.inverseTransformPoint(u);this.setLocation(d.x,d.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=r}),(function(L,b,T){var c=T(0);function h(){}A(h,"FDLayoutConstants");for(var o in c)h[o]=c[o];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h}),(function(L,b,T){function c(h,o){h==null&&o==null?(this.x=0,this.y=0):(this.x=h,this.y=o)}A(c,"PointD"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.setX=function(h){this.x=h},c.prototype.setY=function(h){this.y=h},c.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},c.prototype.getCopy=function(){return new c(this.x,this.y)},c.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=c}),(function(L,b,T){var c=T(2),h=T(10),o=T(0),i=T(7),e=T(3),a=T(1),r=T(13),f=T(12),n=T(11);function t(u,d,N){c.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}A(t,"LGraph"),t.prototype=Object.create(c.prototype);for(var l in c)t[l]=c[l];t.prototype.getNodes=function(){return this.nodes},t.prototype.getEdges=function(){return this.edges},t.prototype.getGraphManager=function(){return this.graphManager},t.prototype.getParent=function(){return this.parent},t.prototype.getLeft=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getTop=function(){return this.top},t.prototype.getBottom=function(){return this.bottom},t.prototype.isConnected=function(){return this.isConnected},t.prototype.add=function(u,d,N){if(d==null&&N==null){var g=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var E=u;if(!(this.getNodes().indexOf(d)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(d.owner==N.owner&&d.owner==this))throw"Both owners must be this graph!";return d.owner!=N.owner?null:(E.source=d,E.target=N,E.isInterGraph=!1,this.getEdges().push(E),d.edges.push(E),N!=d&&N.edges.push(E),E)}},t.prototype.remove=function(u){var d=u;if(u instanceof e){if(d==null)throw"Node is null!";if(!(d.owner!=null&&d.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=d.edges.slice(),g,E=N.length,_=0;_<E;_++)g=N[_],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var C=this.nodes.indexOf(d);if(C==-1)throw"Node not in owner node list!";this.nodes.splice(C,1)}else if(u instanceof a){var g=u;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var U=g.source.edges.indexOf(g),H=g.target.edges.indexOf(g);if(!(U>-1&&H>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(U,1),g.target!=g.source&&g.target.edges.splice(H,1);var C=g.source.owner.getEdges().indexOf(g);if(C==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(C,1)}},t.prototype.updateLeftTop=function(){for(var u=h.MAX_VALUE,d=h.MAX_VALUE,N,g,E,_=this.getNodes(),C=_.length,U=0;U<C;U++){var H=_[U];N=H.getTop(),g=H.getLeft(),u>N&&(u=N),d>g&&(d=g)}return u==h.MAX_VALUE?null:(_[0].getParent().paddingLeft!=null?E=_[0].getParent().paddingLeft:E=this.margin,this.left=d-E,this.top=u-E,new f(this.left,this.top))},t.prototype.updateBounds=function(u){for(var d=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,_,C,U,H,V,B=this.nodes,q=B.length,x=0;x<q;x++){var st=B[x];u&&st.child!=null&&st.updateBounds(),_=st.getLeft(),C=st.getRight(),U=st.getTop(),H=st.getBottom(),d>_&&(d=_),N<C&&(N=C),g>U&&(g=U),E<H&&(E=H)}var s=new r(d,g,N-d,E-g);d==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),B[0].getParent().paddingLeft!=null?V=B[0].getParent().paddingLeft:V=this.margin,this.left=s.x-V,this.right=s.x+s.width+V,this.top=s.y-V,this.bottom=s.y+s.height+V},t.calculateBounds=function(u){for(var d=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,_,C,U,H,V=u.length,B=0;B<V;B++){var q=u[B];_=q.getLeft(),C=q.getRight(),U=q.getTop(),H=q.getBottom(),d>_&&(d=_),N<C&&(N=C),g>U&&(g=U),E<H&&(E=H)}var x=new r(d,g,N-d,E-g);return x},t.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.prototype.calcEstimatedSize=function(){for(var u=0,d=this.nodes,N=d.length,g=0;g<N;g++){var E=d[g];u+=E.calcEstimatedSize()}return u==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=u/Math.sqrt(this.nodes.length),this.estimatedSize},t.prototype.updateConnected=function(){var u=this;if(this.nodes.length==0){this.isConnected=!0;return}var d=new n,N=new Set,g=this.nodes[0],E,_,C=g.withChildren();for(C.forEach(function(x){d.push(x),N.add(x)});d.length!==0;){g=d.shift(),E=g.getEdges();for(var U=E.length,H=0;H<U;H++){var V=E[H];if(_=V.getOtherEndInGraph(g,this),_!=null&&!N.has(_)){var B=_.withChildren();B.forEach(function(x){d.push(x),N.add(x)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var q=0;N.forEach(function(x){x.owner==u&&q++}),q==this.nodes.length&&(this.isConnected=!0)}},L.exports=t}),(function(L,b,T){var c,h=T(1);function o(i){c=T(6),this.layout=i,this.graphs=[],this.edges=[]}A(o,"LGraphManager"),o.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},o.prototype.add=function(i,e,a,r,f){if(a==null&&r==null&&f==null){if(i==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return i.parent=e,e.child=i,i}else{f=a,r=e,a=i;var n=r.getOwner(),t=f.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(t!=null&&t.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==t)return a.isInterGraph=!1,n.add(a,r,f);if(a.isInterGraph=!0,a.source=r,a.target=f,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},o.prototype.remove=function(i){if(i instanceof c){var e=i;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(e.getEdges());for(var r,f=a.length,n=0;n<f;n++)r=a[n],e.remove(r);var t=[];t=t.concat(e.getNodes());var l;f=t.length;for(var n=0;n<f;n++)l=t[n],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(e);this.graphs.splice(u,1),e.parent=null}else if(i instanceof h){if(r=i,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var u=r.source.edges.indexOf(r);if(r.source.edges.splice(u,1),u=r.target.edges.indexOf(r),r.target.edges.splice(u,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var u=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(u,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],e=this.getGraphs(),a=e.length,r=0;r<a;r++)i=i.concat(e[r].getNodes());this.allNodes=i}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){for(var i=[],e=this.getGraphs(),a=e.length,r=0;r<e.length;r++)i=i.concat(e[r].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(i,e){if(!(i!=null&&e!=null))throw"assert failed";if(i==e)return!0;var a=i.getOwner(),r;do{if(r=a.getParent(),r==null)break;if(r==e)return!0;if(a=r.getOwner(),a==null)break}while(!0);a=e.getOwner();do{if(r=a.getParent(),r==null)break;if(r==i)return!0;if(a=r.getOwner(),a==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var i,e,a,r,f,n=this.getAllEdges(),t=n.length,l=0;l<t;l++){if(i=n[l],e=i.source,a=i.target,i.lca=null,i.sourceInLca=e,i.targetInLca=a,e==a){i.lca=e.getOwner();continue}for(r=e.getOwner();i.lca==null;){for(i.targetInLca=a,f=a.getOwner();i.lca==null;){if(f==r){i.lca=f;break}if(f==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=f.getParent(),f=i.targetInLca.getOwner()}if(r==this.rootGraph)break;i.lca==null&&(i.sourceInLca=r.getParent(),r=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(i,e){if(i==e)return i.getOwner();var a=i.getOwner();do{if(a==null)break;var r=e.getOwner();do{if(r==null)break;if(r==a)return r;r=r.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},o.prototype.calcInclusionTreeDepths=function(i,e){i==null&&e==null&&(i=this.rootGraph,e=1);for(var a,r=i.getNodes(),f=r.length,n=0;n<f;n++)a=r[n],a.inclusionTreeDepth=e,a.child!=null&&this.calcInclusionTreeDepths(a.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var i,e=[],a=this.edges.length,r=0;r<a;r++)i=this.edges[r],this.isOneAncestorOfOther(i.source,i.target)&&e.push(i);for(var r=0;r<e.length;r++)this.remove(e[r]);return!1},L.exports=o}),(function(L,b,T){var c=T(12);function h(){}A(h,"IGeometry"),h.calcSeparationAmount=function(o,i,e,a){if(!o.intersects(i))throw"assert failed";var r=new Array(2);this.decideDirectionsForOverlappingNodes(o,i,r),e[0]=Math.min(o.getRight(),i.getRight())-Math.max(o.x,i.x),e[1]=Math.min(o.getBottom(),i.getBottom())-Math.max(o.y,i.y),o.getX()<=i.getX()&&o.getRight()>=i.getRight()?e[0]+=Math.min(i.getX()-o.getX(),o.getRight()-i.getRight()):i.getX()<=o.getX()&&i.getRight()>=o.getRight()&&(e[0]+=Math.min(o.getX()-i.getX(),i.getRight()-o.getRight())),o.getY()<=i.getY()&&o.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-o.getY(),o.getBottom()-i.getBottom()):i.getY()<=o.getY()&&i.getBottom()>=o.getBottom()&&(e[1]+=Math.min(o.getY()-i.getY(),i.getBottom()-o.getBottom()));var f=Math.abs((i.getCenterY()-o.getCenterY())/(i.getCenterX()-o.getCenterX()));i.getCenterY()===o.getCenterY()&&i.getCenterX()===o.getCenterX()&&(f=1);var n=f*e[0],t=e[1]/f;e[0]<t?t=e[0]:n=e[1],e[0]=-1*r[0]*(t/2+a),e[1]=-1*r[1]*(n/2+a)},h.decideDirectionsForOverlappingNodes=function(o,i,e){o.getCenterX()<i.getCenterX()?e[0]=-1:e[0]=1,o.getCenterY()<i.getCenterY()?e[1]=-1:e[1]=1},h.getIntersection2=function(o,i,e){var a=o.getCenterX(),r=o.getCenterY(),f=i.getCenterX(),n=i.getCenterY();if(o.intersects(i))return e[0]=a,e[1]=r,e[2]=f,e[3]=n,!0;var t=o.getX(),l=o.getY(),u=o.getRight(),d=o.getX(),N=o.getBottom(),g=o.getRight(),E=o.getWidthHalf(),_=o.getHeightHalf(),C=i.getX(),U=i.getY(),H=i.getRight(),V=i.getX(),B=i.getBottom(),q=i.getRight(),x=i.getWidthHalf(),st=i.getHeightHalf(),s=!1,y=!1;if(a===f){if(r>n)return e[0]=a,e[1]=l,e[2]=f,e[3]=B,!1;if(r<n)return e[0]=a,e[1]=N,e[2]=f,e[3]=U,!1}else if(r===n){if(a>f)return e[0]=t,e[1]=r,e[2]=H,e[3]=n,!1;if(a<f)return e[0]=u,e[1]=r,e[2]=C,e[3]=n,!1}else{var m=o.height/o.width,v=i.height/i.width,p=(n-r)/(f-a),D=void 0,I=void 0,R=void 0,X=void 0,Y=void 0,W=void 0;if(-m===p?a>f?(e[0]=d,e[1]=N,s=!0):(e[0]=u,e[1]=l,s=!0):m===p&&(a>f?(e[0]=t,e[1]=l,s=!0):(e[0]=g,e[1]=N,s=!0)),-v===p?f>a?(e[2]=V,e[3]=B,y=!0):(e[2]=H,e[3]=U,y=!0):v===p&&(f>a?(e[2]=C,e[3]=U,y=!0):(e[2]=q,e[3]=B,y=!0)),s&&y)return!1;if(a>f?r>n?(D=this.getCardinalDirection(m,p,4),I=this.getCardinalDirection(v,p,2)):(D=this.getCardinalDirection(-m,p,3),I=this.getCardinalDirection(-v,p,1)):r>n?(D=this.getCardinalDirection(-m,p,1),I=this.getCardinalDirection(-v,p,3)):(D=this.getCardinalDirection(m,p,2),I=this.getCardinalDirection(v,p,4)),!s)switch(D){case 1:X=l,R=a+-_/p,e[0]=R,e[1]=X;break;case 2:R=g,X=r+E*p,e[0]=R,e[1]=X;break;case 3:X=N,R=a+_/p,e[0]=R,e[1]=X;break;case 4:R=d,X=r+-E*p,e[0]=R,e[1]=X;break}if(!y)switch(I){case 1:W=U,Y=f+-st/p,e[2]=Y,e[3]=W;break;case 2:Y=q,W=n+x*p,e[2]=Y,e[3]=W;break;case 3:W=B,Y=f+st/p,e[2]=Y,e[3]=W;break;case 4:Y=V,W=n+-x*p,e[2]=Y,e[3]=W;break}}return!1},h.getCardinalDirection=function(o,i,e){return o>i?e:1+e%4},h.getIntersection=function(o,i,e,a){if(a==null)return this.getIntersection2(o,i,e);var r=o.x,f=o.y,n=i.x,t=i.y,l=e.x,u=e.y,d=a.x,N=a.y,g=void 0,E=void 0,_=void 0,C=void 0,U=void 0,H=void 0,V=void 0,B=void 0,q=void 0;return _=t-f,U=r-n,V=n*f-r*t,C=N-u,H=l-d,B=d*u-l*N,q=_*H-C*U,q===0?null:(g=(U*B-H*V)/q,E=(C*V-_*B)/q,new c(g,E))},h.angleOfVector=function(o,i,e,a){var r=void 0;return o!==e?(r=Math.atan((a-i)/(e-o)),e<o?r+=Math.PI:a<i&&(r+=this.TWO_PI)):a<i?r=this.ONE_AND_HALF_PI:r=this.HALF_PI,r},h.doIntersect=function(o,i,e,a){var r=o.x,f=o.y,n=i.x,t=i.y,l=e.x,u=e.y,d=a.x,N=a.y,g=(n-r)*(N-u)-(d-l)*(t-f);if(g===0)return!1;var E=((N-u)*(d-r)+(l-d)*(N-f))/g,_=((f-t)*(d-r)+(n-r)*(N-f))/g;return 0<E&&E<1&&0<_&&_<1},h.findCircleLineIntersections=function(o,i,e,a,r,f,n){var t=(e-o)*(e-o)+(a-i)*(a-i),l=2*((o-r)*(e-o)+(i-f)*(a-i)),u=(o-r)*(o-r)+(i-f)*(i-f)-n*n,d=l*l-4*t*u;if(d>=0){var N=(-l+Math.sqrt(l*l-4*t*u))/(2*t),g=(-l-Math.sqrt(l*l-4*t*u))/(2*t),E=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:E}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h}),(function(L,b,T){function c(){}A(c,"IMath"),c.sign=function(h){return h>0?1:h<0?-1:0},c.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},c.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=c}),(function(L,b,T){function c(){}A(c,"Integer"),c.MAX_VALUE=2147483647,c.MIN_VALUE=-2147483648,L.exports=c}),(function(L,b,T){var c=(function(){function r(f,n){for(var t=0;t<n.length;t++){var l=n[t];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}return A(r,"defineProperties"),function(f,n,t){return n&&r(f.prototype,n),t&&r(f,t),f}})();function h(r,f){if(!(r instanceof f))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var o=A(function(r){return{value:r,next:null,prev:null}},"nodeFrom"),i=A(function(r,f,n,t){return r!==null?r.next=f:t.head=f,n!==null?n.prev=f:t.tail=f,f.prev=r,f.next=n,t.length++,f},"add"),e=A(function(r,f){var n=r.prev,t=r.next;return n!==null?n.next=t:f.head=t,t!==null?t.prev=n:f.tail=n,r.prev=r.next=null,f.length--,r},"_remove"),a=(function(){function r(f){var n=this;h(this,r),this.length=0,this.head=null,this.tail=null,f?.forEach(function(t){return n.push(t)})}return A(r,"LinkedList"),c(r,[{key:"size",value:A(function(){return this.length},"size")},{key:"insertBefore",value:A(function(f,n){return i(n.prev,o(f),n,this)},"insertBefore")},{key:"insertAfter",value:A(function(f,n){return i(n,o(f),n.next,this)},"insertAfter")},{key:"insertNodeBefore",value:A(function(f,n){return i(n.prev,f,n,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:A(function(f,n){return i(n,f,n.next,this)},"insertNodeAfter")},{key:"push",value:A(function(f){return i(this.tail,o(f),null,this)},"push")},{key:"unshift",value:A(function(f){return i(null,o(f),this.head,this)},"unshift")},{key:"remove",value:A(function(f){return e(f,this)},"remove")},{key:"pop",value:A(function(){return e(this.tail,this).value},"pop")},{key:"popNode",value:A(function(){return e(this.tail,this)},"popNode")},{key:"shift",value:A(function(){return e(this.head,this).value},"shift")},{key:"shiftNode",value:A(function(){return e(this.head,this)},"shiftNode")},{key:"get_object_at",value:A(function(f){if(f<=this.length()){for(var n=1,t=this.head;n<f;)t=t.next,n++;return t.value}},"get_object_at")},{key:"set_object_at",value:A(function(f,n){if(f<=this.length()){for(var t=1,l=this.head;t<f;)l=l.next,t++;l.value=n}},"set_object_at")}]),r})();L.exports=a}),(function(L,b,T){function c(h,o,i){this.x=null,this.y=null,h==null&&o==null&&i==null?(this.x=0,this.y=0):typeof h=="number"&&typeof o=="number"&&i==null?(this.x=h,this.y=o):h.constructor.name=="Point"&&o==null&&i==null&&(i=h,this.x=i.x,this.y=i.y)}A(c,"Point"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.getLocation=function(){return new c(this.x,this.y)},c.prototype.setLocation=function(h,o,i){h.constructor.name=="Point"&&o==null&&i==null?(i=h,this.setLocation(i.x,i.y)):typeof h=="number"&&typeof o=="number"&&i==null&&(parseInt(h)==h&&parseInt(o)==o?this.move(h,o):(this.x=Math.floor(h+.5),this.y=Math.floor(o+.5)))},c.prototype.move=function(h,o){this.x=h,this.y=o},c.prototype.translate=function(h,o){this.x+=h,this.y+=o},c.prototype.equals=function(h){if(h.constructor.name=="Point"){var o=h;return this.x==o.x&&this.y==o.y}return this==h},c.prototype.toString=function(){return new c().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=c}),(function(L,b,T){function c(h,o,i,e){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&o!=null&&i!=null&&e!=null&&(this.x=h,this.y=o,this.width=i,this.height=e)}A(c,"RectangleD"),c.prototype.getX=function(){return this.x},c.prototype.setX=function(h){this.x=h},c.prototype.getY=function(){return this.y},c.prototype.setY=function(h){this.y=h},c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},c.prototype.getRight=function(){return this.x+this.width},c.prototype.getBottom=function(){return this.y+this.height},c.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.getBottom()<this.y)},c.prototype.getCenterX=function(){return this.x+this.width/2},c.prototype.getMinX=function(){return this.getX()},c.prototype.getMaxX=function(){return this.getX()+this.width},c.prototype.getCenterY=function(){return this.y+this.height/2},c.prototype.getMinY=function(){return this.getY()},c.prototype.getMaxY=function(){return this.getY()+this.height},c.prototype.getWidthHalf=function(){return this.width/2},c.prototype.getHeightHalf=function(){return this.height/2},L.exports=c}),(function(L,b,T){var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function h(){}A(h,"UniqueIDGeneretor"),h.lastID=0,h.createID=function(o){return h.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=h.getString(),h.lastID++),o.uniqueID)},h.getString=function(o){return o==null&&(o=h.lastID),"Object#"+o},h.isPrimitive=function(o){var i=typeof o>"u"?"undefined":c(o);return o==null||i!="object"&&i!="function"},L.exports=h}),(function(L,b,T){function c(l){if(Array.isArray(l)){for(var u=0,d=Array(l.length);u<l.length;u++)d[u]=l[u];return d}else return Array.from(l)}A(c,"_toConsumableArray");var h=T(0),o=T(7),i=T(3),e=T(1),a=T(6),r=T(5),f=T(17),n=T(29);function t(l){n.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}A(t,"Layout"),t.RANDOM_SEED=1,t.prototype=Object.create(n.prototype),t.prototype.getGraphManager=function(){return this.graphManager},t.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},t.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},t.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},t.prototype.newGraphManager=function(){var l=new o(this);return this.graphManager=l,l},t.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},t.prototype.newNode=function(l){return new i(this.graphManager,l)},t.prototype.newEdge=function(l){return new e(null,null,l)},t.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},t.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),h.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},t.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},t.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,u=this.graphManager.getAllEdges(),d=0;d<u.length;d++)l=u[d];for(var N,g=this.graphManager.getRoot().getNodes(),d=0;d<g.length;d++)N=g[d];this.update(this.graphManager.getRoot())}},t.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof i){var u=l;if(u.getChild()!=null)for(var d=u.getChild().getNodes(),N=0;N<d.length;N++)update(d[N]);if(u.vGraphObject!=null){var g=u.vGraphObject;g.update(u)}}else if(l instanceof e){var E=l;if(E.vGraphObject!=null){var _=E.vGraphObject;_.update(E)}}else if(l instanceof a){var C=l;if(C.vGraphObject!=null){var U=C.vGraphObject;U.update(C)}}},t.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},t.prototype.transform=function(l){if(l==null)this.transform(new r(0,0));else{var u=new f,d=this.graphManager.getRoot().updateLeftTop();if(d!=null){u.setWorldOrgX(l.x),u.setWorldOrgY(l.y),u.setDeviceOrgX(d.x),u.setDeviceOrgY(d.y);for(var N=this.getAllNodes(),g,E=0;E<N.length;E++)g=N[E],g.transform(u)}}},t.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var u,d,N=l.getNodes(),g=0;g<N.length;g++)u=N[g],d=u.getChild(),d==null||d.getNodes().length==0?u.scatter():(this.positionNodesRandomly(d),u.updateBounds())},t.prototype.getFlatForest=function(){for(var l=[],u=!0,d=this.graphManager.getRoot().getNodes(),N=!0,g=0;g<d.length;g++)d[g].getChild()!=null&&(N=!1);if(!N)return l;var E=new Set,_=[],C=new Map,U=[];for(U=U.concat(d);U.length>0&&u;){for(_.push(U[0]);_.length>0&&u;){var H=_[0];_.splice(0,1),E.add(H);for(var V=H.getEdges(),g=0;g<V.length;g++){var B=V[g].getOtherEnd(H);if(C.get(H)!=B)if(!E.has(B))_.push(B),C.set(B,H);else{u=!1;break}}}if(!u)l=[];else{var q=[].concat(c(E));l.push(q);for(var g=0;g<q.length;g++){var x=q[g],st=U.indexOf(x);st>-1&&U.splice(st,1)}E=new Set,C=new Map}}return l},t.prototype.createDummyNodesForBendpoints=function(l){for(var u=[],d=l.source,N=this.graphManager.calcLowestCommonAncestor(l.source,l.target),g=0;g<l.bendpoints.length;g++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),N.add(E);var _=this.newEdge(null);this.graphManager.add(_,d,E),u.add(E),d=E}var _=this.newEdge(null);return this.graphManager.add(_,d,l.target),this.edgeToDummyNodes.set(l,u),l.isInterGraph()?this.graphManager.remove(l):N.remove(l),u},t.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(c(this.edgeToDummyNodes.keys())).concat(l);for(var u=0;u<l.length;u++){var d=l[u];if(d.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(d),g=0;g<N.length;g++){var E=N[g],_=new r(E.getCenterX(),E.getCenterY()),C=d.bendpoints.get(g);C.x=_.x,C.y=_.y,E.getOwner().remove(E)}this.graphManager.add(d,d.source,d.target)}}},t.transform=function(l,u,d,N){if(d!=null&&N!=null){var g=u;if(l<=50){var E=u/d;g-=(u-E)/50*(50-l)}else{var _=u*N;g+=(_-u)/50*(l-50)}return g}else{var C,U;return l<=50?(C=9*u/500,U=u/10):(C=9*u/50,U=-8*u),C*l+U}},t.findCenterOfTree=function(l){var u=[];u=u.concat(l);var d=[],N=new Map,g=!1,E=null;(u.length==1||u.length==2)&&(g=!0,E=u[0]);for(var _=0;_<u.length;_++){var C=u[_],U=C.getNeighborsList().size;N.set(C,C.getNeighborsList().size),U==1&&d.push(C)}var H=[];for(H=H.concat(d);!g;){var V=[];V=V.concat(H),H=[];for(var _=0;_<u.length;_++){var C=u[_],B=u.indexOf(C);B>=0&&u.splice(B,1);var q=C.getNeighborsList();q.forEach(function(s){if(d.indexOf(s)<0){var y=N.get(s),m=y-1;m==1&&H.push(s),N.set(s,m)}})}d=d.concat(H),(u.length==1||u.length==2)&&(g=!0,E=u[0])}return E},t.prototype.setGraphManager=function(l){this.graphManager=l},L.exports=t}),(function(L,b,T){function c(){}A(c,"RandomSeed"),c.seed=1,c.x=0,c.nextDouble=function(){return c.x=Math.sin(c.seed++)*1e4,c.x-Math.floor(c.x)},L.exports=c}),(function(L,b,T){var c=T(5);function h(o,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}A(h,"Transform"),h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(o){this.lworldExtX=o},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(o){this.lworldExtY=o},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},h.prototype.transformX=function(o){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/e),i},h.prototype.transformY=function(o){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/e),i},h.prototype.inverseTransformX=function(o){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/e),i},h.prototype.inverseTransformY=function(o){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/e),i},h.prototype.inverseTransformPoint=function(o){var i=new c(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return i},L.exports=h}),(function(L,b,T){function c(n){if(Array.isArray(n)){for(var t=0,l=Array(n.length);t<n.length;t++)l[t]=n[t];return l}else return Array.from(n)}A(c,"_toConsumableArray");var h=T(15),o=T(4),i=T(0),e=T(8),a=T(9);function r(){h.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}A(r,"FDLayout"),r.prototype=Object.create(h.prototype);for(var f in h)r[f]=h[f];r.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){for(var n,t,l,u,d,N,g,E=this.getGraphManager().getAllEdges(),_=0;_<E.length;_++)n=E[_],t=n.idealLength,n.isInterGraph&&(u=n.getSource(),d=n.getTarget(),N=n.getSourceInLca().getEstimatedSize(),g=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=N+g-2*i.SIMPLE_NODE_SIZE),l=n.getLca().getInclusionTreeDepth(),n.idealLength+=t*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(u.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*l))},r.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(n-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),t,l=0;l<n.length;l++)t=n[l],this.calcSpringForce(t,t.idealLength)},r.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,u,d,N,g=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),E=new Set,l=0;l<g.length;l++)d=g[l],this.calculateRepulsionForceOfANode(d,E,n,t),E.add(d);else for(l=0;l<g.length;l++)for(d=g[l],u=l+1;u<g.length;u++)N=g[u],d.getOwner()==N.getOwner()&&this.calcRepulsionForce(d,N)},r.prototype.calcGravitationalForces=function(){for(var n,t=this.getAllNodesToApplyGravitation(),l=0;l<t.length;l++)n=t[l],this.calcGravitationalForce(n)},r.prototype.moveNodes=function(){for(var n=this.getAllNodes(),t,l=0;l<n.length;l++)t=n[l],t.move()},r.prototype.calcSpringForce=function(n,t){var l=n.getSource(),u=n.getTarget(),d,N,g,E;if(this.uniformLeafNodeSizes&&l.getChild()==null&&u.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;d=n.getLength(),d!=0&&(N=n.edgeElasticity*(d-t),g=N*(n.lengthX/d),E=N*(n.lengthY/d),l.springForceX+=g,l.springForceY+=E,u.springForceX-=g,u.springForceY-=E)},r.prototype.calcRepulsionForce=function(n,t){var l=n.getRect(),u=t.getRect(),d=new Array(2),N=new Array(4),g,E,_,C,U,H,V;if(l.intersects(u)){e.calcSeparationAmount(l,u,d,o.DEFAULT_EDGE_LENGTH/2),H=2*d[0],V=2*d[1];var B=n.noOfChildren*t.noOfChildren/(n.noOfChildren+t.noOfChildren);n.repulsionForceX-=B*H,n.repulsionForceY-=B*V,t.repulsionForceX+=B*H,t.repulsionForceY+=B*V}else this.uniformLeafNodeSizes&&n.getChild()==null&&t.getChild()==null?(g=u.getCenterX()-l.getCenterX(),E=u.getCenterY()-l.getCenterY()):(e.getIntersection(l,u,N),g=N[2]-N[0],E=N[3]-N[1]),Math.abs(g)<o.MIN_REPULSION_DIST&&(g=a.sign(g)*o.MIN_REPULSION_DIST),Math.abs(E)<o.MIN_REPULSION_DIST&&(E=a.sign(E)*o.MIN_REPULSION_DIST),_=g*g+E*E,C=Math.sqrt(_),U=(n.nodeRepulsion/2+t.nodeRepulsion/2)*n.noOfChildren*t.noOfChildren/_,H=U*g/C,V=U*E/C,n.repulsionForceX-=H,n.repulsionForceY-=V,t.repulsionForceX+=H,t.repulsionForceY+=V},r.prototype.calcGravitationalForce=function(n){var t,l,u,d,N,g,E,_;t=n.getOwner(),l=(t.getRight()+t.getLeft())/2,u=(t.getTop()+t.getBottom())/2,d=n.getCenterX()-l,N=n.getCenterY()-u,g=Math.abs(d)+n.getWidth()/2,E=Math.abs(N)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(_=t.getEstimatedSize()*this.gravityRangeFactor,(g>_||E>_)&&(n.gravitationForceX=-this.gravityConstant*d,n.gravitationForceY=-this.gravityConstant*N)):(_=t.getEstimatedSize()*this.compoundGravityRangeFactor,(g>_||E>_)&&(n.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},r.prototype.isConverged=function(){var n,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||t},r.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},r.prototype.calcNoOfChildrenForAllNodes=function(){for(var n,t=this.graphManager.getAllNodes(),l=0;l<t.length;l++)n=t[l],n.noOfChildren=n.getNoOfChildren()},r.prototype.calcGrid=function(n){var t=0,l=0;t=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var u=new Array(t),d=0;d<t;d++)u[d]=new Array(l);for(var d=0;d<t;d++)for(var N=0;N<l;N++)u[d][N]=new Array;return u},r.prototype.addNodeToGrid=function(n,t,l){var u=0,d=0,N=0,g=0;u=parseInt(Math.floor((n.getRect().x-t)/this.repulsionRange)),d=parseInt(Math.floor((n.getRect().width+n.getRect().x-t)/this.repulsionRange)),N=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),g=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var E=u;E<=d;E++)for(var _=N;_<=g;_++)this.grid[E][_].push(n),n.setGridCoordinates(u,d,N,g)},r.prototype.updateGrid=function(){var n,t,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)t=l[n],this.addNodeToGrid(t,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(n,t,l,u){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&l||u){var d=new Set;n.surrounding=new Array;for(var N,g=this.grid,E=n.startX-1;E<n.finishX+2;E++)for(var _=n.startY-1;_<n.finishY+2;_++)if(!(E<0||_<0||E>=g.length||_>=g[0].length)){for(var C=0;C<g[E][_].length;C++)if(N=g[E][_][C],!(n.getOwner()!=N.getOwner()||n==N)&&!t.has(N)&&!d.has(N)){var U=Math.abs(n.getCenterX()-N.getCenterX())-(n.getWidth()/2+N.getWidth()/2),H=Math.abs(n.getCenterY()-N.getCenterY())-(n.getHeight()/2+N.getHeight()/2);U<=this.repulsionRange&&H<=this.repulsionRange&&d.add(N)}}n.surrounding=[].concat(c(d))}for(E=0;E<n.surrounding.length;E++)this.calcRepulsionForce(n,n.surrounding[E])},r.prototype.calcRepulsionRange=function(){return 0},L.exports=r}),(function(L,b,T){var c=T(1),h=T(4);function o(e,a,r){c.call(this,e,a,r),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}A(o,"FDLayoutEdge"),o.prototype=Object.create(c.prototype);for(var i in c)o[i]=c[i];L.exports=o}),(function(L,b,T){var c=T(3),h=T(4);function o(e,a,r,f){c.call(this,e,a,r,f),this.nodeRepulsion=h.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}A(o,"FDLayoutNode"),o.prototype=Object.create(c.prototype);for(var i in c)o[i]=c[i];o.prototype.setGridCoordinates=function(e,a,r,f){this.startX=e,this.finishX=a,this.startY=r,this.finishY=f},L.exports=o}),(function(L,b,T){function c(h,o){this.width=0,this.height=0,h!==null&&o!==null&&(this.height=o,this.width=h)}A(c,"DimensionD"),c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},L.exports=c}),(function(L,b,T){var c=T(14);function h(){this.map={},this.keys=[]}A(h,"HashMap"),h.prototype.put=function(o,i){var e=c.createID(o);this.contains(e)||(this.map[e]=i,this.keys.push(o))},h.prototype.contains=function(o){return c.createID(o),this.map[o]!=null},h.prototype.get=function(o){var i=c.createID(o);return this.map[i]},h.prototype.keySet=function(){return this.keys},L.exports=h}),(function(L,b,T){var c=T(14);function h(){this.set={}}A(h,"HashSet"),h.prototype.add=function(o){var i=c.createID(o);this.contains(i)||(this.set[i]=o)},h.prototype.remove=function(o){delete this.set[c.createID(o)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(o){return this.set[c.createID(o)]==o},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(o){for(var i=Object.keys(this.set),e=i.length,a=0;a<e;a++)o.push(this.set[i[a]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(o){for(var i=o.length,e=0;e<i;e++){var a=o[e];this.add(a)}},L.exports=h}),(function(L,b,T){function c(){}A(c,"Matrix"),c.multMat=function(h,o){for(var i=[],e=0;e<h.length;e++){i[e]=[];for(var a=0;a<o[0].length;a++){i[e][a]=0;for(var r=0;r<h[0].length;r++)i[e][a]+=h[e][r]*o[r][a]}}return i},c.transpose=function(h){for(var o=[],i=0;i<h[0].length;i++){o[i]=[];for(var e=0;e<h.length;e++)o[i][e]=h[e][i]}return o},c.multCons=function(h,o){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]*o;return i},c.minusOp=function(h,o){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]-o[e];return i},c.dotProduct=function(h,o){for(var i=0,e=0;e<h.length;e++)i+=h[e]*o[e];return i},c.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},c.normalize=function(h){for(var o=[],i=this.mag(h),e=0;e<h.length;e++)o[e]=h[e]/i;return o},c.multGamma=function(h){for(var o=[],i=0,e=0;e<h.length;e++)i+=h[e];i*=-1/h.length;for(var a=0;a<h.length;a++)o[a]=i+h[a];return o},c.multL=function(h,o,i){for(var e=[],a=[],r=[],f=0;f<o[0].length;f++){for(var n=0,t=0;t<o.length;t++)n+=-.5*o[t][f]*h[t];a[f]=n}for(var l=0;l<i.length;l++){for(var u=0,d=0;d<i.length;d++)u+=i[l][d]*a[d];r[l]=u}for(var N=0;N<o.length;N++){for(var g=0,E=0;E<o[0].length;E++)g+=o[N][E]*r[E];e[N]=g}return e},L.exports=c}),(function(L,b,T){var c=(function(){function e(a,r){for(var f=0;f<r.length;f++){var n=r[f];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return A(e,"defineProperties"),function(a,r,f){return r&&e(a.prototype,r),f&&e(a,f),a}})();function h(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var o=T(11),i=(function(){function e(a,r){h(this,e),(r!==null||r!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;a instanceof o?f=a.size():f=a.length,this._quicksort(a,0,f-1)}return A(e,"Quicksort"),c(e,[{key:"_quicksort",value:A(function(a,r,f){if(r<f){var n=this._partition(a,r,f);this._quicksort(a,r,n),this._quicksort(a,n+1,f)}},"_quicksort")},{key:"_partition",value:A(function(a,r,f){for(var n=this._get(a,r),t=r,l=f;;){for(;this.compareFunction(n,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,t),n);)t++;if(t<l)this._swap(a,t,l),t++,l--;else return l}},"_partition")},{key:"_get",value:A(function(a,r){return a instanceof o?a.get_object_at(r):a[r]},"_get")},{key:"_set",value:A(function(a,r,f){a instanceof o?a.set_object_at(r,f):a[r]=f},"_set")},{key:"_swap",value:A(function(a,r,f){var n=this._get(a,r);this._set(a,r,this._get(a,f)),this._set(a,f,n)},"_swap")},{key:"_defaultCompareFunction",value:A(function(a,r){return r>a},"_defaultCompareFunction")}]),e})();L.exports=i}),(function(L,b,T){function c(){}A(c,"SVD"),c.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var o=Math.min(this.m,this.n);this.s=(function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At})(Math.min(this.m+1,this.n)),this.U=(function(Tt){var At=A(function Ft(St){if(St.length==0)return 0;for(var zt=[],jt=0;jt<St[0];jt++)zt.push(Ft(St.slice(1)));return zt},"allocate");return At(Tt)})([this.m,o]),this.V=(function(Tt){var At=A(function Ft(St){if(St.length==0)return 0;for(var zt=[],jt=0;jt<St[0];jt++)zt.push(Ft(St.slice(1)));return zt},"allocate");return At(Tt)})([this.n,this.n]);for(var i=(function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At})(this.n),e=(function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At})(this.m),a=!0,r=!0,f=Math.min(this.m-1,this.n),n=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(f,n);t++){if(t<f){this.s[t]=0;for(var l=t;l<this.m;l++)this.s[t]=c.hypot(this.s[t],h[l][t]);if(this.s[t]!==0){h[t][t]<0&&(this.s[t]=-this.s[t]);for(var u=t;u<this.m;u++)h[u][t]/=this.s[t];h[t][t]+=1}this.s[t]=-this.s[t]}for(var d=t+1;d<this.n;d++){if((function(Tt,At){return Tt&&At})(t<f,this.s[t]!==0)){for(var N=0,g=t;g<this.m;g++)N+=h[g][t]*h[g][d];N=-N/h[t][t];for(var E=t;E<this.m;E++)h[E][d]+=N*h[E][t]}i[d]=h[t][d]}if((function(Tt,At){return Tt&&At})(a,t<f))for(var _=t;_<this.m;_++)this.U[_][t]=h[_][t];if(t<n){i[t]=0;for(var C=t+1;C<this.n;C++)i[t]=c.hypot(i[t],i[C]);if(i[t]!==0){i[t+1]<0&&(i[t]=-i[t]);for(var U=t+1;U<this.n;U++)i[U]/=i[t];i[t+1]+=1}if(i[t]=-i[t],(function(Tt,At){return Tt&&At})(t+1<this.m,i[t]!==0)){for(var H=t+1;H<this.m;H++)e[H]=0;for(var V=t+1;V<this.n;V++)for(var B=t+1;B<this.m;B++)e[B]+=i[V]*h[B][V];for(var q=t+1;q<this.n;q++)for(var x=-i[q]/i[t+1],st=t+1;st<this.m;st++)h[st][q]+=x*e[st]}if(r)for(var s=t+1;s<this.n;s++)this.V[s][t]=i[s]}}var y=Math.min(this.n,this.m+1);if(f<this.n&&(this.s[f]=h[f][f]),this.m<y&&(this.s[y-1]=0),n+1<y&&(i[n]=h[n][y-1]),i[y-1]=0,a){for(var m=f;m<o;m++){for(var v=0;v<this.m;v++)this.U[v][m]=0;this.U[m][m]=1}for(var p=f-1;p>=0;p--)if(this.s[p]!==0){for(var D=p+1;D<o;D++){for(var I=0,R=p;R<this.m;R++)I+=this.U[R][p]*this.U[R][D];I=-I/this.U[p][p];for(var X=p;X<this.m;X++)this.U[X][D]+=I*this.U[X][p]}for(var Y=p;Y<this.m;Y++)this.U[Y][p]=-this.U[Y][p];this.U[p][p]=1+this.U[p][p];for(var W=0;W<p-1;W++)this.U[W][p]=0}else{for(var j=0;j<this.m;j++)this.U[j][p]=0;this.U[p][p]=1}}if(r)for(var z=this.n-1;z>=0;z--){if((function(Tt,At){return Tt&&At})(z<n,i[z]!==0))for(var K=z+1;K<o;K++){for(var k=0,F=z+1;F<this.n;F++)k+=this.V[F][z]*this.V[F][K];k=-k/this.V[z+1][z];for(var G=z+1;G<this.n;G++)this.V[G][K]+=k*this.V[G][z]}for(var J=0;J<this.n;J++)this.V[J][z]=0;this.V[z][z]=1}for(var it=y-1,ut=0,Lt=Math.pow(2,-52),Ot=Math.pow(2,-966);y>0;){var P=void 0,rt=void 0;for(P=y-2;P>=-1&&P!==-1;P--)if(Math.abs(i[P])<=Ot+Lt*(Math.abs(this.s[P])+Math.abs(this.s[P+1]))){i[P]=0;break}if(P===y-2)rt=4;else{var ht=void 0;for(ht=y-1;ht>=P&&ht!==P;ht--){var mt=(ht!==y?Math.abs(i[ht]):0)+(ht!==P+1?Math.abs(i[ht-1]):0);if(Math.abs(this.s[ht])<=Ot+Lt*mt){this.s[ht]=0;break}}ht===P?rt=3:ht===y-1?rt=1:(rt=2,P=ht)}switch(P++,rt){case 1:{var Mt=i[y-2];i[y-2]=0;for(var vt=y-2;vt>=P;vt--){var yt=c.hypot(this.s[vt],Mt),wt=this.s[vt]/yt,Ht=Mt/yt;if(this.s[vt]=yt,vt!==P&&(Mt=-Ht*i[vt-1],i[vt-1]=wt*i[vt-1]),r)for(var Pt=0;Pt<this.n;Pt++)yt=wt*this.V[Pt][vt]+Ht*this.V[Pt][y-1],this.V[Pt][y-1]=-Ht*this.V[Pt][vt]+wt*this.V[Pt][y-1],this.V[Pt][vt]=yt}}break;case 2:{var Gt=i[P-1];i[P-1]=0;for(var xt=P;xt<y;xt++){var Ut=c.hypot(this.s[xt],Gt),Xt=this.s[xt]/Ut,Wt=Gt/Ut;if(this.s[xt]=Ut,Gt=-Wt*i[xt],i[xt]=Xt*i[xt],a)for(var lt=0;lt<this.m;lt++)Ut=Xt*this.U[lt][xt]+Wt*this.U[lt][P-1],this.U[lt][P-1]=-Wt*this.U[lt][xt]+Xt*this.U[lt][P-1],this.U[lt][xt]=Ut}}break;case 3:{var M=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[y-1]),Math.abs(this.s[y-2])),Math.abs(i[y-2])),Math.abs(this.s[P])),Math.abs(i[P])),S=this.s[y-1]/M,$=this.s[y-2]/M,Z=i[y-2]/M,Q=this.s[P]/M,pt=i[P]/M,dt=(($+S)*($-S)+Z*Z)/2,tt=S*Z*(S*Z),ct=0;(function(Tt,At){return Tt||At})(dt!==0,tt!==0)&&(ct=Math.sqrt(dt*dt+tt),dt<0&&(ct=-ct),ct=tt/(dt+ct));for(var Et=(Q+S)*(Q-S)+ct,_t=Q*pt,et=P;et<y-1;et++){var It=c.hypot(Et,_t),nt=Et/It,at=_t/It;if(et!==P&&(i[et-1]=It),Et=nt*this.s[et]+at*i[et],i[et]=nt*i[et]-at*this.s[et],_t=at*this.s[et+1],this.s[et+1]=nt*this.s[et+1],r)for(var ot=0;ot<this.n;ot++)It=nt*this.V[ot][et]+at*this.V[ot][et+1],this.V[ot][et+1]=-at*this.V[ot][et]+nt*this.V[ot][et+1],this.V[ot][et]=It;if(It=c.hypot(Et,_t),nt=Et/It,at=_t/It,this.s[et]=It,Et=nt*i[et]+at*this.s[et+1],this.s[et+1]=-at*i[et]+nt*this.s[et+1],_t=at*i[et+1],i[et+1]=nt*i[et+1],a&&et<this.m-1)for(var Nt=0;Nt<this.m;Nt++)It=nt*this.U[Nt][et]+at*this.U[Nt][et+1],this.U[Nt][et+1]=-at*this.U[Nt][et]+nt*this.U[Nt][et+1],this.U[Nt][et]=It}i[y-2]=Et,ut=ut+1}break;case 4:{if(this.s[P]<=0&&(this.s[P]=this.s[P]<0?-this.s[P]:0,r))for(var ft=0;ft<=it;ft++)this.V[ft][P]=-this.V[ft][P];for(;P<it&&!(this.s[P]>=this.s[P+1]);){var bt=this.s[P];if(this.s[P]=this.s[P+1],this.s[P+1]=bt,r&&P<this.n-1)for(var Rt=0;Rt<this.n;Rt++)bt=this.V[Rt][P+1],this.V[Rt][P+1]=this.V[Rt][P],this.V[Rt][P]=bt;if(a&&P<this.m-1)for(var Dt=0;Dt<this.m;Dt++)bt=this.U[Dt][P+1],this.U[Dt][P+1]=this.U[Dt][P],this.U[Dt][P]=bt;P++}ut=0,y--}break}}var Bt={U:this.U,V:this.V,S:this.s};return Bt},c.hypot=function(h,o){var i=void 0;return Math.abs(h)>Math.abs(o)?(i=o/h,i=Math.abs(h)*Math.sqrt(1+i*i)):o!=0?(i=h/o,i=Math.abs(o)*Math.sqrt(1+i*i)):i=0,i},L.exports=c}),(function(L,b,T){var c=(function(){function i(e,a){for(var r=0;r<a.length;r++){var f=a[r];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}return A(i,"defineProperties"),function(e,a,r){return a&&i(e.prototype,a),r&&i(e,r),e}})();function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var o=(function(){function i(e,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,i),this.sequence1=e,this.sequence2=a,this.match_score=r,this.mismatch_penalty=f,this.gap_penalty=n,this.iMax=e.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var t=0;t<this.iMax;t++){this.grid[t]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[t][l]=0}this.tracebackGrid=new Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.tracebackGrid[u][d]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return A(i,"NeedlemanWunsch"),c(i,[{key:"getScore",value:A(function(){return this.score},"getScore")},{key:"getAlignments",value:A(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:A(function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var f=1;f<this.jMax;f++){var n=void 0;this.sequence1[r-1]===this.sequence2[f-1]?n=this.grid[r-1][f-1]+this.match_score:n=this.grid[r-1][f-1]+this.mismatch_penalty;var t=this.grid[r-1][f]+this.gap_penalty,l=this.grid[r][f-1]+this.gap_penalty,u=[n,t,l],d=this.arrayAllMaxIndexes(u);this.grid[r][f]=u[d[0]],this.tracebackGrid[r][f]=[d.includes(0),d.includes(1),d.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:A(function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var a=e[0],r=this.tracebackGrid[a.pos[0]][a.pos[1]];r[0]&&e.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),r[1]&&e.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),r[2]&&e.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),e.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:A(function(e,a){for(var r=[],f=-1;(f=e.indexOf(a,f+1))!==-1;)r.push(f);return r},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:A(function(e){return this.getAllIndexes(e,Math.max.apply(null,e))},"arrayAllMaxIndexes")}]),i})();L.exports=o}),(function(L,b,T){var c=A(function(){},"layoutBase");c.FDLayout=T(18),c.FDLayoutConstants=T(4),c.FDLayoutEdge=T(19),c.FDLayoutNode=T(20),c.DimensionD=T(21),c.HashMap=T(22),c.HashSet=T(23),c.IGeometry=T(8),c.IMath=T(9),c.Integer=T(10),c.Point=T(12),c.PointD=T(5),c.RandomSeed=T(16),c.RectangleD=T(13),c.Transform=T(17),c.UniqueIDGeneretor=T(14),c.Quicksort=T(25),c.LinkedList=T(11),c.LGraphObject=T(2),c.LGraph=T(6),c.LEdge=T(1),c.LGraphManager=T(7),c.LNode=T(3),c.Layout=T(15),c.LayoutConstants=T(0),c.NeedlemanWunsch=T(27),c.Matrix=T(24),c.SVD=T(26),L.exports=c}),(function(L,b,T){function c(){this.listeners=[]}A(c,"Emitter");var h=c.prototype;h.addListener=function(o,i){this.listeners.push({event:o,callback:i})},h.removeListener=function(o,i){for(var e=this.listeners.length;e>=0;e--){var a=this.listeners[e];a.event===o&&a.callback===i&&this.listeners.splice(e,1)}},h.emit=function(o,i){for(var e=0;e<this.listeners.length;e++){var a=this.listeners[e];o===a.event&&a.callback(i)}},L.exports=c})])})}),Ce=pe((w,O)=>{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b(_e()):typeof define=="function"&&define.amd?define(["layout-base"],b):typeof w=="object"?w.coseBase=b(_e()):L.coseBase=b(L.layoutBase)}),"webpackUniversalModuleDefinition")(w,function(L){return(()=>{var b={45:((o,i,e)=>{var a={};a.layoutBase=e(551),a.CoSEConstants=e(806),a.CoSEEdge=e(767),a.CoSEGraph=e(880),a.CoSEGraphManager=e(578),a.CoSELayout=e(765),a.CoSENode=e(991),a.ConstraintHandler=e(902),o.exports=a}),806:((o,i,e)=>{var a=e(551).FDLayoutConstants;function r(){}A(r,"CoSEConstants");for(var f in a)r[f]=a[f];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r}),767:((o,i,e)=>{var a=e(551).FDLayoutEdge;function r(n,t,l){a.call(this,n,t,l)}A(r,"CoSEEdge"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),880:((o,i,e)=>{var a=e(551).LGraph;function r(n,t,l){a.call(this,n,t,l)}A(r,"CoSEGraph"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),578:((o,i,e)=>{var a=e(551).LGraphManager;function r(n){a.call(this,n)}A(r,"CoSEGraphManager"),r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r}),765:((o,i,e)=>{var a=e(551).FDLayout,r=e(578),f=e(880),n=e(991),t=e(767),l=e(806),u=e(902),d=e(551).FDLayoutConstants,N=e(551).LayoutConstants,g=e(551).Point,E=e(551).PointD,_=e(551).DimensionD,C=e(551).Layout,U=e(551).Integer,H=e(551).IGeometry,V=e(551).LGraph,B=e(551).Transform,q=e(551).LinkedList;function x(){a.call(this),this.toBeTiled={},this.constraints={}}A(x,"CoSELayout"),x.prototype=Object.create(a.prototype);for(var st in a)x[st]=a[st];x.prototype.newGraphManager=function(){var s=new r(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new f(null,this.graphManager,s)},x.prototype.newNode=function(s){return new n(this.graphManager,s)},x.prototype.newEdge=function(s){return new t(null,null,s)},x.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){a.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var s=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},x.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(v){return s.has(v)});this.graphManager.setAllNodesToApplyGravitation(y)}}else{var m=this.getFlatForest();if(m.length>0)this.positionNodesRadially(m);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(D){return s.has(D)});this.graphManager.setAllNodesToApplyGravitation(y),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},x.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),y=this.nodesWithGravity.filter(function(p){return s.has(p)});this.graphManager.setAllNodesToApplyGravitation(y),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var m=!this.isTreeGrowing&&!this.isGrowthFinished,v=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(m,v),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),y={},m=0;m<s.length;m++){var v=s[m].rect,p=s[m].id;y[p]={id:p,x:v.getCenterX(),y:v.getCenterY(),w:v.width,h:v.height}}return y},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var s=this.getAllNodes(),y,m=0;m<s.length;m++)y=s[m],y.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var m=0;m<s.length;m++)y=s[m],y.move()},x.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var y=this.graphManager.getAllNodes(),m=0;m<y.length;m++){var v=y[m];this.idToNodeMap.set(v.id,v)}var p=A(function F(G){for(var J=G.getChild().getNodes(),it,ut=0,Lt=0;Lt<J.length;Lt++)it=J[Lt],it.getChild()==null?s.fixedNodeSet.has(it.id)&&(ut+=100):ut+=F(it);return ut},"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(F){s.fixedNodeSet.add(F.nodeId)});for(var y=this.graphManager.getAllNodes(),v,m=0;m<y.length;m++)if(v=y[m],v.getChild()!=null){var D=p(v);D>0&&(v.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var I=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(F){s.fixedNodesOnHorizontal.add(F),s.fixedNodesOnVertical.add(F)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var X=this.constraints.alignmentConstraint.vertical,m=0;m<X.length;m++)this.dummyToNodeForVerticalAlignment.set("dummy"+m,[]),X[m].forEach(function(G){I.set(G,"dummy"+m),s.dummyToNodeForVerticalAlignment.get("dummy"+m).push(G),s.fixedNodeSet.has(G)&&s.fixedNodesOnHorizontal.add("dummy"+m)});if(this.constraints.alignmentConstraint.horizontal)for(var Y=this.constraints.alignmentConstraint.horizontal,m=0;m<Y.length;m++)this.dummyToNodeForHorizontalAlignment.set("dummy"+m,[]),Y[m].forEach(function(G){R.set(G,"dummy"+m),s.dummyToNodeForHorizontalAlignment.get("dummy"+m).push(G),s.fixedNodeSet.has(G)&&s.fixedNodesOnVertical.add("dummy"+m)})}if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(F){var G,J,it;for(it=F.length-1;it>=2*F.length/3;it--)G=Math.floor(Math.random()*(it+1)),J=F[it],F[it]=F[G],F[G]=J;return F},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(F){if(F.left){var G=I.has(F.left)?I.get(F.left):F.left,J=I.has(F.right)?I.get(F.right):F.right;s.nodesInRelativeHorizontal.includes(G)||(s.nodesInRelativeHorizontal.push(G),s.nodeToRelativeConstraintMapHorizontal.set(G,[]),s.dummyToNodeForVerticalAlignment.has(G)?s.nodeToTempPositionMapHorizontal.set(G,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(G)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(G,s.idToNodeMap.get(G).getCenterX())),s.nodesInRelativeHorizontal.includes(J)||(s.nodesInRelativeHorizontal.push(J),s.nodeToRelativeConstraintMapHorizontal.set(J,[]),s.dummyToNodeForVerticalAlignment.has(J)?s.nodeToTempPositionMapHorizontal.set(J,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(J)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(J,s.idToNodeMap.get(J).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(G).push({right:J,gap:F.gap}),s.nodeToRelativeConstraintMapHorizontal.get(J).push({left:G,gap:F.gap})}else{var it=R.has(F.top)?R.get(F.top):F.top,ut=R.has(F.bottom)?R.get(F.bottom):F.bottom;s.nodesInRelativeVertical.includes(it)||(s.nodesInRelativeVertical.push(it),s.nodeToRelativeConstraintMapVertical.set(it,[]),s.dummyToNodeForHorizontalAlignment.has(it)?s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(it)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(it,s.idToNodeMap.get(it).getCenterY())),s.nodesInRelativeVertical.includes(ut)||(s.nodesInRelativeVertical.push(ut),s.nodeToRelativeConstraintMapVertical.set(ut,[]),s.dummyToNodeForHorizontalAlignment.has(ut)?s.nodeToTempPositionMapVertical.set(ut,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ut)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(ut,s.idToNodeMap.get(ut).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(it).push({bottom:ut,gap:F.gap}),s.nodeToRelativeConstraintMapVertical.get(ut).push({top:it,gap:F.gap})}});else{var W=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(F){if(F.left){var G=I.has(F.left)?I.get(F.left):F.left,J=I.has(F.right)?I.get(F.right):F.right;W.has(G)?W.get(G).push(J):W.set(G,[J]),W.has(J)?W.get(J).push(G):W.set(J,[G])}else{var it=R.has(F.top)?R.get(F.top):F.top,ut=R.has(F.bottom)?R.get(F.bottom):F.bottom;j.has(it)?j.get(it).push(ut):j.set(it,[ut]),j.has(ut)?j.get(ut).push(it):j.set(ut,[it])}});var z=A(function(F,G){var J=[],it=[],ut=new q,Lt=new Set,Ot=0;return F.forEach(function(P,rt){if(!Lt.has(rt)){J[Ot]=[],it[Ot]=!1;var ht=rt;for(ut.push(ht),Lt.add(ht),J[Ot].push(ht);ut.length!=0;){ht=ut.shift(),G.has(ht)&&(it[Ot]=!0);var mt=F.get(ht);mt.forEach(function(Mt){Lt.has(Mt)||(ut.push(Mt),Lt.add(Mt),J[Ot].push(Mt))})}Ot++}}),{components:J,isFixed:it}},"constructComponents"),K=z(W,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=K.components,this.fixedComponentsOnHorizontal=K.isFixed;var k=z(j,s.fixedNodesOnVertical);this.componentsOnVertical=k.components,this.fixedComponentsOnVertical=k.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(k){var F=s.idToNodeMap.get(k.nodeId);F.displacementX=0,F.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var y=this.constraints.alignmentConstraint.vertical,m=0;m<y.length;m++){for(var v=0,p=0;p<y[m].length;p++){if(this.fixedNodeSet.has(y[m][p])){v=0;break}v+=this.idToNodeMap.get(y[m][p]).displacementX}for(var D=v/y[m].length,p=0;p<y[m].length;p++)this.idToNodeMap.get(y[m][p]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,m=0;m<I.length;m++){for(var R=0,p=0;p<I[m].length;p++){if(this.fixedNodeSet.has(I[m][p])){R=0;break}R+=this.idToNodeMap.get(I[m][p]).displacementY}for(var X=R/I[m].length,p=0;p<I[m].length;p++)this.idToNodeMap.get(I[m][p]).displacementY=X}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(k){if(!s.fixedNodesOnHorizontal.has(k)){var F=0;s.dummyToNodeForVerticalAlignment.has(k)?F=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(k)[0]).displacementX:F=s.idToNodeMap.get(k).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(k).forEach(function(G){if(G.right){var J=s.nodeToTempPositionMapHorizontal.get(G.right)-s.nodeToTempPositionMapHorizontal.get(k)-F;J<G.gap&&(F-=G.gap-J)}else{var J=s.nodeToTempPositionMapHorizontal.get(k)-s.nodeToTempPositionMapHorizontal.get(G.left)+F;J<G.gap&&(F+=G.gap-J)}}),s.nodeToTempPositionMapHorizontal.set(k,s.nodeToTempPositionMapHorizontal.get(k)+F),s.dummyToNodeForVerticalAlignment.has(k)?s.dummyToNodeForVerticalAlignment.get(k).forEach(function(G){s.idToNodeMap.get(G).displacementX=F}):s.idToNodeMap.get(k).displacementX=F}}),this.nodesInRelativeVertical.forEach(function(k){if(!s.fixedNodesOnHorizontal.has(k)){var F=0;s.dummyToNodeForHorizontalAlignment.has(k)?F=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(k)[0]).displacementY:F=s.idToNodeMap.get(k).displacementY,s.nodeToRelativeConstraintMapVertical.get(k).forEach(function(G){if(G.bottom){var J=s.nodeToTempPositionMapVertical.get(G.bottom)-s.nodeToTempPositionMapVertical.get(k)-F;J<G.gap&&(F-=G.gap-J)}else{var J=s.nodeToTempPositionMapVertical.get(k)-s.nodeToTempPositionMapVertical.get(G.top)+F;J<G.gap&&(F+=G.gap-J)}}),s.nodeToTempPositionMapVertical.set(k,s.nodeToTempPositionMapVertical.get(k)+F),s.dummyToNodeForHorizontalAlignment.has(k)?s.dummyToNodeForHorizontalAlignment.get(k).forEach(function(G){s.idToNodeMap.get(G).displacementY=F}):s.idToNodeMap.get(k).displacementY=F}});else{for(var m=0;m<this.componentsOnHorizontal.length;m++){var Y=this.componentsOnHorizontal[m];if(this.fixedComponentsOnHorizontal[m])for(var p=0;p<Y.length;p++)this.dummyToNodeForVerticalAlignment.has(Y[p])?this.dummyToNodeForVerticalAlignment.get(Y[p]).forEach(function(G){s.idToNodeMap.get(G).displacementX=0}):this.idToNodeMap.get(Y[p]).displacementX=0;else{for(var W=0,j=0,p=0;p<Y.length;p++)if(this.dummyToNodeForVerticalAlignment.has(Y[p])){var z=this.dummyToNodeForVerticalAlignment.get(Y[p]);W+=z.length*this.idToNodeMap.get(z[0]).displacementX,j+=z.length}else W+=this.idToNodeMap.get(Y[p]).displacementX,j++;for(var K=W/j,p=0;p<Y.length;p++)this.dummyToNodeForVerticalAlignment.has(Y[p])?this.dummyToNodeForVerticalAlignment.get(Y[p]).forEach(function(G){s.idToNodeMap.get(G).displacementX=K}):this.idToNodeMap.get(Y[p]).displacementX=K}}for(var m=0;m<this.componentsOnVertical.length;m++){var Y=this.componentsOnVertical[m];if(this.fixedComponentsOnVertical[m])for(var p=0;p<Y.length;p++)this.dummyToNodeForHorizontalAlignment.has(Y[p])?this.dummyToNodeForHorizontalAlignment.get(Y[p]).forEach(function(J){s.idToNodeMap.get(J).displacementY=0}):this.idToNodeMap.get(Y[p]).displacementY=0;else{for(var W=0,j=0,p=0;p<Y.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(Y[p])){var z=this.dummyToNodeForHorizontalAlignment.get(Y[p]);W+=z.length*this.idToNodeMap.get(z[0]).displacementY,j+=z.length}else W+=this.idToNodeMap.get(Y[p]).displacementY,j++;for(var K=W/j,p=0;p<Y.length;p++)this.dummyToNodeForHorizontalAlignment.has(Y[p])?this.dummyToNodeForHorizontalAlignment.get(Y[p]).forEach(function(it){s.idToNodeMap.get(it).displacementY=K}):this.idToNodeMap.get(Y[p]).displacementY=K}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],y,m=this.graphManager.getGraphs(),v=m.length,p;for(p=0;p<v;p++)y=m[p],y.updateConnected(),y.isConnected||(s=s.concat(y.getNodes()));return s},x.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var y=new Set,m;for(m=0;m<s.length;m++){var v=s[m];if(!y.has(v)){var p=v.getSource(),D=v.getTarget();if(p==D)v.getBendpoints().push(new E),v.getBendpoints().push(new E),this.createDummyNodesForBendpoints(v),y.add(v);else{var I=[];if(I=I.concat(p.getEdgeListToNode(D)),I=I.concat(D.getEdgeListToNode(p)),!y.has(I[0])){if(I.length>1){var R;for(R=0;R<I.length;R++){var X=I[R];X.getBendpoints().push(new E),this.createDummyNodesForBendpoints(X)}}I.forEach(function(Y){y.add(Y)})}}}if(y.size==s.length)break}},x.prototype.positionNodesRadially=function(s){for(var y=new g(0,0),m=Math.ceil(Math.sqrt(s.length)),v=0,p=0,D=0,I=new E(0,0),R=0;R<s.length;R++){R%m==0&&(D=0,p=v,R!=0&&(p+=l.DEFAULT_COMPONENT_SEPERATION),v=0);var X=s[R],Y=C.findCenterOfTree(X);y.x=D,y.y=p,I=x.radialLayout(X,Y,y),I.y>v&&(v=Math.floor(I.y)),D=Math.floor(I.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(N.WORLD_CENTER_X-I.x/2,N.WORLD_CENTER_Y-I.y/2))},x.radialLayout=function(s,y,m){var v=Math.max(this.maxDiagonalInTree(s),l.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(y,null,0,359,0,v);var p=V.calculateBounds(s),D=new B;D.setDeviceOrgX(p.getMinX()),D.setDeviceOrgY(p.getMinY()),D.setWorldOrgX(m.x),D.setWorldOrgY(m.y);for(var I=0;I<s.length;I++){var R=s[I];R.transform(D)}var X=new E(p.getMaxX(),p.getMaxY());return D.inverseTransformPoint(X)},x.branchRadialLayout=function(s,y,m,v,p,D){var I=(v-m+1)/2;I<0&&(I+=180);var R=(I+m)%360,X=R*H.TWO_PI/360,Y=p*Math.cos(X),W=p*Math.sin(X);s.setCenter(Y,W);var j=[];j=j.concat(s.getEdges());var z=j.length;y!=null&&z--;for(var K=0,k=j.length,F,G=s.getEdgesBetween(y);G.length>1;){var J=G[0];G.splice(0,1);var it=j.indexOf(J);it>=0&&j.splice(it,1),k--,z--}y!=null?F=(j.indexOf(G[0])+1)%k:F=0;for(var ut=Math.abs(v-m)/z,Lt=F;K!=z;Lt=++Lt%k){var Ot=j[Lt].getOtherEnd(s);if(Ot!=y){var P=(m+K*ut)%360,rt=(P+ut)%360;x.branchRadialLayout(Ot,s,P,rt,p+D,D),K++}}},x.maxDiagonalInTree=function(s){for(var y=U.MIN_VALUE,m=0;m<s.length;m++){var v=s[m],p=v.getDiagonal();p>y&&(y=p)}return y},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,y={};this.memberGroups={},this.idToDummyNode={};for(var m=[],v=this.graphManager.getAllNodes(),p=0;p<v.length;p++){var D=v[p],I=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(I.id==null||!this.getToBeTiled(I))&&m.push(D)}for(var p=0;p<m.length;p++){var D=m[p],R=D.getParent().id;typeof y[R]>"u"&&(y[R]=[]),y[R]=y[R].concat(D)}Object.keys(y).forEach(function(X){if(y[X].length>1){var Y="DummyCompound_"+X;s.memberGroups[Y]=y[X];var W=y[X][0].getParent(),j=new n(s.graphManager);j.id=Y,j.paddingLeft=W.paddingLeft||0,j.paddingRight=W.paddingRight||0,j.paddingBottom=W.paddingBottom||0,j.paddingTop=W.paddingTop||0,s.idToDummyNode[Y]=j;var z=s.getGraphManager().add(s.newGraph(),j),K=W.getChild();K.add(j);for(var k=0;k<y[X].length;k++){var F=y[X][k];K.remove(F),z.add(F)}}})},x.prototype.clearCompounds=function(){var s={},y={};this.performDFSOnCompounds();for(var m=0;m<this.compoundOrder.length;m++)y[this.compoundOrder[m].id]=this.compoundOrder[m],s[this.compoundOrder[m].id]=[].concat(this.compoundOrder[m].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[m].getChild()),this.compoundOrder[m].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,y)},x.prototype.clearZeroDegreeMembers=function(){var s=this,y=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(m){var v=s.idToDummyNode[m];if(y[m]=s.tileNodes(s.memberGroups[m],v.paddingLeft+v.paddingRight),v.rect.width=y[m].width,v.rect.height=y[m].height,v.setCenter(y[m].centerX,y[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var p=v.rect.width,D=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(p+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>p?(v.rect.x-=(v.labelWidth-p)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-p)/2):v.labelPosHorizontal=="right"&&v.setWidth(p+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(D+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>D?(v.rect.y-=(v.labelHeight-D)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-D)/2):v.labelPosVertical=="bottom"&&v.setHeight(D+v.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var y=this.compoundOrder[s],m=y.id,v=y.paddingLeft,p=y.paddingTop,D=y.labelMarginLeft,I=y.labelMarginTop;this.adjustLocations(this.tiledMemberPack[m],y.rect.x,y.rect.y,v,p,D,I)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,y=this.tiledZeroDegreePack;Object.keys(y).forEach(function(m){var v=s.idToDummyNode[m],p=v.paddingLeft,D=v.paddingTop,I=v.labelMarginLeft,R=v.labelMarginTop;s.adjustLocations(y[m],v.rect.x,v.rect.y,p,D,I,R)})},x.prototype.getToBeTiled=function(s){var y=s.id;if(this.toBeTiled[y]!=null)return this.toBeTiled[y];var m=s.getChild();if(m==null)return this.toBeTiled[y]=!1,!1;for(var v=m.getNodes(),p=0;p<v.length;p++){var D=v[p];if(this.getNodeDegree(D)>0)return this.toBeTiled[y]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[y]=!1,!1}return this.toBeTiled[y]=!0,!0},x.prototype.getNodeDegree=function(s){for(var y=s.id,m=s.getEdges(),v=0,p=0;p<m.length;p++){var D=m[p];D.getSource().id!==D.getTarget().id&&(v=v+1)}return v},x.prototype.getNodeDegreeWithChildren=function(s){var y=this.getNodeDegree(s);if(s.getChild()==null)return y;for(var m=s.getChild().getNodes(),v=0;v<m.length;v++){var p=m[v];y+=this.getNodeDegreeWithChildren(p)}return y},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(s){for(var y=0;y<s.length;y++){var m=s[y];m.getChild()!=null&&this.fillCompexOrderByDFS(m.getChild().getNodes()),this.getToBeTiled(m)&&this.compoundOrder.push(m)}},x.prototype.adjustLocations=function(s,y,m,v,p,D,I){y+=v+D,m+=p+I;for(var R=y,X=0;X<s.rows.length;X++){var Y=s.rows[X];y=R;for(var W=0,j=0;j<Y.length;j++){var z=Y[j];z.rect.x=y,z.rect.y=m,y+=z.rect.width+s.horizontalPadding,z.rect.height>W&&(W=z.rect.height)}m+=W+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,y){var m=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(v){var p=y[v];if(m.tiledMemberPack[v]=m.tileNodes(s[v],p.paddingLeft+p.paddingRight),p.rect.width=m.tiledMemberPack[v].width,p.rect.height=m.tiledMemberPack[v].height,p.setCenter(m.tiledMemberPack[v].centerX,m.tiledMemberPack[v].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var D=p.rect.width,I=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(D+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>D?(p.rect.x-=(p.labelWidth-D)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-D)/2):p.labelPosHorizontal=="right"&&p.setWidth(D+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(I+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>I?(p.rect.y-=(p.labelHeight-I)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-I)/2):p.labelPosVertical=="bottom"&&p.setHeight(I+p.labelHeight))}})},x.prototype.tileNodes=function(s,y){var m=this.tileNodesByFavoringDim(s,y,!0),v=this.tileNodesByFavoringDim(s,y,!1),p=this.getOrgRatio(m),D=this.getOrgRatio(v),I;return D<p?I=v:I=m,I},x.prototype.getOrgRatio=function(s){var y=s.width,m=s.height,v=y/m;return v<1&&(v=1/v),v},x.prototype.calcIdealRowWidth=function(s,y){var m=l.TILING_PADDING_VERTICAL,v=l.TILING_PADDING_HORIZONTAL,p=s.length,D=0,I=0,R=0;s.forEach(function(k){D+=k.getWidth(),I+=k.getHeight(),k.getWidth()>R&&(R=k.getWidth())});var X=D/p,Y=I/p,W=Math.pow(m-v,2)+4*(X+v)*(Y+m)*p,j=(v-m+Math.sqrt(W))/(2*(X+v)),z;y?(z=Math.ceil(j),z==j&&z++):z=Math.floor(j);var K=z*(X+v)-v;return R>K&&(K=R),K+=v*2,K},x.prototype.tileNodesByFavoringDim=function(s,y,m){var v=l.TILING_PADDING_VERTICAL,p=l.TILING_PADDING_HORIZONTAL,D=l.TILING_COMPARE_BY,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:y,verticalPadding:v,horizontalPadding:p,centerX:0,centerY:0};D&&(I.idealRowWidth=this.calcIdealRowWidth(s,m));var R=A(function(k){return k.rect.width*k.rect.height},"getNodeArea"),X=A(function(k,F){return R(F)-R(k)},"areaCompareFcn");s.sort(function(k,F){var G=X;return I.idealRowWidth?(G=D,G(k.id,F.id)):G(k,F)});for(var Y=0,W=0,j=0;j<s.length;j++){var z=s[j];Y+=z.getCenterX(),W+=z.getCenterY()}I.centerX=Y/s.length,I.centerY=W/s.length;for(var j=0;j<s.length;j++){var z=s[j];if(I.rows.length==0)this.insertNodeToRow(I,z,0,y);else if(this.canAddHorizontal(I,z.rect.width,z.rect.height)){var K=I.rows.length-1;I.idealRowWidth||(K=this.getShortestRowIndex(I)),this.insertNodeToRow(I,z,K,y)}else this.insertNodeToRow(I,z,I.rows.length,y);this.shiftToLastRow(I)}return I},x.prototype.insertNodeToRow=function(s,y,m,v){var p=v;if(m==s.rows.length){var D=[];s.rows.push(D),s.rowWidth.push(p),s.rowHeight.push(0)}var I=s.rowWidth[m]+y.rect.width;s.rows[m].length>0&&(I+=s.horizontalPadding),s.rowWidth[m]=I,s.width<I&&(s.width=I);var R=y.rect.height;m>0&&(R+=s.verticalPadding);var X=0;R>s.rowHeight[m]&&(X=s.rowHeight[m],s.rowHeight[m]=R,X=s.rowHeight[m]-X),s.height+=X,s.rows[m].push(y)},x.prototype.getShortestRowIndex=function(s){for(var y=-1,m=Number.MAX_VALUE,v=0;v<s.rows.length;v++)s.rowWidth[v]<m&&(y=v,m=s.rowWidth[v]);return y},x.prototype.getLongestRowIndex=function(s){for(var y=-1,m=Number.MIN_VALUE,v=0;v<s.rows.length;v++)s.rowWidth[v]>m&&(y=v,m=s.rowWidth[v]);return y},x.prototype.canAddHorizontal=function(s,y,m){if(s.idealRowWidth){var v=s.rows.length-1,p=s.rowWidth[v];return p+y+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var I=s.rowWidth[D];if(I+s.horizontalPadding+y<=s.width)return!0;var R=0;s.rowHeight[D]<m&&D>0&&(R=m+s.verticalPadding-s.rowHeight[D]);var X;s.width-I>=y+s.horizontalPadding?X=(s.height+R)/(I+y+s.horizontalPadding):X=(s.height+R)/s.width,R=m+s.verticalPadding;var Y;return s.width<y?Y=(s.height+R)/y:Y=(s.height+R)/s.width,Y<1&&(Y=1/Y),X<1&&(X=1/X),X<Y},x.prototype.shiftToLastRow=function(s){var y=this.getLongestRowIndex(s),m=s.rowWidth.length-1,v=s.rows[y],p=v[v.length-1],D=p.width+s.horizontalPadding;if(s.width-s.rowWidth[m]>D&&y!=m){v.splice(-1,1),s.rows[m].push(p),s.rowWidth[y]=s.rowWidth[y]-D,s.rowWidth[m]=s.rowWidth[m]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var I=Number.MIN_VALUE,R=0;R<v.length;R++)v[R].height>I&&(I=v[R].height);y>0&&(I+=s.verticalPadding);var X=s.rowHeight[y]+s.rowHeight[m];s.rowHeight[y]=I,s.rowHeight[m]<p.height+s.verticalPadding&&(s.rowHeight[m]=p.height+s.verticalPadding);var Y=s.rowHeight[y]+s.rowHeight[m];s.height+=Y-X,this.shiftToLastRow(s)}},x.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var s=[],y=!0,m;y;){var v=this.graphManager.getAllNodes(),p=[];y=!1;for(var D=0;D<v.length;D++)if(m=v[D],m.getEdges().length==1&&!m.getEdges()[0].isInterGraph&&m.getChild()==null){if(l.PURE_INCREMENTAL){var I=m.getEdges()[0].getOtherEnd(m),R=new _(m.getCenterX()-I.getCenterX(),m.getCenterY()-I.getCenterY());p.push([m,m.getEdges()[0],m.getOwner(),R])}else p.push([m,m.getEdges()[0],m.getOwner()]);y=!0}if(y==!0){for(var X=[],Y=0;Y<p.length;Y++)p[Y][0].getEdges().length==1&&(X.push(p[Y]),p[Y][0].getOwner().remove(p[Y][0]));s.push(X),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},x.prototype.growTree=function(s){for(var y=s.length,m=s[y-1],v,p=0;p<m.length;p++)v=m[p],this.findPlaceforPrunedNode(v),v[2].add(v[0]),v[2].add(v[1],v[1].source,v[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(s){var y,m,v=s[0];if(v==s[1].source?m=s[1].target:m=s[1].source,l.PURE_INCREMENTAL)v.setCenter(m.getCenterX()+s[3].getWidth(),m.getCenterY()+s[3].getHeight());else{var p=m.startX,D=m.finishX,I=m.startY,R=m.finishY,X=0,Y=0,W=0,j=0,z=[X,W,Y,j];if(I>0)for(var K=p;K<=D;K++)z[0]+=this.grid[K][I-1].length+this.grid[K][I].length-1;if(D<this.grid.length-1)for(var K=I;K<=R;K++)z[1]+=this.grid[D+1][K].length+this.grid[D][K].length-1;if(R<this.grid[0].length-1)for(var K=p;K<=D;K++)z[2]+=this.grid[K][R+1].length+this.grid[K][R].length-1;if(p>0)for(var K=I;K<=R;K++)z[3]+=this.grid[p-1][K].length+this.grid[p][K].length-1;for(var k=U.MAX_VALUE,F,G,J=0;J<z.length;J++)z[J]<k?(k=z[J],F=1,G=J):z[J]==k&&F++;if(F==3&&k==0)z[0]==0&&z[1]==0&&z[2]==0?y=1:z[0]==0&&z[1]==0&&z[3]==0?y=0:z[0]==0&&z[2]==0&&z[3]==0?y=3:z[1]==0&&z[2]==0&&z[3]==0&&(y=2);else if(F==2&&k==0){var it=Math.floor(Math.random()*2);z[0]==0&&z[1]==0?it==0?y=0:y=1:z[0]==0&&z[2]==0?it==0?y=0:y=2:z[0]==0&&z[3]==0?it==0?y=0:y=3:z[1]==0&&z[2]==0?it==0?y=1:y=2:z[1]==0&&z[3]==0?it==0?y=1:y=3:it==0?y=2:y=3}else if(F==4&&k==0){var it=Math.floor(Math.random()*4);y=it}else y=G;y==0?v.setCenter(m.getCenterX(),m.getCenterY()-m.getHeight()/2-d.DEFAULT_EDGE_LENGTH-v.getHeight()/2):y==1?v.setCenter(m.getCenterX()+m.getWidth()/2+d.DEFAULT_EDGE_LENGTH+v.getWidth()/2,m.getCenterY()):y==2?v.setCenter(m.getCenterX(),m.getCenterY()+m.getHeight()/2+d.DEFAULT_EDGE_LENGTH+v.getHeight()/2):v.setCenter(m.getCenterX()-m.getWidth()/2-d.DEFAULT_EDGE_LENGTH-v.getWidth()/2,m.getCenterY())}},o.exports=x}),991:((o,i,e)=>{var a=e(551).FDLayoutNode,r=e(551).IMath;function f(t,l,u,d){a.call(this,t,l,u,d)}A(f,"CoSENode"),f.prototype=Object.create(a.prototype);for(var n in a)f[n]=a[n];f.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementX=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(t,l){for(var u=this.getChild().getNodes(),d,N=0;N<u.length;N++)d=u[N],d.getChild()==null?(d.displacementX+=t,d.displacementY+=l):d.propogateDisplacementToChildren(t,l)},f.prototype.move=function(){var t=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(t){this.pred1=t},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(t){this.next=t},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(t){this.processed=t},f.prototype.isProcessed=function(){return processed},o.exports=f}),902:((o,i,e)=>{function a(u){if(Array.isArray(u)){for(var d=0,N=Array(u.length);d<u.length;d++)N[d]=u[d];return N}else return Array.from(u)}A(a,"_toConsumableArray");var r=e(806),f=e(551).LinkedList,n=e(551).Matrix,t=e(551).SVD;function l(){}A(l,"ConstraintHandler"),l.handleConstraints=function(u){var d={};d.fixedNodeConstraint=u.constraints.fixedNodeConstraint,d.alignmentConstraint=u.constraints.alignmentConstraint,d.relativePlacementConstraint=u.constraints.relativePlacementConstraint;for(var N=new Map,g=new Map,E=[],_=[],C=u.getAllNodes(),U=0,H=0;H<C.length;H++){var V=C[H];V.getChild()==null&&(g.set(V.id,U++),E.push(V.getCenterX()),_.push(V.getCenterY()),N.set(V.id,V))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(M){!M.gap&&M.gap!=0&&(M.left?M.gap=r.DEFAULT_EDGE_LENGTH+N.get(M.left).getWidth()/2+N.get(M.right).getWidth()/2:M.gap=r.DEFAULT_EDGE_LENGTH+N.get(M.top).getHeight()/2+N.get(M.bottom).getHeight()/2)});var B=A(function(M,S){return{x:M.x-S.x,y:M.y-S.y}},"calculatePositionDiff"),q=A(function(M){var S=0,$=0;return M.forEach(function(Z){S+=E[g.get(Z)],$+=_[g.get(Z)]}),{x:S/M.size,y:$/M.size}},"calculateAvgPosition"),x=A(function(M,S,$,Z,Q){function pt(nt,at){var ot=new Set(nt),Nt=!0,ft=!1,bt=void 0;try{for(var Rt=at[Symbol.iterator](),Dt;!(Nt=(Dt=Rt.next()).done);Nt=!0){var Bt=Dt.value;ot.add(Bt)}}catch(Tt){ft=!0,bt=Tt}finally{try{!Nt&&Rt.return&&Rt.return()}finally{if(ft)throw bt}}return ot}A(pt,"setUnion");var dt=new Map;M.forEach(function(nt,at){dt.set(at,0)}),M.forEach(function(nt,at){nt.forEach(function(ot){dt.set(ot.id,dt.get(ot.id)+1)})});var tt=new Map,ct=new Map,Et=new f;dt.forEach(function(nt,at){nt==0?(Et.push(at),$||(S=="horizontal"?tt.set(at,g.has(at)?E[g.get(at)]:Z.get(at)):tt.set(at,g.has(at)?_[g.get(at)]:Z.get(at)))):tt.set(at,Number.NEGATIVE_INFINITY),$&&ct.set(at,new Set([at]))}),$&&Q.forEach(function(nt){var at=[];if(nt.forEach(function(ft){$.has(ft)&&at.push(ft)}),at.length>0){var ot=0;at.forEach(function(ft){S=="horizontal"?(tt.set(ft,g.has(ft)?E[g.get(ft)]:Z.get(ft)),ot+=tt.get(ft)):(tt.set(ft,g.has(ft)?_[g.get(ft)]:Z.get(ft)),ot+=tt.get(ft))}),ot=ot/at.length,nt.forEach(function(ft){$.has(ft)||tt.set(ft,ot)})}else{var Nt=0;nt.forEach(function(ft){S=="horizontal"?Nt+=g.has(ft)?E[g.get(ft)]:Z.get(ft):Nt+=g.has(ft)?_[g.get(ft)]:Z.get(ft)}),Nt=Nt/nt.length,nt.forEach(function(ft){tt.set(ft,Nt)})}});for(var _t=A(function(){var nt=Et.shift(),at=M.get(nt);at.forEach(function(ot){if(tt.get(ot.id)<tt.get(nt)+ot.gap)if($&&$.has(ot.id)){var Nt=void 0;if(S=="horizontal"?Nt=g.has(ot.id)?E[g.get(ot.id)]:Z.get(ot.id):Nt=g.has(ot.id)?_[g.get(ot.id)]:Z.get(ot.id),tt.set(ot.id,Nt),Nt<tt.get(nt)+ot.gap){var ft=tt.get(nt)+ot.gap-Nt;ct.get(nt).forEach(function(bt){tt.set(bt,tt.get(bt)-ft)})}}else tt.set(ot.id,tt.get(nt)+ot.gap);dt.set(ot.id,dt.get(ot.id)-1),dt.get(ot.id)==0&&Et.push(ot.id),$&&ct.set(ot.id,pt(ct.get(nt),ct.get(ot.id)))})},"_loop");Et.length!=0;)_t();if($){var et=new Set;M.forEach(function(nt,at){nt.length==0&&et.add(at)});var It=[];ct.forEach(function(nt,at){if(et.has(at)){var ot=!1,Nt=!0,ft=!1,bt=void 0;try{for(var Rt=nt[Symbol.iterator](),Dt;!(Nt=(Dt=Rt.next()).done);Nt=!0){var Bt=Dt.value;$.has(Bt)&&(ot=!0)}}catch(Ft){ft=!0,bt=Ft}finally{try{!Nt&&Rt.return&&Rt.return()}finally{if(ft)throw bt}}if(!ot){var Tt=!1,At=void 0;It.forEach(function(Ft,St){Ft.has([].concat(a(nt))[0])&&(Tt=!0,At=St)}),Tt?nt.forEach(function(Ft){It[At].add(Ft)}):It.push(new Set(nt))}}}),It.forEach(function(nt,at){var ot=Number.POSITIVE_INFINITY,Nt=Number.POSITIVE_INFINITY,ft=Number.NEGATIVE_INFINITY,bt=Number.NEGATIVE_INFINITY,Rt=!0,Dt=!1,Bt=void 0;try{for(var Tt=nt[Symbol.iterator](),At;!(Rt=(At=Tt.next()).done);Rt=!0){var Ft=At.value,St=void 0;S=="horizontal"?St=g.has(Ft)?E[g.get(Ft)]:Z.get(Ft):St=g.has(Ft)?_[g.get(Ft)]:Z.get(Ft);var zt=tt.get(Ft);St<ot&&(ot=St),St>ft&&(ft=St),zt<Nt&&(Nt=zt),zt>bt&&(bt=zt)}}catch(Jt){Dt=!0,Bt=Jt}finally{try{!Rt&&Tt.return&&Tt.return()}finally{if(Dt)throw Bt}}var jt=(ot+ft)/2-(Nt+bt)/2,re=!0,Zt=!1,Kt=void 0;try{for(var qt=nt[Symbol.iterator](),Qt;!(re=(Qt=qt.next()).done);re=!0){var oe=Qt.value;tt.set(oe,tt.get(oe)+jt)}}catch(Jt){Zt=!0,Kt=Jt}finally{try{!re&&qt.return&&qt.return()}finally{if(Zt)throw Kt}}})}return tt},"findAppropriatePositionForRelativePlacement"),st=A(function(M){var S=0,$=0,Z=0,Q=0;if(M.forEach(function(ct){ct.left?E[g.get(ct.left)]-E[g.get(ct.right)]>=0?S++:$++:_[g.get(ct.top)]-_[g.get(ct.bottom)]>=0?Z++:Q++}),S>$&&Z>Q)for(var pt=0;pt<g.size;pt++)E[pt]=-1*E[pt],_[pt]=-1*_[pt];else if(S>$)for(var dt=0;dt<g.size;dt++)E[dt]=-1*E[dt];else if(Z>Q)for(var tt=0;tt<g.size;tt++)_[tt]=-1*_[tt]},"applyReflectionForRelativePlacement"),s=A(function(M){var S=[],$=new f,Z=new Set,Q=0;return M.forEach(function(pt,dt){if(!Z.has(dt)){S[Q]=[];var tt=dt;for($.push(tt),Z.add(tt),S[Q].push(tt);$.length!=0;){tt=$.shift();var ct=M.get(tt);ct.forEach(function(Et){Z.has(Et.id)||($.push(Et.id),Z.add(Et.id),S[Q].push(Et.id))})}Q++}}),S},"findComponents"),y=A(function(M){var S=new Map;return M.forEach(function($,Z){S.set(Z,[])}),M.forEach(function($,Z){$.forEach(function(Q){S.get(Z).push(Q),S.get(Q.id).push({id:Z,gap:Q.gap,direction:Q.direction})})}),S},"dagToUndirected"),m=A(function(M){var S=new Map;return M.forEach(function($,Z){S.set(Z,[])}),M.forEach(function($,Z){$.forEach(function(Q){S.get(Q.id).push({id:Z,gap:Q.gap,direction:Q.direction})})}),S},"dagToReversed"),v=[],p=[],D=!1,I=!1,R=new Set,X=new Map,Y=new Map,W=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(M){R.add(M.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(M){M.left?(X.has(M.left)?X.get(M.left).push({id:M.right,gap:M.gap,direction:"horizontal"}):X.set(M.left,[{id:M.right,gap:M.gap,direction:"horizontal"}]),X.has(M.right)||X.set(M.right,[])):(X.has(M.top)?X.get(M.top).push({id:M.bottom,gap:M.gap,direction:"vertical"}):X.set(M.top,[{id:M.bottom,gap:M.gap,direction:"vertical"}]),X.has(M.bottom)||X.set(M.bottom,[]))}),Y=y(X),W=s(Y)),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(M,S){v[S]=[M.position.x,M.position.y],p[S]=[E[g.get(M.nodeId)],_[g.get(M.nodeId)]]}),D=!0;else if(d.alignmentConstraint)(function(){var M=0;if(d.alignmentConstraint.vertical){for(var S=d.alignmentConstraint.vertical,$=A(function(tt){var ct=new Set;S[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(a(ct)).filter(function(et){return R.has(et)})),_t=void 0;Et.size>0?_t=E[g.get(Et.values().next().value)]:_t=q(ct).x,S[tt].forEach(function(et){v[M]=[_t,_[g.get(et)]],p[M]=[E[g.get(et)],_[g.get(et)]],M++})},"_loop2"),Z=0;Z<S.length;Z++)$(Z);D=!0}if(d.alignmentConstraint.horizontal){for(var Q=d.alignmentConstraint.horizontal,pt=A(function(tt){var ct=new Set;Q[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(a(ct)).filter(function(et){return R.has(et)})),_t=void 0;Et.size>0?_t=E[g.get(Et.values().next().value)]:_t=q(ct).y,Q[tt].forEach(function(et){v[M]=[E[g.get(et)],_t],p[M]=[E[g.get(et)],_[g.get(et)]],M++})},"_loop3"),dt=0;dt<Q.length;dt++)pt(dt);D=!0}d.relativePlacementConstraint&&(I=!0)})();else if(d.relativePlacementConstraint){for(var j=0,z=0,K=0;K<W.length;K++)W[K].length>j&&(j=W[K].length,z=K);if(j<Y.size/2)st(d.relativePlacementConstraint),D=!1,I=!1;else{var k=new Map,F=new Map,G=[];W[z].forEach(function(M){X.get(M).forEach(function(S){S.direction=="horizontal"?(k.has(M)?k.get(M).push(S):k.set(M,[S]),k.has(S.id)||k.set(S.id,[]),G.push({left:M,right:S.id})):(F.has(M)?F.get(M).push(S):F.set(M,[S]),F.has(S.id)||F.set(S.id,[]),G.push({top:M,bottom:S.id}))})}),st(G),I=!1;var J=x(k,"horizontal"),it=x(F,"vertical");W[z].forEach(function(M,S){p[S]=[E[g.get(M)],_[g.get(M)]],v[S]=[],J.has(M)?v[S][0]=J.get(M):v[S][0]=E[g.get(M)],it.has(M)?v[S][1]=it.get(M):v[S][1]=_[g.get(M)]}),D=!0}}if(D){for(var ut=void 0,Lt=n.transpose(v),Ot=n.transpose(p),P=0;P<Lt.length;P++)Lt[P]=n.multGamma(Lt[P]),Ot[P]=n.multGamma(Ot[P]);var rt=n.multMat(Lt,n.transpose(Ot)),ht=t.svd(rt);ut=n.multMat(ht.V,n.transpose(ht.U));for(var mt=0;mt<g.size;mt++){var Mt=[E[mt],_[mt]],vt=[ut[0][0],ut[1][0]],yt=[ut[0][1],ut[1][1]];E[mt]=n.dotProduct(Mt,vt),_[mt]=n.dotProduct(Mt,yt)}I&&st(d.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var wt={x:0,y:0};d.fixedNodeConstraint.forEach(function(M,S){var $={x:E[g.get(M.nodeId)],y:_[g.get(M.nodeId)]},Z=M.position,Q=B(Z,$);wt.x+=Q.x,wt.y+=Q.y}),wt.x/=d.fixedNodeConstraint.length,wt.y/=d.fixedNodeConstraint.length,E.forEach(function(M,S){E[S]+=wt.x}),_.forEach(function(M,S){_[S]+=wt.y}),d.fixedNodeConstraint.forEach(function(M){E[g.get(M.nodeId)]=M.position.x,_[g.get(M.nodeId)]=M.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Pt=A(function(M){var S=new Set;Ht[M].forEach(function(Q){S.add(Q)});var $=new Set([].concat(a(S)).filter(function(Q){return R.has(Q)})),Z=void 0;$.size>0?Z=E[g.get($.values().next().value)]:Z=q(S).x,S.forEach(function(Q){R.has(Q)||(E[g.get(Q)]=Z)})},"_loop4"),Gt=0;Gt<Ht.length;Gt++)Pt(Gt);if(d.alignmentConstraint.horizontal)for(var xt=d.alignmentConstraint.horizontal,Ut=A(function(M){var S=new Set;xt[M].forEach(function(Q){S.add(Q)});var $=new Set([].concat(a(S)).filter(function(Q){return R.has(Q)})),Z=void 0;$.size>0?Z=_[g.get($.values().next().value)]:Z=q(S).y,S.forEach(function(Q){R.has(Q)||(_[g.get(Q)]=Z)})},"_loop5"),Xt=0;Xt<xt.length;Xt++)Ut(Xt)}d.relativePlacementConstraint&&(function(){var M=new Map,S=new Map,$=new Map,Z=new Map,Q=new Map,pt=new Map,dt=new Set,tt=new Set;if(R.forEach(function(gt){dt.add(gt),tt.add(gt)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var ct=d.alignmentConstraint.vertical,Et=A(function(gt){$.set("dummy"+gt,[]),ct[gt].forEach(function(Ct){M.set(Ct,"dummy"+gt),$.get("dummy"+gt).push(Ct),R.has(Ct)&&dt.add("dummy"+gt)}),Q.set("dummy"+gt,E[g.get(ct[gt][0])])},"_loop6"),_t=0;_t<ct.length;_t++)Et(_t);if(d.alignmentConstraint.horizontal)for(var et=d.alignmentConstraint.horizontal,It=A(function(gt){Z.set("dummy"+gt,[]),et[gt].forEach(function(Ct){S.set(Ct,"dummy"+gt),Z.get("dummy"+gt).push(Ct),R.has(Ct)&&tt.add("dummy"+gt)}),pt.set("dummy"+gt,_[g.get(et[gt][0])])},"_loop7"),nt=0;nt<et.length;nt++)It(nt)}var at=new Map,ot=new Map,Nt=A(function(gt){X.get(gt).forEach(function(Ct){var Yt=void 0,Vt=void 0;Ct.direction=="horizontal"?(Yt=M.get(gt)?M.get(gt):gt,M.get(Ct.id)?Vt={id:M.get(Ct.id),gap:Ct.gap,direction:Ct.direction}:Vt=Ct,at.has(Yt)?at.get(Yt).push(Vt):at.set(Yt,[Vt]),at.has(Vt.id)||at.set(Vt.id,[])):(Yt=S.get(gt)?S.get(gt):gt,S.get(Ct.id)?Vt={id:S.get(Ct.id),gap:Ct.gap,direction:Ct.direction}:Vt=Ct,ot.has(Yt)?ot.get(Yt).push(Vt):ot.set(Yt,[Vt]),ot.has(Vt.id)||ot.set(Vt.id,[]))})},"_loop8"),ft=!0,bt=!1,Rt=void 0;try{for(var Dt=X.keys()[Symbol.iterator](),Bt;!(ft=(Bt=Dt.next()).done);ft=!0){var Tt=Bt.value;Nt(Tt)}}catch(gt){bt=!0,Rt=gt}finally{try{!ft&&Dt.return&&Dt.return()}finally{if(bt)throw Rt}}var At=y(at),Ft=y(ot),St=s(At),zt=s(Ft),jt=m(at),re=m(ot),Zt=[],Kt=[];St.forEach(function(gt,Ct){Zt[Ct]=[],gt.forEach(function(Yt){jt.get(Yt).length==0&&Zt[Ct].push(Yt)})}),zt.forEach(function(gt,Ct){Kt[Ct]=[],gt.forEach(function(Yt){re.get(Yt).length==0&&Kt[Ct].push(Yt)})});var qt=x(at,"horizontal",dt,Q,Zt),Qt=x(ot,"vertical",tt,pt,Kt),oe=A(function(gt){$.get(gt)?$.get(gt).forEach(function(Ct){E[g.get(Ct)]=qt.get(gt)}):E[g.get(gt)]=qt.get(gt)},"_loop9"),Jt=!0,ve=!1,ye=void 0;try{for(var se=qt.keys()[Symbol.iterator](),Ee;!(Jt=(Ee=se.next()).done);Jt=!0){var he=Ee.value;oe(he)}}catch(gt){ve=!0,ye=gt}finally{try{!Jt&&se.return&&se.return()}finally{if(ve)throw ye}}var Ye=A(function(gt){Z.get(gt)?Z.get(gt).forEach(function(Ct){_[g.get(Ct)]=Qt.get(gt)}):_[g.get(gt)]=Qt.get(gt)},"_loop10"),le=!0,Ne=!1,Te=void 0;try{for(var de=Qt.keys()[Symbol.iterator](),Ae;!(le=(Ae=de.next()).done);le=!0){var he=Ae.value;Ye(he)}}catch(gt){Ne=!0,Te=gt}finally{try{!le&&de.return&&de.return()}finally{if(Ne)throw Te}}})()}for(var Wt=0;Wt<C.length;Wt++){var lt=C[Wt];lt.getChild()==null&<.setCenter(E[g.get(lt.id)],_[g.get(lt.id)])}},o.exports=l}),551:(o=>{o.exports=L})},T={};function c(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return b[o](e,e.exports,c),e.exports}A(c,"__webpack_require__");var h=c(45);return h})()})}),hi=pe((w,O)=>{A((function(L,b){typeof w=="object"&&typeof O=="object"?O.exports=b(Ce()):typeof define=="function"&&define.amd?define(["cose-base"],b):typeof w=="object"?w.cytoscapeFcose=b(Ce()):L.cytoscapeFcose=b(L.coseBase)}),"webpackUniversalModuleDefinition")(w,function(L){return(()=>{var b={658:(o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return a.forEach(function(f){Object.keys(f).forEach(function(n){return i[n]=f[n]})}),i}}),548:((o,i,e)=>{var a=(function(){function n(t,l){var u=[],d=!0,N=!1,g=void 0;try{for(var E=t[Symbol.iterator](),_;!(d=(_=E.next()).done)&&(u.push(_.value),!(l&&u.length===l));d=!0);}catch(C){N=!0,g=C}finally{try{!d&&E.return&&E.return()}finally{if(N)throw g}}return u}return A(n,"sliceIterator"),function(t,l){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),r=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(n){for(var t={},l=0;l<n.length;l++)t[n[l].id()]=!0;var u=n.filter(function(d,N){typeof d=="number"&&(d=N);for(var g=d.parent()[0];g!=null;){if(t[g.id()])return!1;g=g.parent()[0]}return!0});return u},f.connectComponents=function(n,t,l,u){var d=new r,N=new Set,g=[],E=void 0,_=void 0,C=void 0,U=!1,H=1,V=[],B=[],q=A(function(){var x=n.collection();B.push(x);var st=l[0],s=n.collection();s.merge(st).merge(st.descendants().intersection(t)),g.push(st),s.forEach(function(v){d.push(v),N.add(v),x.merge(v)});for(var y=A(function(){st=d.shift();var v=n.collection();st.neighborhood().nodes().forEach(function(R){t.intersection(st.edgesWith(R)).length>0&&v.merge(R)});for(var p=0;p<v.length;p++){var D=v[p];if(E=l.intersection(D.union(D.ancestors())),E!=null&&!N.has(E[0])){var I=E.union(E.descendants());I.forEach(function(R){d.push(R),N.add(R),x.merge(R),l.has(R)&&g.push(R)})}}},"_loop2");d.length!=0;)y();if(x.forEach(function(v){t.intersection(v.connectedEdges()).forEach(function(p){x.has(p.source())&&x.has(p.target())&&x.merge(p)})}),g.length==l.length&&(U=!0),!U||U&&H>1){_=g[0],C=_.connectedEdges().length,g.forEach(function(v){v.connectedEdges().length<C&&(C=v.connectedEdges().length,_=v)}),V.push(_.id());var m=n.collection();m.merge(g[0]),g.forEach(function(v){m.merge(v)}),g=[],l=l.difference(m),H++}},"_loop");do q();while(!U);return u&&V.length>0&&u.set("dummy"+(u.size+1),V),B},f.relocateComponent=function(n,t,l){if(!l.fixedNodeConstraint){var u=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var E=!0,_=!1,C=void 0;try{for(var U=t.nodeIndexes[Symbol.iterator](),H;!(E=(H=U.next()).done);E=!0){var V=H.value,B=a(V,2),q=B[0],x=B[1],st=l.cy.getElementById(q);if(st){var s=st.boundingBox(),y=t.xCoords[x]-s.w/2,m=t.xCoords[x]+s.w/2,v=t.yCoords[x]-s.h/2,p=t.yCoords[x]+s.h/2;y<u&&(u=y),m>d&&(d=m),v<N&&(N=v),p>g&&(g=p)}}}catch(Y){_=!0,C=Y}finally{try{!E&&U.return&&U.return()}finally{if(_)throw C}}var D=n.x-(d+u)/2,I=n.y-(g+N)/2;t.xCoords=t.xCoords.map(function(Y){return Y+D}),t.yCoords=t.yCoords.map(function(Y){return Y+I})}else{Object.keys(t).forEach(function(Y){var W=t[Y],j=W.getRect().x,z=W.getRect().x+W.getRect().width,K=W.getRect().y,k=W.getRect().y+W.getRect().height;j<u&&(u=j),z>d&&(d=z),K<N&&(N=K),k>g&&(g=k)});var R=n.x-(d+u)/2,X=n.y-(g+N)/2;Object.keys(t).forEach(function(Y){var W=t[Y];W.setCenter(W.getCenterX()+R,W.getCenterY()+X)})}}},f.calcBoundingBox=function(n,t,l,u){for(var d=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,_=void 0,C=void 0,U=void 0,H=void 0,V=n.descendants().not(":parent"),B=V.length,q=0;q<B;q++){var x=V[q];_=t[u.get(x.id())]-x.width()/2,C=t[u.get(x.id())]+x.width()/2,U=l[u.get(x.id())]-x.height()/2,H=l[u.get(x.id())]+x.height()/2,d>_&&(d=_),N<C&&(N=C),g>U&&(g=U),E<H&&(E=H)}var st={};return st.topLeftX=d,st.topLeftY=g,st.width=N-d,st.height=E-g,st},f.calcParentsWithoutChildren=function(n,t){var l=n.collection();return t.nodes(":parent").forEach(function(u){var d=!1;u.children().forEach(function(N){N.css("display")!="none"&&(d=!0)}),d||l.merge(u)}),l},o.exports=f}),816:((o,i,e)=>{var a=e(548),r=e(140).CoSELayout,f=e(140).CoSENode,n=e(140).layoutBase.PointD,t=e(140).layoutBase.DimensionD,l=e(140).layoutBase.LayoutConstants,u=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=A(function(g,E){var _=g.cy,C=g.eles,U=C.nodes(),H=C.edges(),V=void 0,B=void 0,q=void 0,x={};g.randomize&&(V=E.nodeIndexes,B=E.xCoords,q=E.yCoords);var st=A(function(R){return typeof R=="function"},"isFn"),s=A(function(R,X){return st(R)?R(X):R},"optFn"),y=a.calcParentsWithoutChildren(_,C),m=A(function R(X,Y,W,j){for(var z=Y.length,K=0;K<z;K++){var k=Y[K],F=null;k.intersection(y).length==0&&(F=k.children());var G=void 0,J=k.layoutDimensions({nodeDimensionsIncludeLabels:j.nodeDimensionsIncludeLabels});if(k.outerWidth()!=null&&k.outerHeight()!=null)if(j.randomize)if(!k.isParent())G=X.add(new f(W.graphManager,new n(B[V.get(k.id())]-J.w/2,q[V.get(k.id())]-J.h/2),new t(parseFloat(J.w),parseFloat(J.h))));else{var it=a.calcBoundingBox(k,B,q,V);k.intersection(y).length==0?G=X.add(new f(W.graphManager,new n(it.topLeftX,it.topLeftY),new t(it.width,it.height))):G=X.add(new f(W.graphManager,new n(it.topLeftX,it.topLeftY),new t(parseFloat(J.w),parseFloat(J.h))))}else G=X.add(new f(W.graphManager,new n(k.position("x")-J.w/2,k.position("y")-J.h/2),new t(parseFloat(J.w),parseFloat(J.h))));else G=X.add(new f(this.graphManager));if(G.id=k.data("id"),G.nodeRepulsion=s(j.nodeRepulsion,k),G.paddingLeft=parseInt(k.css("padding")),G.paddingTop=parseInt(k.css("padding")),G.paddingRight=parseInt(k.css("padding")),G.paddingBottom=parseInt(k.css("padding")),j.nodeDimensionsIncludeLabels&&(G.labelWidth=k.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,G.labelHeight=k.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,G.labelPosVertical=k.css("text-valign"),G.labelPosHorizontal=k.css("text-halign")),x[k.data("id")]=G,isNaN(G.rect.x)&&(G.rect.x=0),isNaN(G.rect.y)&&(G.rect.y=0),F!=null&&F.length>0){var ut=void 0;ut=W.getGraphManager().add(W.newGraph(),G),R(ut,F,W,j)}}},"processChildrenList"),v=A(function(R,X,Y){for(var W=0,j=0,z=0;z<Y.length;z++){var K=Y[z],k=x[K.data("source")],F=x[K.data("target")];if(k&&F&&k!==F&&k.getEdgesBetween(F).length==0){var G=X.add(R.newEdge(),k,F);G.id=K.id(),G.idealLength=s(g.idealEdgeLength,K),G.edgeElasticity=s(g.edgeElasticity,K),W+=G.idealLength,j++}}g.idealEdgeLength!=null&&(j>0?d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=W/j:st(g.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=g.idealEdgeLength,d.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},"processEdges"),p=A(function(R,X){X.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=X.fixedNodeConstraint),X.alignmentConstraint&&(R.constraints.alignmentConstraint=X.alignmentConstraint),X.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=X.relativePlacementConstraint)},"processConstraints");g.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.nestingFactor),g.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=g.gravity),g.numIter!=null&&(d.MAX_ITERATIONS=u.MAX_ITERATIONS=g.numIter),g.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=g.gravityRange),g.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.gravityCompound),g.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.gravityRangeCompound),g.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.initialEnergyOnIncremental),g.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=g.tilingCompareBy),g.quality=="proof"?l.QUALITY=2:l.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=g.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!g.randomize,d.ANIMATE=u.ANIMATE=l.ANIMATE=g.animate,d.TILE=g.tile,d.TILING_PADDING_VERTICAL=typeof g.tilingPaddingVertical=="function"?g.tilingPaddingVertical.call():g.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof g.tilingPaddingHorizontal=="function"?g.tilingPaddingHorizontal.call():g.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!g.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=g.uniformNodeDimensions,g.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),g.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),g.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),g.step=="all"&&(g.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),g.fixedNodeConstraint||g.alignmentConstraint||g.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new r,I=D.newGraphManager();return m(I.addRoot(),a.getTopMostNodes(U),D,g),v(D,I,H),p(D,g),D.runLayout(),x},"coseLayout");o.exports={coseLayout:N}}),212:((o,i,e)=>{var a=(function(){function E(_,C){for(var U=0;U<C.length;U++){var H=C[U];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(_,H.key,H)}}return A(E,"defineProperties"),function(_,C,U){return C&&E(_.prototype,C),U&&E(_,U),_}})();function r(E,_){if(!(E instanceof _))throw new TypeError("Cannot call a class as a function")}A(r,"_classCallCheck");var f=e(658),n=e(548),t=e(657),l=t.spectralLayout,u=e(816),d=u.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:A(function(E){return 4500},"nodeRepulsion"),idealEdgeLength:A(function(E){return 50},"idealEdgeLength"),edgeElasticity:A(function(E){return .45},"edgeElasticity"),nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:A(function(){},"ready"),stop:A(function(){},"stop")}),g=(function(){function E(_){r(this,E),this.options=f({},N,_)}return A(E,"Layout"),a(E,[{key:"run",value:A(function(){var _=this,C=this.options,U=C.cy,H=C.eles,V=[],B=[],q=void 0,x=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var st=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;st&&(C.tile=!1,C.packComponents=!1);var s=void 0,y=!1;if(U.layoutUtilities&&C.packComponents&&(s=U.layoutUtilities("get"),s||(s=U.layoutUtilities()),y=!0),H.nodes().length>0)if(y){var m=n.getTopMostNodes(C.eles.nodes());if(q=n.connectComponents(U,C.eles,m),q.forEach(function(P){var rt=P.boundingBox();x.push({x:rt.x1+rt.w/2,y:rt.y1+rt.h/2})}),C.randomize&&q.forEach(function(P){C.eles=P,V.push(l(C))}),C.quality=="default"||C.quality=="proof"){var v=U.collection();if(C.tile){var p=new Map,D=[],I=[],R=0,X={nodeIndexes:p,xCoords:D,yCoords:I},Y=[];if(q.forEach(function(P,rt){P.edges().length==0&&(P.nodes().forEach(function(ht,mt){v.merge(P.nodes()[mt]),ht.isParent()||(X.nodeIndexes.set(P.nodes()[mt].id(),R++),X.xCoords.push(P.nodes()[0].position().x),X.yCoords.push(P.nodes()[0].position().y))}),Y.push(rt))}),v.length>1){var W=v.boundingBox();x.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),q.push(v),V.push(X);for(var j=Y.length-1;j>=0;j--)q.splice(Y[j],1),V.splice(Y[j],1),x.splice(Y[j],1)}}q.forEach(function(P,rt){C.eles=P,B.push(d(C,V[rt])),n.relocateComponent(x[rt],B[rt],C)})}else q.forEach(function(P,rt){n.relocateComponent(x[rt],V[rt],C)});var z=new Set;if(q.length>1){var K=[],k=H.filter(function(P){return P.css("display")=="none"});q.forEach(function(P,rt){var ht=void 0;if(C.quality=="draft"&&(ht=V[rt].nodeIndexes),P.nodes().not(k).length>0){var mt={};mt.edges=[],mt.nodes=[];var Mt=void 0;P.nodes().not(k).forEach(function(vt){if(C.quality=="draft")if(!vt.isParent())Mt=ht.get(vt.id()),mt.nodes.push({x:V[rt].xCoords[Mt]-vt.boundingbox().w/2,y:V[rt].yCoords[Mt]-vt.boundingbox().h/2,width:vt.boundingbox().w,height:vt.boundingbox().h});else{var yt=n.calcBoundingBox(vt,V[rt].xCoords,V[rt].yCoords,ht);mt.nodes.push({x:yt.topLeftX,y:yt.topLeftY,width:yt.width,height:yt.height})}else B[rt][vt.id()]&&mt.nodes.push({x:B[rt][vt.id()].getLeft(),y:B[rt][vt.id()].getTop(),width:B[rt][vt.id()].getWidth(),height:B[rt][vt.id()].getHeight()})}),P.edges().forEach(function(vt){var yt=vt.source(),wt=vt.target();if(yt.css("display")!="none"&&wt.css("display")!="none")if(C.quality=="draft"){var Ht=ht.get(yt.id()),Pt=ht.get(wt.id()),Gt=[],xt=[];if(yt.isParent()){var Ut=n.calcBoundingBox(yt,V[rt].xCoords,V[rt].yCoords,ht);Gt.push(Ut.topLeftX+Ut.width/2),Gt.push(Ut.topLeftY+Ut.height/2)}else Gt.push(V[rt].xCoords[Ht]),Gt.push(V[rt].yCoords[Ht]);if(wt.isParent()){var Xt=n.calcBoundingBox(wt,V[rt].xCoords,V[rt].yCoords,ht);xt.push(Xt.topLeftX+Xt.width/2),xt.push(Xt.topLeftY+Xt.height/2)}else xt.push(V[rt].xCoords[Pt]),xt.push(V[rt].yCoords[Pt]);mt.edges.push({startX:Gt[0],startY:Gt[1],endX:xt[0],endY:xt[1]})}else B[rt][yt.id()]&&B[rt][wt.id()]&&mt.edges.push({startX:B[rt][yt.id()].getCenterX(),startY:B[rt][yt.id()].getCenterY(),endX:B[rt][wt.id()].getCenterX(),endY:B[rt][wt.id()].getCenterY()})}),mt.nodes.length>0&&(K.push(mt),z.add(rt))}});var F=s.packComponents(K,C.randomize).shifts;if(C.quality=="draft")V.forEach(function(P,rt){var ht=P.xCoords.map(function(Mt){return Mt+F[rt].dx}),mt=P.yCoords.map(function(Mt){return Mt+F[rt].dy});P.xCoords=ht,P.yCoords=mt});else{var G=0;z.forEach(function(P){Object.keys(B[P]).forEach(function(rt){var ht=B[P][rt];ht.setCenter(ht.getCenterX()+F[G].dx,ht.getCenterY()+F[G].dy)}),G++})}}}else{var J=C.eles.boundingBox();if(x.push({x:J.x1+J.w/2,y:J.y1+J.h/2}),C.randomize){var it=l(C);V.push(it)}C.quality=="default"||C.quality=="proof"?(B.push(d(C,V[0])),n.relocateComponent(x[0],B[0],C)):n.relocateComponent(x[0],V[0],C)}var ut=A(function(P,rt){if(C.quality=="default"||C.quality=="proof"){typeof P=="number"&&(P=rt);var ht=void 0,mt=void 0,Mt=P.data("id");return B.forEach(function(yt){Mt in yt&&(ht={x:yt[Mt].getRect().getCenterX(),y:yt[Mt].getRect().getCenterY()},mt=yt[Mt])}),C.nodeDimensionsIncludeLabels&&(mt.labelWidth&&(mt.labelPosHorizontal=="left"?ht.x+=mt.labelWidth/2:mt.labelPosHorizontal=="right"&&(ht.x-=mt.labelWidth/2)),mt.labelHeight&&(mt.labelPosVertical=="top"?ht.y+=mt.labelHeight/2:mt.labelPosVertical=="bottom"&&(ht.y-=mt.labelHeight/2))),ht==null&&(ht={x:P.position("x"),y:P.position("y")}),{x:ht.x,y:ht.y}}else{var vt=void 0;return V.forEach(function(yt){var wt=yt.nodeIndexes.get(P.id());wt!=null&&(vt={x:yt.xCoords[wt],y:yt.yCoords[wt]})}),vt==null&&(vt={x:P.position("x"),y:P.position("y")}),{x:vt.x,y:vt.y}}},"getPositions");if(C.quality=="default"||C.quality=="proof"||C.randomize){var Lt=n.calcParentsWithoutChildren(U,H),Ot=H.filter(function(P){return P.css("display")=="none"});C.eles=H.not(Ot),H.nodes().not(":parent").not(Ot).layoutPositions(_,C,ut),Lt.length>0&&Lt.forEach(function(P){P.position(ut(P))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),E})();o.exports=g}),657:((o,i,e)=>{var a=e(548),r=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,n=A(function(t){var l=t.cy,u=t.eles,d=u.nodes(),N=u.nodes(":parent"),g=new Map,E=new Map,_=new Map,C=[],U=[],H=[],V=[],B=[],q=[],x=[],st=[],s=void 0,y=1e8,m=1e-9,v=t.piTol,p=t.samplingType,D=t.nodeSeparation,I=void 0,R=A(function(){for(var lt=0,M=0,S=!1;M<I;){lt=Math.floor(Math.random()*s),S=!1;for(var $=0;$<M;$++)if(V[$]==lt){S=!0;break}if(!S)V[M]=lt,M++;else continue}},"randomSampleCR"),X=A(function(lt,M,S){for(var $=[],Z=0,Q=0,pt=0,dt=void 0,tt=[],ct=0,Et=1,_t=0;_t<s;_t++)tt[_t]=y;for($[Q]=lt,tt[lt]=0;Q>=Z;){pt=$[Z++];for(var et=C[pt],It=0;It<et.length;It++)dt=E.get(et[It]),tt[dt]==y&&(tt[dt]=tt[pt]+1,$[++Q]=dt);q[pt][M]=tt[pt]*D}if(S){for(var nt=0;nt<s;nt++)q[nt][M]<B[nt]&&(B[nt]=q[nt][M]);for(var at=0;at<s;at++)B[at]>ct&&(ct=B[at],Et=at)}return Et},"BFS"),Y=A(function(lt){var M=void 0;if(lt){M=Math.floor(Math.random()*s);for(var S=0;S<s;S++)B[S]=y;for(var $=0;$<I;$++)V[$]=M,M=X(M,$,lt)}else{R();for(var Z=0;Z<I;Z++)X(V[Z],Z,lt,!1)}for(var Q=0;Q<s;Q++)for(var pt=0;pt<I;pt++)q[Q][pt]*=q[Q][pt];for(var dt=0;dt<I;dt++)x[dt]=[];for(var tt=0;tt<I;tt++)for(var ct=0;ct<I;ct++)x[tt][ct]=q[V[ct]][tt]},"allBFS"),W=A(function(){for(var lt=f.svd(x),M=lt.S,S=lt.U,$=lt.V,Z=M[0]*M[0]*M[0],Q=[],pt=0;pt<I;pt++){Q[pt]=[];for(var dt=0;dt<I;dt++)Q[pt][dt]=0,pt==dt&&(Q[pt][dt]=M[pt]/(M[pt]*M[pt]+Z/(M[pt]*M[pt])))}st=r.multMat(r.multMat($,Q),r.transpose(S))},"sample"),j=A(function(){for(var lt=void 0,M=void 0,S=[],$=[],Z=[],Q=[],pt=0;pt<s;pt++)S[pt]=Math.random(),$[pt]=Math.random();S=r.normalize(S),$=r.normalize($);for(var dt=0,tt=m,ct=m,Et=void 0;;){dt++;for(var _t=0;_t<s;_t++)Z[_t]=S[_t];if(S=r.multGamma(r.multL(r.multGamma(Z),q,st)),lt=r.dotProduct(Z,S),S=r.normalize(S),tt=r.dotProduct(Z,S),Et=Math.abs(tt/ct),Et<=1+v&&Et>=1)break;ct=tt}for(var et=0;et<s;et++)Z[et]=S[et];for(dt=0,ct=m;;){dt++;for(var It=0;It<s;It++)Q[It]=$[It];if(Q=r.minusOp(Q,r.multCons(Z,r.dotProduct(Z,Q))),$=r.multGamma(r.multL(r.multGamma(Q),q,st)),M=r.dotProduct(Q,$),$=r.normalize($),tt=r.dotProduct(Q,$),Et=Math.abs(tt/ct),Et<=1+v&&Et>=1)break;ct=tt}for(var nt=0;nt<s;nt++)Q[nt]=$[nt];U=r.multCons(Z,Math.sqrt(Math.abs(lt))),H=r.multCons(Q,Math.sqrt(Math.abs(M)))},"powerIteration");a.connectComponents(l,u,a.getTopMostNodes(d),g),N.forEach(function(lt){a.connectComponents(l,u,a.getTopMostNodes(lt.descendants().intersection(u)),g)});for(var z=0,K=0;K<d.length;K++)d[K].isParent()||E.set(d[K].id(),z++);var k=!0,F=!1,G=void 0;try{for(var J=g.keys()[Symbol.iterator](),it;!(k=(it=J.next()).done);k=!0){var ut=it.value;E.set(ut,z++)}}catch(lt){F=!0,G=lt}finally{try{!k&&J.return&&J.return()}finally{if(F)throw G}}for(var Lt=0;Lt<E.size;Lt++)C[Lt]=[];N.forEach(function(lt){for(var M=lt.children().intersection(u);M.nodes(":childless").length==0;)M=M.nodes()[0].children().intersection(u);var S=0,$=M.nodes(":childless")[0].connectedEdges().length;M.nodes(":childless").forEach(function(Z,Q){Z.connectedEdges().length<$&&($=Z.connectedEdges().length,S=Q)}),_.set(lt.id(),M.nodes(":childless")[S].id())}),d.forEach(function(lt){var M=void 0;lt.isParent()?M=E.get(_.get(lt.id())):M=E.get(lt.id()),lt.neighborhood().nodes().forEach(function(S){u.intersection(lt.edgesWith(S)).length>0&&(S.isParent()?C[M].push(_.get(S.id())):C[M].push(S.id()))})});var Ot=A(function(lt){var M=E.get(lt),S=void 0;g.get(lt).forEach(function($){l.getElementById($).isParent()?S=_.get($):S=$,C[M].push(S),C[E.get(S)].push(lt)})},"_loop"),P=!0,rt=!1,ht=void 0;try{for(var mt=g.keys()[Symbol.iterator](),Mt;!(P=(Mt=mt.next()).done);P=!0){var vt=Mt.value;Ot(vt)}}catch(lt){rt=!0,ht=lt}finally{try{!P&&mt.return&&mt.return()}finally{if(rt)throw ht}}s=E.size;var yt=void 0;if(s>2){I=s<t.sampleSize?s:t.sampleSize;for(var wt=0;wt<s;wt++)q[wt]=[];for(var Ht=0;Ht<I;Ht++)st[Ht]=[];return t.quality=="draft"||t.step=="all"?(Y(p),W(),j(),yt={nodeIndexes:E,xCoords:U,yCoords:H}):(E.forEach(function(lt,M){U.push(l.getElementById(M).position("x")),H.push(l.getElementById(M).position("y"))}),yt={nodeIndexes:E,xCoords:U,yCoords:H}),yt}else{var Pt=E.keys(),Gt=l.getElementById(Pt.next().value),xt=Gt.position(),Ut=Gt.outerWidth();if(U.push(xt.x),H.push(xt.y),s==2){var Xt=l.getElementById(Pt.next().value),Wt=Xt.outerWidth();U.push(xt.x+Ut/2+Wt/2+t.idealEdgeLength),H.push(xt.y)}return yt={nodeIndexes:E,xCoords:U,yCoords:H},yt}},"spectralLayout");o.exports={spectralLayout:n}}),579:((o,i,e)=>{var a=e(212),r=A(function(f){f&&f("layout","fcose",a)},"register");typeof cytoscape<"u"&&r(cytoscape),o.exports=r}),140:(o=>{o.exports=L})},T={};function c(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return b[o](e,e.exports,c),e.exports}A(c,"__webpack_require__");var h=c(579);return h})()})}),Le={L:"left",R:"right",T:"top",B:"bottom"},Me={L:A(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:A(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:A(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:A(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},ae={L:A((w,O)=>w-O+2,"L"),R:A((w,O)=>w-2,"R"),T:A((w,O)=>w-O+2,"T"),B:A((w,O)=>w-2,"B")},li=A(function(w){return kt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=A(function(w){let O=w;return O==="L"||O==="R"||O==="T"||O==="B"},"isArchitectureDirection"),kt=A(function(w){let O=w;return O==="L"||O==="R"},"isArchitectureDirectionX"),$t=A(function(w){let O=w;return O==="T"||O==="B"},"isArchitectureDirectionY"),me=A(function(w,O){let L=kt(w)&&$t(O),b=$t(w)&&kt(O);return L||b},"isArchitectureDirectionXY"),di=A(function(w){let O=w[0],L=w[1],b=kt(O)&&$t(L),T=$t(O)&&kt(L);return b||T},"isArchitecturePairXY"),gi=A(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),ce=A(function(w,O){let L=`${w}${O}`;return gi(L)?L:void 0},"getArchitectureDirectionPair"),ci=A(function([w,O],L){let b=L[0],T=L[1];return kt(b)?$t(T)?[w+(b==="L"?-1:1),O+(T==="T"?1:-1)]:[w+(b==="L"?-1:1),O]:kt(T)?[w+(T==="L"?1:-1),O+(b==="T"?1:-1)]:[w,O+(b==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ui=A(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),fi=A(function(w,O){return me(w,O)?"bend":kt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),pi=A(function(w){return w.type==="service"},"isArchitectureService"),mi=A(function(w){return w.type==="junction"},"isArchitectureJunction"),Oe=A(w=>w.data(),"edgeData"),ee=A(w=>w.data(),"nodeData"),vi=ei.architecture,ie,be=(ie=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=We,this.getAccTitle=je,this.setDiagramTitle=$e,this.getDiagramTitle=qe,this.getAccDescription=Je,this.setAccDescription=Ze,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Ke()}addService({id:O,icon:L,in:b,title:T,iconText:c}){if(this.registeredIds[O]!==void 0)throw new Error(`The service id [${O}] is already in use by another ${this.registeredIds[O]}`);if(b!==void 0){if(O===b)throw new Error(`The service [${O}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The service [${O}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[b]==="node")throw new Error(`The service [${O}]'s parent is not a group`)}this.registeredIds[O]="node",this.nodes[O]={id:O,type:"service",icon:L,iconText:c,title:T,edges:[],in:b}}getServices(){return Object.values(this.nodes).filter(pi)}addJunction({id:O,in:L}){this.registeredIds[O]="node",this.nodes[O]={id:O,type:"junction",edges:[],in:L}}getJunctions(){return Object.values(this.nodes).filter(mi)}getNodes(){return Object.values(this.nodes)}getNode(O){return this.nodes[O]??null}addGroup({id:O,icon:L,in:b,title:T}){if(this.registeredIds?.[O]!==void 0)throw new Error(`The group id [${O}] is already in use by another ${this.registeredIds[O]}`);if(b!==void 0){if(O===b)throw new Error(`The group [${O}] cannot be placed within itself`);if(this.registeredIds?.[b]===void 0)throw new Error(`The group [${O}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[b]==="node")throw new Error(`The group [${O}]'s parent is not a group`)}this.registeredIds[O]="group",this.groups[O]={id:O,icon:L,title:T,in:b}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:O,rhsId:L,lhsDir:b,rhsDir:T,lhsInto:c,rhsInto:h,lhsGroup:o,rhsGroup:i,title:e}){if(!Ie(b))throw new Error(`Invalid direction given for left hand side of edge ${O}--${L}. Expected (L,R,T,B) got ${String(b)}`);if(!Ie(T))throw new Error(`Invalid direction given for right hand side of edge ${O}--${L}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[O]===void 0&&this.groups[O]===void 0)throw new Error(`The left-hand id [${O}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[L]===void 0&&this.groups[L]===void 0)throw new Error(`The right-hand id [${L}] does not yet exist. Please create the service/group before declaring an edge to it.`);let a=this.nodes[O].in,r=this.nodes[L].in;if(o&&a&&r&&a==r)throw new Error(`The left-hand id [${O}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&r&&a==r)throw new Error(`The right-hand id [${L}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let f={lhsId:O,lhsDir:b,lhsInto:c,lhsGroup:o,rhsId:L,rhsDir:T,rhsInto:h,rhsGroup:i,title:e};this.edges.push(f),this.nodes[O]&&this.nodes[L]&&(this.nodes[O].edges.push(this.edges[this.edges.length-1]),this.nodes[L].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let O={},L=Object.entries(this.nodes).reduce((i,[e,a])=>(i[e]=a.edges.reduce((r,f)=>{let n=this.getNode(f.lhsId)?.in,t=this.getNode(f.rhsId)?.in;if(n&&t&&n!==t){let l=fi(f.lhsDir,f.rhsDir);l!=="bend"&&(O[n]??={},O[n][t]=l,O[t]??={},O[t][n]=l)}if(f.lhsId===e){let l=ce(f.lhsDir,f.rhsDir);l&&(r[l]=f.rhsId)}else{let l=ce(f.rhsDir,f.lhsDir);l&&(r[l]=f.lhsId)}return r},{}),i),{}),b=Object.keys(L)[0],T={[b]:1},c=Object.keys(L).reduce((i,e)=>e===b?i:{...i,[e]:1},{}),h=A(i=>{let e={[i]:[0,0]},a=[i];for(;a.length>0;){let r=a.shift();if(r){T[r]=1,delete c[r];let f=L[r],[n,t]=e[r];Object.entries(f).forEach(([l,u])=>{T[u]||(e[u]=ci([n,t],l),a.push(u))})}}return e},"BFS"),o=[h(b)];for(;Object.keys(c).length>0;)o.push(h(Object.keys(c)[0]));this.dataStructures={adjList:L,spatialMaps:o,groupAlignments:O}}return this.dataStructures}setElementForId(O,L){this.elements[O]=L}getElementById(O){return this.elements[O]}getConfig(){return Qe({...vi,...ti().architecture})}getConfigField(O){return this.getConfig()[O]}},A(ie,"ArchitectureDB"),ie),yi=A((w,O)=>{He(w,O),w.groups.map(L=>O.addGroup(L)),w.services.map(L=>O.addService({...L,type:"service"})),w.junctions.map(L=>O.addJunction({...L,type:"junction"})),w.edges.map(L=>O.addEdge(L))},"populateDb"),Re={parser:{yy:void 0},parse:A(async w=>{let O=await ze("architecture",w);we.debug(O);let L=Re.parser?.yy;if(!(L instanceof be))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");yi(O,L)},"parse")},Ei=A(w=>`
|
|
.edge {
|
|
stroke-width: ${w.archEdgeWidth};
|
|
stroke: ${w.archEdgeColor};
|
|
fill: none;
|
|
}
|
|
|
|
.arrow {
|
|
fill: ${w.archEdgeArrowColor};
|
|
}
|
|
|
|
.node-bkg {
|
|
fill: none;
|
|
stroke: ${w.archGroupBorderColor};
|
|
stroke-width: ${w.archGroupBorderWidth};
|
|
stroke-dasharray: 8;
|
|
}
|
|
.node-icon-text {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.node-icon-text > div {
|
|
color: #fff;
|
|
margin: 1px;
|
|
height: fit-content;
|
|
text-align: center;
|
|
overflow: hidden;
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
}
|
|
`,"getStyles"),Ni=Ei,Ti=oi(hi()),te=A(w=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${w}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:te('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:te('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:te('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:te('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:te('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:si,blank:{body:te("")}}},Ai=A(async function(w,O,L){let b=L.getConfigField("padding"),T=L.getConfigField("iconSize"),c=T/2,h=T/6,o=h/2;await Promise.all(O.edges().map(async i=>{let{source:e,sourceDir:a,sourceArrow:r,sourceGroup:f,target:n,targetDir:t,targetArrow:l,targetGroup:u,label:d}=Oe(i),{x:N,y:g}=i[0].sourceEndpoint(),{x:E,y:_}=i[0].midpoint(),{x:C,y:U}=i[0].targetEndpoint(),H=b+4;if(f&&(kt(a)?N+=a==="L"?-H:H:g+=a==="T"?-H:H+18),u&&(kt(t)?C+=t==="L"?-H:H:U+=t==="T"?-H:H+18),!f&&L.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?c:-c:g+=a==="T"?c:-c),!u&&L.getNode(n)?.type==="junction"&&(kt(t)?C+=t==="L"?c:-c:U+=t==="T"?c:-c),i[0]._private.rscratch){let V=w.insert("g");if(V.insert("path").attr("d",`M ${N},${g} L ${E},${_} L${C},${U} `).attr("class","edge").attr("id",ni(e,n,{prefix:"L"})),r){let B=kt(a)?ae[a](N,h):N-o,q=$t(a)?ae[a](g,h):g-o;V.insert("polygon").attr("points",Me[a](h)).attr("transform",`translate(${B},${q})`).attr("class","arrow")}if(l){let B=kt(t)?ae[t](C,h):C-o,q=$t(t)?ae[t](U,h):U-o;V.insert("polygon").attr("points",Me[t](h)).attr("transform",`translate(${B},${q})`).attr("class","arrow")}if(d){let B=me(a,t)?"XY":kt(a)?"X":"Y",q=0;B==="X"?q=Math.abs(N-C):B==="Y"?q=Math.abs(g-U)/1.5:q=Math.abs(N-C)/2;let x=V.append("g");if(await fe(x,d,{useHtmlLabels:!1,width:q,classes:"architecture-service-label"},ue()),x.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),B==="X")x.attr("transform","translate("+E+", "+_+")");else if(B==="Y")x.attr("transform","translate("+E+", "+_+") rotate(-90)");else if(B==="XY"){let st=ce(a,t);if(st&&di(st)){let s=x.node().getBoundingClientRect(),[y,m]=ui(st);x.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*y*m*45})`);let v=x.node().getBoundingClientRect();x.attr("transform",`
|
|
translate(${E}, ${_-s.height/2})
|
|
translate(${y*v.width/2}, ${m*v.height/2})
|
|
rotate(${-1*y*m*45}, 0, ${s.height/2})
|
|
`)}}}}}))},"drawEdges"),_i=A(async function(w,O,L){let b=L.getConfigField("padding")*.75,T=L.getConfigField("fontSize"),c=L.getConfigField("iconSize")/2;await Promise.all(O.nodes().map(async h=>{let o=ee(h);if(o.type==="group"){let{h:i,w:e,x1:a,y1:r}=h.boundingBox(),f=w.append("rect");f.attr("id",`group-${o.id}`).attr("x",a+c).attr("y",r+c).attr("width",e).attr("height",i).attr("class","node-bkg");let n=w.append("g"),t=a,l=r;if(o.icon){let u=n.append("g");u.html(`<g>${await ge(o.icon,{height:b,width:b,fallbackPrefix:ne.prefix})}</g>`),u.attr("transform","translate("+(t+c+1)+", "+(l+c+1)+")"),t+=b,l+=T/2-1-2}if(o.label){let u=n.append("g");await fe(u,o.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},ue()),u.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),u.attr("transform","translate("+(t+c+4)+", "+(l+c+2)+")")}L.setElementForId(o.id,f)}}))},"drawGroups"),Ci=A(async function(w,O,L){let b=ue();for(let T of L){let c=O.append("g"),h=w.getConfigField("iconSize");if(T.title){let a=c.append("g");await fe(a,T.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},b),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+h/2+", "+h+")")}let o=c.append("g");if(T.icon)o.html(`<g>${await ge(T.icon,{height:h,width:h,fallbackPrefix:ne.prefix})}</g>`);else if(T.iconText){o.html(`<g>${await ge("blank",{height:h,width:h,fallbackPrefix:ne.prefix})}</g>`);let a=o.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(ii(T.iconText,b)),r=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/r)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+T.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} H0 Z`);c.attr("id",`service-${T.id}`).attr("class","architecture-service");let{width:i,height:e}=c.node().getBBox();T.width=i,T.height=e,w.setElementForId(T.id,c)}return 0},"drawServices"),Li=A(function(w,O,L){L.forEach(b=>{let T=O.append("g"),c=w.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+b.id).attr("fill-opacity","0").attr("width",c).attr("height",c),T.attr("class","architecture-junction");let{width:h,height:o}=T._groups[0][0].getBBox();T.width=h,T.height=o,w.setElementForId(b.id,T)})},"drawJunctions");ai([{name:ne.prefix,icons:ne}]);xe.use(Ti.default);function De(w,O,L){w.forEach(b=>{O.add({group:"nodes",data:{type:"service",id:b.id,icon:b.icon,label:b.title,parent:b.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}A(De,"addServices");function Fe(w,O,L){w.forEach(b=>{O.add({group:"nodes",data:{type:"junction",id:b.id,parent:b.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}A(Fe,"addJunctions");function Se(w,O){O.nodes().map(L=>{let b=ee(L);b.type!=="group"&&(b.x=L.position().x,b.y=L.position().y,w.getElementById(b.id).attr("transform","translate("+(b.x||0)+","+(b.y||0)+")"))})}A(Se,"positionNodes");function Ge(w,O){w.forEach(L=>{O.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}A(Ge,"addGroups");function Pe(w,O){w.forEach(L=>{let{lhsId:b,rhsId:T,lhsInto:c,lhsGroup:h,rhsInto:o,lhsDir:i,rhsDir:e,rhsGroup:a,title:r}=L,f=me(L.lhsDir,L.rhsDir)?"segments":"straight",n={id:`${b}-${T}`,label:r,source:b,sourceDir:i,sourceArrow:c,sourceGroup:h,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:o,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};O.add({group:"edges",data:n,classes:f})})}A(Pe,"addEdges");function ke(w,O,L){let b=A((o,i)=>Object.entries(o).reduce((e,[a,r])=>{let f=0,n=Object.entries(r);if(n.length===1)return e[a]=n[0][1],e;for(let t=0;t<n.length-1;t++)for(let l=t+1;l<n.length;l++){let[u,d]=n[t],[N,g]=n[l];if(L[u]?.[N]===i)e[a]??=[],e[a]=[...e[a],...d,...g];else if(u==="default"||N==="default")e[a]??=[],e[a]=[...e[a],...d,...g];else{let E=`${a}-${f++}`;e[E]=d;let _=`${a}-${f++}`;e[_]=g}}return e},{}),"flattenAlignments"),T=O.map(o=>{let i={},e={};return Object.entries(o).forEach(([a,[r,f]])=>{let n=w.getNode(a)?.in??"default";i[f]??={},i[f][n]??=[],i[f][n].push(a),e[r]??={},e[r][n]??=[],e[r][n].push(a)}),{horiz:Object.values(b(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(b(e,"vertical")).filter(a=>a.length>1)}}),[c,h]=T.reduce(([o,i],{horiz:e,vert:a})=>[[...o,...e],[...i,...a]],[[],[]]);return{horizontal:c,vertical:h}}A(ke,"getAlignments");function Ue(w,O){let L=[],b=A(c=>`${c[0]},${c[1]}`,"posToStr"),T=A(c=>c.split(",").map(h=>parseInt(h)),"strToPos");return w.forEach(c=>{let h=Object.fromEntries(Object.entries(c).map(([a,r])=>[b(r),a])),o=[b([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){let a=o.shift();if(a){i[a]=1;let r=h[a];if(r){let f=T(a);Object.entries(e).forEach(([n,t])=>{let l=b([f[0]+t[0],f[1]+t[1]]),u=h[l];u&&!i[l]&&(o.push(l),L.push({[Le[n]]:u,[Le[li(n)]]:r,gap:1.5*O.getConfigField("iconSize")}))})}}}}),L}A(Ue,"getRelativeConstraints");function Xe(w,O,L,b,T,{spatialMaps:c,groupAlignments:h}){return new Promise(o=>{let i=ri("body").append("div").attr("id","cy").attr("style","display:none"),e=xe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});i.remove(),Ge(L,e),De(w,e,T),Fe(O,e,T),Pe(b,e);let a=ke(T,c,h),r=Ue(c,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(n){let[t,l]=n.connectedNodes(),{parent:u}=ee(t),{parent:d}=ee(l);return u===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(n){let[t,l]=n.connectedNodes(),{parent:u}=ee(t),{parent:d}=ee(l);return u===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:r});f.one("layoutstop",()=>{function n(t,l,u,d){let N,g,{x:E,y:_}=t,{x:C,y:U}=l;g=(d-_+(E-u)*(_-U)/(E-C))/Math.sqrt(1+Math.pow((_-U)/(E-C),2)),N=Math.sqrt(Math.pow(d-_,2)+Math.pow(u-E,2)-Math.pow(g,2));let H=Math.sqrt(Math.pow(C-E,2)+Math.pow(U-_,2));N=N/H;let V=(C-E)*(d-_)-(U-_)*(u-E);switch(!0){case V>=0:V=1;break;case V<0:V=-1;break}let B=(C-E)*(u-E)+(U-_)*(d-_);switch(!0){case B>=0:B=1;break;case B<0:B=-1;break}return g=Math.abs(g)*V,N=N*B,{distances:g,weights:N}}A(n,"getSegmentWeights"),e.startBatch();for(let t of Object.values(e.edges()))if(t.data?.()){let{x:l,y:u}=t.source().position(),{x:d,y:N}=t.target().position();if(l!==d&&u!==N){let g=t.sourceEndpoint(),E=t.targetEndpoint(),{sourceDir:_}=Oe(t),[C,U]=$t(_)?[g.x,E.y]:[E.x,g.y],{weights:H,distances:V}=n(g,E,C,U);t.style("segment-distances",V),t.style("segment-weights",H)}}e.endBatch(),f.run()}),f.run(),e.ready(n=>{we.info("Ready",n),o(e)})})}A(Xe,"layoutArchitecture");var Mi=A(async(w,O,L,b)=>{let T=b.db,c=T.getServices(),h=T.getJunctions(),o=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=Ve(O),r=a.append("g");r.attr("class","architecture-edges");let f=a.append("g");f.attr("class","architecture-services");let n=a.append("g");n.attr("class","architecture-groups"),await Ci(T,f,c),Li(T,f,h);let t=await Xe(c,h,o,i,T,e);await Ai(r,t,T),await _i(n,t,T),Se(T,t),Be(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Ii={draw:Mi},Fi={parser:Re,get db(){return new be},renderer:Ii,styles:Ni};export{Fi as diagram};
|