2026-05-31 13:54:31 +02:00

37 lines
149 KiB
JavaScript

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