Files
build_notes_simengweb/assets/cose-bilkent-AZ5BDB2T-vIqpKCP5.js

2 lines
82 KiB
JavaScript

import{r as Q}from"./chunk-7SRKK4IT-CK9TWH8W.js";import{m as O,p as j,i as st,q as at,aM as q}from"./mermaid.esm.min-CFMguGj4.js";import"./app-FFcgQi-5.js";var Z=q((C,X)=>{O((function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L():typeof define=="function"&&define.amd?define([],L):typeof C=="object"?C.layoutBase=L():m.layoutBase=L()}),"webpackUniversalModuleDefinition")(C,function(){return(function(m){var L={};function N(i){if(L[i])return L[i].exports;var e=L[i]={i,l:!1,exports:{}};return m[i].call(e.exports,e,e.exports,N),e.l=!0,e.exports}return O(N,"__webpack_require__"),N.m=m,N.c=L,N.i=function(i){return i},N.d=function(i,e,t){N.o(i,e)||Object.defineProperty(i,e,{configurable:!1,enumerable:!0,get:t})},N.n=function(i){var e=i&&i.__esModule?O(function(){return i.default},"getDefault"):O(function(){return i},"getModuleExports");return N.d(e,"a",e),e},N.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},N.p="",N(N.s=26)})([(function(m,L,N){function i(){}O(i,"LayoutConstants"),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,m.exports=i}),(function(m,L,N){var i=N(2),e=N(8),t=N(9);function r(a,o,p){i.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}O(r,"LEdge"),r.prototype=Object.create(i.prototype);for(var h in i)r[h]=i[h];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.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"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),n=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==n)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r}),(function(m,L,N){function i(e){this.vGraphObject=e}O(i,"LGraphObject"),m.exports=i}),(function(m,L,N){var i=N(2),e=N(10),t=N(13),r=N(0),h=N(16),a=N(4);function o(n,g,l,f){l==null&&f==null&&(f=g),i.call(this,f),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=n,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}O(o,"LNode"),o.prototype=Object.create(i.prototype);for(var p in i)o[p]=i[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==n){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==n||f.source==n)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)n.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";n.add(l.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,l;if(n.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){n.add(y)});return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],n+=g.getNoOfChildren();return n==0&&(n=1),n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var n,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;n=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=n,this.rect.y=g},o.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()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var f=new a(g,l),E=n.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o}),(function(m,L,N){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}O(i,"PointD"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=i}),(function(m,L,N){var i=N(2),e=N(10),t=N(0),r=N(6),h=N(3),a=N(1),o=N(13),p=N(12),n=N(11);function g(f,E,y){i.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}O(g,"LGraph"),g.prototype=Object.create(i.prototype);for(var l in i)g[l]=i[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var _=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(_.source=E,_.target=y,_.isInterGraph=!1,this.getEdges().push(_),E.edges.push(_),y!=E&&y.edges.push(_),_)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,_=y.length,v=0;v<_;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var I=this.nodes.indexOf(E);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var I=d.source.owner.getEdges().indexOf(d);if(I==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(I,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,_,v=this.getNodes(),I=v.length,s=0;s<I;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?_=v[0].getParent().paddingLeft:_=this.margin,this.left=E-_,this.top=f-_,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,_=-e.MAX_VALUE,v,I,s,u,c,A=this.nodes,T=A.length,w=0;w<T;w++){var D=A[w];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),I=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),_<u&&(_=u)}var M=new o(E,d,y-E,_-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),A[0].getParent().paddingLeft!=null?c=A[0].getParent().paddingLeft:c=this.margin,this.left=M.x-c,this.right=M.x+M.width+c,this.top=M.y-c,this.bottom=M.y+M.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,_=-e.MAX_VALUE,v,I,s,u,c=f.length,A=0;A<c;A++){var T=f[A];v=T.getLeft(),I=T.getRight(),s=T.getTop(),u=T.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),_<u&&(_=u)}var w=new o(E,d,y-E,_-d);return w},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var _=E[d];f+=_.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new n,y=new Set,d=this.nodes[0],_,v,I=d.withChildren();for(I.forEach(function(w){E.push(w),y.add(w)});E.length!==0;){d=E.shift(),_=d.getEdges();for(var s=_.length,u=0;u<s;u++){var c=_[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var A=v.withChildren();A.forEach(function(w){E.push(w),y.add(w)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var T=0;y.forEach(function(w){w.owner==f&&T++}),T==this.nodes.length&&(this.isConnected=!0)}},m.exports=g}),(function(m,L,N){var i,e=N(1);function t(r){i=N(5),this.layout=r,this.graphs=[],this.edges=[]}O(t,"LGraphManager"),t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var n=o.getOwner(),g=p.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return a.isInterGraph=!1,n.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,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}},t.prototype.remove=function(r){if(r instanceof i){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,n=0;n<p;n++)o=a[n],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var n=0;n<p;n++)l=g[n],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<h.length;o++)r=r.concat(h[o].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,n=this.getAllEdges(),g=n.length,l=0;l<g;l++){if(r=n[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,n=0;n<p;n++)a=o[n],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t}),(function(m,L,N){var i=N(0);function e(){}O(e,"FDLayoutConstants");for(var t in i)e[t]=i[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e}),(function(m,L,N){var i=N(12);function e(){}O(e,"IGeometry"),e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var n=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:n=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(n/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),n=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=n,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),_=t.getWidthHalf(),v=t.getHeightHalf(),I=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),A=r.getBottom(),T=r.getRight(),w=r.getWidthHalf(),D=r.getHeightHalf(),M=!1,R=!1;if(a===p){if(o>n)return h[0]=a,h[1]=l,h[2]=p,h[3]=A,!1;if(o<n)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===n){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=n,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=I,h[3]=n,!1}else{var F=t.height/t.width,S=r.height/r.width,x=(n-o)/(p-a),G=void 0,b=void 0,P=void 0,U=void 0,Y=void 0,B=void 0;if(-F===x?a>p?(h[0]=E,h[1]=y,M=!0):(h[0]=f,h[1]=l,M=!0):F===x&&(a>p?(h[0]=g,h[1]=l,M=!0):(h[0]=d,h[1]=y,M=!0)),-S===x?p>a?(h[2]=c,h[3]=A,R=!0):(h[2]=u,h[3]=s,R=!0):S===x&&(p>a?(h[2]=I,h[3]=s,R=!0):(h[2]=T,h[3]=A,R=!0)),M&&R)return!1;if(a>p?o>n?(G=this.getCardinalDirection(F,x,4),b=this.getCardinalDirection(S,x,2)):(G=this.getCardinalDirection(-F,x,3),b=this.getCardinalDirection(-S,x,1)):o>n?(G=this.getCardinalDirection(-F,x,1),b=this.getCardinalDirection(-S,x,3)):(G=this.getCardinalDirection(F,x,2),b=this.getCardinalDirection(S,x,4)),!M)switch(G){case 1:U=l,P=a+-v/x,h[0]=P,h[1]=U;break;case 2:P=d,U=o+_*x,h[0]=P,h[1]=U;break;case 3:U=y,P=a+v/x,h[0]=P,h[1]=U;break;case 4:P=E,U=o+-_*x,h[0]=P,h[1]=U;break}if(!R)switch(b){case 1:B=s,Y=p+-D/x,h[2]=Y,h[3]=B;break;case 2:Y=T,B=n+w*x,h[2]=Y,h[3]=B;break;case 3:B=A,Y=p+D/x,h[2]=Y,h[3]=B;break;case 4:Y=c,B=n+-w*x,h[2]=Y,h[3]=B;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,_=void 0,v=void 0,I=void 0,s=void 0,u=void 0,c=void 0,A=void 0,T=void 0;return v=g-p,s=o-n,c=n*p-o*g,I=y-f,u=l-E,A=E*f-l*y,T=v*u-I*s,T===0?null:(d=(s*A-u*c)/T,_=(I*c-v*A)/T,new i(d,_))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(n-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var _=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(n-o)*(y-p))/d;return 0<_&&_<1&&0<v&&v<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e}),(function(m,L,N){function i(){}O(i,"IMath"),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=i}),(function(m,L,N){function i(){}O(i,"Integer"),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,m.exports=i}),(function(m,L,N){var i=(function(){function o(p,n){for(var g=0;g<n.length;g++){var l=n[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return O(o,"defineProperties"),function(p,n,g){return n&&o(p.prototype,n),g&&o(p,g),p}})();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=O(function(o){return{value:o,next:null,prev:null}},"nodeFrom"),r=O(function(o,p,n,g){return o!==null?o.next=p:g.head=p,n!==null?n.prev=p:g.tail=p,p.prev=o,p.next=n,g.length++,p},"add"),h=O(function(o,p){var n=o.prev,g=o.next;return n!==null?n.next=g:p.head=g,g!==null?g.prev=n:p.tail=n,o.prev=o.next=null,p.length--,o},"_remove"),a=(function(){function o(p){var n=this;e(this,o),this.length=0,this.head=null,this.tail=null,p?.forEach(function(g){return n.push(g)})}return O(o,"LinkedList"),i(o,[{key:"size",value:O(function(){return this.length},"size")},{key:"insertBefore",value:O(function(p,n){return r(n.prev,t(p),n,this)},"insertBefore")},{key:"insertAfter",value:O(function(p,n){return r(n,t(p),n.next,this)},"insertAfter")},{key:"insertNodeBefore",value:O(function(p,n){return r(n.prev,p,n,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:O(function(p,n){return r(n,p,n.next,this)},"insertNodeAfter")},{key:"push",value:O(function(p){return r(this.tail,t(p),null,this)},"push")},{key:"unshift",value:O(function(p){return r(null,t(p),this.head,this)},"unshift")},{key:"remove",value:O(function(p){return h(p,this)},"remove")},{key:"pop",value:O(function(){return h(this.tail,this).value},"pop")},{key:"popNode",value:O(function(){return h(this.tail,this)},"popNode")},{key:"shift",value:O(function(){return h(this.head,this).value},"shift")},{key:"shiftNode",value:O(function(){return h(this.head,this)},"shiftNode")},{key:"get_object_at",value:O(function(p){if(p<=this.length()){for(var n=1,g=this.head;n<p;)g=g.next,n++;return g.value}},"get_object_at")},{key:"set_object_at",value:O(function(p,n){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=n}},"set_object_at")}]),o})();m.exports=a}),(function(m,L,N){function i(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}O(i,"Point"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=i}),(function(m,L,N){function i(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}O(i,"RectangleD"),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},m.exports=i}),(function(m,L,N){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}O(e,"UniqueIDGeneretor"),e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":i(t);return t==null||r!="object"&&r!="function"},m.exports=e}),(function(m,L,N){function i(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}O(i,"_toConsumableArray");var e=N(0),t=N(6),r=N(3),h=N(1),a=N(5),o=N(4),p=N(17),n=N(27);function g(l){n.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}O(g,"Layout"),g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,f=this.graphManager.getAllEdges(),E=0;E<f.length;E++)l=f[E];for(var y,d=this.graphManager.getRoot().getNodes(),E=0;E<d.length;E++)y=d[E];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var _=l;if(_.vGraphObject!=null){var v=_.vGraphObject;v.update(_)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var s=I.vGraphObject;s.update(I)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,_=0;_<y.length;_++)d=y[_],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var _=new Set,v=[],I=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),_.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var A=c[d].getOtherEnd(u);if(I.get(u)!=A)if(!_.has(A))v.push(A),I.set(A,u);else{f=!1;break}}}if(!f)l=[];else{var T=[].concat(i(_));l.push(T);for(var d=0;d<T.length;d++){var w=T[d],D=s.indexOf(w);D>-1&&s.splice(D,1)}_=new Set,I=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var _=this.newNode(null);_.setRect(new Point(0,0),new Dimension(1,1)),y.add(_);var v=this.newEdge(null);this.graphManager.add(v,E,_),f.add(_),E=_}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(i(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var _=y[d],v=new o(_.getCenterX(),_.getCenterY()),I=E.bendpoints.get(d);I.x=v.x,I.y=v.y,_.getOwner().remove(_)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var _=f/E;d-=(f-_)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var I,s;return l<=50?(I=9*f/500,s=f/10):(I=9*f/50,s=-8*f),I*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,_=null;(f.length==1||f.length==2)&&(d=!0,_=f[0]);for(var v=0;v<f.length;v++){var I=f[v],s=I.getNeighborsList().size;y.set(I,I.getNeighborsList().size),s==1&&E.push(I)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var I=f[v],A=f.indexOf(I);A>=0&&f.splice(A,1);var T=I.getNeighborsList();T.forEach(function(M){if(E.indexOf(M)<0){var R=y.get(M),F=R-1;F==1&&u.push(M),y.set(M,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,_=f[0])}return _},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g}),(function(m,L,N){function i(){}O(i,"RandomSeed"),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},m.exports=i}),(function(m,L,N){var i=N(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}O(e,"Transform"),e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e}),(function(m,L,N){function i(n){if(Array.isArray(n)){for(var g=0,l=Array(n.length);g<n.length;g++)l[g]=n[g];return l}else return Array.from(n)}O(i,"_toConsumableArray");var e=N(15),t=N(7),r=N(0),h=N(8),a=N(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}O(o,"FDLayout"),o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var n,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),_=0;_<d.length;_++)n=d[_],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),f=n.getTarget(),E=n.getSourceInLca().getEstimatedSize(),y=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=n.getLca().getInclusionTreeDepth(),n.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(n-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),g,l=0;l<n.length;l++)g=n[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),_;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),_=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,_,n,g),_.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var n,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)n=g[l],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){for(var n=this.getAllNodes(),g,l=0;l<n.length;l++)g=n[l],g.move()},o.prototype.calcSpringForce=function(n,g){var l=n.getSource(),f=n.getTarget(),E,y,d,_;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;E=n.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(n.lengthX/E),_=y*(n.lengthY/E),l.springForceX+=d,l.springForceY+=_,f.springForceX-=d,f.springForceY-=_)},o.prototype.calcRepulsionForce=function(n,g){var l=n.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,_,v,I,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var A=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=A*u,n.repulsionForceY-=A*c,g.repulsionForceX+=A*u,g.repulsionForceY+=A*c}else this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),_=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],_=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(_)<t.MIN_REPULSION_DIST&&(_=a.sign(_)*t.MIN_REPULSION_DIST),v=d*d+_*_,I=Math.sqrt(v),s=this.repulsionConstant*n.noOfChildren*g.noOfChildren/v,u=s*d/I,c=s*_/I,n.repulsionForceX-=u,n.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(n){var g,l,f,E,y,d,_,v;g=n.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=n.getCenterX()-l,y=n.getCenterY()-f,d=Math.abs(E)+n.getWidth()/2,_=Math.abs(y)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||_>v)&&(n.gravitationForceX=-this.gravityConstant*E,n.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||_>v)&&(n.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var n,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var n,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)n=g[l],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,l=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(n,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var _=f;_<=E;_++)for(var v=y;v<=d;v++)this.grid[_][v].push(n),n.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var n,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)g=l[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;n.surrounding=new Array;for(var y,d=this.grid,_=n.startX-1;_<n.finishX+2;_++)for(var v=n.startY-1;v<n.finishY+2;v++)if(!(_<0||v<0||_>=d.length||v>=d[0].length)){for(var I=0;I<d[_][v].length;I++)if(y=d[_][v][I],!(n.getOwner()!=y.getOwner()||n==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(n.getCenterX()-y.getCenterX())-(n.getWidth()/2+y.getWidth()/2),u=Math.abs(n.getCenterY()-y.getCenterY())-(n.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}n.surrounding=[].concat(i(E))}for(_=0;_<n.surrounding.length;_++)this.calcRepulsionForce(n,n.surrounding[_])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o}),(function(m,L,N){var i=N(1),e=N(7);function t(h,a,o){i.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}O(t,"FDLayoutEdge"),t.prototype=Object.create(i.prototype);for(var r in i)t[r]=i[r];m.exports=t}),(function(m,L,N){var i=N(3);function e(r,h,a,o){i.call(this,r,h,a,o),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=[]}O(e,"FDLayoutNode"),e.prototype=Object.create(i.prototype);for(var t in i)e[t]=i[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e}),(function(m,L,N){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}O(i,"DimensionD"),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},m.exports=i}),(function(m,L,N){var i=N(14);function e(){this.map={},this.keys=[]}O(e,"HashMap"),e.prototype.put=function(t,r){var h=i.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return i.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=i.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e}),(function(m,L,N){var i=N(14);function e(){this.set={}}O(e,"HashSet"),e.prototype.add=function(t){var r=i.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[i.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[i.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e}),(function(m,L,N){var i=(function(){function h(a,o){for(var p=0;p<o.length;p++){var n=o[p];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return O(h,"defineProperties"),function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}})();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=N(11),r=(function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return O(h,"Quicksort"),i(h,[{key:"_quicksort",value:O(function(a,o,p){if(o<p){var n=this._partition(a,o,p);this._quicksort(a,o,n),this._quicksort(a,n+1,p)}},"_quicksort")},{key:"_partition",value:O(function(a,o,p){for(var n=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(n,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),n);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}},"_partition")},{key:"_get",value:O(function(a,o){return a instanceof t?a.get_object_at(o):a[o]},"_get")},{key:"_set",value:O(function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p},"_set")},{key:"_swap",value:O(function(a,o,p){var n=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,n)},"_swap")},{key:"_defaultCompareFunction",value:O(function(a,o){return o>a},"_defaultCompareFunction")}]),h})();m.exports=r}),(function(m,L,N){var i=(function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return O(r,"defineProperties"),function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}})();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=(function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=n,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return O(r,"NeedlemanWunsch"),i(r,[{key:"getScore",value:O(function(){return this.score},"getScore")},{key:"getAlignments",value:O(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:O(function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!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 o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var n=void 0;this.sequence1[o-1]===this.sequence2[p-1]?n=this.grid[o-1][p-1]+this.match_score:n=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[n,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:O(function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.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}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.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}),h.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:O(function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:O(function(h){return this.getAllIndexes(h,Math.max.apply(null,h))},"arrayAllMaxIndexes")}]),r})();m.exports=t}),(function(m,L,N){var i=O(function(){},"layoutBase");i.FDLayout=N(18),i.FDLayoutConstants=N(7),i.FDLayoutEdge=N(19),i.FDLayoutNode=N(20),i.DimensionD=N(21),i.HashMap=N(22),i.HashSet=N(23),i.IGeometry=N(8),i.IMath=N(9),i.Integer=N(10),i.Point=N(12),i.PointD=N(4),i.RandomSeed=N(16),i.RectangleD=N(13),i.Transform=N(17),i.UniqueIDGeneretor=N(14),i.Quicksort=N(24),i.LinkedList=N(11),i.LGraphObject=N(2),i.LGraph=N(5),i.LEdge=N(1),i.LGraphManager=N(6),i.LNode=N(3),i.Layout=N(15),i.LayoutConstants=N(0),i.NeedlemanWunsch=N(25),m.exports=i}),(function(m,L,N){function i(){this.listeners=[]}O(i,"Emitter");var e=i.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=i})])})}),$=q((C,X)=>{O((function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Z()):typeof define=="function"&&define.amd?define(["layout-base"],L):typeof C=="object"?C.coseBase=L(Z()):m.coseBase=L(m.layoutBase)}),"webpackUniversalModuleDefinition")(C,function(m){return(function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)})([(function(L,N){L.exports=m}),(function(L,N,i){var e=i(0).FDLayoutConstants;function t(){}O(t,"CoSEConstants");for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,L.exports=t}),(function(L,N,i){var e=i(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEEdge"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t}),(function(L,N,i){var e=i(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEGraph"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t}),(function(L,N,i){var e=i(0).LGraphManager;function t(h){e.call(this,h)}O(t,"CoSEGraphManager"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t}),(function(L,N,i){var e=i(0).FDLayoutNode,t=i(0).IMath;function r(a,o,p,n){e.call(this,a,o,p,n)}O(r,"CoSENode"),r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.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},r.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),n,g=0;g<p.length;g++)n=p[g],n.getChild()==null?(n.moveBy(a,o),n.displacementX+=a,n.displacementY+=o):n.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},L.exports=r}),(function(L,N,i){var e=i(0).FDLayout,t=i(4),r=i(3),h=i(5),a=i(2),o=i(1),p=i(0).FDLayoutConstants,n=i(0).LayoutConstants,g=i(0).Point,l=i(0).PointD,f=i(0).Layout,E=i(0).Integer,y=i(0).IGeometry,d=i(0).LGraph,_=i(0).Transform;function v(){e.call(this),this.toBeTiled={}}O(v,"CoSELayout"),v.prototype=Object.create(e.prototype);for(var I in e)v[I]=e[I];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(w){return s.has(w)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.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()),u=this.nodesWithGravity.filter(function(T){return s.has(T)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var A=s[c].rect,T=s[c].id;u[T]={id:T,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),A=c.length,T;for(T=0;T<A;T++)u=c[T],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var A=s[c];if(!u.has(A)){var T=A.getSource(),w=A.getTarget();if(T==w)A.getBendpoints().push(new l),A.getBendpoints().push(new l),this.createDummyNodesForBendpoints(A),u.add(A);else{var D=[];if(D=D.concat(T.getEdgeListToNode(w)),D=D.concat(w.getEdgeListToNode(T)),!u.has(D[0])){if(D.length>1){var M;for(M=0;M<D.length;M++){var R=D[M];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),A=0,T=0,w=0,D=new l(0,0),M=0;M<s.length;M++){M%c==0&&(w=0,T=A,M!=0&&(T+=o.DEFAULT_COMPONENT_SEPERATION),A=0);var R=s[M],F=f.findCenterOfTree(R);u.x=w,u.y=T,D=v.radialLayout(R,F,u),D.y>A&&(A=Math.floor(D.y)),w=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-D.x/2,n.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var A=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,A);var T=d.calculateBounds(s),w=new _;w.setDeviceOrgX(T.getMinX()),w.setDeviceOrgY(T.getMinY()),w.setWorldOrgX(c.x),w.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var M=s[D];M.transform(w)}var R=new l(T.getMaxX(),T.getMaxY());return w.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,A,T,w){var D=(A-c+1)/2;D<0&&(D+=180);var M=(D+c)%360,R=M*y.TWO_PI/360,F=T*Math.cos(R),S=T*Math.sin(R);s.setCenter(F,S);var x=[];x=x.concat(s.getEdges());var G=x.length;u!=null&&G--;for(var b=0,P=x.length,U,Y=s.getEdgesBetween(u);Y.length>1;){var B=Y[0];Y.splice(0,1);var k=x.indexOf(B);k>=0&&x.splice(k,1),P--,G--}u!=null?U=(x.indexOf(Y[0])+1)%P:U=0;for(var H=Math.abs(A-c)/G,W=U;b!=G;W=++W%P){var V=x[W].getOtherEnd(s);if(V!=u){var z=(c+b*H)%360,ot=(z+H)%360;v.branchRadialLayout(V,s,z,ot,T+w,w),b++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var A=s[c],T=A.getDiagonal();T>u&&(u=T)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],A=this.graphManager.getAllNodes(),T=0;T<A.length;T++){var w=A[T],D=w.getParent();this.getNodeDegreeWithChildren(w)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(w)}for(var T=0;T<c.length;T++){var w=c[T],M=w.getParent().id;typeof u[M]>"u"&&(u[M]=[]),u[M]=u[M].concat(w)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var S=u[R][0].getParent(),x=new h(s.graphManager);x.id=F,x.paddingLeft=S.paddingLeft||0,x.paddingRight=S.paddingRight||0,x.paddingBottom=S.paddingBottom||0,x.paddingTop=S.paddingTop||0,s.idToDummyNode[F]=x;var G=s.getGraphManager().add(s.newGraph(),x),b=S.getChild();b.add(x);for(var P=0;P<u[R].length;P++){var U=u[R][P];b.remove(U),G.add(U)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var A=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],A.paddingLeft+A.paddingRight),A.rect.width=u[c].width,A.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,A=u.paddingLeft,T=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,A,T)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var A=s.idToDummyNode[c],T=A.paddingLeft,w=A.paddingTop;s.adjustLocations(u[c],A.rect.x,A.rect.y,T,w)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var A=c.getNodes(),T=0;T<A.length;T++){var w=A[T];if(this.getNodeDegree(w)>0)return this.toBeTiled[u]=!1,!1;if(w.getChild()==null){this.toBeTiled[w.id]=!1;continue}if(!this.getToBeTiled(w))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){for(var u=s.id,c=s.getEdges(),A=0,T=0;T<c.length;T++){var w=c[T];w.getSource().id!==w.getTarget().id&&(A=A+1)}return A},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),A=0;A<c.length;A++){var T=c[A];u+=this.getNodeDegreeWithChildren(T)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,A,T){u+=A,c+=T;for(var w=u,D=0;D<s.rows.length;D++){var M=s.rows[D];u=w;for(var R=0,F=0;F<M.length;F++){var S=M[F];S.rect.x=u,S.rect.y=c,u+=S.rect.width+s.horizontalPadding,S.rect.height>R&&(R=S.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var T=u[A];c.tiledMemberPack[A]=c.tileNodes(s[A],T.paddingLeft+T.paddingRight),T.rect.width=c.tiledMemberPack[A].width,T.rect.height=c.tiledMemberPack[A].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,A=o.TILING_PADDING_HORIZONTAL,T={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:A};s.sort(function(M,R){return M.rect.width*M.rect.height>R.rect.width*R.rect.height?-1:M.rect.width*M.rect.height<R.rect.width*R.rect.height?1:0});for(var w=0;w<s.length;w++){var D=s[w];T.rows.length==0?this.insertNodeToRow(T,D,0,u):this.canAddHorizontal(T,D.rect.width,D.rect.height)?this.insertNodeToRow(T,D,this.getShortestRowIndex(T),u):this.insertNodeToRow(T,D,T.rows.length,u),this.shiftToLastRow(T)}return T},v.prototype.insertNodeToRow=function(s,u,c,A){var T=A;if(c==s.rows.length){var w=[];s.rows.push(w),s.rowWidth.push(T),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var M=u.rect.height;c>0&&(M+=s.verticalPadding);var R=0;M>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=M,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]<c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]>c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.canAddHorizontal=function(s,u,c){var A=this.getShortestRowIndex(s);if(A<0)return!0;var T=s.rowWidth[A];if(T+s.horizontalPadding+u<=s.width)return!0;var w=0;s.rowHeight[A]<c&&A>0&&(w=c+s.verticalPadding-s.rowHeight[A]);var D;s.width-T>=u+s.horizontalPadding?D=(s.height+w)/(T+u+s.horizontalPadding):D=(s.height+w)/s.width,w=c+s.verticalPadding;var M;return s.width<u?M=(s.height+w)/u:M=(s.height+w)/s.width,M<1&&(M=1/M),D<1&&(D=1/D),D<M},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,A=s.rows[u],T=A[A.length-1],w=T.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>w&&u!=c){A.splice(-1,1),s.rows[c].push(T),s.rowWidth[u]=s.rowWidth[u]-w,s.rowWidth[c]=s.rowWidth[c]+w,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,M=0;M<A.length;M++)A[M].height>D&&(D=A[M].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<T.height+s.verticalPadding&&(s.rowHeight[c]=T.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var A=this.graphManager.getAllNodes(),T=[];u=!1;for(var w=0;w<A.length;w++)c=A[w],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(T.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],M=0;M<T.length;M++)T[M][0].getEdges().length==1&&(D.push(T[M]),T[M][0].getOwner().remove(T[M][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],A,T=0;T<c.length;T++)A=c[T],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,A=s[0];A==s[1].source?c=s[1].target:c=s[1].source;var T=c.startX,w=c.finishX,D=c.startY,M=c.finishY,R=0,F=0,S=0,x=0,G=[R,S,F,x];if(D>0)for(var b=T;b<=w;b++)G[0]+=this.grid[b][D-1].length+this.grid[b][D].length-1;if(w<this.grid.length-1)for(var b=D;b<=M;b++)G[1]+=this.grid[w+1][b].length+this.grid[w][b].length-1;if(M<this.grid[0].length-1)for(var b=T;b<=w;b++)G[2]+=this.grid[b][M+1].length+this.grid[b][M].length-1;if(T>0)for(var b=D;b<=M;b++)G[3]+=this.grid[T-1][b].length+this.grid[T][b].length-1;for(var P=E.MAX_VALUE,U,Y,B=0;B<G.length;B++)G[B]<P?(P=G[B],U=1,Y=B):G[B]==P&&U++;if(U==3&&P==0)G[0]==0&&G[1]==0&&G[2]==0?u=1:G[0]==0&&G[1]==0&&G[3]==0?u=0:G[0]==0&&G[2]==0&&G[3]==0?u=3:G[1]==0&&G[2]==0&&G[3]==0&&(u=2);else if(U==2&&P==0){var k=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?k==0?u=0:u=1:G[0]==0&&G[2]==0?k==0?u=0:u=2:G[0]==0&&G[3]==0?k==0?u=0:u=3:G[1]==0&&G[2]==0?k==0?u=1:u=2:G[1]==0&&G[3]==0?k==0?u=1:u=3:k==0?u=2:u=3}else if(U==4&&P==0){var k=Math.floor(Math.random()*4);u=k}else u=Y;u==0?A.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-A.getHeight()/2):u==1?A.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+A.getWidth()/2,c.getCenterY()):u==2?A.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+A.getHeight()/2):A.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-A.getWidth()/2,c.getCenterY())},L.exports=v}),(function(L,N,i){var e={};e.layoutBase=i(0),e.CoSEConstants=i(1),e.CoSEEdge=i(2),e.CoSEGraph=i(3),e.CoSEGraphManager=i(4),e.CoSELayout=i(6),e.CoSENode=i(5),L.exports=e})])})}),ht=q((C,X)=>{O((function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L($()):typeof define=="function"&&define.amd?define(["cose-base"],L):typeof C=="object"?C.cytoscapeCoseBilkent=L($()):m.cytoscapeCoseBilkent=L(m.coseBase)}),"webpackUniversalModuleDefinition")(C,function(m){return(function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)})([(function(L,N){L.exports=m}),(function(L,N,i){var e=i(0).layoutBase.LayoutConstants,t=i(0).layoutBase.FDLayoutConstants,r=i(0).CoSEConstants,h=i(0).CoSELayout,a=i(0).CoSENode,o=i(0).layoutBase.PointD,p=i(0).layoutBase.DimensionD,n={ready:O(function(){},"ready"),stop:O(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var _={};for(var v in y)_[v]=y[v];for(var v in d)_[v]=d[v];return _}O(g,"extend");function l(y){this.options=g(n,y),f(this.options)}O(l,"_CoSELayout");var f=O(function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal},"getUserOptions");l.prototype.run=function(){var y,d,_=this.options;this.idToLNode={};var v=this.layout=new h,I=this;I.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var A=0;A<c.length;A++){var T=c[A],w=this.idToLNode[T.data("source")],D=this.idToLNode[T.data("target")];if(w!==D&&w.getEdgesBetween(D).length==0){var M=s.add(v.newEdge(),w,D);M.id=T.id()}}var R=O(function(S,x){typeof S=="number"&&(S=x);var G=S.data("id"),b=I.idToLNode[G];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},"getPositions"),F=O(function S(){for(var x=O(function(){_.fit&&_.cy.fit(_.eles,_.padding),y||(y=!0,I.cy.one("layoutready",_.ready),I.cy.trigger({type:"layoutready",layout:I}))},"afterReposition"),G=I.options.refresh,b,P=0;P<G&&!b;P++)b=I.stopped||I.layout.tick();if(b){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,I.options.eles.nodes().positions(R),x(),I.cy.one("layoutstop",I.options.stop),I.cy.trigger({type:"layoutstop",layout:I}),d&&cancelAnimationFrame(d),y=!1;return}var U=I.layout.getPositionsData();_.eles.nodes().positions(function(Y,B){if(typeof Y=="number"&&(Y=B),!Y.isParent()){for(var k=Y.id(),H=U[k],W=Y;H==null&&(H=U[W.data("parent")]||U["DummyCompound_"+W.data("parent")],U[k]=H,W=W.parent()[0],W!=null););return H!=null?{x:H.x,y:H.y}:{x:Y.position("x"),y:Y.position("y")}}}),x(),d=requestAnimationFrame(S)},"iterateAnimated");return v.addListener("layoutstarted",function(){I.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(I.options.eles.nodes().not(":parent").layoutPositions(I,I.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},_=0;_<y.length;_++)d[y[_].id()]=!0;var v=y.filter(function(I,s){typeof I=="number"&&(I=s);for(var u=I.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,_){for(var v=d.length,I=0;I<v;I++){var s=d[I],u=s.children(),c,A=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(_.graphManager,new o(s.position("x")-A.w/2,s.position("y")-A.h/2),new p(parseFloat(A.w),parseFloat(A.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var T=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,w=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=T,c.labelHeight=w,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var M;M=_.getGraphManager().add(_.newGraph(),c),this.processChildrenList(M,u,_)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=O(function(y){y("layout","cose-bilkent",l)},"register");typeof cytoscape<"u"&&E(cytoscape),L.exports=E})])})}),lt=at(ht());Q.use(lt.default);function K(C,X){C.forEach(m=>{let L={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(N=>{["id","label","height","width","padding","x","y"].includes(N)||(L[N]=m[N])}),X.add({group:"nodes",data:L,position:{x:m.x??0,y:m.y??0}})})}O(K,"addNodes");function J(C,X){C.forEach(m=>{let L={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(N=>{["id","start","end"].includes(N)||(L[N]=m[N])}),X.add({group:"edges",data:L})})}O(J,"addEdges");function tt(C){return new Promise(X=>{let m=st("body").append("div").attr("id","cy").attr("style","display:none"),L=Q({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),K(C.nodes,L),J(C.edges,L),L.nodes().forEach(function(i){i.layoutDimensions=()=>{let e=i.data();return{w:e.width,h:e.height}}});let N={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};L.layout(N).run(),L.ready(i=>{j.info("Cytoscape ready",i),X(L)})})}O(tt,"createCytoscapeInstance");function et(C){return C.nodes().map(X=>{let m=X.data(),L=X.position(),N={id:m.id,x:L.x,y:L.y};return Object.keys(m).forEach(i=>{i!=="id"&&(N[i]=m[i])}),N})}O(et,"extractPositionedNodes");function rt(C){return C.edges().map(X=>{let m=X.data(),L=X._private.rscratch,N={id:m.id,source:m.source,target:m.target,startX:L.startX,startY:L.startY,midX:L.midX,midY:L.midY,endX:L.endX,endY:L.endY};return Object.keys(m).forEach(i=>{["id","source","target"].includes(i)||(N[i]=m[i])}),N})}O(rt,"extractPositionedEdges");async function it(C,X){j.debug("Starting cose-bilkent layout algorithm");try{nt(C);let m=await tt(C),L=et(m),N=rt(m);return j.debug(`Layout completed: ${L.length} nodes, ${N.length} edges`),{nodes:L,edges:N}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}O(it,"executeCoseBilkentLayout");function nt(C){if(!C)throw new Error("Layout data is required");if(!C.config)throw new Error("Configuration is required in layout data");if(!C.rootNode)throw new Error("Root node is required");if(!C.nodes||!Array.isArray(C.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(C.edges))throw new Error("Edges array is required in layout data");return!0}O(nt,"validateLayoutData");var gt=O(async(C,X,{insertCluster:m,insertEdge:L,insertEdgeLabel:N,insertMarkers:i,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{let a={},o={},p=X.select("g");i(p,C.markers,C.type,C.diagramId);let n=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(C.nodes.map(async d=>{if(d.isGroup){let _={...d};o[d.id]=_,a[d.id]=_,await m(n,d)}else{let _={...d};a[d.id]=_;let v=await e(f,d,{config:C.config,dir:C.direction||"TB"}),I=v.node().getBBox();_.width=I.width,_.height=I.height,_.domId=v,t.debug(`Node ${d.id} dimensions: ${I.width}x${I.height}`)}})),t.debug("Running cose-bilkent layout algorithm");let E={...C,nodes:C.nodes.map(d=>{let _=a[d.id];return{...d,width:_.width,height:_.height}})},y=await it(E,C.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{let _=a[d.id];_?.domId&&(_.domId.attr("transform",`translate(${d.x}, ${d.y})`),_.x=d.x,_.y=d.y,t.debug(`Positioned node ${_.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{let _=C.edges.find(v=>v.id===d.id);_&&(_.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(C.edges.map(async d=>{await N(l,d);let _=a[d.start??""],v=a[d.end??""];if(_&&v){let I=y.edges.find(s=>s.id===d.id);if(I){t.debug("APA01 positionedEdge",I);let s={...d},u=L(g,s,o,C.type,_,v,C.diagramId);r(s,u)}else{let s={...d,points:[{x:_.x||0,y:_.y||0},{x:v.x||0,y:v.y||0}]},u=L(g,s,o,C.type,_,v,C.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),pt=gt;export{pt as render};