Files
Awperative/site/public/architectureDiagram-VXUJARFQ-H4V63UKK.min.js
2026-02-09 16:55:27 -05:00

38 lines
146 KiB
JavaScript
Executable File

import{a as qe}from"./chunk-V3WVIUUL.min.js";import{a as Qe}from"./chunk-I6VG5SPK.min.js";import"./chunk-LK7NMYKK.min.js";import{a as ze}from"./chunk-7EBV5LUJ.min.js";import"./chunk-6RTTMAJH.min.js";import"./chunk-LGVO22YL.min.js";import"./chunk-HVSI2YYT.min.js";import"./chunk-6B6J5Z6Z.min.js";import"./chunk-EU44H33B.min.js";import"./chunk-CQUFH26W.min.js";import"./chunk-LBFZT66H.min.js";import{b as Ze,c as ke,d as he,g as le}from"./chunk-XCAVDAZC.min.js";import"./chunk-R5JLOOQ4.min.js";import"./chunk-PTL4EUOE.min.js";import{a as Ee}from"./chunk-XXYYAETH.min.js";import{l as Be,p as $e}from"./chunk-QZZKR5JD.min.js";import"./chunk-CM5D5KZN.min.js";import{D as Fe,M as be,P as Pe,Q as Ge,R as Ue,S as Ye,T as Xe,U as He,V as We,W as se,q as Re,y as Se}from"./chunk-3EE2TK35.min.js";import"./chunk-E5F23VE2.min.js";import{b as ct,d as ye,j as Ve}from"./chunk-6TVUEPFY.min.js";import{a as pe,d as ur}from"./chunk-OSRY5VT3.min.js";var Te=pe((re,me)=>{(function(w,N){typeof re=="object"&&typeof me=="object"?me.exports=N():typeof define=="function"&&define.amd?define([],N):typeof re=="object"?re.layoutBase=N():w.layoutBase=N()})(re,function(){return(function(m){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return m[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return N.m=m,N.c=w,N.i=function(u){return u},N.d=function(u,o,n){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:n})},N.n=function(u){var o=u&&u.__esModule?function(){return u.default}:function(){return u};return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},N.p="",N(N.s=28)})([(function(m,w,N){"use strict";function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(8),n=N(9);function e(c,t,g){u.call(this,g),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=g,this.bendpoints=[],this.source=c,this.target=t}e.prototype=Object.create(u.prototype);for(var a in u)e[a]=u[a];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(c,t){for(var g=this.getOtherEnd(c),i=t.getGraphManager().getRoot();;){if(g.getOwner()==t)return g;if(g.getOwner()==i)break;g=g.getOwner().getParent()}return null},e.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=e}),(function(m,w,N){"use strict";function u(o){this.vGraphObject=o}m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(10),n=N(13),e=N(0),a=N(16),c=N(5);function t(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new n(r.x,r.y,h.width,h.height):this.rect=new n}t.prototype=Object.create(u.prototype);for(var g in u)t[g]=u[g];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(i){this.rect.width=i},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(i){this.rect.height=i},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},t.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},t.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},t.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},t.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},t.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;l<f.length;l++)r=f[l],h=r.withChildren(),h.forEach(function(L){i.add(L)});return i},t.prototype.getNoOfChildren=function(){var i=0,r;if(this.child==null)i=1;else for(var h=this.child.getNodes(),f=0;f<h.length;f++)r=h[f],i+=r.getNoOfChildren();return i==0&&(i=1),i},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.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)},t.prototype.scatter=function(){var i,r,h=-e.INITIAL_WORLD_BOUNDARY,f=e.INITIAL_WORLD_BOUNDARY;i=e.WORLD_CENTER_X+a.nextDouble()*(f-h)+h;var l=-e.INITIAL_WORLD_BOUNDARY,L=e.INITIAL_WORLD_BOUNDARY;r=e.WORLD_CENTER_Y+a.nextDouble()*(L-l)+l,this.rect.x=i,this.rect.y=r},t.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.getRight()-i.getLeft(),h=i.getBottom()-i.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(i){var r=this.rect.x;r>e.WORLD_BOUNDARY?r=e.WORLD_BOUNDARY:r<-e.WORLD_BOUNDARY&&(r=-e.WORLD_BOUNDARY);var h=this.rect.y;h>e.WORLD_BOUNDARY?h=e.WORLD_BOUNDARY:h<-e.WORLD_BOUNDARY&&(h=-e.WORLD_BOUNDARY);var f=new c(r,h),l=i.inverseTransformPoint(f);this.setLocation(l.x,l.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=t}),(function(m,w,N){"use strict";var u=N(0);function o(){}for(var n in u)o[n]=u[n];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=o}),(function(m,w,N){"use strict";function u(o,n){o==null&&n==null?(this.x=0,this.y=0):(this.x=o,this.y=n)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},m.exports=u}),(function(m,w,N){"use strict";var u=N(2),o=N(10),n=N(0),e=N(7),a=N(3),c=N(1),t=N(13),g=N(12),i=N(11);function r(f,l,L){u.call(this,L),this.estimatedSize=o.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(f,l,L){if(l==null&&L==null){var y=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(y)>-1)throw"Node already in graph!";return y.owner=this,this.getNodes().push(y),y}else{var p=f;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(L)>-1))throw"Source or target not in graph!";if(!(l.owner==L.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=L.owner?null:(p.source=l,p.target=L,p.isInterGraph=!1,this.getEdges().push(p),l.edges.push(p),L!=l&&L.edges.push(p),p)}},r.prototype.remove=function(f){var l=f;if(f instanceof a){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var L=l.edges.slice(),y,p=L.length,C=0;C<p;C++)y=L[C],y.isInterGraph?this.graphManager.remove(y):y.source.owner.remove(y);var R=this.nodes.indexOf(l);if(R==-1)throw"Node not in owner node list!";this.nodes.splice(R,1)}else if(f instanceof c){var y=f;if(y==null)throw"Edge is null!";if(!(y.source!=null&&y.target!=null))throw"Source and/or target is null!";if(!(y.source.owner!=null&&y.target.owner!=null&&y.source.owner==this&&y.target.owner==this))throw"Source and/or target owner is invalid!";var A=y.source.edges.indexOf(y),S=y.target.edges.indexOf(y);if(!(A>-1&&S>-1))throw"Source and/or target doesn't know this edge!";y.source.edges.splice(A,1),y.target!=y.source&&y.target.edges.splice(S,1);var R=y.source.owner.getEdges().indexOf(y);if(R==-1)throw"Not in owner's edge list!";y.source.owner.getEdges().splice(R,1)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,L,y,p,C=this.getNodes(),R=C.length,A=0;A<R;A++){var S=C[A];L=S.getTop(),y=S.getLeft(),f>L&&(f=L),l>y&&(l=y)}return f==o.MAX_VALUE?null:(C[0].getParent().paddingLeft!=null?p=C[0].getParent().paddingLeft:p=this.margin,this.left=l-p,this.top=f-p,new g(this.left,this.top))},r.prototype.updateBounds=function(f){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,y=o.MAX_VALUE,p=-o.MAX_VALUE,C,R,A,S,B,Y=this.nodes,tt=Y.length,x=0;x<tt;x++){var k=Y[x];f&&k.child!=null&&k.updateBounds(),C=k.getLeft(),R=k.getRight(),A=k.getTop(),S=k.getBottom(),l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var s=new t(l,y,L-l,p-y);l==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?B=Y[0].getParent().paddingLeft:B=this.margin,this.left=s.x-B,this.right=s.x+s.width+B,this.top=s.y-B,this.bottom=s.y+s.height+B},r.calculateBounds=function(f){for(var l=o.MAX_VALUE,L=-o.MAX_VALUE,y=o.MAX_VALUE,p=-o.MAX_VALUE,C,R,A,S,B=f.length,Y=0;Y<B;Y++){var tt=f[Y];C=tt.getLeft(),R=tt.getRight(),A=tt.getTop(),S=tt.getBottom(),l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var x=new t(l,y,L-l,p-y);return x},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var f=0,l=this.nodes,L=l.length,y=0;y<L;y++){var p=l[y];f+=p.calcEstimatedSize()}return f==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new i,L=new Set,y=this.nodes[0],p,C,R=y.withChildren();for(R.forEach(function(x){l.push(x),L.add(x)});l.length!==0;){y=l.shift(),p=y.getEdges();for(var A=p.length,S=0;S<A;S++){var B=p[S];if(C=B.getOtherEndInGraph(y,this),C!=null&&!L.has(C)){var Y=C.withChildren();Y.forEach(function(x){l.push(x),L.add(x)})}}}if(this.isConnected=!1,L.size>=this.nodes.length){var tt=0;L.forEach(function(x){x.owner==f&&tt++}),tt==this.nodes.length&&(this.isConnected=!0)}},m.exports=r}),(function(m,w,N){"use strict";var u,o=N(1);function n(e){u=N(6),this.layout=e,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var e=this.layout.newGraph(),a=this.layout.newNode(null),c=this.add(e,a);return this.setRootGraph(c),this.rootGraph},n.prototype.add=function(e,a,c,t,g){if(c==null&&t==null&&g==null){if(e==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return e.parent=a,a.child=e,e}else{g=c,t=a,c=e;var i=t.getOwner(),r=g.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,t,g);if(c.isInterGraph=!0,c.source=t,c.target=g,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},n.prototype.remove=function(e){if(e instanceof u){var a=e;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(a.getEdges());for(var t,g=c.length,i=0;i<g;i++)t=c[i],a.remove(t);var r=[];r=r.concat(a.getNodes());var h;g=r.length;for(var i=0;i<g;i++)h=r[i],a.remove(h);a==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(a);this.graphs.splice(f,1),a.parent=null}else if(e instanceof o){if(t=e,t==null)throw"Edge is null!";if(!t.isInterGraph)throw"Not an inter-graph edge!";if(!(t.source!=null&&t.target!=null))throw"Source and/or target is null!";if(!(t.source.edges.indexOf(t)!=-1&&t.target.edges.indexOf(t)!=-1))throw"Source and/or target doesn't know this edge!";var f=t.source.edges.indexOf(t);if(t.source.edges.splice(f,1),f=t.target.edges.indexOf(t),t.target.edges.splice(f,1),!(t.source.owner!=null&&t.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(t.source.owner.getGraphManager().edges.indexOf(t)==-1)throw"Not in owner graph manager's edge list!";var f=t.source.owner.getGraphManager().edges.indexOf(t);t.source.owner.getGraphManager().edges.splice(f,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],a=this.getGraphs(),c=a.length,t=0;t<c;t++)e=e.concat(a[t].getNodes());this.allNodes=e}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],a=this.getGraphs(),c=a.length,t=0;t<a.length;t++)e=e.concat(a[t].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(e,a){if(!(e!=null&&a!=null))throw"assert failed";if(e==a)return!0;var c=e.getOwner(),t;do{if(t=c.getParent(),t==null)break;if(t==a)return!0;if(c=t.getOwner(),c==null)break}while(!0);c=a.getOwner();do{if(t=c.getParent(),t==null)break;if(t==e)return!0;if(c=t.getOwner(),c==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var e,a,c,t,g,i=this.getAllEdges(),r=i.length,h=0;h<r;h++){if(e=i[h],a=e.source,c=e.target,e.lca=null,e.sourceInLca=a,e.targetInLca=c,a==c){e.lca=a.getOwner();continue}for(t=a.getOwner();e.lca==null;){for(e.targetInLca=c,g=c.getOwner();e.lca==null;){if(g==t){e.lca=g;break}if(g==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=g.getParent(),g=e.targetInLca.getOwner()}if(t==this.rootGraph)break;e.lca==null&&(e.sourceInLca=t.getParent(),t=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(e,a){if(e==a)return e.getOwner();var c=e.getOwner();do{if(c==null)break;var t=a.getOwner();do{if(t==null)break;if(t==c)return t;t=t.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},n.prototype.calcInclusionTreeDepths=function(e,a){e==null&&a==null&&(e=this.rootGraph,a=1);for(var c,t=e.getNodes(),g=t.length,i=0;i<g;i++)c=t[i],c.inclusionTreeDepth=a,c.child!=null&&this.calcInclusionTreeDepths(c.child,a+1)},n.prototype.includesInvalidEdge=function(){for(var e,a=[],c=this.edges.length,t=0;t<c;t++)e=this.edges[t],this.isOneAncestorOfOther(e.source,e.target)&&a.push(e);for(var t=0;t<a.length;t++)this.remove(a[t]);return!1},m.exports=n}),(function(m,w,N){"use strict";var u=N(12);function o(){}o.calcSeparationAmount=function(n,e,a,c){if(!n.intersects(e))throw"assert failed";var t=new Array(2);this.decideDirectionsForOverlappingNodes(n,e,t),a[0]=Math.min(n.getRight(),e.getRight())-Math.max(n.x,e.x),a[1]=Math.min(n.getBottom(),e.getBottom())-Math.max(n.y,e.y),n.getX()<=e.getX()&&n.getRight()>=e.getRight()?a[0]+=Math.min(e.getX()-n.getX(),n.getRight()-e.getRight()):e.getX()<=n.getX()&&e.getRight()>=n.getRight()&&(a[0]+=Math.min(n.getX()-e.getX(),e.getRight()-n.getRight())),n.getY()<=e.getY()&&n.getBottom()>=e.getBottom()?a[1]+=Math.min(e.getY()-n.getY(),n.getBottom()-e.getBottom()):e.getY()<=n.getY()&&e.getBottom()>=n.getBottom()&&(a[1]+=Math.min(n.getY()-e.getY(),e.getBottom()-n.getBottom()));var g=Math.abs((e.getCenterY()-n.getCenterY())/(e.getCenterX()-n.getCenterX()));e.getCenterY()===n.getCenterY()&&e.getCenterX()===n.getCenterX()&&(g=1);var i=g*a[0],r=a[1]/g;a[0]<r?r=a[0]:i=a[1],a[0]=-1*t[0]*(r/2+c),a[1]=-1*t[1]*(i/2+c)},o.decideDirectionsForOverlappingNodes=function(n,e,a){n.getCenterX()<e.getCenterX()?a[0]=-1:a[0]=1,n.getCenterY()<e.getCenterY()?a[1]=-1:a[1]=1},o.getIntersection2=function(n,e,a){var c=n.getCenterX(),t=n.getCenterY(),g=e.getCenterX(),i=e.getCenterY();if(n.intersects(e))return a[0]=c,a[1]=t,a[2]=g,a[3]=i,!0;var r=n.getX(),h=n.getY(),f=n.getRight(),l=n.getX(),L=n.getBottom(),y=n.getRight(),p=n.getWidthHalf(),C=n.getHeightHalf(),R=e.getX(),A=e.getY(),S=e.getRight(),B=e.getX(),Y=e.getBottom(),tt=e.getRight(),x=e.getWidthHalf(),k=e.getHeightHalf(),s=!1,E=!1;if(c===g){if(t>i)return a[0]=c,a[1]=h,a[2]=g,a[3]=Y,!1;if(t<i)return a[0]=c,a[1]=L,a[2]=g,a[3]=A,!1}else if(t===i){if(c>g)return a[0]=r,a[1]=t,a[2]=S,a[3]=i,!1;if(c<g)return a[0]=f,a[1]=t,a[2]=R,a[3]=i,!1}else{var v=n.height/n.width,T=e.height/e.width,d=(i-t)/(g-c),D=void 0,O=void 0,P=void 0,F=void 0,I=void 0,Z=void 0;if(-v===d?c>g?(a[0]=l,a[1]=L,s=!0):(a[0]=f,a[1]=h,s=!0):v===d&&(c>g?(a[0]=r,a[1]=h,s=!0):(a[0]=y,a[1]=L,s=!0)),-T===d?g>c?(a[2]=B,a[3]=Y,E=!0):(a[2]=S,a[3]=A,E=!0):T===d&&(g>c?(a[2]=R,a[3]=A,E=!0):(a[2]=tt,a[3]=Y,E=!0)),s&&E)return!1;if(c>g?t>i?(D=this.getCardinalDirection(v,d,4),O=this.getCardinalDirection(T,d,2)):(D=this.getCardinalDirection(-v,d,3),O=this.getCardinalDirection(-T,d,1)):t>i?(D=this.getCardinalDirection(-v,d,1),O=this.getCardinalDirection(-T,d,3)):(D=this.getCardinalDirection(v,d,2),O=this.getCardinalDirection(T,d,4)),!s)switch(D){case 1:F=h,P=c+-C/d,a[0]=P,a[1]=F;break;case 2:P=y,F=t+p*d,a[0]=P,a[1]=F;break;case 3:F=L,P=c+C/d,a[0]=P,a[1]=F;break;case 4:P=l,F=t+-p*d,a[0]=P,a[1]=F;break}if(!E)switch(O){case 1:Z=A,I=g+-k/d,a[2]=I,a[3]=Z;break;case 2:I=tt,Z=i+x*d,a[2]=I,a[3]=Z;break;case 3:Z=Y,I=g+k/d,a[2]=I,a[3]=Z;break;case 4:I=B,Z=i+-x*d,a[2]=I,a[3]=Z;break}}return!1},o.getCardinalDirection=function(n,e,a){return n>e?a:1+a%4},o.getIntersection=function(n,e,a,c){if(c==null)return this.getIntersection2(n,e,a);var t=n.x,g=n.y,i=e.x,r=e.y,h=a.x,f=a.y,l=c.x,L=c.y,y=void 0,p=void 0,C=void 0,R=void 0,A=void 0,S=void 0,B=void 0,Y=void 0,tt=void 0;return C=r-g,A=t-i,B=i*g-t*r,R=L-f,S=h-l,Y=l*f-h*L,tt=C*S-R*A,tt===0?null:(y=(A*Y-S*B)/tt,p=(R*B-C*Y)/tt,new u(y,p))},o.angleOfVector=function(n,e,a,c){var t=void 0;return n!==a?(t=Math.atan((c-e)/(a-n)),a<n?t+=Math.PI:c<e&&(t+=this.TWO_PI)):c<e?t=this.ONE_AND_HALF_PI:t=this.HALF_PI,t},o.doIntersect=function(n,e,a,c){var t=n.x,g=n.y,i=e.x,r=e.y,h=a.x,f=a.y,l=c.x,L=c.y,y=(i-t)*(L-f)-(l-h)*(r-g);if(y===0)return!1;var p=((L-f)*(l-t)+(h-l)*(L-g))/y,C=((g-r)*(l-t)+(i-t)*(L-g))/y;return 0<p&&p<1&&0<C&&C<1},o.findCircleLineIntersections=function(n,e,a,c,t,g,i){var r=(a-n)*(a-n)+(c-e)*(c-e),h=2*((n-t)*(a-n)+(e-g)*(c-e)),f=(n-t)*(n-t)+(e-g)*(e-g)-i*i,l=h*h-4*r*f;if(l>=0){var L=(-h+Math.sqrt(h*h-4*r*f))/(2*r),y=(-h-Math.sqrt(h*h-4*r*f))/(2*r),p=null;return L>=0&&L<=1?[L]:y>=0&&y<=1?[y]:p}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,m.exports=o}),(function(m,w,N){"use strict";function u(){}u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},m.exports=u}),(function(m,w,N){"use strict";function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,m.exports=u}),(function(m,w,N){"use strict";var u=(function(){function t(g,i){for(var r=0;r<i.length;r++){var h=i[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(g,h.key,h)}}return function(g,i,r){return i&&t(g.prototype,i),r&&t(g,r),g}})();function o(t,g){if(!(t instanceof g))throw new TypeError("Cannot call a class as a function")}var n=function(g){return{value:g,next:null,prev:null}},e=function(g,i,r,h){return g!==null?g.next=i:h.head=i,r!==null?r.prev=i:h.tail=i,i.prev=g,i.next=r,h.length++,i},a=function(g,i){var r=g.prev,h=g.next;return r!==null?r.next=h:i.head=h,h!==null?h.prev=r:i.tail=r,g.prev=g.next=null,i.length--,g},c=(function(){function t(g){var i=this;o(this,t),this.length=0,this.head=null,this.tail=null,g?.forEach(function(r){return i.push(r)})}return u(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,r){return e(r.prev,n(i),r,this)}},{key:"insertAfter",value:function(i,r){return e(r,n(i),r.next,this)}},{key:"insertNodeBefore",value:function(i,r){return e(r.prev,i,r,this)}},{key:"insertNodeAfter",value:function(i,r){return e(r,i,r.next,this)}},{key:"push",value:function(i){return e(this.tail,n(i),null,this)}},{key:"unshift",value:function(i){return e(null,n(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){for(var r=1,h=this.head;r<i;)h=h.next,r++;return h.value}}},{key:"set_object_at",value:function(i,r){if(i<=this.length()){for(var h=1,f=this.head;h<i;)f=f.next,h++;f.value=r}}}]),t})();m.exports=c}),(function(m,w,N){"use strict";function u(o,n,e){this.x=null,this.y=null,o==null&&n==null&&e==null?(this.x=0,this.y=0):typeof o=="number"&&typeof n=="number"&&e==null?(this.x=o,this.y=n):o.constructor.name=="Point"&&n==null&&e==null&&(e=o,this.x=e.x,this.y=e.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(o,n,e){o.constructor.name=="Point"&&n==null&&e==null?(e=o,this.setLocation(e.x,e.y)):typeof o=="number"&&typeof n=="number"&&e==null&&(parseInt(o)==o&&parseInt(n)==n?this.move(o,n):(this.x=Math.floor(o+.5),this.y=Math.floor(n+.5)))},u.prototype.move=function(o,n){this.x=o,this.y=n},u.prototype.translate=function(o,n){this.x+=o,this.y+=n},u.prototype.equals=function(o){if(o.constructor.name=="Point"){var n=o;return this.x==n.x&&this.y==n.y}return this==o},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=u}),(function(m,w,N){"use strict";function u(o,n,e,a){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&n!=null&&e!=null&&a!=null&&(this.x=o,this.y=n,this.width=e,this.height=a)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(o){this.x=o},u.prototype.getY=function(){return this.y},u.prototype.setY=function(o){this.y=o},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},m.exports=u}),(function(m,w,N){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function o(){}o.lastID=0,o.createID=function(n){return o.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=o.getString(),o.lastID++),n.uniqueID)},o.getString=function(n){return n==null&&(n=o.lastID),"Object#"+n},o.isPrimitive=function(n){var e=typeof n>"u"?"undefined":u(n);return n==null||e!="object"&&e!="function"},m.exports=o}),(function(m,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var f=0,l=Array(h.length);f<h.length;f++)l[f]=h[f];return l}else return Array.from(h)}var o=N(0),n=N(7),e=N(3),a=N(1),c=N(6),t=N(5),g=N(17),i=N(29);function r(h){i.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}r.RANDOM_SEED=1,r.prototype=Object.create(i.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new n(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new c(null,this.graphManager,h)},r.prototype.newNode=function(h){return new e(this.graphManager,h)},r.prototype.newEdge=function(h){return new a(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),o.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h,f=this.graphManager.getAllEdges(),l=0;l<f.length;l++)h=f[l];for(var L,y=this.graphManager.getRoot().getNodes(),l=0;l<y.length;l++)L=y[l];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof e){var f=h;if(f.getChild()!=null)for(var l=f.getChild().getNodes(),L=0;L<l.length;L++)update(l[L]);if(f.vGraphObject!=null){var y=f.vGraphObject;y.update(f)}}else if(h instanceof a){var p=h;if(p.vGraphObject!=null){var C=p.vGraphObject;C.update(p)}}else if(h instanceof c){var R=h;if(R.vGraphObject!=null){var A=R.vGraphObject;A.update(R)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new t(0,0));else{var f=new g,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){f.setWorldOrgX(h.x),f.setWorldOrgY(h.y),f.setDeviceOrgX(l.x),f.setDeviceOrgY(l.y);for(var L=this.getAllNodes(),y,p=0;p<L.length;p++)y=L[p],y.transform(f)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,l,L=h.getNodes(),y=0;y<L.length;y++)f=L[y],l=f.getChild(),l==null||l.getNodes().length==0?f.scatter():(this.positionNodesRandomly(l),f.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],f=!0,l=this.graphManager.getRoot().getNodes(),L=!0,y=0;y<l.length;y++)l[y].getChild()!=null&&(L=!1);if(!L)return h;var p=new Set,C=[],R=new Map,A=[];for(A=A.concat(l);A.length>0&&f;){for(C.push(A[0]);C.length>0&&f;){var S=C[0];C.splice(0,1),p.add(S);for(var B=S.getEdges(),y=0;y<B.length;y++){var Y=B[y].getOtherEnd(S);if(R.get(S)!=Y)if(!p.has(Y))C.push(Y),R.set(Y,S);else{f=!1;break}}}if(!f)h=[];else{var tt=[].concat(u(p));h.push(tt);for(var y=0;y<tt.length;y++){var x=tt[y],k=A.indexOf(x);k>-1&&A.splice(k,1)}p=new Set,R=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var f=[],l=h.source,L=this.graphManager.calcLowestCommonAncestor(h.source,h.target),y=0;y<h.bendpoints.length;y++){var p=this.newNode(null);p.setRect(new Point(0,0),new Dimension(1,1)),L.add(p);var C=this.newEdge(null);this.graphManager.add(C,l,p),f.add(p),l=p}var C=this.newEdge(null);return this.graphManager.add(C,l,h.target),this.edgeToDummyNodes.set(h,f),h.isInterGraph()?this.graphManager.remove(h):L.remove(h),f},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var f=0;f<h.length;f++){var l=h[f];if(l.bendpoints.length>0){for(var L=this.edgeToDummyNodes.get(l),y=0;y<L.length;y++){var p=L[y],C=new t(p.getCenterX(),p.getCenterY()),R=l.bendpoints.get(y);R.x=C.x,R.y=C.y,p.getOwner().remove(p)}this.graphManager.add(l,l.source,l.target)}}},r.transform=function(h,f,l,L){if(l!=null&&L!=null){var y=f;if(h<=50){var p=f/l;y-=(f-p)/50*(50-h)}else{var C=f*L;y+=(C-f)/50*(h-50)}return y}else{var R,A;return h<=50?(R=9*f/500,A=f/10):(R=9*f/50,A=-8*f),R*h+A}},r.findCenterOfTree=function(h){var f=[];f=f.concat(h);var l=[],L=new Map,y=!1,p=null;(f.length==1||f.length==2)&&(y=!0,p=f[0]);for(var C=0;C<f.length;C++){var R=f[C],A=R.getNeighborsList().size;L.set(R,R.getNeighborsList().size),A==1&&l.push(R)}var S=[];for(S=S.concat(l);!y;){var B=[];B=B.concat(S),S=[];for(var C=0;C<f.length;C++){var R=f[C],Y=f.indexOf(R);Y>=0&&f.splice(Y,1);var tt=R.getNeighborsList();tt.forEach(function(s){if(l.indexOf(s)<0){var E=L.get(s),v=E-1;v==1&&S.push(s),L.set(s,v)}})}l=l.concat(S),(f.length==1||f.length==2)&&(y=!0,p=f[0])}return p},r.prototype.setGraphManager=function(h){this.graphManager=h},m.exports=r}),(function(m,w,N){"use strict";function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},m.exports=u}),(function(m,w,N){"use strict";var u=N(5);function o(n,e){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.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(n){this.lworldExtX=n},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(n){this.lworldExtY=n},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},o.prototype.transformX=function(n){var e=0,a=this.lworldExtX;return a!=0&&(e=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/a),e},o.prototype.transformY=function(n){var e=0,a=this.lworldExtY;return a!=0&&(e=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/a),e},o.prototype.inverseTransformX=function(n){var e=0,a=this.ldeviceExtX;return a!=0&&(e=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/a),e},o.prototype.inverseTransformY=function(n){var e=0,a=this.ldeviceExtY;return a!=0&&(e=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/a),e},o.prototype.inverseTransformPoint=function(n){var e=new u(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return e},m.exports=o}),(function(m,w,N){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);r<i.length;r++)h[r]=i[r];return h}else return Array.from(i)}var o=N(15),n=N(4),e=N(0),a=N(8),c=N(9);function t(){o.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}t.prototype=Object.create(o.prototype);for(var g in o)t[g]=o[g];t.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},t.prototype.calcIdealEdgeLengths=function(){for(var i,r,h,f,l,L,y,p=this.getGraphManager().getAllEdges(),C=0;C<p.length;C++)i=p[C],r=i.idealLength,i.isInterGraph&&(f=i.getSource(),l=i.getTarget(),L=i.getSourceInLca().getEstimatedSize(),y=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=L+y-2*e.SIMPLE_NODE_SIZE),h=i.getLca().getInclusionTreeDepth(),i.idealLength+=r*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*h))},t.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(i-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),r,h=0;h<i.length;h++)r=i[h],this.calcSpringForce(r,r.idealLength)},t.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,f,l,L,y=this.getAllNodes(),p;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),p=new Set,h=0;h<y.length;h++)l=y[h],this.calculateRepulsionForceOfANode(l,p,i,r),p.add(l);else for(h=0;h<y.length;h++)for(l=y[h],f=h+1;f<y.length;f++)L=y[f],l.getOwner()==L.getOwner()&&this.calcRepulsionForce(l,L)},t.prototype.calcGravitationalForces=function(){for(var i,r=this.getAllNodesToApplyGravitation(),h=0;h<r.length;h++)i=r[h],this.calcGravitationalForce(i)},t.prototype.moveNodes=function(){for(var i=this.getAllNodes(),r,h=0;h<i.length;h++)r=i[h],r.move()},t.prototype.calcSpringForce=function(i,r){var h=i.getSource(),f=i.getTarget(),l,L,y,p;if(this.uniformLeafNodeSizes&&h.getChild()==null&&f.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;l=i.getLength(),l!=0&&(L=i.edgeElasticity*(l-r),y=L*(i.lengthX/l),p=L*(i.lengthY/l),h.springForceX+=y,h.springForceY+=p,f.springForceX-=y,f.springForceY-=p)},t.prototype.calcRepulsionForce=function(i,r){var h=i.getRect(),f=r.getRect(),l=new Array(2),L=new Array(4),y,p,C,R,A,S,B;if(h.intersects(f)){a.calcSeparationAmount(h,f,l,n.DEFAULT_EDGE_LENGTH/2),S=2*l[0],B=2*l[1];var Y=i.noOfChildren*r.noOfChildren/(i.noOfChildren+r.noOfChildren);i.repulsionForceX-=Y*S,i.repulsionForceY-=Y*B,r.repulsionForceX+=Y*S,r.repulsionForceY+=Y*B}else this.uniformLeafNodeSizes&&i.getChild()==null&&r.getChild()==null?(y=f.getCenterX()-h.getCenterX(),p=f.getCenterY()-h.getCenterY()):(a.getIntersection(h,f,L),y=L[2]-L[0],p=L[3]-L[1]),Math.abs(y)<n.MIN_REPULSION_DIST&&(y=c.sign(y)*n.MIN_REPULSION_DIST),Math.abs(p)<n.MIN_REPULSION_DIST&&(p=c.sign(p)*n.MIN_REPULSION_DIST),C=y*y+p*p,R=Math.sqrt(C),A=(i.nodeRepulsion/2+r.nodeRepulsion/2)*i.noOfChildren*r.noOfChildren/C,S=A*y/R,B=A*p/R,i.repulsionForceX-=S,i.repulsionForceY-=B,r.repulsionForceX+=S,r.repulsionForceY+=B},t.prototype.calcGravitationalForce=function(i){var r,h,f,l,L,y,p,C;r=i.getOwner(),h=(r.getRight()+r.getLeft())/2,f=(r.getTop()+r.getBottom())/2,l=i.getCenterX()-h,L=i.getCenterY()-f,y=Math.abs(l)+i.getWidth()/2,p=Math.abs(L)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(C=r.getEstimatedSize()*this.gravityRangeFactor,(y>C||p>C)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*L)):(C=r.getEstimatedSize()*this.compoundGravityRangeFactor,(y>C||p>C)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*L*this.compoundGravityConstant))},t.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||r},t.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},t.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,r=this.graphManager.getAllNodes(),h=0;h<r.length;h++)i=r[h],i.noOfChildren=i.getNoOfChildren()},t.prototype.calcGrid=function(i){var r=0,h=0;r=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var f=new Array(r),l=0;l<r;l++)f[l]=new Array(h);for(var l=0;l<r;l++)for(var L=0;L<h;L++)f[l][L]=new Array;return f},t.prototype.addNodeToGrid=function(i,r,h){var f=0,l=0,L=0,y=0;f=parseInt(Math.floor((i.getRect().x-r)/this.repulsionRange)),l=parseInt(Math.floor((i.getRect().width+i.getRect().x-r)/this.repulsionRange)),L=parseInt(Math.floor((i.getRect().y-h)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().height+i.getRect().y-h)/this.repulsionRange));for(var p=f;p<=l;p++)for(var C=L;C<=y;C++)this.grid[p][C].push(i),i.setGridCoordinates(f,l,L,y)},t.prototype.updateGrid=function(){var i,r,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<h.length;i++)r=h[i],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},t.prototype.calculateRepulsionForceOfANode=function(i,r,h,f){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&h||f){var l=new Set;i.surrounding=new Array;for(var L,y=this.grid,p=i.startX-1;p<i.finishX+2;p++)for(var C=i.startY-1;C<i.finishY+2;C++)if(!(p<0||C<0||p>=y.length||C>=y[0].length)){for(var R=0;R<y[p][C].length;R++)if(L=y[p][C][R],!(i.getOwner()!=L.getOwner()||i==L)&&!r.has(L)&&!l.has(L)){var A=Math.abs(i.getCenterX()-L.getCenterX())-(i.getWidth()/2+L.getWidth()/2),S=Math.abs(i.getCenterY()-L.getCenterY())-(i.getHeight()/2+L.getHeight()/2);A<=this.repulsionRange&&S<=this.repulsionRange&&l.add(L)}}i.surrounding=[].concat(u(l))}for(p=0;p<i.surrounding.length;p++)this.calcRepulsionForce(i,i.surrounding[p])},t.prototype.calcRepulsionRange=function(){return 0},m.exports=t}),(function(m,w,N){"use strict";var u=N(1),o=N(4);function n(a,c,t){u.call(this,a,c,t),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}n.prototype=Object.create(u.prototype);for(var e in u)n[e]=u[e];m.exports=n}),(function(m,w,N){"use strict";var u=N(3),o=N(4);function n(a,c,t,g){u.call(this,a,c,t,g),this.nodeRepulsion=o.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=[]}n.prototype=Object.create(u.prototype);for(var e in u)n[e]=u[e];n.prototype.setGridCoordinates=function(a,c,t,g){this.startX=a,this.finishX=c,this.startY=t,this.finishY=g},m.exports=n}),(function(m,w,N){"use strict";function u(o,n){this.width=0,this.height=0,o!==null&&n!==null&&(this.height=n,this.width=o)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},m.exports=u}),(function(m,w,N){"use strict";var u=N(14);function o(){this.map={},this.keys=[]}o.prototype.put=function(n,e){var a=u.createID(n);this.contains(a)||(this.map[a]=e,this.keys.push(n))},o.prototype.contains=function(n){var e=u.createID(n);return this.map[n]!=null},o.prototype.get=function(n){var e=u.createID(n);return this.map[e]},o.prototype.keySet=function(){return this.keys},m.exports=o}),(function(m,w,N){"use strict";var u=N(14);function o(){this.set={}}o.prototype.add=function(n){var e=u.createID(n);this.contains(e)||(this.set[e]=n)},o.prototype.remove=function(n){delete this.set[u.createID(n)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(n){return this.set[u.createID(n)]==n},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(n){for(var e=Object.keys(this.set),a=e.length,c=0;c<a;c++)n.push(this.set[e[c]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(n){for(var e=n.length,a=0;a<e;a++){var c=n[a];this.add(c)}},m.exports=o}),(function(m,w,N){"use strict";function u(){}u.multMat=function(o,n){for(var e=[],a=0;a<o.length;a++){e[a]=[];for(var c=0;c<n[0].length;c++){e[a][c]=0;for(var t=0;t<o[0].length;t++)e[a][c]+=o[a][t]*n[t][c]}}return e},u.transpose=function(o){for(var n=[],e=0;e<o[0].length;e++){n[e]=[];for(var a=0;a<o.length;a++)n[e][a]=o[a][e]}return n},u.multCons=function(o,n){for(var e=[],a=0;a<o.length;a++)e[a]=o[a]*n;return e},u.minusOp=function(o,n){for(var e=[],a=0;a<o.length;a++)e[a]=o[a]-n[a];return e},u.dotProduct=function(o,n){for(var e=0,a=0;a<o.length;a++)e+=o[a]*n[a];return e},u.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},u.normalize=function(o){for(var n=[],e=this.mag(o),a=0;a<o.length;a++)n[a]=o[a]/e;return n},u.multGamma=function(o){for(var n=[],e=0,a=0;a<o.length;a++)e+=o[a];e*=-1/o.length;for(var c=0;c<o.length;c++)n[c]=e+o[c];return n},u.multL=function(o,n,e){for(var a=[],c=[],t=[],g=0;g<n[0].length;g++){for(var i=0,r=0;r<n.length;r++)i+=-.5*n[r][g]*o[r];c[g]=i}for(var h=0;h<e.length;h++){for(var f=0,l=0;l<e.length;l++)f+=e[h][l]*c[l];t[h]=f}for(var L=0;L<n.length;L++){for(var y=0,p=0;p<n[0].length;p++)y+=n[L][p]*t[p];a[L]=y}return a},m.exports=u}),(function(m,w,N){"use strict";var u=(function(){function a(c,t){for(var g=0;g<t.length;g++){var i=t[g];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}return function(c,t,g){return t&&a(c.prototype,t),g&&a(c,g),c}})();function o(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function")}var n=N(11),e=(function(){function a(c,t){o(this,a),(t!==null||t!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var g=void 0;c instanceof n?g=c.size():g=c.length,this._quicksort(c,0,g-1)}return u(a,[{key:"_quicksort",value:function(t,g,i){if(g<i){var r=this._partition(t,g,i);this._quicksort(t,g,r),this._quicksort(t,r+1,i)}}},{key:"_partition",value:function(t,g,i){for(var r=this._get(t,g),h=g,f=i;;){for(;this.compareFunction(r,this._get(t,f));)f--;for(;this.compareFunction(this._get(t,h),r);)h++;if(h<f)this._swap(t,h,f),h++,f--;else return f}}},{key:"_get",value:function(t,g){return t instanceof n?t.get_object_at(g):t[g]}},{key:"_set",value:function(t,g,i){t instanceof n?t.set_object_at(g,i):t[g]=i}},{key:"_swap",value:function(t,g,i){var r=this._get(t,g);this._set(t,g,this._get(t,i)),this._set(t,i,r)}},{key:"_defaultCompareFunction",value:function(t,g){return g>t}}]),a})();m.exports=e}),(function(m,w,N){"use strict";function u(){}u.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var n=Math.min(this.m,this.n);this.s=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(Math.min(this.m+1,this.n)),this.U=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.m,n]),this.V=(function(Dt){var Nt=function $t(Rt){if(Rt.length==0)return 0;for(var Xt=[],zt=0;zt<Rt[0];zt++)Xt.push($t(Rt.slice(1)));return Xt};return Nt(Dt)})([this.n,this.n]);for(var e=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.n),a=(function(Dt){for(var Nt=[];Dt-- >0;)Nt.push(0);return Nt})(this.m),c=!0,t=!0,g=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(g,i);r++){if(r<g){this.s[r]=0;for(var h=r;h<this.m;h++)this.s[r]=u.hypot(this.s[r],o[h][r]);if(this.s[r]!==0){o[r][r]<0&&(this.s[r]=-this.s[r]);for(var f=r;f<this.m;f++)o[f][r]/=this.s[r];o[r][r]+=1}this.s[r]=-this.s[r]}for(var l=r+1;l<this.n;l++){if((function(Dt,Nt){return Dt&&Nt})(r<g,this.s[r]!==0)){for(var L=0,y=r;y<this.m;y++)L+=o[y][r]*o[y][l];L=-L/o[r][r];for(var p=r;p<this.m;p++)o[p][l]+=L*o[p][r]}e[l]=o[r][l]}if((function(Dt,Nt){return Dt&&Nt})(c,r<g))for(var C=r;C<this.m;C++)this.U[C][r]=o[C][r];if(r<i){e[r]=0;for(var R=r+1;R<this.n;R++)e[r]=u.hypot(e[r],e[R]);if(e[r]!==0){e[r+1]<0&&(e[r]=-e[r]);for(var A=r+1;A<this.n;A++)e[A]/=e[r];e[r+1]+=1}if(e[r]=-e[r],(function(Dt,Nt){return Dt&&Nt})(r+1<this.m,e[r]!==0)){for(var S=r+1;S<this.m;S++)a[S]=0;for(var B=r+1;B<this.n;B++)for(var Y=r+1;Y<this.m;Y++)a[Y]+=e[B]*o[Y][B];for(var tt=r+1;tt<this.n;tt++)for(var x=-e[tt]/e[r+1],k=r+1;k<this.m;k++)o[k][tt]+=x*a[k]}if(t)for(var s=r+1;s<this.n;s++)this.V[s][r]=e[s]}}var E=Math.min(this.n,this.m+1);if(g<this.n&&(this.s[g]=o[g][g]),this.m<E&&(this.s[E-1]=0),i+1<E&&(e[i]=o[i][E-1]),e[E-1]=0,c){for(var v=g;v<n;v++){for(var T=0;T<this.m;T++)this.U[T][v]=0;this.U[v][v]=1}for(var d=g-1;d>=0;d--)if(this.s[d]!==0){for(var D=d+1;D<n;D++){for(var O=0,P=d;P<this.m;P++)O+=this.U[P][d]*this.U[P][D];O=-O/this.U[d][d];for(var F=d;F<this.m;F++)this.U[F][D]+=O*this.U[F][d]}for(var I=d;I<this.m;I++)this.U[I][d]=-this.U[I][d];this.U[d][d]=1+this.U[d][d];for(var Z=0;Z<d-1;Z++)this.U[Z][d]=0}else{for(var _=0;_<this.m;_++)this.U[_][d]=0;this.U[d][d]=1}}if(t)for(var b=this.n-1;b>=0;b--){if((function(Dt,Nt){return Dt&&Nt})(b<i,e[b]!==0))for(var j=b+1;j<n;j++){for(var V=0,M=b+1;M<this.n;M++)V+=this.V[M][b]*this.V[M][j];V=-V/this.V[b+1][b];for(var U=b+1;U<this.n;U++)this.V[U][j]+=V*this.V[U][b]}for(var X=0;X<this.n;X++)this.V[X][b]=0;this.V[b][b]=1}for(var J=E-1,st=0,Lt=Math.pow(2,-52),St=Math.pow(2,-966);E>0;){var Q=void 0,Ut=void 0;for(Q=E-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(e[Q])<=St+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){e[Q]=0;break}if(Q===E-2)Ut=4;else{var wt=void 0;for(wt=E-1;wt>=Q&&wt!==Q;wt--){var nt=(wt!==E?Math.abs(e[wt]):0)+(wt!==Q+1?Math.abs(e[wt-1]):0);if(Math.abs(this.s[wt])<=St+Lt*nt){this.s[wt]=0;break}}wt===Q?Ut=3:wt===E-1?Ut=1:(Ut=2,Q=wt)}switch(Q++,Ut){case 1:{var et=e[E-2];e[E-2]=0;for(var pt=E-2;pt>=Q;pt--){var Et=u.hypot(this.s[pt],et),Ct=this.s[pt]/Et,mt=et/Et;if(this.s[pt]=Et,pt!==Q&&(et=-mt*e[pt-1],e[pt-1]=Ct*e[pt-1]),t)for(var Tt=0;Tt<this.n;Tt++)Et=Ct*this.V[Tt][pt]+mt*this.V[Tt][E-1],this.V[Tt][E-1]=-mt*this.V[Tt][pt]+Ct*this.V[Tt][E-1],this.V[Tt][pt]=Et}}break;case 2:{var Ot=e[Q-1];e[Q-1]=0;for(var It=Q;It<E;It++){var Wt=u.hypot(this.s[It],Ot),Pt=this.s[It]/Wt,Yt=Ot/Wt;if(this.s[It]=Wt,Ot=-Yt*e[It],e[It]=Pt*e[It],c)for(var bt=0;bt<this.m;bt++)Wt=Pt*this.U[bt][It]+Yt*this.U[bt][Q-1],this.U[bt][Q-1]=-Yt*this.U[bt][It]+Pt*this.U[bt][Q-1],this.U[bt][It]=Wt}}break;case 3:{var G=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[E-1]),Math.abs(this.s[E-2])),Math.abs(e[E-2])),Math.abs(this.s[Q])),Math.abs(e[Q])),H=this.s[E-1]/G,W=this.s[E-2]/G,z=e[E-2]/G,$=this.s[Q]/G,K=e[Q]/G,ut=((W+H)*(W-H)+z*z)/2,ft=H*z*(H*z),q=0;(function(Dt,Nt){return Dt||Nt})(ut!==0,ft!==0)&&(q=Math.sqrt(ut*ut+ft),ut<0&&(q=-q),q=ft/(ut+q));for(var ht=($+H)*($-H)+q,gt=$*K,rt=Q;rt<E-1;rt++){var vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt;if(rt!==Q&&(e[rt-1]=vt),ht=At*this.s[rt]+ot*e[rt],e[rt]=At*e[rt]-ot*this.s[rt],gt=ot*this.s[rt+1],this.s[rt+1]=At*this.s[rt+1],t)for(var it=0;it<this.n;it++)vt=At*this.V[it][rt]+ot*this.V[it][rt+1],this.V[it][rt+1]=-ot*this.V[it][rt]+At*this.V[it][rt+1],this.V[it][rt]=vt;if(vt=u.hypot(ht,gt),At=ht/vt,ot=gt/vt,this.s[rt]=vt,ht=At*e[rt]+ot*this.s[rt+1],this.s[rt+1]=-ot*e[rt]+At*this.s[rt+1],gt=ot*e[rt+1],e[rt+1]=At*e[rt+1],c&&rt<this.m-1)for(var dt=0;dt<this.m;dt++)vt=At*this.U[dt][rt]+ot*this.U[dt][rt+1],this.U[dt][rt+1]=-ot*this.U[dt][rt]+At*this.U[dt][rt+1],this.U[dt][rt]=vt}e[E-2]=ht,st=st+1}break;case 4:{if(this.s[Q]<=0&&(this.s[Q]=this.s[Q]<0?-this.s[Q]:0,t))for(var at=0;at<=J;at++)this.V[at][Q]=-this.V[at][Q];for(;Q<J&&!(this.s[Q]>=this.s[Q+1]);){var lt=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=lt,t&&Q<this.n-1)for(var Ft=0;Ft<this.n;Ft++)lt=this.V[Ft][Q+1],this.V[Ft][Q+1]=this.V[Ft][Q],this.V[Ft][Q]=lt;if(c&&Q<this.m-1)for(var xt=0;xt<this.m;xt++)lt=this.U[xt][Q+1],this.U[xt][Q+1]=this.U[xt][Q],this.U[xt][Q]=lt;Q++}st=0,E--}break}}var Vt={U:this.U,V:this.V,S:this.s};return Vt},u.hypot=function(o,n){var e=void 0;return Math.abs(o)>Math.abs(n)?(e=n/o,e=Math.abs(o)*Math.sqrt(1+e*e)):n!=0?(e=o/n,e=Math.abs(n)*Math.sqrt(1+e*e)):e=0,e},m.exports=u}),(function(m,w,N){"use strict";var u=(function(){function e(a,c){for(var t=0;t<c.length;t++){var g=c[t];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(a,g.key,g)}}return function(a,c,t){return c&&e(a.prototype,c),t&&e(a,t),a}})();function o(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}var n=(function(){function e(a,c){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,e),this.sequence1=a,this.sequence2=c,this.match_score=t,this.mismatch_penalty=g,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[r][h]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[f][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(e,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var g=1;g<this.iMax;g++)for(var i=1;i<this.jMax;i++){var r=void 0;this.sequence1[g-1]===this.sequence2[i-1]?r=this.grid[g-1][i-1]+this.match_score:r=this.grid[g-1][i-1]+this.mismatch_penalty;var h=this.grid[g-1][i]+this.gap_penalty,f=this.grid[g][i-1]+this.gap_penalty,l=[r,h,f],L=this.arrayAllMaxIndexes(l);this.grid[g][i]=l[L[0]],this.tracebackGrid[g][i]=[L.includes(0),L.includes(1),L.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var c=[];for(c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});c[0];){var t=c[0],g=this.tracebackGrid[t.pos[0]][t.pos[1]];g[0]&&c.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),g[1]&&c.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),g[2]&&c.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),t.pos[0]===0&&t.pos[1]===0&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),c.shift()}return this.alignments}},{key:"getAllIndexes",value:function(c,t){for(var g=[],i=-1;(i=c.indexOf(t,i+1))!==-1;)g.push(i);return g}},{key:"arrayAllMaxIndexes",value:function(c){return this.getAllIndexes(c,Math.max.apply(null,c))}}]),e})();m.exports=n}),(function(m,w,N){"use strict";var u=function(){};u.FDLayout=N(18),u.FDLayoutConstants=N(4),u.FDLayoutEdge=N(19),u.FDLayoutNode=N(20),u.DimensionD=N(21),u.HashMap=N(22),u.HashSet=N(23),u.IGeometry=N(8),u.IMath=N(9),u.Integer=N(10),u.Point=N(12),u.PointD=N(5),u.RandomSeed=N(16),u.RectangleD=N(13),u.Transform=N(17),u.UniqueIDGeneretor=N(14),u.Quicksort=N(25),u.LinkedList=N(11),u.LGraphObject=N(2),u.LGraph=N(6),u.LEdge=N(1),u.LGraphManager=N(7),u.LNode=N(3),u.Layout=N(15),u.LayoutConstants=N(0),u.NeedlemanWunsch=N(27),u.Matrix=N(24),u.SVD=N(26),m.exports=u}),(function(m,w,N){"use strict";function u(){this.listeners=[]}var o=u.prototype;o.addListener=function(n,e){this.listeners.push({event:n,callback:e})},o.removeListener=function(n,e){for(var a=this.listeners.length;a>=0;a--){var c=this.listeners[a];c.event===n&&c.callback===e&&this.listeners.splice(a,1)}},o.emit=function(n,e){for(var a=0;a<this.listeners.length;a++){var c=this.listeners[a];n===c.event&&c.callback(e)}},m.exports=u})])})});var Le=pe((ie,Ne)=>{(function(w,N){typeof ie=="object"&&typeof Ne=="object"?Ne.exports=N(Te()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ie=="object"?ie.coseBase=N(Te()):w.coseBase=N(w.layoutBase)})(ie,function(m){return(()=>{"use strict";var w={45:((n,e,a)=>{var c={};c.layoutBase=a(551),c.CoSEConstants=a(806),c.CoSEEdge=a(767),c.CoSEGraph=a(880),c.CoSEGraphManager=a(578),c.CoSELayout=a(765),c.CoSENode=a(991),c.ConstraintHandler=a(902),n.exports=c}),806:((n,e,a)=>{var c=a(551).FDLayoutConstants;function t(){}for(var g in c)t[g]=c[g];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,t.ENFORCE_CONSTRAINTS=!0,t.APPLY_LAYOUT=!0,t.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,t.TREE_REDUCTION_ON_INCREMENTAL=!0,t.PURE_INCREMENTAL=t.DEFAULT_INCREMENTAL,n.exports=t}),767:((n,e,a)=>{var c=a(551).FDLayoutEdge;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),880:((n,e,a)=>{var c=a(551).LGraph;function t(i,r,h){c.call(this,i,r,h)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),578:((n,e,a)=>{var c=a(551).LGraphManager;function t(i){c.call(this,i)}t.prototype=Object.create(c.prototype);for(var g in c)t[g]=c[g];n.exports=t}),765:((n,e,a)=>{var c=a(551).FDLayout,t=a(578),g=a(880),i=a(991),r=a(767),h=a(806),f=a(902),l=a(551).FDLayoutConstants,L=a(551).LayoutConstants,y=a(551).Point,p=a(551).PointD,C=a(551).DimensionD,R=a(551).Layout,A=a(551).Integer,S=a(551).IGeometry,B=a(551).LGraph,Y=a(551).Transform,tt=a(551).LinkedList;function x(){c.call(this),this.toBeTiled={},this.constraints={}}x.prototype=Object.create(c.prototype);for(var k in c)x[k]=c[k];x.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},x.prototype.newGraph=function(s){return new g(null,this.graphManager,s)},x.prototype.newNode=function(s){return new i(this.graphManager,s)},x.prototype.newEdge=function(s){return new r(null,null,s)},x.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},x.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},x.prototype.layout=function(){var s=L.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(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(D){return E.has(D)});this.graphManager.setAllNodesToApplyGravitation(v)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var E=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(T){return E.has(T)});this.graphManager.setAllNodesToApplyGravitation(v),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.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%l.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()),E=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.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()),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var v=!this.isTreeGrowing&&!this.isGrowthFinished,T=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(v,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},x.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),E={},v=0;v<s.length;v++){var T=s[v].rect,d=s[v].id;E[d]={id:d,x:T.getCenterX(),y:T.getCenterY(),w:T.width,h:T.height}}return E},x.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},x.prototype.moveNodes=function(){for(var s=this.getAllNodes(),E,v=0;v<s.length;v++)E=s[v],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var v=0;v<s.length;v++)E=s[v],E.move()},x.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),v=0;v<E.length;v++){var T=E[v];this.idToNodeMap.set(T.id,T)}var d=function M(U){for(var X=U.getChild().getNodes(),J,st=0,Lt=0;Lt<X.length;Lt++)J=X[Lt],J.getChild()==null?s.fixedNodeSet.has(J.id)&&(st+=100):st+=M(J);return st};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(X){s.fixedNodeSet.add(X.nodeId)});for(var E=this.graphManager.getAllNodes(),T,v=0;v<E.length;v++)if(T=E[v],T.getChild()!=null){var D=d(T);D>0&&(T.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var O=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var F=this.constraints.alignmentConstraint.vertical,v=0;v<F.length;v++)this.dummyToNodeForVerticalAlignment.set("dummy"+v,[]),F[v].forEach(function(U){O.set(U,"dummy"+v),s.dummyToNodeForVerticalAlignment.get("dummy"+v).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnHorizontal.add("dummy"+v)});if(this.constraints.alignmentConstraint.horizontal)for(var I=this.constraints.alignmentConstraint.horizontal,v=0;v<I.length;v++)this.dummyToNodeForHorizontalAlignment.set("dummy"+v,[]),I[v].forEach(function(U){P.set(U,"dummy"+v),s.dummyToNodeForHorizontalAlignment.get("dummy"+v).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnVertical.add("dummy"+v)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var U,X,J;for(J=M.length-1;J>=2*M.length/3;J--)U=Math.floor(Math.random()*(J+1)),X=M[J],M[J]=M[U],M[U]=X;return M},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(M){if(M.left){var U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(X)||(s.nodesInRelativeHorizontal.push(X),s.nodeToRelativeConstraintMapHorizontal.set(X,[]),s.dummyToNodeForVerticalAlignment.has(X)?s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(X,s.idToNodeMap.get(X).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:X,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(X).push({left:U,gap:M.gap})}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(J)||(s.nodesInRelativeVertical.push(J),s.nodeToRelativeConstraintMapVertical.set(J,[]),s.dummyToNodeForHorizontalAlignment.has(J)?s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(J)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(J,s.idToNodeMap.get(J).getCenterY())),s.nodesInRelativeVertical.includes(st)||(s.nodesInRelativeVertical.push(st),s.nodeToRelativeConstraintMapVertical.set(st,[]),s.dummyToNodeForHorizontalAlignment.has(st)?s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(st,s.idToNodeMap.get(st).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(J).push({bottom:st,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(st).push({top:J,gap:M.gap})}});else{var Z=new Map,_=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=O.has(M.left)?O.get(M.left):M.left,X=O.has(M.right)?O.get(M.right):M.right;Z.has(U)?Z.get(U).push(X):Z.set(U,[X]),Z.has(X)?Z.get(X).push(U):Z.set(X,[U])}else{var J=P.has(M.top)?P.get(M.top):M.top,st=P.has(M.bottom)?P.get(M.bottom):M.bottom;_.has(J)?_.get(J).push(st):_.set(J,[st]),_.has(st)?_.get(st).push(J):_.set(st,[J])}});var b=function(U,X){var J=[],st=[],Lt=new tt,St=new Set,Q=0;return U.forEach(function(Ut,wt){if(!St.has(wt)){J[Q]=[],st[Q]=!1;var nt=wt;for(Lt.push(nt),St.add(nt),J[Q].push(nt);Lt.length!=0;){nt=Lt.shift(),X.has(nt)&&(st[Q]=!0);var et=U.get(nt);et.forEach(function(pt){St.has(pt)||(Lt.push(pt),St.add(pt),J[Q].push(pt))})}Q++}}),{components:J,isFixed:st}},j=b(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=j.components,this.fixedComponentsOnHorizontal=j.isFixed;var V=b(_,s.fixedNodesOnVertical);this.componentsOnVertical=V.components,this.fixedComponentsOnVertical=V.isFixed}}},x.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(V){var M=s.idToNodeMap.get(V.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,v=0;v<E.length;v++){for(var T=0,d=0;d<E[v].length;d++){if(this.fixedNodeSet.has(E[v][d])){T=0;break}T+=this.idToNodeMap.get(E[v][d]).displacementX}for(var D=T/E[v].length,d=0;d<E[v].length;d++)this.idToNodeMap.get(E[v][d]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var O=this.constraints.alignmentConstraint.horizontal,v=0;v<O.length;v++){for(var P=0,d=0;d<O[v].length;d++){if(this.fixedNodeSet.has(O[v][d])){P=0;break}P+=this.idToNodeMap.get(O[v][d]).displacementY}for(var F=P/O[v].length,d=0;d<O[v].length;d++)this.idToNodeMap.get(O[v][d]).displacementY=F}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(V){if(!s.fixedNodesOnHorizontal.has(V)){var M=0;s.dummyToNodeForVerticalAlignment.has(V)?M=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(V)[0]).displacementX:M=s.idToNodeMap.get(V).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(V).forEach(function(U){if(U.right){var X=s.nodeToTempPositionMapHorizontal.get(U.right)-s.nodeToTempPositionMapHorizontal.get(V)-M;X<U.gap&&(M-=U.gap-X)}else{var X=s.nodeToTempPositionMapHorizontal.get(V)-s.nodeToTempPositionMapHorizontal.get(U.left)+M;X<U.gap&&(M+=U.gap-X)}}),s.nodeToTempPositionMapHorizontal.set(V,s.nodeToTempPositionMapHorizontal.get(V)+M),s.dummyToNodeForVerticalAlignment.has(V)?s.dummyToNodeForVerticalAlignment.get(V).forEach(function(U){s.idToNodeMap.get(U).displacementX=M}):s.idToNodeMap.get(V).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(V){if(!s.fixedNodesOnHorizontal.has(V)){var M=0;s.dummyToNodeForHorizontalAlignment.has(V)?M=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(V)[0]).displacementY:M=s.idToNodeMap.get(V).displacementY,s.nodeToRelativeConstraintMapVertical.get(V).forEach(function(U){if(U.bottom){var X=s.nodeToTempPositionMapVertical.get(U.bottom)-s.nodeToTempPositionMapVertical.get(V)-M;X<U.gap&&(M-=U.gap-X)}else{var X=s.nodeToTempPositionMapVertical.get(V)-s.nodeToTempPositionMapVertical.get(U.top)+M;X<U.gap&&(M+=U.gap-X)}}),s.nodeToTempPositionMapVertical.set(V,s.nodeToTempPositionMapVertical.get(V)+M),s.dummyToNodeForHorizontalAlignment.has(V)?s.dummyToNodeForHorizontalAlignment.get(V).forEach(function(U){s.idToNodeMap.get(U).displacementY=M}):s.idToNodeMap.get(V).displacementY=M}});else{for(var v=0;v<this.componentsOnHorizontal.length;v++){var I=this.componentsOnHorizontal[v];if(this.fixedComponentsOnHorizontal[v])for(var d=0;d<I.length;d++)this.dummyToNodeForVerticalAlignment.has(I[d])?this.dummyToNodeForVerticalAlignment.get(I[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=0}):this.idToNodeMap.get(I[d]).displacementX=0;else{for(var Z=0,_=0,d=0;d<I.length;d++)if(this.dummyToNodeForVerticalAlignment.has(I[d])){var b=this.dummyToNodeForVerticalAlignment.get(I[d]);Z+=b.length*this.idToNodeMap.get(b[0]).displacementX,_+=b.length}else Z+=this.idToNodeMap.get(I[d]).displacementX,_++;for(var j=Z/_,d=0;d<I.length;d++)this.dummyToNodeForVerticalAlignment.has(I[d])?this.dummyToNodeForVerticalAlignment.get(I[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=j}):this.idToNodeMap.get(I[d]).displacementX=j}}for(var v=0;v<this.componentsOnVertical.length;v++){var I=this.componentsOnVertical[v];if(this.fixedComponentsOnVertical[v])for(var d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.has(I[d])?this.dummyToNodeForHorizontalAlignment.get(I[d]).forEach(function(X){s.idToNodeMap.get(X).displacementY=0}):this.idToNodeMap.get(I[d]).displacementY=0;else{for(var Z=0,_=0,d=0;d<I.length;d++)if(this.dummyToNodeForHorizontalAlignment.has(I[d])){var b=this.dummyToNodeForHorizontalAlignment.get(I[d]);Z+=b.length*this.idToNodeMap.get(b[0]).displacementY,_+=b.length}else Z+=this.idToNodeMap.get(I[d]).displacementY,_++;for(var j=Z/_,d=0;d<I.length;d++)this.dummyToNodeForHorizontalAlignment.has(I[d])?this.dummyToNodeForHorizontalAlignment.get(I[d]).forEach(function(Lt){s.idToNodeMap.get(Lt).displacementY=j}):this.idToNodeMap.get(I[d]).displacementY=j}}}},x.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],E,v=this.graphManager.getGraphs(),T=v.length,d;for(d=0;d<T;d++)E=v[d],E.updateConnected(),E.isConnected||(s=s.concat(E.getNodes()));return s},x.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var E=new Set,v;for(v=0;v<s.length;v++){var T=s[v];if(!E.has(T)){var d=T.getSource(),D=T.getTarget();if(d==D)T.getBendpoints().push(new p),T.getBendpoints().push(new p),this.createDummyNodesForBendpoints(T),E.add(T);else{var O=[];if(O=O.concat(d.getEdgeListToNode(D)),O=O.concat(D.getEdgeListToNode(d)),!E.has(O[0])){if(O.length>1){var P;for(P=0;P<O.length;P++){var F=O[P];F.getBendpoints().push(new p),this.createDummyNodesForBendpoints(F)}}O.forEach(function(I){E.add(I)})}}}if(E.size==s.length)break}},x.prototype.positionNodesRadially=function(s){for(var E=new y(0,0),v=Math.ceil(Math.sqrt(s.length)),T=0,d=0,D=0,O=new p(0,0),P=0;P<s.length;P++){P%v==0&&(D=0,d=T,P!=0&&(d+=h.DEFAULT_COMPONENT_SEPERATION),T=0);var F=s[P],I=R.findCenterOfTree(F);E.x=D,E.y=d,O=x.radialLayout(F,I,E),O.y>T&&(T=Math.floor(O.y)),D=Math.floor(O.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(L.WORLD_CENTER_X-O.x/2,L.WORLD_CENTER_Y-O.y/2))},x.radialLayout=function(s,E,v){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);x.branchRadialLayout(E,null,0,359,0,T);var d=B.calculateBounds(s),D=new Y;D.setDeviceOrgX(d.getMinX()),D.setDeviceOrgY(d.getMinY()),D.setWorldOrgX(v.x),D.setWorldOrgY(v.y);for(var O=0;O<s.length;O++){var P=s[O];P.transform(D)}var F=new p(d.getMaxX(),d.getMaxY());return D.inverseTransformPoint(F)},x.branchRadialLayout=function(s,E,v,T,d,D){var O=(T-v+1)/2;O<0&&(O+=180);var P=(O+v)%360,F=P*S.TWO_PI/360,I=Math.cos(F),Z=d*Math.cos(F),_=d*Math.sin(F);s.setCenter(Z,_);var b=[];b=b.concat(s.getEdges());var j=b.length;E!=null&&j--;for(var V=0,M=b.length,U,X=s.getEdgesBetween(E);X.length>1;){var J=X[0];X.splice(0,1);var st=b.indexOf(J);st>=0&&b.splice(st,1),M--,j--}E!=null?U=(b.indexOf(X[0])+1)%M:U=0;for(var Lt=Math.abs(T-v)/j,St=U;V!=j;St=++St%M){var Q=b[St].getOtherEnd(s);if(Q!=E){var Ut=(v+V*Lt)%360,wt=(Ut+Lt)%360;x.branchRadialLayout(Q,s,Ut,wt,d+D,D),V++}}},x.maxDiagonalInTree=function(s){for(var E=A.MIN_VALUE,v=0;v<s.length;v++){var T=s[v],d=T.getDiagonal();d>E&&(E=d)}return E},x.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},x.prototype.groupZeroDegreeMembers=function(){var s=this,E={};this.memberGroups={},this.idToDummyNode={};for(var v=[],T=this.graphManager.getAllNodes(),d=0;d<T.length;d++){var D=T[d],O=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(O.id==null||!this.getToBeTiled(O))&&v.push(D)}for(var d=0;d<v.length;d++){var D=v[d],P=D.getParent().id;typeof E[P]>"u"&&(E[P]=[]),E[P]=E[P].concat(D)}Object.keys(E).forEach(function(F){if(E[F].length>1){var I="DummyCompound_"+F;s.memberGroups[I]=E[F];var Z=E[F][0].getParent(),_=new i(s.graphManager);_.id=I,_.paddingLeft=Z.paddingLeft||0,_.paddingRight=Z.paddingRight||0,_.paddingBottom=Z.paddingBottom||0,_.paddingTop=Z.paddingTop||0,s.idToDummyNode[I]=_;var b=s.getGraphManager().add(s.newGraph(),_),j=Z.getChild();j.add(_);for(var V=0;V<E[F].length;V++){var M=E[F][V];j.remove(M),b.add(M)}}})},x.prototype.clearCompounds=function(){var s={},E={};this.performDFSOnCompounds();for(var v=0;v<this.compoundOrder.length;v++)E[this.compoundOrder[v].id]=this.compoundOrder[v],s[this.compoundOrder[v].id]=[].concat(this.compoundOrder[v].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[v].getChild()),this.compoundOrder[v].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,E)},x.prototype.clearZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(v){var T=s.idToDummyNode[v];if(E[v]=s.tileNodes(s.memberGroups[v],T.paddingLeft+T.paddingRight),T.rect.width=E[v].width,T.rect.height=E[v].height,T.setCenter(E[v].centerX,E[v].centerY),T.labelMarginLeft=0,T.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var d=T.rect.width,D=T.rect.height;T.labelWidth&&(T.labelPosHorizontal=="left"?(T.rect.x-=T.labelWidth,T.setWidth(d+T.labelWidth),T.labelMarginLeft=T.labelWidth):T.labelPosHorizontal=="center"&&T.labelWidth>d?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(D+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>D?(T.rect.y-=(T.labelHeight-D)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-D)/2):T.labelPosVertical=="bottom"&&T.setHeight(D+T.labelHeight))}})},x.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var E=this.compoundOrder[s],v=E.id,T=E.paddingLeft,d=E.paddingTop,D=E.labelMarginLeft,O=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[v],E.rect.x,E.rect.y,T,d,D,O)}},x.prototype.repopulateZeroDegreeMembers=function(){var s=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(v){var T=s.idToDummyNode[v],d=T.paddingLeft,D=T.paddingTop,O=T.labelMarginLeft,P=T.labelMarginTop;s.adjustLocations(E[v],T.rect.x,T.rect.y,d,D,O,P)})},x.prototype.getToBeTiled=function(s){var E=s.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var v=s.getChild();if(v==null)return this.toBeTiled[E]=!1,!1;for(var T=v.getNodes(),d=0;d<T.length;d++){var D=T[d];if(this.getNodeDegree(D)>0)return this.toBeTiled[E]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},x.prototype.getNodeDegree=function(s){for(var E=s.id,v=s.getEdges(),T=0,d=0;d<v.length;d++){var D=v[d];D.getSource().id!==D.getTarget().id&&(T=T+1)}return T},x.prototype.getNodeDegreeWithChildren=function(s){var E=this.getNodeDegree(s);if(s.getChild()==null)return E;for(var v=s.getChild().getNodes(),T=0;T<v.length;T++){var d=v[T];E+=this.getNodeDegreeWithChildren(d)}return E},x.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},x.prototype.fillCompexOrderByDFS=function(s){for(var E=0;E<s.length;E++){var v=s[E];v.getChild()!=null&&this.fillCompexOrderByDFS(v.getChild().getNodes()),this.getToBeTiled(v)&&this.compoundOrder.push(v)}},x.prototype.adjustLocations=function(s,E,v,T,d,D,O){E+=T+D,v+=d+O;for(var P=E,F=0;F<s.rows.length;F++){var I=s.rows[F];E=P;for(var Z=0,_=0;_<I.length;_++){var b=I[_];b.rect.x=E,b.rect.y=v,E+=b.rect.width+s.horizontalPadding,b.rect.height>Z&&(Z=b.rect.height)}v+=Z+s.verticalPadding}},x.prototype.tileCompoundMembers=function(s,E){var v=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=E[T];if(v.tiledMemberPack[T]=v.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=v.tiledMemberPack[T].width,d.rect.height=v.tiledMemberPack[T].height,d.setCenter(v.tiledMemberPack[T].centerX,v.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var D=d.rect.width,O=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(D+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>D?(d.rect.x-=(d.labelWidth-D)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-D)/2):d.labelPosHorizontal=="right"&&d.setWidth(D+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(O+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>O?(d.rect.y-=(d.labelHeight-O)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-O)/2):d.labelPosVertical=="bottom"&&d.setHeight(O+d.labelHeight))}})},x.prototype.tileNodes=function(s,E){var v=this.tileNodesByFavoringDim(s,E,!0),T=this.tileNodesByFavoringDim(s,E,!1),d=this.getOrgRatio(v),D=this.getOrgRatio(T),O;return D<d?O=T:O=v,O},x.prototype.getOrgRatio=function(s){var E=s.width,v=s.height,T=E/v;return T<1&&(T=1/T),T},x.prototype.calcIdealRowWidth=function(s,E){var v=h.TILING_PADDING_VERTICAL,T=h.TILING_PADDING_HORIZONTAL,d=s.length,D=0,O=0,P=0;s.forEach(function(V){D+=V.getWidth(),O+=V.getHeight(),V.getWidth()>P&&(P=V.getWidth())});var F=D/d,I=O/d,Z=Math.pow(v-T,2)+4*(F+T)*(I+v)*d,_=(T-v+Math.sqrt(Z))/(2*(F+T)),b;E?(b=Math.ceil(_),b==_&&b++):b=Math.floor(_);var j=b*(F+T)-T;return P>j&&(j=P),j+=T*2,j},x.prototype.tileNodesByFavoringDim=function(s,E,v){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,D=h.TILING_COMPARE_BY,O={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};D&&(O.idealRowWidth=this.calcIdealRowWidth(s,v));var P=function(M){return M.rect.width*M.rect.height},F=function(M,U){return P(U)-P(M)};s.sort(function(V,M){var U=F;return O.idealRowWidth?(U=D,U(V.id,M.id)):U(V,M)});for(var I=0,Z=0,_=0;_<s.length;_++){var b=s[_];I+=b.getCenterX(),Z+=b.getCenterY()}O.centerX=I/s.length,O.centerY=Z/s.length;for(var _=0;_<s.length;_++){var b=s[_];if(O.rows.length==0)this.insertNodeToRow(O,b,0,E);else if(this.canAddHorizontal(O,b.rect.width,b.rect.height)){var j=O.rows.length-1;O.idealRowWidth||(j=this.getShortestRowIndex(O)),this.insertNodeToRow(O,b,j,E)}else this.insertNodeToRow(O,b,O.rows.length,E);this.shiftToLastRow(O)}return O},x.prototype.insertNodeToRow=function(s,E,v,T){var d=T;if(v==s.rows.length){var D=[];s.rows.push(D),s.rowWidth.push(d),s.rowHeight.push(0)}var O=s.rowWidth[v]+E.rect.width;s.rows[v].length>0&&(O+=s.horizontalPadding),s.rowWidth[v]=O,s.width<O&&(s.width=O);var P=E.rect.height;v>0&&(P+=s.verticalPadding);var F=0;P>s.rowHeight[v]&&(F=s.rowHeight[v],s.rowHeight[v]=P,F=s.rowHeight[v]-F),s.height+=F,s.rows[v].push(E)},x.prototype.getShortestRowIndex=function(s){for(var E=-1,v=Number.MAX_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]<v&&(E=T,v=s.rowWidth[T]);return E},x.prototype.getLongestRowIndex=function(s){for(var E=-1,v=Number.MIN_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]>v&&(E=T,v=s.rowWidth[T]);return E},x.prototype.canAddHorizontal=function(s,E,v){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+E+s.horizontalPadding<=s.idealRowWidth}var D=this.getShortestRowIndex(s);if(D<0)return!0;var O=s.rowWidth[D];if(O+s.horizontalPadding+E<=s.width)return!0;var P=0;s.rowHeight[D]<v&&D>0&&(P=v+s.verticalPadding-s.rowHeight[D]);var F;s.width-O>=E+s.horizontalPadding?F=(s.height+P)/(O+E+s.horizontalPadding):F=(s.height+P)/s.width,P=v+s.verticalPadding;var I;return s.width<E?I=(s.height+P)/E:I=(s.height+P)/s.width,I<1&&(I=1/I),F<1&&(F=1/F),F<I},x.prototype.shiftToLastRow=function(s){var E=this.getLongestRowIndex(s),v=s.rowWidth.length-1,T=s.rows[E],d=T[T.length-1],D=d.width+s.horizontalPadding;if(s.width-s.rowWidth[v]>D&&E!=v){T.splice(-1,1),s.rows[v].push(d),s.rowWidth[E]=s.rowWidth[E]-D,s.rowWidth[v]=s.rowWidth[v]+D,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var O=Number.MIN_VALUE,P=0;P<T.length;P++)T[P].height>O&&(O=T[P].height);E>0&&(O+=s.verticalPadding);var F=s.rowHeight[E]+s.rowHeight[v];s.rowHeight[E]=O,s.rowHeight[v]<d.height+s.verticalPadding&&(s.rowHeight[v]=d.height+s.verticalPadding);var I=s.rowHeight[E]+s.rowHeight[v];s.height+=I-F,this.shiftToLastRow(s)}},x.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},x.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},x.prototype.reduceTrees=function(){for(var s=[],E=!0,v;E;){var T=this.graphManager.getAllNodes(),d=[];E=!1;for(var D=0;D<T.length;D++)if(v=T[D],v.getEdges().length==1&&!v.getEdges()[0].isInterGraph&&v.getChild()==null){if(h.PURE_INCREMENTAL){var O=v.getEdges()[0].getOtherEnd(v),P=new C(v.getCenterX()-O.getCenterX(),v.getCenterY()-O.getCenterY());d.push([v,v.getEdges()[0],v.getOwner(),P])}else d.push([v,v.getEdges()[0],v.getOwner()]);E=!0}if(E==!0){for(var F=[],I=0;I<d.length;I++)d[I][0].getEdges().length==1&&(F.push(d[I]),d[I][0].getOwner().remove(d[I][0]));s.push(F),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},x.prototype.growTree=function(s){for(var E=s.length,v=s[E-1],T,d=0;d<v.length;d++)T=v[d],this.findPlaceforPrunedNode(T),T[2].add(T[0]),T[2].add(T[1],T[1].source,T[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},x.prototype.findPlaceforPrunedNode=function(s){var E,v,T=s[0];if(T==s[1].source?v=s[1].target:v=s[1].source,h.PURE_INCREMENTAL)T.setCenter(v.getCenterX()+s[3].getWidth(),v.getCenterY()+s[3].getHeight());else{var d=v.startX,D=v.finishX,O=v.startY,P=v.finishY,F=0,I=0,Z=0,_=0,b=[F,Z,I,_];if(O>0)for(var j=d;j<=D;j++)b[0]+=this.grid[j][O-1].length+this.grid[j][O].length-1;if(D<this.grid.length-1)for(var j=O;j<=P;j++)b[1]+=this.grid[D+1][j].length+this.grid[D][j].length-1;if(P<this.grid[0].length-1)for(var j=d;j<=D;j++)b[2]+=this.grid[j][P+1].length+this.grid[j][P].length-1;if(d>0)for(var j=O;j<=P;j++)b[3]+=this.grid[d-1][j].length+this.grid[d][j].length-1;for(var V=A.MAX_VALUE,M,U,X=0;X<b.length;X++)b[X]<V?(V=b[X],M=1,U=X):b[X]==V&&M++;if(M==3&&V==0)b[0]==0&&b[1]==0&&b[2]==0?E=1:b[0]==0&&b[1]==0&&b[3]==0?E=0:b[0]==0&&b[2]==0&&b[3]==0?E=3:b[1]==0&&b[2]==0&&b[3]==0&&(E=2);else if(M==2&&V==0){var J=Math.floor(Math.random()*2);b[0]==0&&b[1]==0?J==0?E=0:E=1:b[0]==0&&b[2]==0?J==0?E=0:E=2:b[0]==0&&b[3]==0?J==0?E=0:E=3:b[1]==0&&b[2]==0?J==0?E=1:E=2:b[1]==0&&b[3]==0?J==0?E=1:E=3:J==0?E=2:E=3}else if(M==4&&V==0){var J=Math.floor(Math.random()*4);E=J}else E=U;E==0?T.setCenter(v.getCenterX(),v.getCenterY()-v.getHeight()/2-l.DEFAULT_EDGE_LENGTH-T.getHeight()/2):E==1?T.setCenter(v.getCenterX()+v.getWidth()/2+l.DEFAULT_EDGE_LENGTH+T.getWidth()/2,v.getCenterY()):E==2?T.setCenter(v.getCenterX(),v.getCenterY()+v.getHeight()/2+l.DEFAULT_EDGE_LENGTH+T.getHeight()/2):T.setCenter(v.getCenterX()-v.getWidth()/2-l.DEFAULT_EDGE_LENGTH-T.getWidth()/2,v.getCenterY())}},n.exports=x}),991:((n,e,a)=>{var c=a(551).FDLayoutNode,t=a(551).IMath;function g(r,h,f,l){c.call(this,r,h,f,l)}g.prototype=Object.create(c.prototype);for(var i in c)g[i]=c[i];g.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*t.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},g.prototype.propogateDisplacementToChildren=function(r,h){for(var f=this.getChild().getNodes(),l,L=0;L<f.length;L++)l=f[L],l.getChild()==null?(l.displacementX+=r,l.displacementY+=h):l.propogateDisplacementToChildren(r,h)},g.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.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},g.prototype.setPred1=function(r){this.pred1=r},g.prototype.getPred1=function(){return pred1},g.prototype.getPred2=function(){return pred2},g.prototype.setNext=function(r){this.next=r},g.prototype.getNext=function(){return next},g.prototype.setProcessed=function(r){this.processed=r},g.prototype.isProcessed=function(){return processed},n.exports=g}),902:((n,e,a)=>{function c(f){if(Array.isArray(f)){for(var l=0,L=Array(f.length);l<f.length;l++)L[l]=f[l];return L}else return Array.from(f)}var t=a(806),g=a(551).LinkedList,i=a(551).Matrix,r=a(551).SVD;function h(){}h.handleConstraints=function(f){var l={};l.fixedNodeConstraint=f.constraints.fixedNodeConstraint,l.alignmentConstraint=f.constraints.alignmentConstraint,l.relativePlacementConstraint=f.constraints.relativePlacementConstraint;for(var L=new Map,y=new Map,p=[],C=[],R=f.getAllNodes(),A=0,S=0;S<R.length;S++){var B=R[S];B.getChild()==null&&(y.set(B.id,A++),p.push(B.getCenterX()),C.push(B.getCenterY()),L.set(B.id,B))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(G){!G.gap&&G.gap!=0&&(G.left?G.gap=t.DEFAULT_EDGE_LENGTH+L.get(G.left).getWidth()/2+L.get(G.right).getWidth()/2:G.gap=t.DEFAULT_EDGE_LENGTH+L.get(G.top).getHeight()/2+L.get(G.bottom).getHeight()/2)});var Y=function(H,W){return{x:H.x-W.x,y:H.y-W.y}},tt=function(H){var W=0,z=0;return H.forEach(function($){W+=p[y.get($)],z+=C[y.get($)]}),{x:W/H.size,y:z/H.size}},x=function(H,W,z,$,K){function ut(ot,it){var dt=new Set(ot),at=!0,lt=!1,Ft=void 0;try{for(var xt=it[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;dt.add(Dt)}}catch(Nt){lt=!0,Ft=Nt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}return dt}var ft=new Map;H.forEach(function(ot,it){ft.set(it,0)}),H.forEach(function(ot,it){ot.forEach(function(dt){ft.set(dt.id,ft.get(dt.id)+1)})});var q=new Map,ht=new Map,gt=new g;ft.forEach(function(ot,it){ot==0?(gt.push(it),z||(W=="horizontal"?q.set(it,y.has(it)?p[y.get(it)]:$.get(it)):q.set(it,y.has(it)?C[y.get(it)]:$.get(it)))):q.set(it,Number.NEGATIVE_INFINITY),z&&ht.set(it,new Set([it]))}),z&&K.forEach(function(ot){var it=[];if(ot.forEach(function(lt){z.has(lt)&&it.push(lt)}),it.length>0){var dt=0;it.forEach(function(lt){W=="horizontal"?(q.set(lt,y.has(lt)?p[y.get(lt)]:$.get(lt)),dt+=q.get(lt)):(q.set(lt,y.has(lt)?C[y.get(lt)]:$.get(lt)),dt+=q.get(lt))}),dt=dt/it.length,ot.forEach(function(lt){z.has(lt)||q.set(lt,dt)})}else{var at=0;ot.forEach(function(lt){W=="horizontal"?at+=y.has(lt)?p[y.get(lt)]:$.get(lt):at+=y.has(lt)?C[y.get(lt)]:$.get(lt)}),at=at/ot.length,ot.forEach(function(lt){q.set(lt,at)})}});for(var rt=function(){var it=gt.shift(),dt=H.get(it);dt.forEach(function(at){if(q.get(at.id)<q.get(it)+at.gap)if(z&&z.has(at.id)){var lt=void 0;if(W=="horizontal"?lt=y.has(at.id)?p[y.get(at.id)]:$.get(at.id):lt=y.has(at.id)?C[y.get(at.id)]:$.get(at.id),q.set(at.id,lt),lt<q.get(it)+at.gap){var Ft=q.get(it)+at.gap-lt;ht.get(it).forEach(function(xt){q.set(xt,q.get(xt)-Ft)})}}else q.set(at.id,q.get(it)+at.gap);ft.set(at.id,ft.get(at.id)-1),ft.get(at.id)==0&&gt.push(at.id),z&&ht.set(at.id,ut(ht.get(it),ht.get(at.id)))})};gt.length!=0;)rt();if(z){var vt=new Set;H.forEach(function(ot,it){ot.length==0&&vt.add(it)});var At=[];ht.forEach(function(ot,it){if(vt.has(it)){var dt=!1,at=!0,lt=!1,Ft=void 0;try{for(var xt=ot[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;z.has(Dt)&&(dt=!0)}}catch(Rt){lt=!0,Ft=Rt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}if(!dt){var Nt=!1,$t=void 0;At.forEach(function(Rt,Xt){Rt.has([].concat(c(ot))[0])&&(Nt=!0,$t=Xt)}),Nt?ot.forEach(function(Rt){At[$t].add(Rt)}):At.push(new Set(ot))}}}),At.forEach(function(ot,it){var dt=Number.POSITIVE_INFINITY,at=Number.POSITIVE_INFINITY,lt=Number.NEGATIVE_INFINITY,Ft=Number.NEGATIVE_INFINITY,xt=!0,Vt=!1,Dt=void 0;try{for(var Nt=ot[Symbol.iterator](),$t;!(xt=($t=Nt.next()).done);xt=!0){var Rt=$t.value,Xt=void 0;W=="horizontal"?Xt=y.has(Rt)?p[y.get(Rt)]:$.get(Rt):Xt=y.has(Rt)?C[y.get(Rt)]:$.get(Rt);var zt=q.get(Rt);Xt<dt&&(dt=Xt),Xt>lt&&(lt=Xt),zt<at&&(at=zt),zt>Ft&&(Ft=zt)}}catch(_t){Vt=!0,Dt=_t}finally{try{!xt&&Nt.return&&Nt.return()}finally{if(Vt)throw Dt}}var ce=(dt+lt)/2-(at+Ft)/2,qt=!0,Jt=!1,Kt=void 0;try{for(var Qt=ot[Symbol.iterator](),oe;!(qt=(oe=Qt.next()).done);qt=!0){var jt=oe.value;q.set(jt,q.get(jt)+ce)}}catch(_t){Jt=!0,Kt=_t}finally{try{!qt&&Qt.return&&Qt.return()}finally{if(Jt)throw Kt}}})}return q},k=function(H){var W=0,z=0,$=0,K=0;if(H.forEach(function(ht){ht.left?p[y.get(ht.left)]-p[y.get(ht.right)]>=0?W++:z++:C[y.get(ht.top)]-C[y.get(ht.bottom)]>=0?$++:K++}),W>z&&$>K)for(var ut=0;ut<y.size;ut++)p[ut]=-1*p[ut],C[ut]=-1*C[ut];else if(W>z)for(var ft=0;ft<y.size;ft++)p[ft]=-1*p[ft];else if($>K)for(var q=0;q<y.size;q++)C[q]=-1*C[q]},s=function(H){var W=[],z=new g,$=new Set,K=0;return H.forEach(function(ut,ft){if(!$.has(ft)){W[K]=[];var q=ft;for(z.push(q),$.add(q),W[K].push(q);z.length!=0;){q=z.shift();var ht=H.get(q);ht.forEach(function(gt){$.has(gt.id)||(z.push(gt.id),$.add(gt.id),W[K].push(gt.id))})}K++}}),W},E=function(H){var W=new Map;return H.forEach(function(z,$){W.set($,[])}),H.forEach(function(z,$){z.forEach(function(K){W.get($).push(K),W.get(K.id).push({id:$,gap:K.gap,direction:K.direction})})}),W},v=function(H){var W=new Map;return H.forEach(function(z,$){W.set($,[])}),H.forEach(function(z,$){z.forEach(function(K){W.get(K.id).push({id:$,gap:K.gap,direction:K.direction})})}),W},T=[],d=[],D=!1,O=!1,P=new Set,F=new Map,I=new Map,Z=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(G){P.add(G.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(G){G.left?(F.has(G.left)?F.get(G.left).push({id:G.right,gap:G.gap,direction:"horizontal"}):F.set(G.left,[{id:G.right,gap:G.gap,direction:"horizontal"}]),F.has(G.right)||F.set(G.right,[])):(F.has(G.top)?F.get(G.top).push({id:G.bottom,gap:G.gap,direction:"vertical"}):F.set(G.top,[{id:G.bottom,gap:G.gap,direction:"vertical"}]),F.has(G.bottom)||F.set(G.bottom,[]))}),I=E(F),Z=s(I)),t.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(G,H){T[H]=[G.position.x,G.position.y],d[H]=[p[y.get(G.nodeId)],C[y.get(G.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var G=0;if(l.alignmentConstraint.vertical){for(var H=l.alignmentConstraint.vertical,W=function(q){var ht=new Set;H[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(c(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).x,H[q].forEach(function(vt){T[G]=[rt,C[y.get(vt)]],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},z=0;z<H.length;z++)W(z);D=!0}if(l.alignmentConstraint.horizontal){for(var $=l.alignmentConstraint.horizontal,K=function(q){var ht=new Set;$[q].forEach(function(vt){ht.add(vt)});var gt=new Set([].concat(c(ht)).filter(function(vt){return P.has(vt)})),rt=void 0;gt.size>0?rt=p[y.get(gt.values().next().value)]:rt=tt(ht).y,$[q].forEach(function(vt){T[G]=[p[y.get(vt)],rt],d[G]=[p[y.get(vt)],C[y.get(vt)]],G++})},ut=0;ut<$.length;ut++)K(ut);D=!0}l.relativePlacementConstraint&&(O=!0)})();else if(l.relativePlacementConstraint){for(var _=0,b=0,j=0;j<Z.length;j++)Z[j].length>_&&(_=Z[j].length,b=j);if(_<I.size/2)k(l.relativePlacementConstraint),D=!1,O=!1;else{var V=new Map,M=new Map,U=[];Z[b].forEach(function(G){F.get(G).forEach(function(H){H.direction=="horizontal"?(V.has(G)?V.get(G).push(H):V.set(G,[H]),V.has(H.id)||V.set(H.id,[]),U.push({left:G,right:H.id})):(M.has(G)?M.get(G).push(H):M.set(G,[H]),M.has(H.id)||M.set(H.id,[]),U.push({top:G,bottom:H.id}))})}),k(U),O=!1;var X=x(V,"horizontal"),J=x(M,"vertical");Z[b].forEach(function(G,H){d[H]=[p[y.get(G)],C[y.get(G)]],T[H]=[],X.has(G)?T[H][0]=X.get(G):T[H][0]=p[y.get(G)],J.has(G)?T[H][1]=J.get(G):T[H][1]=C[y.get(G)]}),D=!0}}if(D){for(var st=void 0,Lt=i.transpose(T),St=i.transpose(d),Q=0;Q<Lt.length;Q++)Lt[Q]=i.multGamma(Lt[Q]),St[Q]=i.multGamma(St[Q]);var Ut=i.multMat(Lt,i.transpose(St)),wt=r.svd(Ut);st=i.multMat(wt.V,i.transpose(wt.U));for(var nt=0;nt<y.size;nt++){var et=[p[nt],C[nt]],pt=[st[0][0],st[1][0]],Et=[st[0][1],st[1][1]];p[nt]=i.dotProduct(et,pt),C[nt]=i.dotProduct(et,Et)}O&&k(l.relativePlacementConstraint)}}if(t.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var Ct={x:0,y:0};l.fixedNodeConstraint.forEach(function(G,H){var W={x:p[y.get(G.nodeId)],y:C[y.get(G.nodeId)]},z=G.position,$=Y(z,W);Ct.x+=$.x,Ct.y+=$.y}),Ct.x/=l.fixedNodeConstraint.length,Ct.y/=l.fixedNodeConstraint.length,p.forEach(function(G,H){p[H]+=Ct.x}),C.forEach(function(G,H){C[H]+=Ct.y}),l.fixedNodeConstraint.forEach(function(G){p[y.get(G.nodeId)]=G.position.x,C[y.get(G.nodeId)]=G.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var mt=l.alignmentConstraint.vertical,Tt=function(H){var W=new Set;mt[H].forEach(function(K){W.add(K)});var z=new Set([].concat(c(W)).filter(function(K){return P.has(K)})),$=void 0;z.size>0?$=p[y.get(z.values().next().value)]:$=tt(W).x,W.forEach(function(K){P.has(K)||(p[y.get(K)]=$)})},Ot=0;Ot<mt.length;Ot++)Tt(Ot);if(l.alignmentConstraint.horizontal)for(var It=l.alignmentConstraint.horizontal,Wt=function(H){var W=new Set;It[H].forEach(function(K){W.add(K)});var z=new Set([].concat(c(W)).filter(function(K){return P.has(K)})),$=void 0;z.size>0?$=C[y.get(z.values().next().value)]:$=tt(W).y,W.forEach(function(K){P.has(K)||(C[y.get(K)]=$)})},Pt=0;Pt<It.length;Pt++)Wt(Pt)}l.relativePlacementConstraint&&(function(){var G=new Map,H=new Map,W=new Map,z=new Map,$=new Map,K=new Map,ut=new Set,ft=new Set;if(P.forEach(function(Gt){ut.add(Gt),ft.add(Gt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var q=l.alignmentConstraint.vertical,ht=function(yt){W.set("dummy"+yt,[]),q[yt].forEach(function(Mt){G.set(Mt,"dummy"+yt),W.get("dummy"+yt).push(Mt),P.has(Mt)&&ut.add("dummy"+yt)}),$.set("dummy"+yt,p[y.get(q[yt][0])])},gt=0;gt<q.length;gt++)ht(gt);if(l.alignmentConstraint.horizontal)for(var rt=l.alignmentConstraint.horizontal,vt=function(yt){z.set("dummy"+yt,[]),rt[yt].forEach(function(Mt){H.set(Mt,"dummy"+yt),z.get("dummy"+yt).push(Mt),P.has(Mt)&&ft.add("dummy"+yt)}),K.set("dummy"+yt,C[y.get(rt[yt][0])])},At=0;At<rt.length;At++)vt(At)}var ot=new Map,it=new Map,dt=function(yt){F.get(yt).forEach(function(Mt){var Zt=void 0,Bt=void 0;Mt.direction=="horizontal"?(Zt=G.get(yt)?G.get(yt):yt,G.get(Mt.id)?Bt={id:G.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:Bt=Mt,ot.has(Zt)?ot.get(Zt).push(Bt):ot.set(Zt,[Bt]),ot.has(Bt.id)||ot.set(Bt.id,[])):(Zt=H.get(yt)?H.get(yt):yt,H.get(Mt.id)?Bt={id:H.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:Bt=Mt,it.has(Zt)?it.get(Zt).push(Bt):it.set(Zt,[Bt]),it.has(Bt.id)||it.set(Bt.id,[]))})},at=!0,lt=!1,Ft=void 0;try{for(var xt=F.keys()[Symbol.iterator](),Vt;!(at=(Vt=xt.next()).done);at=!0){var Dt=Vt.value;dt(Dt)}}catch(Gt){lt=!0,Ft=Gt}finally{try{!at&&xt.return&&xt.return()}finally{if(lt)throw Ft}}var Nt=E(ot),$t=E(it),Rt=s(Nt),Xt=s($t),zt=v(ot),ce=v(it),qt=[],Jt=[];Rt.forEach(function(Gt,yt){qt[yt]=[],Gt.forEach(function(Mt){zt.get(Mt).length==0&&qt[yt].push(Mt)})}),Xt.forEach(function(Gt,yt){Jt[yt]=[],Gt.forEach(function(Mt){ce.get(Mt).length==0&&Jt[yt].push(Mt)})});var Kt=x(ot,"horizontal",ut,$,qt),Qt=x(it,"vertical",ft,K,Jt),oe=function(yt){W.get(yt)?W.get(yt).forEach(function(Mt){p[y.get(Mt)]=Kt.get(yt)}):p[y.get(yt)]=Kt.get(yt)},jt=!0,_t=!1,we=void 0;try{for(var ge=Kt.keys()[Symbol.iterator](),Oe;!(jt=(Oe=ge.next()).done);jt=!0){var ue=Oe.value;oe(ue)}}catch(Gt){_t=!0,we=Gt}finally{try{!jt&&ge.return&&ge.return()}finally{if(_t)throw we}}var gr=function(yt){z.get(yt)?z.get(yt).forEach(function(Mt){C[y.get(Mt)]=Qt.get(yt)}):C[y.get(yt)]=Qt.get(yt)},de=!0,De=!1,xe=void 0;try{for(var ve=Qt.keys()[Symbol.iterator](),Ie;!(de=(Ie=ve.next()).done);de=!0){var ue=Ie.value;gr(ue)}}catch(Gt){De=!0,xe=Gt}finally{try{!de&&ve.return&&ve.return()}finally{if(De)throw xe}}})()}for(var Yt=0;Yt<R.length;Yt++){var bt=R[Yt];bt.getChild()==null&&bt.setCenter(p[y.get(bt.id)],C[y.get(bt.id)])}},n.exports=h}),551:(n=>{n.exports=m})},N={};function u(n){var e=N[n];if(e!==void 0)return e.exports;var a=N[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(45);return o})()})});var Je=pe((ae,Ce)=>{(function(w,N){typeof ae=="object"&&typeof Ce=="object"?Ce.exports=N(Le()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof ae=="object"?ae.cytoscapeFcose=N(Le()):w.cytoscapeFcose=N(w.coseBase)})(ae,function(m){return(()=>{"use strict";var w={658:(n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var a=arguments.length,c=Array(a>1?a-1:0),t=1;t<a;t++)c[t-1]=arguments[t];return c.forEach(function(g){Object.keys(g).forEach(function(i){return e[i]=g[i]})}),e}}),548:((n,e,a)=>{var c=(function(){function i(r,h){var f=[],l=!0,L=!1,y=void 0;try{for(var p=r[Symbol.iterator](),C;!(l=(C=p.next()).done)&&(f.push(C.value),!(h&&f.length===h));l=!0);}catch(R){L=!0,y=R}finally{try{!l&&p.return&&p.return()}finally{if(L)throw y}}return f}return function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),t=a(140).layoutBase.LinkedList,g={};g.getTopMostNodes=function(i){for(var r={},h=0;h<i.length;h++)r[i[h].id()]=!0;var f=i.filter(function(l,L){typeof l=="number"&&(l=L);for(var y=l.parent()[0];y!=null;){if(r[y.id()])return!1;y=y.parent()[0]}return!0});return f},g.connectComponents=function(i,r,h,f){var l=new t,L=new Set,y=[],p=void 0,C=void 0,R=void 0,A=!1,S=1,B=[],Y=[],tt=function(){var k=i.collection();Y.push(k);var s=h[0],E=i.collection();E.merge(s).merge(s.descendants().intersection(r)),y.push(s),E.forEach(function(d){l.push(d),L.add(d),k.merge(d)});for(var v=function(){s=l.shift();var D=i.collection();s.neighborhood().nodes().forEach(function(I){r.intersection(s.edgesWith(I)).length>0&&D.merge(I)});for(var O=0;O<D.length;O++){var P=D[O];if(p=h.intersection(P.union(P.ancestors())),p!=null&&!L.has(p[0])){var F=p.union(p.descendants());F.forEach(function(I){l.push(I),L.add(I),k.merge(I),h.has(I)&&y.push(I)})}}};l.length!=0;)v();if(k.forEach(function(d){r.intersection(d.connectedEdges()).forEach(function(D){k.has(D.source())&&k.has(D.target())&&k.merge(D)})}),y.length==h.length&&(A=!0),!A||A&&S>1){C=y[0],R=C.connectedEdges().length,y.forEach(function(d){d.connectedEdges().length<R&&(R=d.connectedEdges().length,C=d)}),B.push(C.id());var T=i.collection();T.merge(y[0]),y.forEach(function(d){T.merge(d)}),y=[],h=h.difference(T),S++}};do tt();while(!A);return f&&B.length>0&&f.set("dummy"+(f.size+1),B),Y},g.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var p=!0,C=!1,R=void 0;try{for(var A=r.nodeIndexes[Symbol.iterator](),S;!(p=(S=A.next()).done);p=!0){var B=S.value,Y=c(B,2),tt=Y[0],x=Y[1],k=h.cy.getElementById(tt);if(k){var s=k.boundingBox(),E=r.xCoords[x]-s.w/2,v=r.xCoords[x]+s.w/2,T=r.yCoords[x]-s.h/2,d=r.yCoords[x]+s.h/2;E<f&&(f=E),v>l&&(l=v),T<L&&(L=T),d>y&&(y=d)}}}catch(I){C=!0,R=I}finally{try{!p&&A.return&&A.return()}finally{if(C)throw R}}var D=i.x-(l+f)/2,O=i.y-(y+L)/2;r.xCoords=r.xCoords.map(function(I){return I+D}),r.yCoords=r.yCoords.map(function(I){return I+O})}else{Object.keys(r).forEach(function(I){var Z=r[I],_=Z.getRect().x,b=Z.getRect().x+Z.getRect().width,j=Z.getRect().y,V=Z.getRect().y+Z.getRect().height;_<f&&(f=_),b>l&&(l=b),j<L&&(L=j),V>y&&(y=V)});var P=i.x-(l+f)/2,F=i.y-(y+L)/2;Object.keys(r).forEach(function(I){var Z=r[I];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+F)})}}},g.calcBoundingBox=function(i,r,h,f){for(var l=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,C=void 0,R=void 0,A=void 0,S=void 0,B=i.descendants().not(":parent"),Y=B.length,tt=0;tt<Y;tt++){var x=B[tt];C=r[f.get(x.id())]-x.width()/2,R=r[f.get(x.id())]+x.width()/2,A=h[f.get(x.id())]-x.height()/2,S=h[f.get(x.id())]+x.height()/2,l>C&&(l=C),L<R&&(L=R),y>A&&(y=A),p<S&&(p=S)}var k={};return k.topLeftX=l,k.topLeftY=y,k.width=L-l,k.height=p-y,k},g.calcParentsWithoutChildren=function(i,r){var h=i.collection();return r.nodes(":parent").forEach(function(f){var l=!1;f.children().forEach(function(L){L.css("display")!="none"&&(l=!0)}),l||h.merge(f)}),h},n.exports=g}),816:((n,e,a)=>{var c=a(548),t=a(140).CoSELayout,g=a(140).CoSENode,i=a(140).layoutBase.PointD,r=a(140).layoutBase.DimensionD,h=a(140).layoutBase.LayoutConstants,f=a(140).layoutBase.FDLayoutConstants,l=a(140).CoSEConstants,L=function(p,C){var R=p.cy,A=p.eles,S=A.nodes(),B=A.edges(),Y=void 0,tt=void 0,x=void 0,k={};p.randomize&&(Y=C.nodeIndexes,tt=C.xCoords,x=C.yCoords);var s=function(I){return typeof I=="function"},E=function(I,Z){return s(I)?I(Z):I},v=c.calcParentsWithoutChildren(R,A),T=function F(I,Z,_,b){for(var j=Z.length,V=0;V<j;V++){var M=Z[V],U=null;M.intersection(v).length==0&&(U=M.children());var X=void 0,J=M.layoutDimensions({nodeDimensionsIncludeLabels:b.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(b.randomize)if(!M.isParent())X=I.add(new g(_.graphManager,new i(tt[Y.get(M.id())]-J.w/2,x[Y.get(M.id())]-J.h/2),new r(parseFloat(J.w),parseFloat(J.h))));else{var st=c.calcBoundingBox(M,tt,x,Y);M.intersection(v).length==0?X=I.add(new g(_.graphManager,new i(st.topLeftX,st.topLeftY),new r(st.width,st.height))):X=I.add(new g(_.graphManager,new i(st.topLeftX,st.topLeftY),new r(parseFloat(J.w),parseFloat(J.h))))}else X=I.add(new g(_.graphManager,new i(M.position("x")-J.w/2,M.position("y")-J.h/2),new r(parseFloat(J.w),parseFloat(J.h))));else X=I.add(new g(this.graphManager));if(X.id=M.data("id"),X.nodeRepulsion=E(b.nodeRepulsion,M),X.paddingLeft=parseInt(M.css("padding")),X.paddingTop=parseInt(M.css("padding")),X.paddingRight=parseInt(M.css("padding")),X.paddingBottom=parseInt(M.css("padding")),b.nodeDimensionsIncludeLabels&&(X.labelWidth=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,X.labelHeight=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,X.labelPosVertical=M.css("text-valign"),X.labelPosHorizontal=M.css("text-halign")),k[M.data("id")]=X,isNaN(X.rect.x)&&(X.rect.x=0),isNaN(X.rect.y)&&(X.rect.y=0),U!=null&&U.length>0){var Lt=void 0;Lt=_.getGraphManager().add(_.newGraph(),X),F(Lt,U,_,b)}}},d=function(I,Z,_){for(var b=0,j=0,V=0;V<_.length;V++){var M=_[V],U=k[M.data("source")],X=k[M.data("target")];if(U&&X&&U!==X&&U.getEdgesBetween(X).length==0){var J=Z.add(I.newEdge(),U,X);J.id=M.id(),J.idealLength=E(p.idealEdgeLength,M),J.edgeElasticity=E(p.edgeElasticity,M),b+=J.idealLength,j++}}p.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=b/j:s(p.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=p.idealEdgeLength,l.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)},D=function(I,Z){Z.fixedNodeConstraint&&(I.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(I.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(I.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)};p.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(l.MAX_ITERATIONS=f.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=p.tilingCompareBy),p.quality=="proof"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!p.randomize,l.ANIMATE=f.ANIMATE=h.ANIMATE=p.animate,l.TILE=p.tile,l.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!p.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=p.uniformNodeDimensions,p.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),p.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),p.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),p.step=="all"&&(p.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),p.fixedNodeConstraint||p.alignmentConstraint||p.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new t,P=O.newGraphManager();return T(P.addRoot(),c.getTopMostNodes(S),O,p),d(O,P,B),D(O,p),O.runLayout(),k};n.exports={coseLayout:L}}),212:((n,e,a)=>{var c=(function(){function p(C,R){for(var A=0;A<R.length;A++){var S=R[A];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(C,S.key,S)}}return function(C,R,A){return R&&p(C.prototype,R),A&&p(C,A),C}})();function t(p,C){if(!(p instanceof C))throw new TypeError("Cannot call a class as a function")}var g=a(658),i=a(548),r=a(657),h=r.spectralLayout,f=a(816),l=f.coseLayout,L=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:function(C){return 4500},idealEdgeLength:function(C){return 50},edgeElasticity:function(C){return .45},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:function(){},stop:function(){}}),y=(function(){function p(C){t(this,p),this.options=g({},L,C)}return c(p,[{key:"run",value:function(){var R=this,A=this.options,S=A.cy,B=A.eles,Y=[],tt=void 0,x=void 0,k=[],s=void 0,E=[];A.fixedNodeConstraint&&(!Array.isArray(A.fixedNodeConstraint)||A.fixedNodeConstraint.length==0)&&(A.fixedNodeConstraint=void 0),A.alignmentConstraint&&(A.alignmentConstraint.vertical&&(!Array.isArray(A.alignmentConstraint.vertical)||A.alignmentConstraint.vertical.length==0)&&(A.alignmentConstraint.vertical=void 0),A.alignmentConstraint.horizontal&&(!Array.isArray(A.alignmentConstraint.horizontal)||A.alignmentConstraint.horizontal.length==0)&&(A.alignmentConstraint.horizontal=void 0)),A.relativePlacementConstraint&&(!Array.isArray(A.relativePlacementConstraint)||A.relativePlacementConstraint.length==0)&&(A.relativePlacementConstraint=void 0);var v=A.fixedNodeConstraint||A.alignmentConstraint||A.relativePlacementConstraint;v&&(A.tile=!1,A.packComponents=!1);var T=void 0,d=!1;if(S.layoutUtilities&&A.packComponents&&(T=S.layoutUtilities("get"),T||(T=S.layoutUtilities()),d=!0),B.nodes().length>0)if(d){var P=i.getTopMostNodes(A.eles.nodes());if(s=i.connectComponents(S,A.eles,P),s.forEach(function(nt){var et=nt.boundingBox();E.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),A.randomize&&s.forEach(function(nt){A.eles=nt,Y.push(h(A))}),A.quality=="default"||A.quality=="proof"){var F=S.collection();if(A.tile){var I=new Map,Z=[],_=[],b=0,j={nodeIndexes:I,xCoords:Z,yCoords:_},V=[];if(s.forEach(function(nt,et){nt.edges().length==0&&(nt.nodes().forEach(function(pt,Et){F.merge(nt.nodes()[Et]),pt.isParent()||(j.nodeIndexes.set(nt.nodes()[Et].id(),b++),j.xCoords.push(nt.nodes()[0].position().x),j.yCoords.push(nt.nodes()[0].position().y))}),V.push(et))}),F.length>1){var M=F.boundingBox();E.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(F),Y.push(j);for(var U=V.length-1;U>=0;U--)s.splice(V[U],1),Y.splice(V[U],1),E.splice(V[U],1)}}s.forEach(function(nt,et){A.eles=nt,k.push(l(A,Y[et])),i.relocateComponent(E[et],k[et],A)})}else s.forEach(function(nt,et){i.relocateComponent(E[et],Y[et],A)});var X=new Set;if(s.length>1){var J=[],st=B.filter(function(nt){return nt.css("display")=="none"});s.forEach(function(nt,et){var pt=void 0;if(A.quality=="draft"&&(pt=Y[et].nodeIndexes),nt.nodes().not(st).length>0){var Et={};Et.edges=[],Et.nodes=[];var Ct=void 0;nt.nodes().not(st).forEach(function(mt){if(A.quality=="draft")if(!mt.isParent())Ct=pt.get(mt.id()),Et.nodes.push({x:Y[et].xCoords[Ct]-mt.boundingbox().w/2,y:Y[et].yCoords[Ct]-mt.boundingbox().h/2,width:mt.boundingbox().w,height:mt.boundingbox().h});else{var Tt=i.calcBoundingBox(mt,Y[et].xCoords,Y[et].yCoords,pt);Et.nodes.push({x:Tt.topLeftX,y:Tt.topLeftY,width:Tt.width,height:Tt.height})}else k[et][mt.id()]&&Et.nodes.push({x:k[et][mt.id()].getLeft(),y:k[et][mt.id()].getTop(),width:k[et][mt.id()].getWidth(),height:k[et][mt.id()].getHeight()})}),nt.edges().forEach(function(mt){var Tt=mt.source(),Ot=mt.target();if(Tt.css("display")!="none"&&Ot.css("display")!="none")if(A.quality=="draft"){var It=pt.get(Tt.id()),Wt=pt.get(Ot.id()),Pt=[],Yt=[];if(Tt.isParent()){var bt=i.calcBoundingBox(Tt,Y[et].xCoords,Y[et].yCoords,pt);Pt.push(bt.topLeftX+bt.width/2),Pt.push(bt.topLeftY+bt.height/2)}else Pt.push(Y[et].xCoords[It]),Pt.push(Y[et].yCoords[It]);if(Ot.isParent()){var G=i.calcBoundingBox(Ot,Y[et].xCoords,Y[et].yCoords,pt);Yt.push(G.topLeftX+G.width/2),Yt.push(G.topLeftY+G.height/2)}else Yt.push(Y[et].xCoords[Wt]),Yt.push(Y[et].yCoords[Wt]);Et.edges.push({startX:Pt[0],startY:Pt[1],endX:Yt[0],endY:Yt[1]})}else k[et][Tt.id()]&&k[et][Ot.id()]&&Et.edges.push({startX:k[et][Tt.id()].getCenterX(),startY:k[et][Tt.id()].getCenterY(),endX:k[et][Ot.id()].getCenterX(),endY:k[et][Ot.id()].getCenterY()})}),Et.nodes.length>0&&(J.push(Et),X.add(et))}});var Lt=T.packComponents(J,A.randomize).shifts;if(A.quality=="draft")Y.forEach(function(nt,et){var pt=nt.xCoords.map(function(Ct){return Ct+Lt[et].dx}),Et=nt.yCoords.map(function(Ct){return Ct+Lt[et].dy});nt.xCoords=pt,nt.yCoords=Et});else{var St=0;X.forEach(function(nt){Object.keys(k[nt]).forEach(function(et){var pt=k[nt][et];pt.setCenter(pt.getCenterX()+Lt[St].dx,pt.getCenterY()+Lt[St].dy)}),St++})}}}else{var D=A.eles.boundingBox();if(E.push({x:D.x1+D.w/2,y:D.y1+D.h/2}),A.randomize){var O=h(A);Y.push(O)}A.quality=="default"||A.quality=="proof"?(k.push(l(A,Y[0])),i.relocateComponent(E[0],k[0],A)):i.relocateComponent(E[0],Y[0],A)}var Q=function(et,pt){if(A.quality=="default"||A.quality=="proof"){typeof et=="number"&&(et=pt);var Et=void 0,Ct=void 0,mt=et.data("id");return k.forEach(function(Ot){mt in Ot&&(Et={x:Ot[mt].getRect().getCenterX(),y:Ot[mt].getRect().getCenterY()},Ct=Ot[mt])}),A.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Et.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Et.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Et.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Et.y-=Ct.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var Tt=void 0;return Y.forEach(function(Ot){var It=Ot.nodeIndexes.get(et.id());It!=null&&(Tt={x:Ot.xCoords[It],y:Ot.yCoords[It]})}),Tt==null&&(Tt={x:et.position("x"),y:et.position("y")}),{x:Tt.x,y:Tt.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var Ut=i.calcParentsWithoutChildren(S,B),wt=B.filter(function(nt){return nt.css("display")=="none"});A.eles=B.not(wt),B.nodes().not(":parent").not(wt).layoutPositions(R,A,Q),Ut.length>0&&Ut.forEach(function(nt){nt.position(Q(nt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),p})();n.exports=y}),657:((n,e,a)=>{var c=a(548),t=a(140).layoutBase.Matrix,g=a(140).layoutBase.SVD,i=function(h){var f=h.cy,l=h.eles,L=l.nodes(),y=l.nodes(":parent"),p=new Map,C=new Map,R=new Map,A=[],S=[],B=[],Y=[],tt=[],x=[],k=[],s=[],E=void 0,v=void 0,T=1e8,d=1e-9,D=h.piTol,O=h.samplingType,P=h.nodeSeparation,F=void 0,I=function(){for(var W=0,z=0,$=!1;z<F;){W=Math.floor(Math.random()*v),$=!1;for(var K=0;K<z;K++)if(Y[K]==W){$=!0;break}if(!$)Y[z]=W,z++;else continue}},Z=function(W,z,$){for(var K=[],ut=0,ft=0,q=0,ht=void 0,gt=[],rt=0,vt=1,At=0;At<v;At++)gt[At]=T;for(K[ft]=W,gt[W]=0;ft>=ut;){q=K[ut++];for(var ot=A[q],it=0;it<ot.length;it++)ht=C.get(ot[it]),gt[ht]==T&&(gt[ht]=gt[q]+1,K[++ft]=ht);x[q][z]=gt[q]*P}if($){for(var dt=0;dt<v;dt++)x[dt][z]<tt[dt]&&(tt[dt]=x[dt][z]);for(var at=0;at<v;at++)tt[at]>rt&&(rt=tt[at],vt=at)}return vt},_=function(W){var z=void 0;if(W){z=Math.floor(Math.random()*v),E=z;for(var K=0;K<v;K++)tt[K]=T;for(var ut=0;ut<F;ut++)Y[ut]=z,z=Z(z,ut,W)}else{I();for(var $=0;$<F;$++)Z(Y[$],$,W,!1)}for(var ft=0;ft<v;ft++)for(var q=0;q<F;q++)x[ft][q]*=x[ft][q];for(var ht=0;ht<F;ht++)k[ht]=[];for(var gt=0;gt<F;gt++)for(var rt=0;rt<F;rt++)k[gt][rt]=x[Y[rt]][gt]},b=function(){for(var W=g.svd(k),z=W.S,$=W.U,K=W.V,ut=z[0]*z[0]*z[0],ft=[],q=0;q<F;q++){ft[q]=[];for(var ht=0;ht<F;ht++)ft[q][ht]=0,q==ht&&(ft[q][ht]=z[q]/(z[q]*z[q]+ut/(z[q]*z[q])))}s=t.multMat(t.multMat(K,ft),t.transpose($))},j=function(){for(var W=void 0,z=void 0,$=[],K=[],ut=[],ft=[],q=0;q<v;q++)$[q]=Math.random(),K[q]=Math.random();$=t.normalize($),K=t.normalize(K);for(var ht=0,gt=d,rt=d,vt=void 0;;){ht++;for(var At=0;At<v;At++)ut[At]=$[At];if($=t.multGamma(t.multL(t.multGamma(ut),x,s)),W=t.dotProduct(ut,$),$=t.normalize($),gt=t.dotProduct(ut,$),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var ot=0;ot<v;ot++)ut[ot]=$[ot];for(ht=0,rt=d;;){ht++;for(var it=0;it<v;it++)ft[it]=K[it];if(ft=t.minusOp(ft,t.multCons(ut,t.dotProduct(ut,ft))),K=t.multGamma(t.multL(t.multGamma(ft),x,s)),z=t.dotProduct(ft,K),K=t.normalize(K),gt=t.dotProduct(ft,K),vt=Math.abs(gt/rt),vt<=1+D&&vt>=1)break;rt=gt}for(var dt=0;dt<v;dt++)ft[dt]=K[dt];S=t.multCons(ut,Math.sqrt(Math.abs(W))),B=t.multCons(ft,Math.sqrt(Math.abs(z)))};c.connectComponents(f,l,c.getTopMostNodes(L),p),y.forEach(function(H){c.connectComponents(f,l,c.getTopMostNodes(H.descendants().intersection(l)),p)});for(var V=0,M=0;M<L.length;M++)L[M].isParent()||C.set(L[M].id(),V++);var U=!0,X=!1,J=void 0;try{for(var st=p.keys()[Symbol.iterator](),Lt;!(U=(Lt=st.next()).done);U=!0){var St=Lt.value;C.set(St,V++)}}catch(H){X=!0,J=H}finally{try{!U&&st.return&&st.return()}finally{if(X)throw J}}for(var Q=0;Q<C.size;Q++)A[Q]=[];y.forEach(function(H){for(var W=H.children().intersection(l);W.nodes(":childless").length==0;)W=W.nodes()[0].children().intersection(l);var z=0,$=W.nodes(":childless")[0].connectedEdges().length;W.nodes(":childless").forEach(function(K,ut){K.connectedEdges().length<$&&($=K.connectedEdges().length,z=ut)}),R.set(H.id(),W.nodes(":childless")[z].id())}),L.forEach(function(H){var W=void 0;H.isParent()?W=C.get(R.get(H.id())):W=C.get(H.id()),H.neighborhood().nodes().forEach(function(z){l.intersection(H.edgesWith(z)).length>0&&(z.isParent()?A[W].push(R.get(z.id())):A[W].push(z.id()))})});var Ut=function(W){var z=C.get(W),$=void 0;p.get(W).forEach(function(K){f.getElementById(K).isParent()?$=R.get(K):$=K,A[z].push($),A[C.get($)].push(W)})},wt=!0,nt=!1,et=void 0;try{for(var pt=p.keys()[Symbol.iterator](),Et;!(wt=(Et=pt.next()).done);wt=!0){var Ct=Et.value;Ut(Ct)}}catch(H){nt=!0,et=H}finally{try{!wt&&pt.return&&pt.return()}finally{if(nt)throw et}}v=C.size;var mt=void 0;if(v>2){F=v<h.sampleSize?v:h.sampleSize;for(var Tt=0;Tt<v;Tt++)x[Tt]=[];for(var Ot=0;Ot<F;Ot++)s[Ot]=[];return h.quality=="draft"||h.step=="all"?(_(O),b(),j(),mt={nodeIndexes:C,xCoords:S,yCoords:B}):(C.forEach(function(H,W){S.push(f.getElementById(W).position("x")),B.push(f.getElementById(W).position("y"))}),mt={nodeIndexes:C,xCoords:S,yCoords:B}),mt}else{var It=C.keys(),Wt=f.getElementById(It.next().value),Pt=Wt.position(),Yt=Wt.outerWidth();if(S.push(Pt.x),B.push(Pt.y),v==2){var bt=f.getElementById(It.next().value),G=bt.outerWidth();S.push(Pt.x+Yt/2+G/2+h.idealEdgeLength),B.push(Pt.y)}return mt={nodeIndexes:C,xCoords:S,yCoords:B},mt}};n.exports={spectralLayout:i}}),579:((n,e,a)=>{var c=a(212),t=function(i){i&&i("layout","fcose",c)};typeof cytoscape<"u"&&t(cytoscape),n.exports=t}),140:(n=>{n.exports=m})},N={};function u(n){var e=N[n];if(e!==void 0)return e.exports;var a=N[n]={exports:{}};return w[n](a,a.exports,u),a.exports}var o=u(579);return o})()})});var ir=ur(Je(),1);var Ke={L:"left",R:"right",T:"top",B:"bottom"},je={L:ct(m=>`${m},${m/2} 0,${m} 0,0`,"L"),R:ct(m=>`0,${m/2} ${m},0 ${m},${m}`,"R"),T:ct(m=>`0,0 ${m},0 ${m/2},${m}`,"T"),B:ct(m=>`${m/2},0 ${m},${m} 0,${m}`,"B")},fe={L:ct((m,w)=>m-w+2,"L"),R:ct((m,w)=>m-2,"R"),T:ct((m,w)=>m-w+2,"T"),B:ct((m,w)=>m-2,"B")},dr=ct(function(m){return Ht(m)?m==="L"?"R":"L":m==="T"?"B":"T"},"getOppositeArchitectureDirection"),_e=ct(function(m){let w=m;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Ht=ct(function(m){let w=m;return w==="L"||w==="R"},"isArchitectureDirectionX"),kt=ct(function(m){let w=m;return w==="T"||w==="B"},"isArchitectureDirectionY"),Me=ct(function(m,w){let N=Ht(m)&&kt(w),u=kt(m)&&Ht(w);return N||u},"isArchitectureDirectionXY"),vr=ct(function(m){let w=m[0],N=m[1],u=Ht(w)&&kt(N),o=kt(w)&&Ht(N);return u||o},"isArchitecturePairXY"),pr=ct(function(m){return m!=="LL"&&m!=="RR"&&m!=="TT"&&m!=="BB"},"isValidArchitectureDirectionPair"),Ae=ct(function(m,w){let N=`${m}${w}`;return pr(N)?N:void 0},"getArchitectureDirectionPair"),yr=ct(function([m,w],N){let u=N[0],o=N[1];return Ht(u)?kt(o)?[m+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[m+(u==="L"?-1:1),w]:Ht(o)?[m+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[m,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Er=ct(function(m){return m==="LT"||m==="TL"?[1,1]:m==="BL"||m==="LB"?[1,-1]:m==="BR"||m==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),mr=ct(function(m,w){return Me(m,w)?"bend":Ht(m)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Tr=ct(function(m){return m.type==="service"},"isArchitectureService"),Nr=ct(function(m){return m.type==="junction"},"isArchitectureJunction"),tr=ct(m=>m.data(),"edgeData"),ee=ct(m=>m.data(),"nodeData"),Lr=Re.architecture,er=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Ge,this.getAccTitle=Ue,this.setDiagramTitle=He,this.getDiagramTitle=We,this.getAccDescription=Xe,this.setAccDescription=Ye,this.clear()}static{ct(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Pe()}addService({id:m,icon:w,in:N,title:u,iconText:o}){if(this.registeredIds[m]!==void 0)throw new Error(`The service id [${m}] is already in use by another ${this.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The service [${m}] cannot be placed within itself`);if(this.registeredIds[N]===void 0)throw new Error(`The service [${m}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[N]==="node")throw new Error(`The service [${m}]'s parent is not a group`)}this.registeredIds[m]="node",this.nodes[m]={id:m,type:"service",icon:w,iconText:o,title:u,edges:[],in:N}}getServices(){return Object.values(this.nodes).filter(Tr)}addJunction({id:m,in:w}){this.registeredIds[m]="node",this.nodes[m]={id:m,type:"junction",edges:[],in:w}}getJunctions(){return Object.values(this.nodes).filter(Nr)}getNodes(){return Object.values(this.nodes)}getNode(m){return this.nodes[m]??null}addGroup({id:m,icon:w,in:N,title:u}){if(this.registeredIds?.[m]!==void 0)throw new Error(`The group id [${m}] is already in use by another ${this.registeredIds[m]}`);if(N!==void 0){if(m===N)throw new Error(`The group [${m}] cannot be placed within itself`);if(this.registeredIds?.[N]===void 0)throw new Error(`The group [${m}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[N]==="node")throw new Error(`The group [${m}]'s parent is not a group`)}this.registeredIds[m]="group",this.groups[m]={id:m,icon:w,title:u,in:N}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:m,rhsId:w,lhsDir:N,rhsDir:u,lhsInto:o,rhsInto:n,lhsGroup:e,rhsGroup:a,title:c}){if(!_e(N))throw new Error(`Invalid direction given for left hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${String(N)}`);if(!_e(u))throw new Error(`Invalid direction given for right hand side of edge ${m}--${w}. Expected (L,R,T,B) got ${String(u)}`);if(this.nodes[m]===void 0&&this.groups[m]===void 0)throw new Error(`The left-hand id [${m}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[w]===void 0&&this.groups[w]===void 0)throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);let t=this.nodes[m].in,g=this.nodes[w].in;if(e&&t&&g&&t==g)throw new Error(`The left-hand id [${m}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(a&&t&&g&&t==g)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:m,lhsDir:N,lhsInto:o,lhsGroup:e,rhsId:w,rhsDir:u,rhsInto:n,rhsGroup:a,title:c};this.edges.push(i),this.nodes[m]&&this.nodes[w]&&(this.nodes[m].edges.push(this.edges[this.edges.length-1]),this.nodes[w].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let m={},w=Object.entries(this.nodes).reduce((a,[c,t])=>(a[c]=t.edges.reduce((g,i)=>{let r=this.getNode(i.lhsId)?.in,h=this.getNode(i.rhsId)?.in;if(r&&h&&r!==h){let f=mr(i.lhsDir,i.rhsDir);f!=="bend"&&(m[r]??={},m[r][h]=f,m[h]??={},m[h][r]=f)}if(i.lhsId===c){let f=Ae(i.lhsDir,i.rhsDir);f&&(g[f]=i.rhsId)}else{let f=Ae(i.rhsDir,i.lhsDir);f&&(g[f]=i.lhsId)}return g},{}),a),{}),N=Object.keys(w)[0],u={[N]:1},o=Object.keys(w).reduce((a,c)=>c===N?a:{...a,[c]:1},{}),n=ct(a=>{let c={[a]:[0,0]},t=[a];for(;t.length>0;){let g=t.shift();if(g){u[g]=1,delete o[g];let i=w[g],[r,h]=c[g];Object.entries(i).forEach(([f,l])=>{u[l]||(c[l]=yr([r,h],f),t.push(l))})}}return c},"BFS"),e=[n(N)];for(;Object.keys(o).length>0;)e.push(n(Object.keys(o)[0]));this.dataStructures={adjList:w,spatialMaps:e,groupAlignments:m}}return this.dataStructures}setElementForId(m,w){this.elements[m]=w}getElementById(m){return this.elements[m]}getConfig(){return Be({...Lr,...Se().architecture})}getConfigField(m){return this.getConfig()[m]}},Cr=ct((m,w)=>{qe(m,w),m.groups.map(N=>w.addGroup(N)),m.services.map(N=>w.addService({...N,type:"service"})),m.junctions.map(N=>w.addJunction({...N,type:"junction"})),m.edges.map(N=>w.addEdge(N))},"populateDb"),rr={parser:{yy:void 0},parse:ct(async m=>{let w=await Qe("architecture",m);ye.debug(w);let N=rr.parser?.yy;if(!(N instanceof er))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.");Cr(w,N)},"parse")},Ar=ct(m=>`
.edge {
stroke-width: ${m.archEdgeWidth};
stroke: ${m.archEdgeColor};
fill: none;
}
.arrow {
fill: ${m.archEdgeArrowColor};
}
.node-bkg {
fill: none;
stroke: ${m.archGroupBorderColor};
stroke-width: ${m.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"),Mr=Ar,te=ct(m=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${m}</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:Ze,blank:{body:te("")}}},wr=ct(async function(m,w,N){let u=N.getConfigField("padding"),o=N.getConfigField("iconSize"),n=o/2,e=o/6,a=e/2;await Promise.all(w.edges().map(async c=>{let{source:t,sourceDir:g,sourceArrow:i,sourceGroup:r,target:h,targetDir:f,targetArrow:l,targetGroup:L,label:y}=tr(c),{x:p,y:C}=c[0].sourceEndpoint(),{x:R,y:A}=c[0].midpoint(),{x:S,y:B}=c[0].targetEndpoint(),Y=u+4;if(r&&(Ht(g)?p+=g==="L"?-Y:Y:C+=g==="T"?-Y:Y+18),L&&(Ht(f)?S+=f==="L"?-Y:Y:B+=f==="T"?-Y:Y+18),!r&&N.getNode(t)?.type==="junction"&&(Ht(g)?p+=g==="L"?n:-n:C+=g==="T"?n:-n),!L&&N.getNode(h)?.type==="junction"&&(Ht(f)?S+=f==="L"?n:-n:B+=f==="T"?n:-n),c[0]._private.rscratch){let tt=m.insert("g");if(tt.insert("path").attr("d",`M ${p},${C} L ${R},${A} L${S},${B} `).attr("class","edge").attr("id",$e(t,h,{prefix:"L"})),i){let x=Ht(g)?fe[g](p,e):p-a,k=kt(g)?fe[g](C,e):C-a;tt.insert("polygon").attr("points",je[g](e)).attr("transform",`translate(${x},${k})`).attr("class","arrow")}if(l){let x=Ht(f)?fe[f](S,e):S-a,k=kt(f)?fe[f](B,e):B-a;tt.insert("polygon").attr("points",je[f](e)).attr("transform",`translate(${x},${k})`).attr("class","arrow")}if(y){let x=Me(g,f)?"XY":Ht(g)?"X":"Y",k=0;x==="X"?k=Math.abs(p-S):x==="Y"?k=Math.abs(C-B)/1.5:k=Math.abs(p-S)/2;let s=tt.append("g");if(await le(s,y,{useHtmlLabels:!1,width:k,classes:"architecture-service-label"},se()),s.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),x==="X")s.attr("transform","translate("+R+", "+A+")");else if(x==="Y")s.attr("transform","translate("+R+", "+A+") rotate(-90)");else if(x==="XY"){let E=Ae(g,f);if(E&&vr(E)){let v=s.node().getBoundingClientRect(),[T,d]=Er(E);s.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*T*d*45})`);let D=s.node().getBoundingClientRect();s.attr("transform",`
translate(${R}, ${A-v.height/2})
translate(${T*D.width/2}, ${d*D.height/2})
rotate(${-1*T*d*45}, 0, ${v.height/2})
`)}}}}}))},"drawEdges"),Or=ct(async function(m,w,N){let o=N.getConfigField("padding")*.75,n=N.getConfigField("fontSize"),a=N.getConfigField("iconSize")/2;await Promise.all(w.nodes().map(async c=>{let t=ee(c);if(t.type==="group"){let{h:g,w:i,x1:r,y1:h}=c.boundingBox(),f=m.append("rect");f.attr("id",`group-${t.id}`).attr("x",r+a).attr("y",h+a).attr("width",i).attr("height",g).attr("class","node-bkg");let l=m.append("g"),L=r,y=h;if(t.icon){let p=l.append("g");p.html(`<g>${await he(t.icon,{height:o,width:o,fallbackPrefix:ne.prefix})}</g>`),p.attr("transform","translate("+(L+a+1)+", "+(y+a+1)+")"),L+=o,y+=n/2-1-2}if(t.label){let p=l.append("g");await le(p,t.label,{useHtmlLabels:!1,width:i,classes:"architecture-service-label"},se()),p.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),p.attr("transform","translate("+(L+a+4)+", "+(y+a+2)+")")}N.setElementForId(t.id,f)}}))},"drawGroups"),Dr=ct(async function(m,w,N){let u=se();for(let o of N){let n=w.append("g"),e=m.getConfigField("iconSize");if(o.title){let g=n.append("g");await le(g,o.title,{useHtmlLabels:!1,width:e*1.5,classes:"architecture-service-label"},u),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),g.attr("transform","translate("+e/2+", "+e+")")}let a=n.append("g");if(o.icon)a.html(`<g>${await he(o.icon,{height:e,width:e,fallbackPrefix:ne.prefix})}</g>`);else if(o.iconText){a.html(`<g>${await he("blank",{height:e,width:e,fallbackPrefix:ne.prefix})}</g>`);let r=a.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(Fe(o.iconText,u)),h=parseInt(window.getComputedStyle(r.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;r.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/h)};`)}else a.append("path").attr("class","node-bkg").attr("id","node-"+o.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${o.id}`).attr("class","architecture-service");let{width:c,height:t}=n.node().getBBox();o.width=c,o.height=t,m.setElementForId(o.id,n)}return 0},"drawServices"),xr=ct(function(m,w,N){N.forEach(u=>{let o=w.append("g"),n=m.getConfigField("iconSize");o.append("g").append("rect").attr("id","node-"+u.id).attr("fill-opacity","0").attr("width",n).attr("height",n),o.attr("class","architecture-junction");let{width:a,height:c}=o._groups[0][0].getBBox();o.width=a,o.height=c,m.setElementForId(u.id,o)})},"drawJunctions");ke([{name:ne.prefix,icons:ne}]);Ee.use(ir.default);function ar(m,w,N){m.forEach(u=>{w.add({group:"nodes",data:{type:"service",id:u.id,icon:u.icon,label:u.title,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-service"})})}ct(ar,"addServices");function nr(m,w,N){m.forEach(u=>{w.add({group:"nodes",data:{type:"junction",id:u.id,parent:u.in,width:N.getConfigField("iconSize"),height:N.getConfigField("iconSize")},classes:"node-junction"})})}ct(nr,"addJunctions");function or(m,w){w.nodes().map(N=>{let u=ee(N);if(u.type==="group")return;u.x=N.position().x,u.y=N.position().y,m.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}ct(or,"positionNodes");function sr(m,w){m.forEach(N=>{w.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}ct(sr,"addGroups");function hr(m,w){m.forEach(N=>{let{lhsId:u,rhsId:o,lhsInto:n,lhsGroup:e,rhsInto:a,lhsDir:c,rhsDir:t,rhsGroup:g,title:i}=N,r=Me(N.lhsDir,N.rhsDir)?"segments":"straight",h={id:`${u}-${o}`,label:i,source:u,sourceDir:c,sourceArrow:n,sourceGroup:e,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:o,targetDir:t,targetArrow:a,targetGroup:g,targetEndpoint:t==="L"?"0 50%":t==="R"?"100% 50%":t==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:r})})}ct(hr,"addEdges");function lr(m,w,N){let u=ct((a,c)=>Object.entries(a).reduce((t,[g,i])=>{let r=0,h=Object.entries(i);if(h.length===1)return t[g]=h[0][1],t;for(let f=0;f<h.length-1;f++)for(let l=f+1;l<h.length;l++){let[L,y]=h[f],[p,C]=h[l];if(N[L]?.[p]===c)t[g]??=[],t[g]=[...t[g],...y,...C];else if(L==="default"||p==="default")t[g]??=[],t[g]=[...t[g],...y,...C];else{let A=`${g}-${r++}`;t[A]=y;let S=`${g}-${r++}`;t[S]=C}}return t},{}),"flattenAlignments"),o=w.map(a=>{let c={},t={};return Object.entries(a).forEach(([g,[i,r]])=>{let h=m.getNode(g)?.in??"default";c[r]??={},c[r][h]??=[],c[r][h].push(g),t[i]??={},t[i][h]??=[],t[i][h].push(g)}),{horiz:Object.values(u(c,"horizontal")).filter(g=>g.length>1),vert:Object.values(u(t,"vertical")).filter(g=>g.length>1)}}),[n,e]=o.reduce(([a,c],{horiz:t,vert:g})=>[[...a,...t],[...c,...g]],[[],[]]);return{horizontal:n,vertical:e}}ct(lr,"getAlignments");function fr(m,w){let N=[],u=ct(n=>`${n[0]},${n[1]}`,"posToStr"),o=ct(n=>n.split(",").map(e=>parseInt(e)),"strToPos");return m.forEach(n=>{let e=Object.fromEntries(Object.entries(n).map(([g,i])=>[u(i),g])),a=[u([0,0])],c={},t={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;a.length>0;){let g=a.shift();if(g){c[g]=1;let i=e[g];if(i){let r=o(g);Object.entries(t).forEach(([h,f])=>{let l=u([r[0]+f[0],r[1]+f[1]]),L=e[l];L&&!c[l]&&(a.push(l),N.push({[Ke[h]]:L,[Ke[dr(h)]]:i,gap:1.5*w.getConfigField("iconSize")}))})}}}}),N}ct(fr,"getRelativeConstraints");function cr(m,w,N,u,o,{spatialMaps:n,groupAlignments:e}){return new Promise(a=>{let c=Ve("body").append("div").attr("id","cy").attr("style","display:none"),t=Ee({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":`${o.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:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});c.remove(),sr(N,t),ar(m,t,o),nr(w,t,o),hr(u,t);let g=lr(o,n,e),i=fr(n,o),r=t.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(h){let[f,l]=h.connectedNodes(),{parent:L}=ee(f),{parent:y}=ee(l);return L===y?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(h){let[f,l]=h.connectedNodes(),{parent:L}=ee(f),{parent:y}=ee(l);return L===y?.45:.001},alignmentConstraint:g,relativePlacementConstraint:i});r.one("layoutstop",()=>{function h(f,l,L,y){let p,C,{x:R,y:A}=f,{x:S,y:B}=l;C=(y-A+(R-L)*(A-B)/(R-S))/Math.sqrt(1+Math.pow((A-B)/(R-S),2)),p=Math.sqrt(Math.pow(y-A,2)+Math.pow(L-R,2)-Math.pow(C,2));let Y=Math.sqrt(Math.pow(S-R,2)+Math.pow(B-A,2));p=p/Y;let tt=(S-R)*(y-A)-(B-A)*(L-R);switch(!0){case tt>=0:tt=1;break;case tt<0:tt=-1;break}let x=(S-R)*(L-R)+(B-A)*(y-A);switch(!0){case x>=0:x=1;break;case x<0:x=-1;break}return C=Math.abs(C)*tt,p=p*x,{distances:C,weights:p}}ct(h,"getSegmentWeights"),t.startBatch();for(let f of Object.values(t.edges()))if(f.data?.()){let{x:l,y:L}=f.source().position(),{x:y,y:p}=f.target().position();if(l!==y&&L!==p){let C=f.sourceEndpoint(),R=f.targetEndpoint(),{sourceDir:A}=tr(f),[S,B]=kt(A)?[C.x,R.y]:[R.x,C.y],{weights:Y,distances:tt}=h(C,R,S,B);f.style("segment-distances",tt),f.style("segment-weights",Y)}}t.endBatch(),r.run()}),r.run(),t.ready(h=>{ye.info("Ready",h),a(t)})})}ct(cr,"layoutArchitecture");var Ir=ct(async(m,w,N,u)=>{let o=u.db,n=o.getServices(),e=o.getJunctions(),a=o.getGroups(),c=o.getEdges(),t=o.getDataStructures(),g=ze(w),i=g.append("g");i.attr("class","architecture-edges");let r=g.append("g");r.attr("class","architecture-services");let h=g.append("g");h.attr("class","architecture-groups"),await Dr(o,r,n),xr(o,r,e);let f=await cr(n,e,a,c,o,t);await wr(i,f,o),await Or(h,f,o),or(o,f),be(void 0,g,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw"),Rr={draw:Ir},Wr={parser:rr,get db(){return new er},renderer:Rr,styles:Mr};export{Wr as diagram};
//# sourceMappingURL=architectureDiagram-VXUJARFQ-H4V63UKK.min.js.map